jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1570716 - in /jena/branches/jena-fuseki-new-ui/src: main/java/org/apache/jena/fuseki/ main/java/org/apache/jena/fuseki/mgt/ main/resources/ test/java/org/apache/jena/fuseki/ test/resources/
Date Fri, 21 Feb 2014 21:29:56 GMT
Author: andy
Date: Fri Feb 21 21:29:56 2014
New Revision: 1570716

URL: http://svn.apache.org/r1570716
Log:
Logging - for runtime and for testing

Removed:
    jena/branches/jena-fuseki-new-ui/src/test/resources/log4j.properties
Modified:
    jena/branches/jena-fuseki-new-ui/src/main/java/org/apache/jena/fuseki/Fuseki.java
    jena/branches/jena-fuseki-new-ui/src/main/java/org/apache/jena/fuseki/FusekiCmd.java
    jena/branches/jena-fuseki-new-ui/src/main/java/org/apache/jena/fuseki/mgt/ActionDescription.java
    jena/branches/jena-fuseki-new-ui/src/main/resources/log4j.properties
    jena/branches/jena-fuseki-new-ui/src/test/java/org/apache/jena/fuseki/ServerTest.java
    jena/branches/jena-fuseki-new-ui/src/test/java/org/apache/jena/fuseki/TS_Fuseki.java

Modified: jena/branches/jena-fuseki-new-ui/src/main/java/org/apache/jena/fuseki/Fuseki.java
URL: http://svn.apache.org/viewvc/jena/branches/jena-fuseki-new-ui/src/main/java/org/apache/jena/fuseki/Fuseki.java?rev=1570716&r1=1570715&r2=1570716&view=diff
==============================================================================
--- jena/branches/jena-fuseki-new-ui/src/main/java/org/apache/jena/fuseki/Fuseki.java (original)
+++ jena/branches/jena-fuseki-new-ui/src/main/java/org/apache/jena/fuseki/Fuseki.java Fri
Feb 21 21:29:56 2014
@@ -18,12 +18,10 @@
 
 package org.apache.jena.fuseki ;
 
-import org.apache.jena.fuseki.server.SPARQLServer ;
 import org.apache.jena.riot.RIOT ;
 import org.apache.jena.riot.stream.LocatorFTP ;
 import org.apache.jena.riot.stream.LocatorHTTP ;
 import org.apache.jena.riot.stream.StreamManager ;
-import org.eclipse.jetty.server.Server ;
 import org.slf4j.Logger ;
 import org.slf4j.LoggerFactory ;
 
@@ -181,50 +179,6 @@ public class Fuseki {
         return ARQ.getContext() ;
     }
 
