Port ServerCtl to Fuseki2. Make naming and use consistent

Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/7c3a5cfd
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/7c3a5cfd
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/7c3a5cfd

Branch: refs/heads/master
Commit: 7c3a5cfd683426cc02b671c129878c45a6aebb30
Parents: dc27c2b
Author: Andy Seaborne <a...@apache.org>
Authored: Sun Oct 16 15:53:34 2016 +0100
Committer: Andy Seaborne <a...@apache.org>
Committed: Sun Oct 16 17:23:37 2016 +0100

----------------------------------------------------------------------
 .../java/org/apache/jena/fuseki/ServerCtl.java  |   2 +-
 .../java/org/apache/jena/fuseki/TestQuery.java  |   2 +-
 .../apache/jena/fuseki/TestSPARQLProtocol.java  |   2 +-
 .../fuseki/http/TestDatasetAccessorHTTP.java    |  10 +-
 .../http/TestDatasetGraphAccessorHTTP.java      |   2 +-
 .../org/apache/jena/fuseki/http/TestHttpOp.java |   4 +-
 .../apache/jena/fuseki/AbstractFusekiTest.java  |  18 +-
 .../java/org/apache/jena/fuseki/ServerCtl.java  | 287 +++++++++++++++++++
 .../java/org/apache/jena/fuseki/ServerTest.java | 126 --------
 .../java/org/apache/jena/fuseki/TS_Fuseki.java  |   8 +
 .../java/org/apache/jena/fuseki/TestAdmin.java  |  62 ++--
 .../java/org/apache/jena/fuseki/TestAuth.java   |   7 +-
 .../org/apache/jena/fuseki/TestDatasetOps.java  |  30 +-
 .../org/apache/jena/fuseki/TestFileUpload.java  |  27 +-
 .../apache/jena/fuseki/TestHttpOperations.java  |  32 +--
 .../org/apache/jena/fuseki/TestHttpOptions.java |  13 +-
 .../java/org/apache/jena/fuseki/TestQuery.java  | 112 ++++----
 .../apache/jena/fuseki/TestSPARQLProtocol.java  |  34 +--
 .../apache/jena/fuseki/TestServerReadOnly.java  |  32 +--
 .../fuseki/http/TestDatasetAccessorHTTP.java    |  37 +--
 .../http/TestDatasetGraphAccessorHTTP.java      |  18 +-
 .../org/apache/jena/fuseki/http/TestHttpOp.java |  21 +-
 .../TestRemoteEndpointConnection.java           |   2 +-
 .../TestRemoteEndpointConnectionWithAuth.java   |   2 +-
 ...stRemoteEndpointConnectionWithGraphUris.java |   2 +-
 ...oteEndpointConnectionWithResultSetTypes.java |   2 +-
 .../results/TestRemoteEndpointResults.java      |   2 +-
 .../TestRemoteEndpointResultsWithAuth.java      |   2 +-
 .../TestRemoteEndpointResultsWithGraphUris.java |   2 +-
 ...RemoteEndpointResultsWithResultSetTypes.java |   2 +-
 30 files changed, 520 insertions(+), 382 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/7c3a5cfd/jena-fuseki1/src/test/java/org/apache/jena/fuseki/ServerCtl.java
