You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devicemap.apache.org by re...@apache.org on 2015/08/05 14:56:17 UTC

svn commit: r1694202 - in /devicemap/trunk/clients/2.0/reference: src/JsonFile.java test.sh

Author: rezan
Date: Wed Aug  5 12:56:16 2015
New Revision: 1694202

URL: http://svn.apache.org/r1694202
Log:
cleanup

Modified:
    devicemap/trunk/clients/2.0/reference/src/JsonFile.java
    devicemap/trunk/clients/2.0/reference/test.sh

Modified: devicemap/trunk/clients/2.0/reference/src/JsonFile.java
URL: http://svn.apache.org/viewvc/devicemap/trunk/clients/2.0/reference/src/JsonFile.java?rev=1694202&r1=1694201&r2=1694202&view=diff
==============================================================================
--- devicemap/trunk/clients/2.0/reference/src/JsonFile.java (original)
+++ devicemap/trunk/clients/2.0/reference/src/JsonFile.java Wed Aug  5 12:56:16 2015
@@ -43,8 +43,8 @@ public class JsonFile {
       throw new Exception("JsonFile is not an object");
     }
 
-    if(json.get("specVersion").asDouble(0d) != 2.0d) {
-      throw new Exception("Bad specVersion found: " + json.get("specVersion").asDouble(0d));
+    if(get(json, "specVersion").asDouble(0d) != 2.0d) {
+      throw new Exception("Bad specVersion found: " + get(json, "specVersion").asDouble(0d));
     }
 
     if(empty(json, "type")) {

Modified: devicemap/trunk/clients/2.0/reference/test.sh
URL: http://svn.apache.org/viewvc/devicemap/trunk/clients/2.0/reference/test.sh?rev=1694202&r1=1694201&r2=1694202&view=diff
==============================================================================
--- devicemap/trunk/clients/2.0/reference/test.sh (original)
+++ devicemap/trunk/clients/2.0/reference/test.sh Wed Aug  5 12:56:16 2015
@@ -3,16 +3,21 @@
 ROOT=../../../data/2.0/reference
 DOMAINS=`find $ROOT -maxdepth 1 -type d | grep -v "reference$" | sort | xargs echo`
 
-if [ -d "$1" ]
+function error
+{
+    echo "Please pass in a valid reference domain root"
+    echo "Or run ./test.sh from SVN"
+    exit 1
+}
+
+if [ "$1" != "" ]
 then
     DOMAINS=$@
 fi
 
 if [ "$DOMAINS" = "" ]
 then
-    echo "Please pass in valid domain root(s)"
-    echo "Or run ./test.sh from SVN"
-    exit 1
+    error
 fi
 
 FAIL=
@@ -22,7 +27,7 @@ for DROOT in $DOMAINS
 do
     DOMAIN=`basename $DROOT`
 
-    if [ ! -d $DROOT -o "`ls $DROOT | grep pattern`" = "" ]
+    if [ ! -d $DROOT -o "`ls $DROOT 2> /dev/null | grep pattern`" = "" ]
     then
         continue
     fi
@@ -48,22 +53,19 @@ do
     fi
 done
 
-echo
-
 if [ "$FAIL" != "" ]
 then
+    echo
     echo "The following tests have failed:$FAIL"
     exit 1
 fi
 
 if [ "$PASS" != "" ]
 then
+    echo
     echo "All tests have passed:$PASS"
     exit 0
 fi
 
-echo "Something went wrong"
-echo
-echo "Please pass in a valid reference domain root"
-echo "Or run ./test.sh from SVN"
-exit 1
+error
+