Author: rezan
Date: Wed Jul 29 14:36:05 2015
New Revision: 1693275
URL: http://svn.apache.org/r1693275
Log:
test suite parsing
Modified:
devicemap/trunk/clients/2.0/reference/src/DeviceMapClient.java
devicemap/trunk/clients/2.0/reference/src/Main.java
Modified: devicemap/trunk/clients/2.0/reference/src/DeviceMapClient.java
URL:
http://svn.apache.org/viewvc/devicemap/trunk/clients/2.0/reference/src/DeviceMapClient.java?rev=1693275&r1=1693274&r2=1693275&view=diff
==============================================================================
--- devicemap/trunk/clients/2.0/reference/src/DeviceMapClient.java (original)
+++ devicemap/trunk/clients/2.0/reference/src/DeviceMapClient.java Wed Jul 29
14:36:05 2015
@@ -193,7 +193,7 @@ public class DeviceMapClient {
}
}
- private JsonNode get(JsonNode node, String name) throws Exception {
+ public static JsonNode get(JsonNode node, String name) throws Exception {
JsonNode ret = node.get(name);
if(ret != null) {
@@ -208,4 +208,16 @@ public class DeviceMapClient {
return nullNode;
}
+ public String classify(String text) {
+ return "";
+ }
+
+ public String getDomain() {
+ return domain;
+ }
+
+ public String getDomainVersion() {
+ return domainVersion;
+ }
+
}
Modified: devicemap/trunk/clients/2.0/reference/src/Main.java
URL:
http://svn.apache.org/viewvc/devicemap/trunk/clients/2.0/reference/src/Main.java?rev=1693275&r1=1693274&r2=1693275&view=diff
==============================================================================
--- devicemap/trunk/clients/2.0/reference/src/Main.java (original)
+++ devicemap/trunk/clients/2.0/reference/src/Main.java Wed Jul 29 14:36:05 2015
@@ -74,7 +74,7 @@ public class Main {
for(String test : tests) {
Main.log("Test file: '" + test + "'");
- JsonFile testSuite = new JsonFile(test);
+ test(client, new JsonFile(test));
}
if(testString != null) {
@@ -108,4 +108,20 @@ public class Main {
System.out.println(s);
}
}
+
+ private static void test(DeviceMapClient client, JsonFile test) throws
Exception {
+ if(!test.getType().equals("test")) {
+ throw new Exception("Unknown test type: " + test.getType());
+ }
+
+ if(!test.getDomain().equals(client.getDomain())) {
+ throw new Exception("Domains do not match: " + client.getDomain() + " !=
" + test.getDomain());
+ }
+
+ if(!test.getDomainVersion().equals(client.getDomainVersion())) {
+ throw new Exception("DomainVersions do not match: " +
client.getDomainVersion() + " != " + test.getDomainVersion());
+ }
+
+ Main.log(" Loading test: " + test.getDomain() + ", version: " +
test.getDomainVersion());
+ }
}