-    // Temporary ...
-    private static SPARQLServer server ;
-    private static Server       jettyServer ;
-    private static Server       mgtJettyServer ;
-
-//    /**
-//     * set/specify the {@link SPARQLServer}
-//     * instance.
-//     */
-//    public static void setServer(SPARQLServer _server) {
-//        server = _server ;
-//    }
-//
-//    /** get the {@link SPARQLServer} instance. */
-//    public static SPARQLServer getServer() {
-//        return server ;
-//    }
-//
-//    /**
-//     * set/specify the {@link org.apache.jena.fuseki.server.SPARQLServer}
-//     * instance.
-//     */
-//    public static void setJettyServer(Server _server) {
-//        jettyServer = _server ;
-//    }
-//
-//    /** get the {@link org.apache.jena.fuseki.server.SPARQLServer} instance. */
-//    public static Server getJettyServer() {
-//        return jettyServer ;
-//    }
-//
-//    /**
-//     * set/specify the {@link org.apache.jena.fuseki.server.SPARQLServer}
-//     * instance.
-//     */
-//    public static void setJettyMgtServer(Server _server) {
-//        mgtJettyServer = _server ;
-//    }
-//
-//    /** get the {@link org.apache.jena.fuseki.server.SPARQLServer} instance. */
-//    public static Server getJettyMgtServer() {
-//        return mgtJettyServer ;
-//    }
-
     // Force a call to init.
     static {
         init() ;

Modified: jena/branches/jena-fuseki-new-ui/src/main/java/org/apache/jena/fuseki/FusekiCmd.java
URL: http://svn.apache.org/viewvc/jena/branches/jena-fuseki-new-ui/src/main/java/org/apache/jena/fuseki/FusekiCmd.java?rev=1570716&r1=1570715&r2=1570716&view=diff
==============================================================================
--- jena/branches/jena-fuseki-new-ui/src/main/java/org/apache/jena/fuseki/FusekiCmd.java (original)
+++ jena/branches/jena-fuseki-new-ui/src/main/java/org/apache/jena/fuseki/FusekiCmd.java Fri
Feb 21 21:29:56 2014
@@ -27,9 +27,9 @@ import org.apache.jena.atlas.lib.Lib ;
 import org.apache.jena.atlas.lib.StrUtils ;
 import org.apache.jena.fuseki.build.Template ;
 import org.apache.jena.fuseki.server.FusekiServletContextListener ;
-import org.apache.jena.fuseki.server.SPARQLServer ;
-import org.apache.jena.fuseki.server.ServerConfig ;
 import org.apache.jena.fuseki.server.ServerInitialConfig ;
+import org.apache.jena.fuseki.jetty.JettyServerConfig ;
+import org.apache.jena.fuseki.jetty.SPARQLServer ;
 import org.apache.jena.riot.Lang ;
 import org.apache.jena.riot.RDFDataMgr ;
 import org.apache.jena.riot.RDFLanguages ;
@@ -210,7 +210,7 @@ public class FusekiCmd extends CmdARQ {
 //    public String authConfigFile ;
     
     public String       homeDir                 = null ;
-    private ServerConfig jettyServerConfig          = new ServerConfig() ;
+    private JettyServerConfig jettyServerConfig          = new JettyServerConfig() ;
     {
         jettyServerConfig.port = 3030 ;
         jettyServerConfig.mgtPort = 3031 ;

Modified: jena/branches/jena-fuseki-new-ui/src/main/java/org/apache/jena/fuseki/mgt/ActionDescription.java
URL: http://svn.apache.org/viewvc/jena/branches/jena-fuseki-new-ui/src/main/java/org/apache/jena/fuseki/mgt/ActionDescription.java?rev=1570716&r1=1570715&r2=1570716&view=diff
==============================================================================
--- jena/branches/jena-fuseki-new-ui/src/main/java/org/apache/jena/fuseki/mgt/ActionDescription.java
(original)
+++ jena/branches/jena-fuseki-new-ui/src/main/java/org/apache/jena/fuseki/mgt/ActionDescription.java
Fri Feb 21 21:29:56 2014
@@ -32,7 +32,6 @@ import org.apache.jena.atlas.json.JsonBu
 import org.apache.jena.atlas.json.JsonValue ;
 import org.apache.jena.fuseki.Fuseki ;
 import org.apache.jena.fuseki.server.DataAccessPointRegistry ;
-import org.apache.jena.fuseki.server.SPARQLServer ;
 import org.apache.jena.fuseki.servlets.HttpAction ;
 import org.apache.jena.fuseki.servlets.ServletOps ;
 
@@ -64,7 +63,7 @@ public class ActionDescription extends A
         
         JsonBuilder builder = new JsonBuilder() ; 
         builder.startObject() ;
-        describeServer(builder) ;
+        describeServer(builder, action.request.getLocalPort()) ;
         describeDataset(builder) ;
         builder.finishObject() ;
         
@@ -74,27 +73,25 @@ public class ActionDescription extends A
         out.flush() ;
     }
 
-    private void describeServer(JsonBuilder builder) {
+    private void describeServer(JsonBuilder builder, int port) {
         String versionStr = Fuseki.VERSION ;
         String builtDateStr = Fuseki.BUILD_DATE ;
         if ( versionStr == null )
             versionStr = "Development" ;
         if ( builtDateStr == null )
             builtDateStr = "Unknown" ;
-            
-        if ( SPARQLServer.instance != null ) {
-            builder
-                .key(JsonConst.server)
-                .startObject()
-                .key(JsonConst.port).value(SPARQLServer.instance.getServerPort())
-                .finishObject() ;
-            builder
-                .key(JsonConst.admin)
-                .startObject()
-                //.key(JsonConst.hostname).value(req.getLocalName())
-                .key(JsonConst.port).value(SPARQLServer.instance.getMgtPort())
-                .finishObject() ;
-        }
+
+//        builder
+//            .key(JsonConst.server)
+//            .startObject()
+//            .key(JsonConst.port).value(port)
+//            .finishObject() ;
+        builder
+            .key(JsonConst.admin)
+            .startObject()
+            .key(JsonConst.port).value(port)
+            .finishObject() ;
+
         builder
             .key(JsonConst.version).value(versionStr)
             .key(JsonConst.built).value(builtDateStr) ;

Modified: jena/branches/jena-fuseki-new-ui/src/main/resources/log4j.properties
URL: http://svn.apache.org/viewvc/jena/branches/jena-fuseki-new-ui/src/main/resources/log4j.properties?rev=1570716&r1=1570715&r2=1570716&view=diff
==============================================================================
--- jena/branches/jena-fuseki-new-ui/src/main/resources/log4j.properties (original)
+++ jena/branches/jena-fuseki-new-ui/src/main/resources/log4j.properties Fri Feb 21 21:29:56
2014
@@ -1,28 +1,29 @@
-## Plain output to stdout
+# Plain output to stdout
 log4j.appender.jena.plainstdout=org.apache.log4j.ConsoleAppender
 log4j.appender.jena.plainstdout.target=System.out
 log4j.appender.jena.plainstdout.layout=org.apache.log4j.PatternLayout
 log4j.appender.jena.plainstdout.layout.ConversionPattern=%d{HH:mm:ss} %-10c{1} %-5p %m%n
-## Plain output to stderr
+# Plain output to stderr
 log4j.appender.jena.plainstderr=org.apache.log4j.ConsoleAppender
 log4j.appender.jena.plainstderr.target=System.err
 log4j.appender.jena.plainstderr.layout=org.apache.log4j.PatternLayout
 log4j.appender.jena.plainstderr.layout.ConversionPattern=%d{HH:mm:ss} %-10c{1} %-5p %m%n
-## Everything
+# Everything
 log4j.rootLogger=INFO, jena.plainstdout
 log4j.logger.com.hp.hpl.jena=WARN
-log4j.logger.org.openjena=WARN
 log4j.logger.org.apache.jena=WARN
-log4j.logger.org.apache.jena=WARN
-# System logs.
+log4j.logger.org.apache.jena.fuseki=INFO
+# Others
+log4j.logger.org.eclipse.jetty=WARN
+log4j.logger.org.apache.shiro=WARN
+# Fuseki System logs.
 log4j.logger.org.apache.jena.fuseki.Server=INFO
 log4j.logger.org.apache.jena.fuseki.Fuseki=INFO
 log4j.logger.org.apache.jena.fuseki.Admin=INFO
 log4j.logger.org.apache.jena.fuseki.Validate=INFO
 log4j.logger.org.apache.jena.fuseki.Config=INFO
+# TDB
 log4j.logger.org.apache.jena.tdb.loader=INFO
-log4j.logger.org.eclipse.jetty=WARN
-log4j.logger.org.apache.shiro=WARN
 ## Parser output
-log4j.additivityorg.apache.jena.riot=false
+log4j.additivity.org.apache.jena.riot=false
 log4j.logger.org.apache.jena.riot=INFO, jena.plainstdout

Modified: jena/branches/jena-fuseki-new-ui/src/test/java/org/apache/jena/fuseki/ServerTest.java
URL: http://svn.apache.org/viewvc/jena/branches/jena-fuseki-new-ui/src/test/java/org/apache/jena/fuseki/ServerTest.java?rev=1570716&r1=1570715&r2=1570716&view=diff
==============================================================================
--- jena/branches/jena-fuseki-new-ui/src/test/java/org/apache/jena/fuseki/ServerTest.java
(original)
+++ jena/branches/jena-fuseki-new-ui/src/test/java/org/apache/jena/fuseki/ServerTest.java
Fri Feb 21 21:29:56 2014
@@ -22,6 +22,8 @@ import java.util.Collection ;
 
 import org.apache.jena.atlas.iterator.Iter ;
 import org.apache.jena.fuseki.server.* ;
+import org.apache.jena.fuseki.jetty.JettyServerConfig ;
+import org.apache.jena.fuseki.jetty.SPARQLServer ;
 
 import com.hp.hpl.jena.graph.Graph ;
 import com.hp.hpl.jena.graph.Node ;
@@ -110,15 +112,15 @@ public class ServerTest {
         params.allowUpdate = true ;
         FusekiServletContextListener.initialSetup = params ;
         
-        ServerConfig config = make(true, true) ;
+        JettyServerConfig config = make(true, true) ;
         config.authConfigFile = authConfigFile ;
         SPARQLServer.initializeServer(config);
         server = SPARQLServer.instance ;
         server.start() ;
     }
 
-    public static ServerConfig make(boolean allowUpdate, boolean listenLocal) {
-        ServerConfig config = new ServerConfig() ;
+    public static JettyServerConfig make(boolean allowUpdate, boolean listenLocal) {
+        JettyServerConfig config = new JettyServerConfig() ;
         // Avoid any persistent record.
         config.port = ServerTest.port ;
         config.mgtPort = ServerTest.port ;

Modified: jena/branches/jena-fuseki-new-ui/src/test/java/org/apache/jena/fuseki/TS_Fuseki.java
URL: http://svn.apache.org/viewvc/jena/branches/jena-fuseki-new-ui/src/test/java/org/apache/jena/fuseki/TS_Fuseki.java?rev=1570716&r1=1570715&r2=1570716&view=diff
==============================================================================
--- jena/branches/jena-fuseki-new-ui/src/test/java/org/apache/jena/fuseki/TS_Fuseki.java (original)
+++ jena/branches/jena-fuseki-new-ui/src/test/java/org/apache/jena/fuseki/TS_Fuseki.java Fri
Feb 21 21:29:56 2014
@@ -18,9 +18,11 @@
 
 package org.apache.jena.fuseki;
 
+import org.apache.jena.atlas.logging.LogCtl ;
 import org.apache.jena.fuseki.http.TestDatasetAccessorHTTP ;
 import org.apache.jena.fuseki.http.TestDatasetGraphAccessorHTTP ;
 import org.apache.jena.fuseki.http.TestHttpOp ;
+import org.junit.BeforeClass ;
 import org.junit.runner.RunWith ;
 import org.junit.runners.Suite ;
 
@@ -38,4 +40,19 @@ import org.junit.runners.Suite ;
     , TestAdmin.class
 })
 public class TS_Fuseki extends ServerTest
-{ }
+{ 
+    @BeforeClass public static void setQuietLogging() {
+        org.apache.log4j.Level WARN1 = org.apache.log4j.Level.WARN ; 
+        java.util.logging.Level WARN2 = java.util.logging.Level.WARNING ;
+
+        // Occasionally log4j.properties gets out of step.
+//        LogCtl.logLevel("org.apache.shiro",    WARN1, WARN2);
+//        LogCtl.logLevel("org.eclipse.jetty",    WARN1, WARN2);
+        
+        LogCtl.logLevel(Fuseki.serverLogName,   WARN1, WARN2);
+        LogCtl.logLevel(Fuseki.configLogName,   WARN1, WARN2);
+        LogCtl.logLevel(Fuseki.adminLogName,    WARN1, WARN2);
+        LogCtl.logLevel(Fuseki.builderLogName,  WARN1, WARN2);
+        LogCtl.logLevel(Fuseki.requestLogName,  WARN1, WARN2);
+    }
+}
\ No newline at end of file



Mime
View raw message