----------------------------------------------------------------------
diff --git a/jena-fuseki1/src/test/java/org/apache/jena/fuseki/ServerCtl.java 
b/jena-fuseki1/src/test/java/org/apache/jena/fuseki/ServerCtl.java
index 2c91bd5..43878b2 100644
--- a/jena-fuseki1/src/test/java/org/apache/jena/fuseki/ServerCtl.java
+++ b/jena-fuseki1/src/test/java/org/apache/jena/fuseki/ServerCtl.java
@@ -112,7 +112,7 @@ public class ServerCtl {
     public static final String datasetPath()    { return "/dataset" ; }
     public static final String serviceUpdate()  { return 
"http://localhost:"+port()+datasetPath()+"/update" ; } 
     public static final String serviceQuery()   { return 
"http://localhost:"+port()+datasetPath()+"/query" ; }
-    public static final String serviceREST()    { return 
"http://localhost:"+port()+datasetPath()+"/data" ; }
+    public static final String serviceGSP()     { return 
"http://localhost:"+port()+datasetPath()+"/data" ; }
     
     
     public static void ctlBeforeTestSuite() {

http://git-wip-us.apache.org/repos/asf/jena/blob/7c3a5cfd/jena-fuseki1/src/test/java/org/apache/jena/fuseki/TestQuery.java
----------------------------------------------------------------------
diff --git a/jena-fuseki1/src/test/java/org/apache/jena/fuseki/TestQuery.java 
b/jena-fuseki1/src/test/java/org/apache/jena/fuseki/TestQuery.java
index 894f3bc..7911048 100644
--- a/jena-fuseki1/src/test/java/org/apache/jena/fuseki/TestQuery.java
+++ b/jena-fuseki1/src/test/java/org/apache/jena/fuseki/TestQuery.java
@@ -43,7 +43,7 @@ public class TestQuery extends BaseTest
     @After       public void ctlAfterTest()          { 
ServerCtl.ctlAfterTest(); }
     
     @Before public void beforeClass() {
-        DatasetAccessor du = 
DatasetAccessorFactory.createHTTP(ServerCtl.serviceREST()) ;
+        DatasetAccessor du = 
DatasetAccessorFactory.createHTTP(ServerCtl.serviceGSP()) ;
         du.putModel(model1) ;
         du.putModel(gn1, model2) ;
     }

http://git-wip-us.apache.org/repos/asf/jena/blob/7c3a5cfd/jena-fuseki1/src/test/java/org/apache/jena/fuseki/TestSPARQLProtocol.java
----------------------------------------------------------------------
diff --git 
a/jena-fuseki1/src/test/java/org/apache/jena/fuseki/TestSPARQLProtocol.java 
b/jena-fuseki1/src/test/java/org/apache/jena/fuseki/TestSPARQLProtocol.java
index e377be8..c41808c 100644
--- a/jena-fuseki1/src/test/java/org/apache/jena/fuseki/TestSPARQLProtocol.java
+++ b/jena-fuseki1/src/test/java/org/apache/jena/fuseki/TestSPARQLProtocol.java
@@ -45,7 +45,7 @@ public class TestSPARQLProtocol extends BaseTest
     @Before
     public void before() {
         // Load some data.
-        DatasetAccessor du = DatasetAccessorFactory.createHTTP(serviceREST()) ;
+        DatasetAccessor du = DatasetAccessorFactory.createHTTP(serviceGSP()) ;
         du.putModel(model1) ;
         du.putModel(gn1, model2) ;
     }

http://git-wip-us.apache.org/repos/asf/jena/blob/7c3a5cfd/jena-fuseki1/src/test/java/org/apache/jena/fuseki/http/TestDatasetAccessorHTTP.java
----------------------------------------------------------------------
diff --git 
a/jena-fuseki1/src/test/java/org/apache/jena/fuseki/http/TestDatasetAccessorHTTP.java
 
b/jena-fuseki1/src/test/java/org/apache/jena/fuseki/http/TestDatasetAccessorHTTP.java
index 675eec5..f505e6a 100644
--- 
a/jena-fuseki1/src/test/java/org/apache/jena/fuseki/http/TestDatasetAccessorHTTP.java
+++ 
b/jena-fuseki1/src/test/java/org/apache/jena/fuseki/http/TestDatasetAccessorHTTP.java
@@ -20,7 +20,7 @@ package org.apache.jena.fuseki.http;
 
 import static org.apache.jena.fuseki.ServerCtl.datasetPath ;
 import static org.apache.jena.fuseki.ServerCtl.port ;
-import static org.apache.jena.fuseki.ServerCtl.serviceREST ;
+import static org.apache.jena.fuseki.ServerCtl.serviceGSP ;
 import static org.apache.jena.fuseki.ServerTestData.gn1 ;
 import static org.apache.jena.fuseki.ServerTestData.gn2 ;
 import static org.apache.jena.fuseki.ServerTestData.gn99 ;
@@ -46,14 +46,14 @@ public class TestDatasetAccessorHTTP extends BaseTest
     @After       public void ctlAfterTest()          { 
ServerCtl.ctlAfterTest(); } 
     
     final String datasetURI_not_1    = "http://localhost:"+port()+"/junk" ;
-    final String datasetURI_not_2    = serviceREST()+"/not" ;
+    final String datasetURI_not_2    = serviceGSP()+"/not" ;
     final String datasetURI_not_3    = 
"http://localhost:"+port()+datasetPath()+"/not/data" ;
     
     @Test(expected = HttpException.class)
     public void test_ds_1() {
         // Can't GET the dataset service.
         try {
-            HttpOp.execHttpGet(serviceREST()) ;
+            HttpOp.execHttpGet(serviceGSP()) ;
         }
         catch (HttpException ex) {
             assertTrue(HttpSC.isClientError(ex.getResponseCode())) ;
@@ -101,7 +101,7 @@ public class TestDatasetAccessorHTTP extends BaseTest
     @Test
     public void test_404_3() {
         // Right service, wrong graph
-        DatasetAccessor du = DatasetAccessorFactory.createHTTP(serviceREST()) ;
+        DatasetAccessor du = DatasetAccessorFactory.createHTTP(serviceGSP()) ;
         Model graph = du.getModel(gn99) ;
         assertNull(graph) ;
     }
@@ -254,6 +254,6 @@ public class TestDatasetAccessorHTTP extends BaseTest
     }
 
     static DatasetAccessor create() {
-        return DatasetAccessorFactory.createHTTP(serviceREST()) ;
+        return DatasetAccessorFactory.createHTTP(serviceGSP()) ;
     }
 }

http://git-wip-us.apache.org/repos/asf/jena/blob/7c3a5cfd/jena-fuseki1/src/test/java/org/apache/jena/fuseki/http/TestDatasetGraphAccessorHTTP.java
----------------------------------------------------------------------
diff --git 
a/jena-fuseki1/src/test/java/org/apache/jena/fuseki/http/TestDatasetGraphAccessorHTTP.java
 
b/jena-fuseki1/src/test/java/org/apache/jena/fuseki/http/TestDatasetGraphAccessorHTTP.java
index 328c9e4..0c4bb1a 100644
--- 
a/jena-fuseki1/src/test/java/org/apache/jena/fuseki/http/TestDatasetGraphAccessorHTTP.java
+++ 
b/jena-fuseki1/src/test/java/org/apache/jena/fuseki/http/TestDatasetGraphAccessorHTTP.java
@@ -36,6 +36,6 @@ public class TestDatasetGraphAccessorHTTP extends 
AbstractTestDatasetGraphAccess
     
     @Override
     protected DatasetGraphAccessor getDatasetUpdater() {
-        return new DatasetGraphAccessorHTTP(ServerCtl.serviceREST()) ;
+        return new DatasetGraphAccessorHTTP(ServerCtl.serviceGSP()) ;
     }
 }

http://git-wip-us.apache.org/repos/asf/jena/blob/7c3a5cfd/jena-fuseki1/src/test/java/org/apache/jena/fuseki/http/TestHttpOp.java
----------------------------------------------------------------------
diff --git 
a/jena-fuseki1/src/test/java/org/apache/jena/fuseki/http/TestHttpOp.java 
b/jena-fuseki1/src/test/java/org/apache/jena/fuseki/http/TestHttpOp.java
index 48b9b67..361c37b 100644
--- a/jena-fuseki1/src/test/java/org/apache/jena/fuseki/http/TestHttpOp.java
+++ b/jena-fuseki1/src/test/java/org/apache/jena/fuseki/http/TestHttpOp.java
@@ -19,7 +19,7 @@
 package org.apache.jena.fuseki.http;
 
 import static org.apache.jena.fuseki.ServerCtl.serviceQuery ;
-import static org.apache.jena.fuseki.ServerCtl.serviceREST ;
+import static org.apache.jena.fuseki.ServerCtl.serviceGSP ;
 import static org.apache.jena.fuseki.ServerCtl.serviceUpdate ;
 import static org.apache.jena.fuseki.ServerCtl.urlRoot ;
 
@@ -48,7 +48,7 @@ public class TestHttpOp extends BaseTest {
     @After       public void ctlAfterTest()          { 
ServerCtl.ctlAfterTest(); } 
     
     static String pingURL     = urlRoot() + "ping.txt" ;
-    static String graphURL    = serviceREST() + "?default" ;
+    static String graphURL    = serviceGSP() + "?default" ;
     static String queryURL    = serviceQuery() ;
     static String updateURL   = serviceUpdate() ;
     static String simpleQuery = 
queryURL+"?query="+IRILib.encodeUriComponent("ASK{}") ;

http://git-wip-us.apache.org/repos/asf/jena/blob/7c3a5cfd/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/AbstractFusekiTest.java
----------------------------------------------------------------------
diff --git 
a/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/AbstractFusekiTest.java
 
b/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/AbstractFusekiTest.java
index 3f1aa17..7ccfba9 100644
--- 
a/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/AbstractFusekiTest.java
+++ 
b/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/AbstractFusekiTest.java
@@ -19,6 +19,7 @@
 package org.apache.jena.fuseki;
 
 import org.apache.jena.atlas.junit.BaseTest ;
+import org.junit.After ;
 import org.junit.AfterClass ;
 import org.junit.Before ;
 import org.junit.BeforeClass ;
@@ -30,18 +31,9 @@ import org.junit.BeforeClass ;
 
 public class AbstractFusekiTest extends BaseTest
 {
-    @BeforeClass
-    public static void allocServerForSuite() {
-        ServerTest.allocServer() ;
-    }
-
-    @AfterClass
-    public static void freeServerForSuite() {
-        ServerTest.freeServer() ;
-    }
-    
-    @Before public void resetServer() {
-        ServerTest.resetServer() ;
-    }
+    @BeforeClass public static void ctlBeforeClass() { 
ServerCtl.ctlBeforeClass(); }
+    @AfterClass  public static void ctlAfterClass()  { 
ServerCtl.ctlAfterClass(); }
+    @Before      public void ctlBeforeTest()         { 
ServerCtl.ctlBeforeTest(); }
+    @After       public void ctlAfterTest()          { 
ServerCtl.ctlAfterTest(); }
 }
 

http://git-wip-us.apache.org/repos/asf/jena/blob/7c3a5cfd/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/ServerCtl.java
----------------------------------------------------------------------
diff --git 
a/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/ServerCtl.java
 
b/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/ServerCtl.java
new file mode 100644
index 0000000..cc6d97a
--- /dev/null
+++ 
b/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/ServerCtl.java
@@ -0,0 +1,287 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.fuseki;
+
+import static org.apache.jena.fuseki.ServerCtl.ServerScope.CLASS ;
+import static org.apache.jena.fuseki.ServerCtl.ServerScope.SUITE ;
+import static org.apache.jena.fuseki.ServerCtl.ServerScope.TEST ;
+
+import java.io.IOException ;
+import java.net.ServerSocket ;
+import java.nio.file.Paths ;
+import java.util.Collection ;
+import java.util.concurrent.atomic.AtomicInteger ;
+
+import org.apache.http.client.HttpClient ;
+import org.apache.http.impl.client.CloseableHttpClient ;
+import org.apache.jena.atlas.io.IO ;
+import org.apache.jena.atlas.iterator.Iter ;
+import org.apache.jena.atlas.lib.FileOps ;
+import org.apache.jena.fuseki.jetty.JettyFuseki ;
+import org.apache.jena.fuseki.jetty.JettyServerConfig ;
+import org.apache.jena.fuseki.server.* ;
+import org.apache.jena.riot.web.HttpOp ;
+import org.apache.jena.sparql.core.DatasetGraph ;
+import org.apache.jena.sparql.core.DatasetGraphFactory ;
+import org.apache.jena.sparql.modify.request.Target ;
+import org.apache.jena.sparql.modify.request.UpdateDrop ;
+import org.apache.jena.system.Txn ;
+import org.apache.jena.tdb.base.file.Location ;
+import org.apache.jena.update.Update ;
+import org.apache.jena.update.UpdateExecutionFactory ;
+import org.apache.jena.update.UpdateProcessor ;
+
+/**
+ * Manage a single server for use with tests. It supports three modes:
+ * <ul>
+ * <li>One server for a whole test suite
+ * <li>One server per test class
+ * <li>One server per individual test
+ * </ul>
+ * One server per individual test can be troublesome due to connections not 
closing down
+ * fast enough (left in TCP state {@code TIME_WAIT} which is 2 minutes) and 
also can be slow.
+ * One server per test class is a good compromise. 
+ * <p> The data in the server is always reseet between tests.
+ * <p>
+ * Using a connection pooling HttpClient (see {@link 
HttpOp#createPoolingHttpClient()}) is important,
+ * both for test performance and for reducing the TCP connection load on the 
operarting system.  
+ * <p>
+ * Usage:
+ * </p>
+ * <p>
+ * In the test suite, put:
+ * 
+ * <pre>
+ *  {@literal @BeforeClass} static public void beforeSuiteClass() { 
ServerCtl.ctlBeforeTestSuite(); } 
+ *  {@literal @AfterClass}  static public void afterSuiteClass()  { 
ServerCtl.ctlAfterTestSuite(); }
+ * </pre>
+ * <p>
+ * In the test class, put:
+ * <pre>
+ * {@literal @BeforeClass} public static void ctlBeforeClass() { 
ServerCtl.ctlBeforeClass(); }
+ * {@literal @AfterClass}  public static void ctlAfterClass()  { 
ServerCtl.ctlAfterClass(); }
+ * {@literal @Before}      public void ctlBeforeTest()         { 
ServerCtl.ctlBeforeTest(); }
+ * {@literal @After}       public void ctlAfterTest()          { 
ServerCtl.ctlAfterTest(); }
+ * </pre>
+ */
+public class ServerCtl {
+    static { Fuseki.init(); }
+
+    /* Cut&Paste versions:
+
+    Test suite (TS_*)
+    @BeforeClass static public void beforeSuiteClass() { 
ServerCtl.ctlBeforeTestSuite(); } 
+    @AfterClass  static public void afterSuiteClass()  { 
ServerCtl.ctlAfterTestSuite(); }
+
+    Test class (Test*)
+    @BeforeClass public static void ctlBeforeClass() { 
ServerCtl.ctlBeforeClass(); }
+    @AfterClass  public static void ctlAfterClass()  { 
ServerCtl.ctlAfterClass(); }
+    @Before      public void ctlBeforeTest()         { 
ServerCtl.ctlBeforeTest(); }
+    @After       public void ctlAfterTest()          { 
ServerCtl.ctlAfterTest(); }
+     
+    */
+    
+    static HttpClient defaultHttpClient = HttpOp.getDefaultHttpClient();
+
+    // Note: it is import to cleanly close a PoolingHttpClient across server 
restarts
+    // otherwise the pooled connections remain for the old server. 
+    
+    /*package : for import static */ enum ServerScope { SUITE, CLASS, TEST }
+    private static ServerScope serverScope = ServerScope.CLASS ;
+    private static int currentPort = choosePort() ;
+    
+    public static int port() {
+        return currentPort ;
+    }
+
+    // Whether to use a transaction on the dataset or to use SPARQL Update. 
+    static boolean CLEAR_DSG_DIRECTLY = true ;
+    static private DatasetGraph dsgTesting ;
+    
+    // Abstraction that runs a SPARQL server for tests.
+    public static final String urlRoot()        { return 
"http://localhost:"+port()+"/" ; }
+    public static final String datasetPath()    { return "/dataset" ; }
+    public static final String urlDataset()     { return 
"http://localhost:"+port()+datasetPath() ; }
+    
+    public static final String serviceUpdate()  { return 
"http://localhost:"+port()+datasetPath()+"/update" ; } 
+    public static final String serviceQuery()   { return 
"http://localhost:"+port()+datasetPath()+"/query" ; }
+    public static final String serviceGSP()     { return 
"http://localhost:"+port()+datasetPath()+"/data" ; }
+    
+    
+    public static void ctlBeforeTestSuite() {
+        if ( serverScope == SUITE  ) {
+            setPoolingHttpClient() ;
+            allocServer();
+        }
+    }
+    
+    public static void ctlAfterTestSuite()  {
+        if ( serverScope == SUITE  ) {
+            freeServer();
+            resetDefaultHttpClient() ;
+        }
+    }
+    
+    /**
+     * Setup for the tests by allocating a Fuseki instance to work with
+     */
+    public static void ctlBeforeClass() {
+        if ( serverScope == CLASS  ) {
+            setPoolingHttpClient() ;
+            allocServer();
+        }
+    }
+    
+    /**
+     * Clean up after tests by de-allocating the Fuseki instance
+     */
+    public static void ctlAfterClass() {
+        if ( serverScope == CLASS  ) {
+            freeServer();
+            resetDefaultHttpClient() ;
+        }
+    }
+
+    /**
+     * Placeholder.
+     */
+    public static void ctlBeforeTest() {
+        if ( serverScope == TEST  ) {
+            setPoolingHttpClient() ;
+            allocServer();
+        }
+    }
+
+    /**
+     * Clean up after each test by resetting the Fuseki dataset
+     */
+    public static void ctlAfterTest() {
+        if ( serverScope == TEST  ) {
+            freeServer();
+            resetDefaultHttpClient() ;
+        } else
+            resetServer();
+    }
+
+    /** Set a PoolingHttpClient */
+    private static void setPoolingHttpClient() {
+        setHttpClient(HttpOp.createPoolingHttpClient()) ;
+    }
+
+    /** Restore the original setup */
+    private static void resetDefaultHttpClient() {
+        setHttpClient(defaultHttpClient);
+    }
+    
+    /** Set the HttpClient - close the old one if appropriate */
+    /*package*/ static void setHttpClient(HttpClient newHttpClient) {
+        HttpClient hc = HttpOp.getDefaultHttpClient() ;
+        if ( hc instanceof CloseableHttpClient )
+            IO.close((CloseableHttpClient)hc) ;
+        HttpOp.setDefaultHttpClient(newHttpClient) ;
+    }
+    
+    // reference count of start/stop server
+    private static AtomicInteger countServer = new AtomicInteger() ; 
+    private static JettyFuseki server        = null ;
+    
+    /*package*/ static void allocServer() {
+        if ( countServer.getAndIncrement() == 0 )
+            setupServer(true) ;
+    }
+    
+    /*package*/ static void freeServer() {
+        if ( countServer.decrementAndGet() == 0 )
+            teardownServer() ;
+    }
+    
+    protected static void setupServer(boolean updateable) {
+        FusekiEnv.FUSEKI_HOME = 
Paths.get(TS_Fuseki.FusekiTestHome).toAbsolutePath() ;
+        FileOps.ensureDir("target");
+        FileOps.ensureDir(TS_Fuseki.FusekiTestHome);
+        FileOps.ensureDir(TS_Fuseki.FusekiTestBase) ;
+        FusekiEnv.FUSEKI_BASE = 
Paths.get(TS_Fuseki.FusekiTestBase).toAbsolutePath() ;
+        setupServer(port(), null, datasetPath(), updateable) ;
+    }
+    
+    public static void setupServer(int port, String authConfigFile, String 
datasetPath, boolean updateable) {
+        SystemState.location = Location.mem() ;
+        SystemState.init$() ;
+        
+        ServerInitialConfig params = new ServerInitialConfig() ;
+        dsgTesting = DatasetGraphFactory.createTxnMem() ;
+        params.dsg = dsgTesting ;
+        params.datasetPath = datasetPath ;
+        params.allowUpdate = updateable ;
+        
+        FusekiServerListener.initialSetup = params ;
+        
+        JettyServerConfig config = make(port, true, true) ;
+        config.authConfigFile = authConfigFile ;
+        JettyFuseki.initializeServer(config);
+        JettyFuseki.instance.start() ;
+        server = JettyFuseki.instance ;
+    }
+    
+    /*package*/ static void teardownServer() {
+        if ( server != null )
+            server.stop() ;
+        server = null ;
+        // Clear out the registry.
+        Collection<String> keys = 
Iter.toList(DataAccessPointRegistry.get().keys().iterator()) ;
+        for (String k : keys)
+            DataAccessPointRegistry.get().remove(k) ;
+        // Clear configuration directory.
+        FileOps.clearAll(FusekiServer.dirConfiguration.toFile()) ;
+    }
+
+    /*package*/ static JettyServerConfig make(int port, boolean allowUpdate, 
boolean listenLocal) {
+        JettyServerConfig config = new JettyServerConfig() ;
+        // Avoid any persistent record.
+        config.port = port ;
+        config.contextPath = "/" ;
+        config.loopback = listenLocal ;
+        config.jettyConfigFile = null ;
+        config.enableCompression = true ;
+        config.verboseLogging = false ;
+        return config ;
+    }
+
+    /*package*/ static void resetServer() {
+        if (countServer.get() == 0)  
+            throw new RuntimeException("No server started!");
+        if ( CLEAR_DSG_DIRECTLY ) {
+            Txn.executeWrite(dsgTesting, ()->dsgTesting.clear()) ;   
+        } else {
+            Update clearRequest = new UpdateDrop(Target.ALL) ;
+            UpdateProcessor proc = 
UpdateExecutionFactory.createRemote(clearRequest, serviceUpdate()) ;
+            try {proc.execute() ; }
+            catch (Throwable e) {e.printStackTrace(); throw e;}
+        }
+    }
+    
+    /** Choose an unused port for a server to listen on */
+    public static int choosePort() {
+        try (ServerSocket s = new ServerSocket(0)) {
+            return s.getLocalPort();
+        } catch (IOException ex) {
+            throw new FusekiException("Failed to find a port for tests!");
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/7c3a5cfd/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/ServerTest.java
----------------------------------------------------------------------
diff --git 
a/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/ServerTest.java
 
b/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/ServerTest.java
index d36f104..cd832cc 100644
--- 
a/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/ServerTest.java
+++ 
b/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/ServerTest.java
@@ -18,31 +18,12 @@
 
 package org.apache.jena.fuseki ;
 
-import java.io.IOException ;
-import java.net.ServerSocket ;
-import java.nio.file.Paths ;
-import java.util.Arrays ;
-import java.util.Collection ;
-
-import org.apache.jena.atlas.iterator.Iter ;
-import org.apache.jena.atlas.lib.FileOps ;
-import org.apache.jena.fuseki.server.* ;
-import org.apache.jena.fuseki.jetty.JettyServerConfig ;
-import org.apache.jena.fuseki.jetty.JettyFuseki ;
 import org.apache.jena.graph.Graph ;
 import org.apache.jena.graph.Node ;
 import org.apache.jena.graph.NodeFactory ;
 import org.apache.jena.rdf.model.Model ;
 import org.apache.jena.rdf.model.ModelFactory ;
-import org.apache.jena.sparql.core.DatasetGraph ;
-import org.apache.jena.sparql.core.DatasetGraphFactory ;
-import org.apache.jena.sparql.modify.request.Target ;
-import org.apache.jena.sparql.modify.request.UpdateDrop ;
 import org.apache.jena.sparql.sse.SSE ;
-import org.apache.jena.tdb.base.file.Location ;
-import org.apache.jena.update.Update ;
-import org.apache.jena.update.UpdateExecutionFactory ;
-import org.apache.jena.update.UpdateProcessor ;
 
 /**
  * Manage a server for testing. Example for one server per test suite:
@@ -54,15 +35,6 @@ import org.apache.jena.update.UpdateProcessor ;
  * </pre>
  */
 public class ServerTest {
-    // Abstraction that runs a SPARQL server for tests.
-    public static final int     port          = choosePort(3535, 3534, 3735, 
9035, 9135, 10035) ;
-    public static final String  urlRoot       = "http://localhost:"; + port + 
"/" ;
-    public static final String  datasetPath   = "/dataset" ;
-    public static final String  urlDataset    = "http://localhost:"; + port + 
datasetPath ;
-    public static final String  serviceUpdate = urlDataset + "/update" ;
-    public static final String  serviceQuery  = urlDataset + "/query" ;
-    public static final String  serviceGSP    = urlDataset + "/data" ;
-
     public static final String  gn1           = "http://graph/1"; ;
     public static final String  gn2           = "http://graph/2"; ;
     public static final String  gn99          = "http://graph/99"; ;
@@ -76,102 +48,4 @@ public class ServerTest {
 
     public static final Model   model1        = 
ModelFactory.createModelForGraph(graph1) ;
     public static final Model   model2        = 
ModelFactory.createModelForGraph(graph2) ;
-
-    private static JettyFuseki server        = null ;
-
-    // reference count of start/stop server
-    private static int          countServer   = 0 ;
-
-    // This will cause there to be one server over all tests.
-    // Must be after initialization of counters
-    // static { allocServer() ; }
-
-    static public void allocServer() {
-        allocServer(true) ;
-    }
-    
-    static public void allocServer(boolean updateable) {
-        if ( countServer == 0 )
-            setupServer(updateable) ;
-        countServer++ ;
-    }
-
-    static public void freeServer() {
-        if ( countServer >= 0 ) {
-            countServer-- ;
-            if ( countServer == 0 )
-                teardownServer() ;
-        }
-    }
-
-    protected static void setupServer(boolean updateable) {
-        FusekiEnv.FUSEKI_HOME = 
Paths.get(TS_Fuseki.FusekiTestHome).toAbsolutePath() ;
-        FileOps.ensureDir("target");
-        FileOps.ensureDir(TS_Fuseki.FusekiTestHome);
-        FileOps.ensureDir(TS_Fuseki.FusekiTestBase) ;
-        FusekiEnv.FUSEKI_BASE = 
Paths.get(TS_Fuseki.FusekiTestBase).toAbsolutePath() ;
-        setupServer(ServerTest.port, null, ServerTest.datasetPath, updateable) 
;
-    }
-    
-    protected static void setupServer(int port, String authConfigFile, String 
datasetPath, boolean updateable) {
-        SystemState.location = Location.mem() ;
-        SystemState.init$() ;
-        
-        ServerInitialConfig params = new ServerInitialConfig() ;
-        DatasetGraph dsg = DatasetGraphFactory.create() ;
-        params.dsg = dsg ;
-        params.datasetPath = datasetPath ;
-        params.allowUpdate = updateable ;
-        
-        FusekiServerListener.initialSetup = params ;
-        
-        JettyServerConfig config = make(port, true, true) ;
-        config.authConfigFile = authConfigFile ;
-        JettyFuseki.initializeServer(config);
-        JettyFuseki.instance.start() ;
-        server = JettyFuseki.instance ;
-    }
-
-    public static JettyServerConfig make(int port, boolean allowUpdate, 
boolean listenLocal) {
-        JettyServerConfig config = new JettyServerConfig() ;
-        // Avoid any persistent record.
-        config.port = port ;
-        config.contextPath = "/" ;
-        config.loopback = listenLocal ;
-        config.jettyConfigFile = null ;
-        config.enableCompression = true ;
-        config.verboseLogging = false ;
-        return config ;
-    }
-
-    protected static void teardownServer() {
-        if ( server != null )
-            server.stop() ;
-        server = null ;
-        // Clear out the registry.
-        Collection<String> keys = 
Iter.toList(DataAccessPointRegistry.get().keys().iterator()) ;
-        for (String k : keys)
-            DataAccessPointRegistry.get().remove(k) ;
-        // Clear configuration directory.
-        FileOps.clearAll(FusekiServer.dirConfiguration.toFile()) ;
-    }
-
-    public static void resetServer() {
-        Update clearRequest = new UpdateDrop(Target.ALL) ;
-        UpdateProcessor proc = 
UpdateExecutionFactory.createRemote(clearRequest, ServerTest.serviceUpdate) ;
-        proc.execute() ;
-    }
-    
-    // Imperfect probing for a port.
-    // There is a race condition on finding a free port and using it in the 
tests. 
-    private static int choosePort(int... ports) {
-        for (int port : ports) {
-            try {
-                ServerSocket s = new ServerSocket(port) ;
-                s.close();
-                return s.getLocalPort() ; // OK to call after close.
-            } catch (IOException ex) { }
-        }
-        throw new FusekiException("Failed to find a port in 
:"+Arrays.asList(ports)) ;
-    }
 }

http://git-wip-us.apache.org/repos/asf/jena/blob/7c3a5cfd/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TS_Fuseki.java
----------------------------------------------------------------------
diff --git 
a/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TS_Fuseki.java
 
b/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TS_Fuseki.java
index 9424eb8..c5af249 100644
--- 
a/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TS_Fuseki.java
+++ 
b/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TS_Fuseki.java
@@ -25,6 +25,7 @@ import org.apache.jena.fuseki.http.TestDatasetAccessorHTTP ;
 import org.apache.jena.fuseki.http.TestDatasetGraphAccessorHTTP ;
 import org.apache.jena.fuseki.http.TestHttpOp ;
 import org.apache.jena.fuseki.server.FusekiEnv ;
+import org.junit.AfterClass ;
 import org.junit.BeforeClass ;
 import org.junit.runner.RunWith ;
 import org.junit.runners.Suite ;
@@ -69,5 +70,12 @@ public class TS_Fuseki extends ServerTest
         LogCtl.setLevel(Fuseki.actionLogName,        "WARN");
         LogCtl.setLevel(Fuseki.requestLogName,       "WARN");
         LogCtl.setLevel(Fuseki.servletRequestLogName,"WARN");
+        
+        ServerCtl.ctlBeforeTestSuite();
+    }
+    
+    @AfterClass
+    static public void afterSuiteClass() {
+        ServerCtl.ctlAfterTestSuite() ;
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jena/blob/7c3a5cfd/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestAdmin.java
----------------------------------------------------------------------
diff --git 
a/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestAdmin.java
 
b/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestAdmin.java
index bc02309..f447960 100644
--- 
a/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestAdmin.java
+++ 
b/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestAdmin.java
@@ -18,8 +18,6 @@
 
 package org.apache.jena.fuseki;
 
-import static org.apache.jena.fuseki.ServerTest.datasetPath ;
-import static org.apache.jena.fuseki.ServerTest.urlRoot ;
 import static org.apache.jena.fuseki.mgt.MgtConst.opDatasets ;
 import static org.apache.jena.fuseki.mgt.MgtConst.opListBackups ;
 import static org.apache.jena.fuseki.mgt.MgtConst.opPing ;
@@ -60,17 +58,17 @@ public class TestAdmin extends AbstractFusekiTest {
     // --- Ping 
     
     @Test public void ping_1() {
-        execHttpGet(ServerTest.urlRoot+"$/"+opPing) ;
+        execHttpGet(ServerCtl.urlRoot()+"$/"+opPing) ;
     }
     
     @Test public void ping_2() {
-        execHttpPost(ServerTest.urlRoot+"$/"+opPing, null) ;
+        execHttpPost(ServerCtl.urlRoot()+"$/"+opPing, null) ;
     }
     
     // --- Server status 
     
     @Test public void server_1() {
-        JsonValue jv = httpGetJson(ServerTest.urlRoot+"$/"+opServer) ;
+        JsonValue jv = httpGetJson(ServerCtl.urlRoot()+"$/"+opServer) ;
         JsonObject obj = jv.getAsObject() ;
         // Now optional : assertTrue(obj.hasKey(JsonConst.admin)) ;
         assertTrue(obj.hasKey(JsonConst.datasets)) ;
@@ -79,17 +77,17 @@ public class TestAdmin extends AbstractFusekiTest {
     }
 
     @Test public void server_2() {
-        execHttpPost(ServerTest.urlRoot+"$/"+opServer, null) ;
+        execHttpPost(ServerCtl.urlRoot()+"$/"+opServer, null) ;
     }
     
     // --- List all datasets
     
     @Test public void list_datasets_1() {
-        try ( TypedInputStream in = execHttpGet(urlRoot+"$/"+opDatasets) ; ) { 
}
+        try ( TypedInputStream in = 
execHttpGet(ServerCtl.urlRoot()+"$/"+opDatasets) ; ) { }
     }
     
     @Test public void list_datasets_2() {
-        try ( TypedInputStream in = execHttpGet(urlRoot+"$/"+opDatasets) ) {
+        try ( TypedInputStream in = 
execHttpGet(ServerCtl.urlRoot()+"$/"+opDatasets) ) {
             assertEqualsIgnoreCase(WebContent.contentTypeJSON, 
in.getContentType()) ;
             JsonValue v = JSON.parseAny(in) ;
             assertNotNull(v.getAsObject().get("datasets")) ; 
@@ -99,7 +97,7 @@ public class TestAdmin extends AbstractFusekiTest {
     
     // Specific dataset
     @Test public void list_datasets_3() {
-        checkExists(datasetPath) ;
+        checkExists(ServerCtl.datasetPath()) ;
     }
     
     // Specific dataset
@@ -109,7 +107,7 @@ public class TestAdmin extends AbstractFusekiTest {
     
     // Specific dataset
     @Test public void list_datasets_5() {
-        JsonValue v = getDatasetDescription(datasetPath) ;
+        JsonValue v = getDatasetDescription(ServerCtl.datasetPath()) ;
         checkJsonDatasetsOne(v.getAsObject()) ;
     }
 
@@ -135,14 +133,14 @@ public class TestAdmin extends AbstractFusekiTest {
         { 
             org.apache.http.entity.ContentType ct = 
org.apache.http.entity.ContentType.parse(WebContent.contentTypeTurtle+"; 
charset="+WebContent.charsetUTF8) ;
             HttpEntity e = new FileEntity(f, ct) ;
-            execHttpPost(ServerTest.urlRoot+"$/"+opDatasets, e) ;
+            execHttpPost(ServerCtl.urlRoot()+"$/"+opDatasets, e) ;
         }
         // Check exists.
         checkExists(dsTest) ;
         try {
             org.apache.http.entity.ContentType ct = 
org.apache.http.entity.ContentType.parse(WebContent.contentTypeTurtle+"; 
charset="+WebContent.charsetUTF8) ;
             HttpEntity e = new FileEntity(f, ct) ;
-            execHttpPost(ServerTest.urlRoot+"$/"+opDatasets, e) ;
+            execHttpPost(ServerCtl.urlRoot()+"$/"+opDatasets, e) ;
         } catch (HttpException ex) {
             assertEquals(HttpSC.CONFLICT_409, ex.getResponseCode()) ;
         }
@@ -184,7 +182,7 @@ public class TestAdmin extends AbstractFusekiTest {
     
     @Test public void delete_dataset_1() {
         String name = "NoSuchDataset" ;
-        FusekiTest.exec404( ()-> 
execHttpDelete(ServerTest.urlRoot+"$/"+opDatasets+"/"+name) ) ;
+        FusekiTest.exec404( ()-> 
execHttpDelete(ServerCtl.urlRoot()+"$/"+opDatasets+"/"+name) ) ;
     }
 
     // ---- Active/Offline.
@@ -194,11 +192,11 @@ public class TestAdmin extends AbstractFusekiTest {
         addTestDataset() ;
         checkExists(dsTest) ;
 
-        
execHttpPost(ServerTest.urlRoot+"$/"+opDatasets+"/"+dsTest+"?state=offline", 
null) ;
+        
execHttpPost(ServerCtl.urlRoot()+"$/"+opDatasets+"/"+dsTest+"?state=offline", 
null) ;
 
         checkExistsNotActive(dsTest); 
         
-        
execHttpPost(ServerTest.urlRoot+"$/"+opDatasets+"/"+dsTest+"?state=active", 
null) ;
+        
execHttpPost(ServerCtl.urlRoot()+"$/"+opDatasets+"/"+dsTest+"?state=active", 
null) ;
         
         checkExists(dsTest) ;
         deleteDataset(dsTest) ;
@@ -206,14 +204,14 @@ public class TestAdmin extends AbstractFusekiTest {
     
     @Test public void state_2() {
         addTestDataset() ;
-        
execHttpPost(ServerTest.urlRoot+"$/"+opDatasets+"/"+dsTest+"?state=offline", 
null) ;
+        
execHttpPost(ServerCtl.urlRoot()+"$/"+opDatasets+"/"+dsTest+"?state=offline", 
null) ;
         deleteDataset(dsTest) ;
         checkNotThere(dsTest) ;
     }
 
     @Test public void state_3() {
         addTestDataset() ;
-        
FusekiTest.exec404(()->execHttpPost(ServerTest.urlRoot+"$/"+opDatasets+"/DoesNotExist?state=offline",
 null)) ;
+        
FusekiTest.exec404(()->execHttpPost(ServerCtl.urlRoot()+"$/"+opDatasets+"/DoesNotExist?state=offline",
 null)) ;
         deleteDataset(dsTest) ;
     }
     
@@ -224,13 +222,13 @@ public class TestAdmin extends AbstractFusekiTest {
     // ---- Stats
     
     @Test public void stats_1() {
-        JsonValue v = execGetJSON(urlRoot+"$/"+opStats) ;
+        JsonValue v = execGetJSON(ServerCtl.urlRoot()+"$/"+opStats) ;
         checkJsonStatsAll(v); 
     }
     
     @Test public void stats_2() {
         addTestDataset() ;
-        JsonValue v = execGetJSON(urlRoot+"$/"+opStats+datasetPath) ;
+        JsonValue v = 
execGetJSON(ServerCtl.urlRoot()+"$/"+opStats+ServerCtl.datasetPath()) ;
         checkJsonStatsAll(v); 
         deleteDataset(dsTest) ;
     }
@@ -238,7 +236,7 @@ public class TestAdmin extends AbstractFusekiTest {
     @Test public void stats_3() {
         addTestDataset() ;
         FusekiTest.exec404(()->{
-            JsonValue v = execGetJSON(urlRoot+"$/"+opStats+"/DoesNotExist") ;
+            JsonValue v = 
execGetJSON(ServerCtl.urlRoot()+"$/"+opStats+"/DoesNotExist") ;
         }) ;
         deleteDataset(dsTest) ;
     }
@@ -253,7 +251,7 @@ public class TestAdmin extends AbstractFusekiTest {
     
     @Test public void task_2() {
         String x = "NoSuchTask" ;
-        String url = urlRoot+"$/tasks/"+x ;
+        String url = ServerCtl.urlRoot()+"$/tasks/"+x ;
         FusekiTest.exec404(()->httpGetJson(url) ) ;
         try { 
             checkInTasks(x) ;
@@ -278,7 +276,7 @@ public class TestAdmin extends AbstractFusekiTest {
         String x = execSleepTask(null, 1) ;
         // Check exists in the list of all tasks (should be "finished")
         checkInTasks(x) ;
-        String url = urlRoot+"$/tasks/"+x ;
+        String url = ServerCtl.urlRoot()+"$/tasks/"+x ;
         
         boolean finished = false ; 
         for ( int i = 0 ; i < 10 ; i++ ) {
@@ -302,7 +300,7 @@ public class TestAdmin extends AbstractFusekiTest {
     }
 
     @Test public void list_backups_1() {
-        try ( TypedInputStream in = execHttpGet(urlRoot+"$/"+opListBackups) ) {
+        try ( TypedInputStream in = 
execHttpGet(ServerCtl.urlRoot()+"$/"+opListBackups) ) {
             assertEqualsIgnoreCase(WebContent.contentTypeJSON, 
in.getContentType()) ;
             JsonValue v = JSON.parseAny(in) ;
             assertNotNull(v.getAsObject().get("backups")) ; 
@@ -310,12 +308,12 @@ public class TestAdmin extends AbstractFusekiTest {
     }
 
     private JsonValue getTask(String taskId) {
-        String url = urlRoot+"$/tasks/"+taskId ;
+        String url = ServerCtl.urlRoot()+"$/tasks/"+taskId ;
         return httpGetJson(url) ;
     }
 
     private static JsonValue getDatasetDescription(String dsName) {
-        try (TypedInputStream in = execHttpGet(urlRoot + "$/" + opDatasets + 
"/" + dsName)) {
+        try (TypedInputStream in = execHttpGet(ServerCtl.urlRoot() + "$/" + 
opDatasets + "/" + dsName)) {
             assertEqualsIgnoreCase(WebContent.contentTypeJSON, 
in.getContentType());
             JsonValue v = JSON.parse(in);
             return v;
@@ -332,11 +330,11 @@ public class TestAdmin extends AbstractFusekiTest {
         File f = new File(filename) ;
         org.apache.http.entity.ContentType ct = 
org.apache.http.entity.ContentType.parse(WebContent.contentTypeTurtle+"; 
charset="+WebContent.charsetUTF8) ;
         HttpEntity e = new FileEntity(f, ct) ;
-        execHttpPost(ServerTest.urlRoot+"$/"+opDatasets, e) ;
+        execHttpPost(ServerCtl.urlRoot()+"$/"+opDatasets, e) ;
     }
 
     private static void deleteDataset(String name) {
-        execHttpDelete(ServerTest.urlRoot+"$/"+opDatasets+"/"+name) ;
+        execHttpDelete(ServerCtl.urlRoot()+"$/"+opDatasets+"/"+name) ;
     }
 
     static class JsonResponseHandler implements HttpResponseHandler {
@@ -357,7 +355,7 @@ public class TestAdmin extends AbstractFusekiTest {
     }
     
     private String execSleepTask(String name, int millis) {
-        String url = urlRoot+"$/sleep" ;
+        String url = ServerCtl.urlRoot()+"$/sleep" ;
         if ( name != null ) {
             if ( name.startsWith("/") )
                 name = name.substring(1) ;
@@ -378,7 +376,7 @@ public class TestAdmin extends AbstractFusekiTest {
     }
     
     private void checkTask(String x) {
-        String url = urlRoot+"$/tasks/"+x ;
+        String url = ServerCtl.urlRoot()+"$/tasks/"+x ;
         JsonValue v = httpGetJson(url) ;
         checkTask(v) ;
     }    
@@ -399,7 +397,7 @@ public class TestAdmin extends AbstractFusekiTest {
     }
         
    private void checkInTasks(String x) {
-       String url = urlRoot+"$/tasks" ;
+       String url = ServerCtl.urlRoot()+"$/tasks" ;
        JsonValue v = httpGetJson(url) ;
        assertTrue(v.isArray()) ;
        JsonArray array = v.getAsArray() ; 
@@ -421,11 +419,11 @@ public class TestAdmin extends AbstractFusekiTest {
     private static void askPing(String name) {
         if ( name.startsWith("/") )
             name = name.substring(1) ;
-        try ( TypedInputStream in = 
execHttpGet(urlRoot+name+"/sparql?query=ASK%7B%7D") ) {}  
+        try ( TypedInputStream in = 
execHttpGet(ServerCtl.urlRoot()+name+"/sparql?query=ASK%7B%7D") ) {}  
     }
     
     private static void adminPing(String name) {
-        try ( TypedInputStream in = 
execHttpGet(urlRoot+"$/"+opDatasets+"/"+name) ) {} 
+        try ( TypedInputStream in = 
execHttpGet(ServerCtl.urlRoot()+"$/"+opDatasets+"/"+name) ) {} 
     }
 
     private static void checkExists(String name)  {

http://git-wip-us.apache.org/repos/asf/jena/blob/7c3a5cfd/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestAuth.java
----------------------------------------------------------------------
diff --git 
a/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestAuth.java
 
b/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestAuth.java
index 1a4f517..a860291 100644
--- 
a/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestAuth.java
+++ 
b/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestAuth.java
@@ -56,10 +56,9 @@ import org.junit.Test ;
  */
 public class TestAuth {
     
-
     // Use different port etc because sometimes the previous testing servers
     // don't release ports fast enough (OS issue / Linux)
-    public static final int authPort             = ServerTest.port+10 ;
+    public static final int authPort             = ServerCtl.port()+10 ;
     public static final String authUrlRoot       = 
"http://localhost:"+authPort+"/"; ;
     public static final String authDatasetPath   = "/dataset" ;
     public static final String authServiceUpdate = 
"http://localhost:"+authPort+authDatasetPath+"/update"; ; 
@@ -84,7 +83,7 @@ public class TestAuth {
         LogCtl.setLevel(Fuseki.actionLogName, "warn") ;
         LogCtl.setLevel("org.eclipse.jetty",  "warn") ;
 
-        ServerTest.setupServer(authPort, realmFile.getAbsolutePath(), 
authDatasetPath, true);
+        ServerCtl.setupServer(authPort, realmFile.getAbsolutePath(), 
authDatasetPath, true);
     }
 
     /**
@@ -92,7 +91,7 @@ public class TestAuth {
      */
     @AfterClass
     public static void teardown() {
-        ServerTest.teardownServer(); 
+        ServerCtl.teardownServer(); 
         realmFile.delete();
     }
 

http://git-wip-us.apache.org/repos/asf/jena/blob/7c3a5cfd/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestDatasetOps.java
----------------------------------------------------------------------
diff --git 
a/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestDatasetOps.java
 
b/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestDatasetOps.java
index fac056b..6ee42d4 100644
--- 
a/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestDatasetOps.java
+++ 
b/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestDatasetOps.java
@@ -18,9 +18,7 @@
 
 package org.apache.jena.fuseki;
 
-import static org.apache.jena.fuseki.ServerTest.serviceQuery ;
-import static org.apache.jena.fuseki.ServerTest.serviceGSP ;
-import static org.apache.jena.fuseki.ServerTest.urlDataset ;
+import static org.apache.jena.fuseki.ServerCtl.* ; 
 import org.apache.http.HttpEntity ;
 import org.apache.http.entity.EntityTemplate ;
 import org.apache.jena.atlas.lib.StrUtils ;
@@ -61,19 +59,19 @@ public class TestDatasetOps extends AbstractFusekiTest
     }
     
     @Test public void gsp_x_01() {
-        gsp_x(urlDataset, urlDataset) ;
+        gsp_x(urlDataset(), urlDataset()) ;
     }
 
     @Test public void gsp_x_02() {
-        gsp_x(urlDataset, serviceGSP) ;
+        gsp_x(urlDataset(), serviceGSP()) ;
     }
 
     @Test public void gsp_x_03() {
-        gsp_x(serviceGSP, urlDataset) ;
+        gsp_x(serviceGSP(), urlDataset()) ;
     }
 
     @Test public void gsp_x_04() {
-        gsp_x(serviceGSP, urlDataset) ;
+        gsp_x(serviceGSP(), urlDataset()) ;
     }
 
     private void gsp_x(String outward, String inward) {
@@ -89,38 +87,38 @@ public class TestDatasetOps extends AbstractFusekiTest
     // Get dataset.  Tests conneg.
     @Test 
     public void gsp_x_10() {
-        gsp_x_ct(urlDataset, WebContent.contentTypeNQuads, 
WebContent.contentTypeNQuads) ;
+        gsp_x_ct(urlDataset(), WebContent.contentTypeNQuads, 
WebContent.contentTypeNQuads) ;
     }
 
     @Test 
     public void gsp_x_11() {
-        gsp_x_ct(urlDataset, WebContent.contentTypeNQuadsAlt1, 
WebContent.contentTypeNQuads) ;
+        gsp_x_ct(urlDataset(), WebContent.contentTypeNQuadsAlt1, 
WebContent.contentTypeNQuads) ;
     }
 
     @Test 
     public void gsp_x_12() {
-        gsp_x_ct(urlDataset, WebContent.contentTypeTriG, 
WebContent.contentTypeTriG) ;
+        gsp_x_ct(urlDataset(), WebContent.contentTypeTriG, 
WebContent.contentTypeTriG) ;
     }
 
     @Test 
     public void gsp_x_13() {
-        gsp_x_ct(urlDataset, WebContent.contentTypeTriGAlt1, 
WebContent.contentTypeTriG) ;
+        gsp_x_ct(urlDataset(), WebContent.contentTypeTriGAlt1, 
WebContent.contentTypeTriG) ;
     }
 
     @Test 
     public void gsp_x_14() {
-        gsp_x_ct(urlDataset, WebContent.defaultDatasetAcceptHeader, 
WebContent.contentTypeTriG) ;
+        gsp_x_ct(urlDataset(), WebContent.defaultDatasetAcceptHeader, 
WebContent.contentTypeTriG) ;
     }
 
     @Test 
     public void gsp_x_15() {
         // Anything!
-        gsp_x_ct(urlDataset, WebContent.defaultRDFAcceptHeader, 
WebContent.contentTypeTriG) ;
+        gsp_x_ct(urlDataset(), WebContent.defaultRDFAcceptHeader, 
WebContent.contentTypeTriG) ;
     }
     
-    private void gsp_x_ct(String urldataset, String acceptheader, String 
contentTypeResponse) {
+    private void gsp_x_ct(String urlDataset, String acceptheader, String 
contentTypeResponse) {
         HttpEntity e = datasetToHttpEntity(data) ;
-        HttpOp.execHttpPut(urlDataset, e);
+        HttpOp.execHttpPut(urlDataset(), e);
         TypedInputStream in = HttpOp.execHttpGet(urlDataset, acceptheader) ;
         assertEqualsIgnoreCase(contentTypeResponse, in.getContentType()) ;
         DatasetGraph dsg = DatasetGraphFactory.create() ;
@@ -133,7 +131,7 @@ public class TestDatasetOps extends AbstractFusekiTest
     {
         HttpEntity e = datasetToHttpEntity(data) ;
         try { 
-            HttpOp.execHttpPost(serviceQuery, e);
+            HttpOp.execHttpPost(serviceQuery(), e);
         } catch (HttpException ex) {
             assertTrue(HttpSC.isClientError(ex.getResponseCode())) ;
         }

http://git-wip-us.apache.org/repos/asf/jena/blob/7c3a5cfd/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestFileUpload.java
----------------------------------------------------------------------
diff --git 
a/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestFileUpload.java
 
b/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestFileUpload.java
index d351c7d..cfc0527 100644
--- 
a/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestFileUpload.java
+++ 
b/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestFileUpload.java
@@ -18,7 +18,6 @@
 
 package org.apache.jena.fuseki;
 
-import static org.apache.jena.fuseki.ServerTest.serviceGSP ;
 import org.apache.jena.atlas.web.TypedInputStream ;
 import org.apache.jena.fuseki.http.TestDatasetAccessorHTTP ;
 import org.apache.jena.fuseki.http.TestHttpOp ;
@@ -42,12 +41,12 @@ public class TestFileUpload extends AbstractFusekiTest
 {
     @Test public void upload_gsp_01()
     {
-        FileSender x = new FileSender(serviceGSP+"?default") ;
+        FileSender x = new FileSender(ServerCtl.serviceGSP()+"?default") ;
         x.add("D.ttl", "<http://example/s> <http://example/p> 
<http://example/o> .", "text/turtle") ;
         x.send("POST") ;
         
         Model m = ModelFactory.createDefaultModel() ;
-        TypedInputStream in = HttpOp.execHttpGet(serviceGSP, "text/turtle") ;
+        TypedInputStream in = HttpOp.execHttpGet(ServerCtl.serviceGSP(), 
"text/turtle") ;
         RDFDataMgr.read(m, in, 
RDFLanguages.contentTypeToLang(in.getMediaType()) ) ;
         // which is is effectively :
 //        DatasetAccessor du = DatasetAccessorFactory.createHTTP(serviceREST) ;
@@ -57,13 +56,13 @@ public class TestFileUpload extends AbstractFusekiTest
     
     @Test public void upload_gsp_02()
     {
-        FileSender x = new FileSender(ServerTest.serviceGSP+"?default") ;
+        FileSender x = new FileSender(ServerCtl.serviceGSP()+"?default") ;
         x.add("D.ttl", "<http://example/s> <http://example/p> 123 .", 
"text/turtle") ;
         x.add("D.nt", "<http://example/s> <http://example/p> 
<http://example/o-456> .", "application/n-triples") ;
         x.send("PUT") ;
         
         // BUG
-        DatasetAccessor du = DatasetAccessorFactory.createHTTP(serviceGSP) ;
+        DatasetAccessor du = 
DatasetAccessorFactory.createHTTP(ServerCtl.serviceGSP()) ;
         Model m = du.getModel() ;
         assertEquals(2, m.size()) ;
     }
@@ -71,12 +70,12 @@ public class TestFileUpload extends AbstractFusekiTest
     // Extension of GSP - no graph selector => dataset
     @Test public void upload_gsp_03()
     {
-        FileSender x = new FileSender(ServerTest.serviceGSP) ;
+        FileSender x = new FileSender(ServerCtl.serviceGSP()) ;
         x.add("D.ttl", "<http://example/s> <http://example/p> 
<http://example/o> .", "text/turtle") ;
         x.add("D.trig", "<http://example/g> { <http://example/s> 
<http://example/p> <http://example/o> }", "text/trig") ;
         x.send("POST") ;
         
-        DatasetAccessor du = DatasetAccessorFactory.createHTTP(serviceGSP) ;
+        DatasetAccessor du = 
DatasetAccessorFactory.createHTTP(ServerCtl.serviceGSP()) ;
         Model m = du.getModel() ;
         assertEquals(1, m.size()) ;
     }
@@ -84,16 +83,16 @@ public class TestFileUpload extends AbstractFusekiTest
     @Test public void upload_gsp_04()
     {
         {
-            DatasetAccessor du = DatasetAccessorFactory.createHTTP(serviceGSP) 
;
+            DatasetAccessor du = 
DatasetAccessorFactory.createHTTP(ServerCtl.serviceGSP()) ;
             Model m = du.getModel() ;
             assertEquals(0, m.size()) ;
         }
-        FileSender x = new FileSender(ServerTest.urlDataset) ;
+        FileSender x = new FileSender(ServerCtl.urlDataset()) ;
         x.add("D.ttl", "<http://example/s> <http://example/p> 
<http://example/o> .", "text/plain") ;
         x.add("D.trig", "<http://example/g> { <http://example/s> 
<http://example/p> 123,456 }", "text/plain") ;
         x.send("POST") ;
         
-        DatasetAccessor du = DatasetAccessorFactory.createHTTP(serviceGSP) ;
+        DatasetAccessor du = 
DatasetAccessorFactory.createHTTP(ServerCtl.serviceGSP()) ;
         Model m = du.getModel() ;
         assertEquals(1, m.size()) ;
         m = du.getModel("http://example/g";) ;
@@ -103,21 +102,21 @@ public class TestFileUpload extends AbstractFusekiTest
     // Via DatasetAccessor
     
     @Test public void dataset_accessor_01() {
-        FileSender x = new FileSender(ServerTest.urlDataset) ;
+        FileSender x = new FileSender(ServerCtl.urlDataset()) ;
         x.add("D.nq", "", "application/-n-quads") ;
         x.send("PUT") ;
         
-        DatasetAccessor du = DatasetAccessorFactory.createHTTP(serviceGSP) ;
+        DatasetAccessor du = 
DatasetAccessorFactory.createHTTP(ServerCtl.serviceGSP()) ;
         Model m = du.getModel() ;
         assertEquals(0, m.size()) ;
     }
     
     @Test public void dataset_accessor_02() {
-        FileSender x = new FileSender(ServerTest.urlDataset) ;
+        FileSender x = new FileSender(ServerCtl.urlDataset()) ;
         x.add("D.nq", "<http://example/s> <http://example/p> 
<http://example/o-456> <http://example/g> .", "application/n-quads") ;
         x.send("PUT") ;
         
-        DatasetAccessor du = DatasetAccessorFactory.createHTTP(serviceGSP) ;
+        DatasetAccessor du = 
DatasetAccessorFactory.createHTTP(ServerCtl.serviceGSP()) ;
         Model m = du.getModel("http://example/g";) ;
         assertEquals(1, m.size()) ;
         m = du.getModel() ;

http://git-wip-us.apache.org/repos/asf/jena/blob/7c3a5cfd/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestHttpOperations.java
----------------------------------------------------------------------
diff --git 
a/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestHttpOperations.java
 
b/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestHttpOperations.java
index 2f5b751..71011a0 100644
--- 
a/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestHttpOperations.java
+++ 
b/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestHttpOperations.java
@@ -18,8 +18,8 @@
 
 package org.apache.jena.fuseki ;
 
-import static org.apache.jena.fuseki.ServerTest.* ;
-import static org.apache.jena.fuseki.ServerTest.serviceUpdate ;
+import static org.apache.jena.fuseki.ServerCtl.serviceQuery ;
+import static org.apache.jena.fuseki.ServerCtl.serviceUpdate ;
 
 import org.apache.jena.atlas.web.HttpException ;
 import org.apache.jena.atlas.web.TypedInputStream ;
@@ -38,7 +38,7 @@ public class TestHttpOperations extends AbstractFusekiTest {
     @Test 
     public void query_by_get_1() {
         String qs = Convert.encWWWForm("ASK{}") ;
-        String u = serviceQuery+"?query=" + qs ;
+        String u = serviceQuery()+"?query=" + qs ;
         try (TypedInputStream in = HttpOp.execHttpGet(u)) {
             Assert.assertNotNull(in);
         }
@@ -46,8 +46,7 @@ public class TestHttpOperations extends AbstractFusekiTest {
     
     @Test 
     public void query_by_post_1() {
-        String u = serviceQuery ;
-        try (TypedInputStream in = HttpOp.execHttpPostStream(u, 
WebContent.contentTypeSPARQLQuery, "ASK{}", "*")) {
+        try (TypedInputStream in = HttpOp.execHttpPostStream(serviceQuery(), 
WebContent.contentTypeSPARQLQuery, "ASK{}", "*")) {
             Assert.assertNotNull(in);
         }
     }
@@ -55,7 +54,7 @@ public class TestHttpOperations extends AbstractFusekiTest {
     @Test 
     public void query_by_post_2() {
         String qs = Convert.encWWWForm("ASK{}") ;
-        String u = serviceQuery+"?query=" + qs ;
+        String u = serviceQuery()+"?query=" + qs ;
         try (TypedInputStream in = HttpOp.execHttpPostStream(u, null, null)) {
             Assert.assertNotNull(in);
         }
@@ -63,26 +62,23 @@ public class TestHttpOperations extends AbstractFusekiTest {
 
     @Test 
     public void query_by_form_1() {
-        String u = serviceQuery ;
         Params params = new Params().addParam("query", "ASK{}") ;
-        try (TypedInputStream in = HttpOp.execHttpPostFormStream(u, params, 
"*") ) { 
+        try (TypedInputStream in = 
HttpOp.execHttpPostFormStream(serviceQuery(), params, "*") ) { 
             Assert.assertNotNull(in);
         }
     }
 
     @Test(expected=HttpException.class) 
     public void query_by_form_2() {
-        String u = serviceQuery ;
         Params params = new Params().addParam("foobar", "ASK{}") ;    // Wrong.
-        try (TypedInputStream in = HttpOp.execHttpPostFormStream(u, params, 
"*") ) { 
+        try (TypedInputStream in = 
HttpOp.execHttpPostFormStream(serviceQuery(), params, "*") ) { 
             Assert.assertNotNull(in);
         }
     }
 
     @Test 
     public void update_by_post_1() {
-        String u = serviceUpdate ;
-        HttpOp.execHttpPost(u, WebContent.contentTypeSPARQLUpdate, "INSERT 
DATA{}") ;
+        HttpOp.execHttpPost(serviceUpdate(), 
WebContent.contentTypeSPARQLUpdate, "INSERT DATA{}") ;
     }
 
     // POST ?request= :: Not supported.
@@ -97,18 +93,16 @@ public class TestHttpOperations extends AbstractFusekiTest {
 
     @Test
     public void update_by_form_1() {
-        String u = serviceUpdate ;
         Params params = new Params().addParam("update", "INSERT DATA{}") ;
-        try (TypedInputStream in = HttpOp.execHttpPostFormStream(u, params, 
"*") ) { 
+        try (TypedInputStream in = 
HttpOp.execHttpPostFormStream(serviceUpdate(), params, "*") ) { 
             Assert.assertNotNull(in);
         }
     }
     
     @Test(expected=HttpException.class)
     public void update_by_form_2() {
-        String u = serviceUpdate ;
         Params params = new Params().addParam("query", "INSERT DATA{}") ;  // 
Wrong paramater
-        try (TypedInputStream in = HttpOp.execHttpPostFormStream(u, params, 
"*") ) { 
+        try (TypedInputStream in = 
HttpOp.execHttpPostFormStream(serviceUpdate(), params, "*") ) { 
             Assert.assertNotNull(in);
         }
     }
@@ -117,7 +111,7 @@ public class TestHttpOperations extends AbstractFusekiTest {
     
     @Test 
     public void ds_query_by_get_1() {
-        String u = urlDataset ;
+        String u = ServerCtl.urlDataset() ;
         try (TypedInputStream in = HttpOp.execHttpGet(u)) {
             Assert.assertNotNull(in);
         }
@@ -125,7 +119,7 @@ public class TestHttpOperations extends AbstractFusekiTest {
 
     @Test 
     public void ds_query_by_post_1() {
-        String u = urlDataset ;
+        String u = ServerCtl.urlDataset() ;
         try (TypedInputStream in = HttpOp.execHttpPostStream(u, 
WebContent.contentTypeSPARQLQuery, "ASK{}", "*")) {
             Assert.assertNotNull(in);
         }
@@ -133,7 +127,7 @@ public class TestHttpOperations extends AbstractFusekiTest {
     
     @Test 
     public void ds_update_by_post_1() {
-        String u = urlDataset ;
+        String u = ServerCtl.urlDataset() ;
         HttpOp.execHttpPost(u, WebContent.contentTypeSPARQLUpdate, "INSERT 
DATA{}") ;
     }
 

http://git-wip-us.apache.org/repos/asf/jena/blob/7c3a5cfd/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestHttpOptions.java
----------------------------------------------------------------------
diff --git 
a/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestHttpOptions.java
 
b/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestHttpOptions.java
index 8f26d1a..7c6d4cd 100644
--- 
a/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestHttpOptions.java
+++ 
b/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestHttpOptions.java
@@ -18,30 +18,25 @@
 
 package org.apache.jena.fuseki;
 
-import static org.apache.jena.fuseki.ServerTest.serviceGSP ;
-import static org.apache.jena.fuseki.ServerTest.serviceQuery ;
-import static org.apache.jena.fuseki.ServerTest.serviceUpdate ;
-import static org.apache.jena.fuseki.ServerTest.urlDataset ;
-
 import org.junit.Test ;
 
 public class TestHttpOptions extends AbstractFusekiTest
 {
     @Test
     public void options_query() {
-        String v = FusekiTest.execOptions(serviceQuery) ;
+        String v = FusekiTest.execOptions(ServerCtl.serviceQuery()) ;
         FusekiTest.assertStringList(v, "GET", "OPTIONS", "POST") ;
     }
     
     @Test
     public void options_update() {
-        String v = FusekiTest.execOptions(serviceUpdate) ;
+        String v = FusekiTest.execOptions(ServerCtl.serviceUpdate()) ;
         FusekiTest.assertStringList(v, "OPTIONS", "POST") ;
     }
     
     @Test
     public void options_dataset_01() {
-        String v = FusekiTest.execOptions(urlDataset) ;
+        String v = FusekiTest.execOptions(ServerCtl.urlDataset()) ;
         // Not DELETE
         FusekiTest.assertStringList(v, "HEAD", "GET", "OPTIONS", "POST", 
"PUT") ;
     }
@@ -53,7 +48,7 @@ public class TestHttpOptions extends AbstractFusekiTest
     
     @Test
     public void options_gsp_rw() {
-        String v = FusekiTest.execOptions(serviceGSP+"?default") ;
+        String v = FusekiTest.execOptions(ServerCtl.serviceGSP()+"?default") ;
         FusekiTest.assertStringList(v, "GET", "OPTIONS", "HEAD", "POST", 
"PUT", "DELETE") ;
     }
 

http://git-wip-us.apache.org/repos/asf/jena/blob/7c3a5cfd/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestQuery.java
----------------------------------------------------------------------
diff --git 
a/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestQuery.java
 
b/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestQuery.java
index 213ea38..5651b77 100644
--- 
a/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestQuery.java
+++ 
b/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestQuery.java
@@ -18,19 +18,17 @@
 
 package org.apache.jena.fuseki ;
 
-import static org.apache.jena.fuseki.ServerTest.gn1 ;
-import static org.apache.jena.fuseki.ServerTest.gn2 ;
+import static org.apache.jena.fuseki.ServerCtl.serviceGSP ;
+import static org.apache.jena.fuseki.ServerCtl.serviceQuery ;
+import static org.apache.jena.fuseki.ServerTest.* ;
 import static org.apache.jena.fuseki.ServerTest.model1 ;
 import static org.apache.jena.fuseki.ServerTest.model2 ;
-import static org.apache.jena.fuseki.ServerTest.serviceQuery ;
-import static org.apache.jena.fuseki.ServerTest.serviceGSP ;
 
 import java.io.IOException ;
 import java.net.HttpURLConnection ;
 import java.net.URL ;
 import java.util.Iterator ;
 
-import org.apache.jena.atlas.junit.BaseTest ;
 import org.apache.jena.atlas.web.AcceptList ;
 import org.apache.jena.atlas.web.MediaType;
 import org.apache.jena.graph.Node ;
@@ -42,37 +40,24 @@ import org.apache.jena.sparql.core.Var ;
 import org.apache.jena.sparql.engine.binding.Binding ;
 import org.apache.jena.sparql.engine.http.QueryEngineHTTP ;
 import org.apache.jena.sparql.resultset.ResultSetCompare ;
-import org.apache.jena.sparql.sse.Item ;
 import org.apache.jena.sparql.sse.SSE ;
-import org.apache.jena.sparql.sse.builders.BuilderResultSet ;
 import org.apache.jena.sparql.util.Convert ;
-import org.junit.AfterClass ;
 import org.junit.Assert ;
-import org.junit.BeforeClass ;
+import org.junit.Before ;
 import org.junit.Test ;
 
-public class TestQuery extends BaseTest {
-    protected static ResultSet rs1 = null ;
-    static {
-        Item item = SSE.parseItem("(resultset (?s ?p ?o) (row (?s <x>)(?p 
<p>)(?o 1)))") ;
-        rs1 = BuilderResultSet.build(item) ;
-    }
-
-    @BeforeClass
-    public static void beforeClass() {
-        ServerTest.allocServer() ;
-        DatasetAccessor du = DatasetAccessorFactory.createHTTP(serviceGSP) ;
+public class TestQuery extends AbstractFusekiTest {
+    
+    @Before
+    public void before() {
+        DatasetAccessor du = DatasetAccessorFactory.createHTTP(serviceGSP()) ;
         du.putModel(model1) ;
         du.putModel(gn1, model2) ;
     }
-
-    @AfterClass
-    public static void afterClass() {
-        DatasetAccessor du = DatasetAccessorFactory.createHTTP(serviceGSP) ;
-        du.deleteDefault() ;
-        ServerTest.freeServer() ;
-    }
-
+    
+    private static final AcceptList quadsOfferTest = DEF.quadsOffer ;
+    private static final AcceptList rdfOfferTest   = DEF.rdfOffer ;    
+    
     @Test
     public void query_01() {
         execQuery("SELECT * {?s ?p ?o}", 1) ;
@@ -80,8 +65,8 @@ public class TestQuery extends BaseTest {
 
     @Test
     public void query_recursive_01() {
-        String query = "SELECT * WHERE { SERVICE <" + serviceQuery + "> { ?s 
?p ?o . BIND(?o AS ?x) } }" ;
-        try (QueryExecution qExec = 
QueryExecutionFactory.sparqlService(serviceQuery, query)) {
+        String query = "SELECT * WHERE { SERVICE <" + serviceQuery() + "> { ?s 
?p ?o . BIND(?o AS ?x) } }" ;
+        try (QueryExecution qExec = 
QueryExecutionFactory.sparqlService(serviceQuery(), query)) {
             ResultSet rs = qExec.execSelect() ;
             Var x = Var.alloc("x") ;
             while (rs.hasNext()) {
@@ -94,7 +79,7 @@ public class TestQuery extends BaseTest {
     @Test
     public void query_with_params_01() {
         String query = "ASK { }" ;
-        try (QueryExecution qExec = 
QueryExecutionFactory.sparqlService(serviceQuery + "?output=json", query)) {
+        try (QueryExecution qExec = 
QueryExecutionFactory.sparqlService(serviceQuery() + "?output=json", query)) {
             boolean result = qExec.execAsk() ;
             Assert.assertTrue(result) ;
         }
@@ -103,19 +88,19 @@ public class TestQuery extends BaseTest {
     @Test
     public void request_id_header_01() throws IOException {
         String qs = Convert.encWWWForm("ASK{}") ;
-        URL u = new URL(serviceQuery + "?query=" + qs) ;
+        URL u = new URL(serviceQuery() + "?query=" + qs) ;
         HttpURLConnection conn = (HttpURLConnection)u.openConnection() ;
         Assert.assertTrue(conn.getHeaderField("Fuseki-Request-ID") != null) ;
     }
 
     @Test
     public void query_dynamic_dataset_01() {
-        DatasetAccessor du = DatasetAccessorFactory.createHTTP(serviceGSP) ;
+        DatasetAccessor du = DatasetAccessorFactory.createHTTP(serviceGSP()) ;
         du.putModel(model1);
         du.putModel(gn1, model2);
         {
             String query = "SELECT * { ?s ?p ?o }" ;
-            try (QueryExecution qExec = 
QueryExecutionFactory.sparqlService(serviceQuery + "?output=json", query)) {
+            try (QueryExecution qExec = 
QueryExecutionFactory.sparqlService(serviceQuery() + "?output=json", query)) {
                 ResultSet rs = qExec.execSelect() ;
                 Node o = rs.next().getLiteral("o").asNode() ;
                 Node n = SSE.parseNode("1") ;
@@ -124,7 +109,7 @@ public class TestQuery extends BaseTest {
         }
         {
             String query = "SELECT * FROM <" + gn1 + "> { ?s ?p ?o }" ;
-            try (QueryExecution qExec = 
QueryExecutionFactory.sparqlService(serviceQuery + "?output=json", query)) {
+            try (QueryExecution qExec = 
QueryExecutionFactory.sparqlService(serviceQuery() + "?output=json", query)) {
                 ResultSet rs = qExec.execSelect() ;
                 Node o = rs.next().getLiteral("o").asNode() ;
                 Node n = SSE.parseNode("2") ;
@@ -135,12 +120,12 @@ public class TestQuery extends BaseTest {
 
     @Test
     public void query_dynamic_dataset_02() {
-        DatasetAccessor du = DatasetAccessorFactory.createHTTP(serviceGSP) ;
+        DatasetAccessor du = DatasetAccessorFactory.createHTTP(serviceGSP()) ;
         du.putModel(model1);
         du.putModel(gn1, model1);
         du.putModel(gn2, model2);
         String query = "SELECT * FROM <"+gn1+"> FROM <"+gn2+"> { ?s ?p ?o }" ;
-        try (QueryExecution qExec = 
QueryExecutionFactory.sparqlService(serviceQuery + "?output=json", query)) {
+        try (QueryExecution qExec = 
QueryExecutionFactory.sparqlService(serviceQuery() + "?output=json", query)) {
             ResultSet rs = qExec.execSelect() ;
             int n = ResultSetFormatter.consume(rs) ;
             assertEquals(2, n) ;
@@ -153,7 +138,7 @@ public class TestQuery extends BaseTest {
         String queryString = " CONSTRUCT { GRAPH <http://eg/g> {?s ?p ?oq} } 
WHERE {?s ?p ?oq}" ;
         Query query = QueryFactory.create(queryString, Syntax.syntaxARQ);
 
-        try ( QueryExecution qExec = 
QueryExecutionFactory.sparqlService(serviceQuery, query) ) {
+        try ( QueryExecution qExec = 
QueryExecutionFactory.sparqlService(serviceQuery(), query) ) {
             Iterator<Quad> result = qExec.execConstructQuads();
             Assert.assertTrue(result.hasNext());
             Assert.assertEquals( "http://eg/g";, 
result.next().getGraph().getURI());
@@ -167,7 +152,7 @@ public class TestQuery extends BaseTest {
         String queryString = " CONSTRUCT { GRAPH <http://eg/g> {?s ?p ?oq} } 
WHERE {?s ?p ?oq}" ;
         Query query = QueryFactory.create(queryString, Syntax.syntaxARQ);
 
-        try ( QueryExecution qExec = 
QueryExecutionFactory.sparqlService(serviceQuery, query) ) {
+        try ( QueryExecution qExec = 
QueryExecutionFactory.sparqlService(serviceQuery(), query) ) {
             Dataset result = qExec.execConstructDataset();
             Assert.assertTrue(result.asDatasetGraph().find().hasNext());
             Assert.assertEquals( "http://eg/g";, 
result.asDatasetGraph().find().next().getGraph().getURI());
@@ -178,7 +163,7 @@ public class TestQuery extends BaseTest {
     public void query_construct_01()
     {
         String query = " CONSTRUCT {?s ?p ?o} WHERE {?s ?p ?o}" ;
-        try ( QueryExecution qExec = 
QueryExecutionFactory.sparqlService(serviceQuery, query) ) {
+        try ( QueryExecution qExec = 
QueryExecutionFactory.sparqlService(serviceQuery(), query) ) {
             Iterator<Triple> result = qExec.execConstructTriples();
             Assert.assertTrue(result.hasNext());
         }
@@ -188,7 +173,7 @@ public class TestQuery extends BaseTest {
     public void query_construct_02()
     {
         String query = " CONSTRUCT {?s ?p ?o} WHERE {?s ?p ?o}" ;
-        try ( QueryExecution qExec = 
QueryExecutionFactory.sparqlService(serviceQuery, query) ) {
+        try ( QueryExecution qExec = 
QueryExecutionFactory.sparqlService(serviceQuery(), query) ) {
             Model result = qExec.execConstruct();
             assertEquals(1, result.size());
         }
@@ -197,7 +182,7 @@ public class TestQuery extends BaseTest {
     @Test
     public void query_describe_01() {
         String query = "DESCRIBE ?s WHERE {?s ?p ?o}" ;
-        try ( QueryExecution qExec = 
QueryExecutionFactory.sparqlService(serviceQuery, query) ) {
+        try ( QueryExecution qExec = 
QueryExecutionFactory.sparqlService(serviceQuery(), query) ) {
             Model result = qExec.execDescribe();
             assertFalse(result.isEmpty()) ;
         }
@@ -206,21 +191,27 @@ public class TestQuery extends BaseTest {
     @Test
     public void query_describe_02() {
         String query = "DESCRIBE <http://example/somethingelse> WHERE { }" ;
-        try ( QueryExecution qExec = 
QueryExecutionFactory.sparqlService(serviceQuery, query) ) {
+        try ( QueryExecution qExec = 
QueryExecutionFactory.sparqlService(serviceQuery(), query) ) {
             Model result = qExec.execDescribe();
             assertTrue(result.isEmpty()) ;
         }
     }
 
-    private static final AcceptList rdfOfferTest = DEF.rdfOffer ;
-    private static final AcceptList quadsOfferTest = DEF.quadsOffer ;
-
+    // Conneg tests:
+    // These avoid pooling connection pooling.
+    // It leads to lock up if the list is long (contentTypeTriXxml seems 
signiifcant)
+    // Hence: ServerCtl.setHttpClient(null) ;
+    
+    
     @Test
     public void query_construct_conneg() {
+        ServerCtl.setHttpClient(null) ;
+        
         String query = " CONSTRUCT {?s ?p ?o} WHERE {?s ?p ?o}" ;
         for (MediaType type: rdfOfferTest.entries()){
+            
             String contentType = type.toHeaderString();
-            try ( QueryEngineHTTP qExec = (QueryEngineHTTP) 
QueryExecutionFactory.sparqlService(serviceQuery, query) ) {
+            try ( QueryEngineHTTP qExec = (QueryEngineHTTP) 
QueryExecutionFactory.sparqlService(serviceQuery(), query) ) {
                 qExec.setModelContentType( contentType );
                 Iterator<Triple> iter = qExec.execConstructTriples();
                 assertTrue(iter.hasNext()) ;
@@ -232,11 +223,13 @@ public class TestQuery extends BaseTest {
 
     @Test
     public void query_construct_quad_conneg() {
+        ServerCtl.setHttpClient(null) ;
+
         String queryString = " CONSTRUCT { GRAPH ?g {?s ?p ?o} } WHERE { GRAPH 
?g {?s ?p ?o}}" ;
         Query query = QueryFactory.create(queryString, Syntax.syntaxARQ);
         for (MediaType type: quadsOfferTest.entries()){
             String contentType = type.toHeaderString();
-            try ( QueryEngineHTTP qExec = (QueryEngineHTTP) 
QueryExecutionFactory.sparqlService(serviceQuery, query) ) {
+            try ( QueryEngineHTTP qExec = (QueryEngineHTTP) 
QueryExecutionFactory.sparqlService(serviceQuery(), query) ) {
                 qExec.setDatasetContentType( contentType );
                 Iterator<Quad> iter = qExec.execConstructQuads();
                 assertTrue(iter.hasNext()) ;
@@ -248,10 +241,12 @@ public class TestQuery extends BaseTest {
 
     @Test
     public void query_describe_conneg() {
+        ServerCtl.setHttpClient(null) ;
+
         String query = "DESCRIBE ?s WHERE {?s ?p ?o}" ;
         for (MediaType type: rdfOfferTest.entries()){
             String contentType = type.toHeaderString();
-            try ( QueryEngineHTTP qExec = (QueryEngineHTTP) 
QueryExecutionFactory.sparqlService(serviceQuery, query) ) {
+            try ( QueryEngineHTTP qExec = (QueryEngineHTTP) 
QueryExecutionFactory.sparqlService(serviceQuery(), query) ) {
                 qExec.setModelContentType( contentType );
                 Model m = qExec.execDescribe() ;
                 String x = qExec.getHttpResponseContentType() ;
@@ -261,18 +256,19 @@ public class TestQuery extends BaseTest {
         }
     }
 
-
     private void execQuery(String queryString, int exceptedRowCount) {
-        QueryExecution qExec = 
QueryExecutionFactory.sparqlService(serviceQuery, queryString) ;
-        ResultSet rs = qExec.execSelect() ;
-        int x = ResultSetFormatter.consume(rs) ;
-        assertEquals(exceptedRowCount, x) ;
+        try ( QueryExecution qExec = 
QueryExecutionFactory.sparqlService(serviceQuery(), queryString) ) {
+            ResultSet rs = qExec.execSelect() ;
+            int x = ResultSetFormatter.consume(rs) ;
+            assertEquals(exceptedRowCount, x) ;
+        }
     }
 
     private void execQuery(String queryString, ResultSet expectedResultSet) {
-        QueryExecution qExec = 
QueryExecutionFactory.sparqlService(serviceQuery, queryString) ;
-        ResultSet rs = qExec.execSelect() ;
-        boolean b = ResultSetCompare.equalsByTerm(rs, expectedResultSet) ;
-        assertTrue("Result sets different", b) ;
+        try ( QueryExecution qExec = 
QueryExecutionFactory.sparqlService(serviceQuery(), queryString) ) {
+            ResultSet rs = qExec.execSelect() ;
+            boolean b = ResultSetCompare.equalsByTerm(rs, expectedResultSet) ;
+            assertTrue("Result sets different", b) ;
+        }
     }
 }

http://git-wip-us.apache.org/repos/asf/jena/blob/7c3a5cfd/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestSPARQLProtocol.java
----------------------------------------------------------------------
diff --git 
a/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestSPARQLProtocol.java
 
b/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestSPARQLProtocol.java
index 32bc663..a5a5be3 100644
--- 
a/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestSPARQLProtocol.java
+++ 
b/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestSPARQLProtocol.java
@@ -18,8 +18,12 @@
 
 package org.apache.jena.fuseki;
 
-import static org.apache.jena.fuseki.ServerTest.*;
-import org.apache.jena.atlas.junit.BaseTest;
+import static org.apache.jena.fuseki.ServerCtl.serviceQuery ;
+import static org.apache.jena.fuseki.ServerCtl.serviceUpdate ;
+import static org.apache.jena.fuseki.ServerTest.gn1 ;
+import static org.apache.jena.fuseki.ServerTest.model1 ;
+import static org.apache.jena.fuseki.ServerTest.model2 ;
+
 import org.apache.jena.query.*;
 import org.apache.jena.riot.WebContent;
 import org.apache.jena.sparql.engine.http.QueryEngineHTTP;
@@ -28,27 +32,19 @@ import org.apache.jena.update.UpdateExecutionFactory;
 import org.apache.jena.update.UpdateFactory;
 import org.apache.jena.update.UpdateProcessor;
 import org.apache.jena.update.UpdateRequest;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
+import org.junit.Before ;
 import org.junit.Test;
 
-public class TestSPARQLProtocol extends BaseTest
+public class TestSPARQLProtocol extends AbstractFusekiTest
 {
-    @BeforeClass
-    public static void beforeClass() {
-        ServerTest.allocServer();
+    @Before
+    public void before() {
         // Load some data.
-        DatasetAccessor du = DatasetAccessorFactory.createHTTP(serviceGSP);
+        DatasetAccessor du = 
DatasetAccessorFactory.createHTTP(ServerCtl.serviceGSP());
         du.putModel(model1);
         du.putModel(gn1, model2);
     }
 
-    @AfterClass
-    public static void afterClass() {
-        ServerTest.resetServer();
-        ServerTest.freeServer();
-    }
-
     static String query(String base, String queryString) {
         return base + "?query=" + Convert.encWWWForm(queryString);
     }
@@ -56,7 +52,7 @@ public class TestSPARQLProtocol extends BaseTest
     @Test
     public void query_01() {
         Query query = QueryFactory.create("SELECT * { ?s ?p ?o }");
-        QueryExecution qexec = 
QueryExecutionFactory.sparqlService(serviceQuery, query);
+        QueryExecution qexec = 
QueryExecutionFactory.sparqlService(serviceQuery(), query);
         ResultSet rs = qexec.execSelect();
         int x = ResultSetFormatter.consume(rs);
         assertTrue(x != 0);
@@ -65,7 +61,7 @@ public class TestSPARQLProtocol extends BaseTest
     @Test
     public void query_02() {
         Query query = QueryFactory.create("SELECT * { ?s ?p ?o }");
-        QueryEngineHTTP engine = 
QueryExecutionFactory.createServiceRequest(serviceQuery, query);
+        QueryEngineHTTP engine = 
QueryExecutionFactory.createServiceRequest(serviceQuery(), query);
         engine.setSelectContentType(WebContent.contentTypeResultsJSON);
         ResultSet rs = engine.execSelect();
         int x = ResultSetFormatter.consume(rs);
@@ -75,14 +71,14 @@ public class TestSPARQLProtocol extends BaseTest
     @Test
     public void update_01() {
         UpdateRequest update = UpdateFactory.create("INSERT DATA {}");
-        UpdateProcessor proc = UpdateExecutionFactory.createRemote(update, 
serviceUpdate);
+        UpdateProcessor proc = UpdateExecutionFactory.createRemote(update, 
serviceUpdate());
         proc.execute();
     }
 
     @Test
     public void update_02() {
         UpdateRequest update = UpdateFactory.create("INSERT DATA {}");
-        UpdateProcessor proc = UpdateExecutionFactory.createRemoteForm(update, 
serviceUpdate);
+        UpdateProcessor proc = UpdateExecutionFactory.createRemoteForm(update, 
serviceUpdate());
         proc.execute();
     }
 }

http://git-wip-us.apache.org/repos/asf/jena/blob/7c3a5cfd/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestServerReadOnly.java
----------------------------------------------------------------------
diff --git 
a/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestServerReadOnly.java
 
b/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestServerReadOnly.java
index 8e3f98a..225279f 100644
--- 
a/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestServerReadOnly.java
+++ 
b/jena-fuseki2/jena-fuseki-core/src/test/java/org/apache/jena/fuseki/TestServerReadOnly.java
@@ -18,15 +18,13 @@
 
 package org.apache.jena.fuseki;
 
-import static org.apache.jena.fuseki.ServerTest.serviceGSP ;
-import static org.apache.jena.fuseki.ServerTest.serviceQuery ;
-import static org.apache.jena.fuseki.ServerTest.serviceUpdate ;
+import static org.apache.jena.fuseki.ServerCtl.serviceQuery ;
+import static org.apache.jena.fuseki.ServerCtl.serviceUpdate ;
 
 import java.nio.charset.StandardCharsets ;
 
 import org.apache.http.HttpEntity ;
 import org.apache.http.entity.StringEntity ;
-import org.apache.jena.atlas.junit.BaseTest ;
 import org.apache.jena.query.Query ;
 import org.apache.jena.query.QueryExecution ;
 import org.apache.jena.query.QueryExecutionFactory ;
@@ -42,23 +40,25 @@ import org.junit.BeforeClass ;
 import org.junit.Test ;
 
 /** Tests on a read only server. */
-public class TestServerReadOnly extends BaseTest
+public class TestServerReadOnly
 {
     // readonly server.
     @BeforeClass
     public static void allocServerForSuite() {
-        ServerTest.allocServer(false) ;
+        ServerCtl.freeServer();
+        //Manage ourselves.
+        ServerCtl.setupServer(false) ;
     }
 
     @AfterClass
     public static void freeServerForSuite() {
-        ServerTest.freeServer() ;
+        ServerCtl.freeServer() ;
     }
     
     @Test
     public void query_readonly() {
         Query query = QueryFactory.create("ASK{}");
-        QueryExecution qexec = 
QueryExecutionFactory.sparqlService(serviceQuery, query);
+        QueryExecution qexec = 
QueryExecutionFactory.sparqlService(serviceQuery(), query);
         qexec.execAsk() ;
     }
     
@@ -66,7 +66,7 @@ public class TestServerReadOnly extends BaseTest
     public void update_readonly() {
         FusekiTest.exec404( () -> {
             UpdateRequest update = UpdateFactory.create("INSERT DATA {}");
-            UpdateProcessor proc = UpdateExecutionFactory.createRemote(update, 
serviceUpdate);
+            UpdateProcessor proc = UpdateExecutionFactory.createRemote(update, 
serviceUpdate());
             proc.execute();
         });
     }
@@ -77,7 +77,7 @@ public class TestServerReadOnly extends BaseTest
         // Try to write
         FusekiTest.execWithHttpException(HttpSC.METHOD_NOT_ALLOWED_405, ()->{
             HttpEntity e = new StringEntity("", StandardCharsets.UTF_8) ;
-            HttpOp.execHttpPost(serviceGSP+"?default", e);
+            HttpOp.execHttpPost(ServerCtl.serviceGSP()+"?default", e);
         }) ;
     }
     
@@ -86,7 +86,7 @@ public class TestServerReadOnly extends BaseTest
         // Try to write
         FusekiTest.execWithHttpException(HttpSC.METHOD_NOT_ALLOWED_405, ()->{
             HttpEntity e = new StringEntity("", StandardCharsets.UTF_8) ;
-            HttpOp.execHttpPut(serviceGSP+"?default", e);
+            HttpOp.execHttpPut(ServerCtl.serviceGSP()+"?default", e);
         }) ;
     }
 
@@ -94,7 +94,7 @@ public class TestServerReadOnly extends BaseTest
     public void gsp_w_readonly_DELETE() {
         // Try to write
         FusekiTest.execWithHttpException(HttpSC.METHOD_NOT_ALLOWED_405, ()->{
-            HttpOp.execHttpDelete(serviceGSP+"?default");
+            HttpOp.execHttpDelete(ServerCtl.serviceGSP()+"?default");
         }) ;
     }
     
@@ -103,7 +103,7 @@ public class TestServerReadOnly extends BaseTest
         // Try to write
         FusekiTest.execWithHttpException(HttpSC.METHOD_NOT_ALLOWED_405, ()->{
             HttpEntity e = new StringEntity("", StandardCharsets.UTF_8) ;
-            HttpOp.execHttpPost(ServerTest.urlDataset, e) ;
+            HttpOp.execHttpPost(ServerCtl.urlDataset(), e) ;
         }) ;
     }
 
@@ -112,7 +112,7 @@ public class TestServerReadOnly extends BaseTest
         // Try to write
         FusekiTest.execWithHttpException(HttpSC.METHOD_NOT_ALLOWED_405, ()->{
             HttpEntity e = new StringEntity("", StandardCharsets.UTF_8) ;
-            HttpOp.execHttpPut(ServerTest.urlDataset, e) ;
+            HttpOp.execHttpPut(ServerCtl.urlDataset(), e) ;
         }) ;
     }
 
@@ -120,13 +120,13 @@ public class TestServerReadOnly extends BaseTest
     public void dataset_w_readonly_DELETE() {
         // Try to write
         FusekiTest.execWithHttpException(HttpSC.METHOD_NOT_ALLOWED_405, ()->{
-            HttpOp.execHttpDelete(ServerTest.urlDataset) ;
+            HttpOp.execHttpDelete(ServerCtl.urlDataset()) ;
         }) ;
     }
 
     @Test
     public void options_gsp_readonly() {
-        String v = FusekiTest.execOptions(serviceGSP+"?default") ;
+        String v = FusekiTest.execOptions(ServerCtl.serviceGSP()+"?default") ;
         FusekiTest.assertStringList(v, "GET", "OPTIONS", "HEAD") ;
     }
 

Reply via email to