jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1607088 - /jena/Experimental/jena-fuseki2/src/test/java/org/apache/jena/fuseki/TestAdmin.java
Date Tue, 01 Jul 2014 14:11:31 GMT
Author: andy
Date: Tue Jul  1 14:11:31 2014
New Revision: 1607088

URL: http://svn.apache.org/r1607088
Log:
Tests for stats details

Modified:
    jena/Experimental/jena-fuseki2/src/test/java/org/apache/jena/fuseki/TestAdmin.java

Modified: jena/Experimental/jena-fuseki2/src/test/java/org/apache/jena/fuseki/TestAdmin.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-fuseki2/src/test/java/org/apache/jena/fuseki/TestAdmin.java?rev=1607088&r1=1607087&r2=1607088&view=diff
==============================================================================
--- jena/Experimental/jena-fuseki2/src/test/java/org/apache/jena/fuseki/TestAdmin.java (original)
+++ jena/Experimental/jena-fuseki2/src/test/java/org/apache/jena/fuseki/TestAdmin.java Tue
Jul  1 14:11:31 2014
@@ -495,15 +495,23 @@ public class TestAdmin extends BaseTest 
     }
     
     private static void checkJsonStatsOne(JsonValue v) {
+        checkJsonStatsCounters(v) ;
+        JsonObject obj1 = v.getAsObject().get("endpoints").getAsObject() ;
+        for ( String srvName : obj1.keys() ) {
+            JsonObject obj2 = obj1.get(srvName).getAsObject() ; 
+            assertTrue(obj2.hasKey("description"));
+            assertTrue(obj2.hasKey("operation"));
+            checkJsonStatsCounters(obj2);
+        }
+    }
+
+    private static void checkJsonStatsCounters(JsonValue v) {
         JsonObject obj = v.getAsObject() ;
         assertTrue(obj.hasKey("Requests")) ;
         assertTrue(obj.hasKey("RequestsGood")) ;
         assertTrue(obj.hasKey("RequestsBad")) ;
-        assertTrue(obj.hasKey("endpoints")) ;
-        JsonObject obj2 = obj.get("endpoints").getAsObject() ;
-        // More
     }
-
+    
     private static JsonValue execGetJSON(String url) {
         try ( TypedInputStream in = execHttpGet(url) ) {
             assertEqualsIgnoreCase(WebContent.contentTypeJSON, in.getContentType()) ;



Mime
View raw message