/*

   Derby - Class org.apache.derbyTesting.functionTests.tests.jdbcapi.NetworkClientHarnessJavaTest

   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.derbyTesting.functionTests.tests.derbynet;

import junit.framework.Test;
import junit.framework.TestSuite;

import org.apache.derbyTesting.functionTests.util.HarnessJavaTest;
import org.apache.derbyTesting.junit.TestConfiguration;
import org.apache.derbyTesting.junit.SecurityManagerSetup;
import org.apache.derbyTesting.junit.SupportFilesSetup;

/**
 * NetHarnessJavaTest includes .java tests in the derbynet directory that
 * have not been converted to junit and do not have multiple masters.
 * 
 * The following tests could not be run this way, reasons for the
 * 
 * dblook_test_net - filters output
 * dataSourcePermissions_net - InvocationTargetException, needs investigation
 * getCurrentProperties - ExceptionInInitializerError, needs investigation
 * maxthreads - forks VM
 * runtimeinfo" - filters output
 * sysinfo" - forks VM
 * sysinfo_withproperties" - forks VM
 * testProperties" - filters output
 * testconnection" - forks VM
 * testij" - filters output
 * timeslice" - forks VM
 * NSinSameJVM" - filters output
 * DerbyNetAutoStart" - forks VM
 */
public class NetHarnessJavaTest extends HarnessJavaTest {
    
    /**
     * Only allow construction from our suite method.
     * 
     * @param name the name of the test to execute
     */
    private NetHarnessJavaTest(String name) {
        super(name);
     }

    /**
     * Run tests from the functionTests/tests/derbynet directory.
     */
    protected String getArea() {
        return "derbynet";
    }
    
    public static Test suite()
    {
        TestSuite suite = new TestSuite("jdbcapi: old harness java tests");

        suite.addTest(TestConfiguration.clientServerDecorator(
        		         decorate(new NetHarnessJavaTest("executeUpdate"))));

        suite.addTest(TestConfiguration.clientServerDecorator(
        		         SecurityManagerSetup.noSecurityManager(
        		             decorate(new NetHarnessJavaTest("testProtocol")))));

        suite.addTest(SecurityManagerSetup.noSecurityManager(
        		         decorate(new NetHarnessJavaTest("DerbyNetNewServer"))));
        
        return new SupportFilesSetup(suite,
        	           new String[] {
	                       "functionTests/tests/derbynet/protocol.tests",
	                       "functionTests/tests/derbynet/excsat_accsecrd1.inc",
	                       "functionTests/tests/derbynet/excsat_accsecrd2.inc",
	                       "functionTests/tests/derbynet/excsat_secchk.inc",
	                       "functionTests/tests/derbynet/connect.inc",
	                       "functionTests/tests/derbynet/values1.inc",
	                       "functionTests/tests/derbynet/values64kblksz.inc"
	                   });
    }

}

@@ -1081,24 +1081,68 @@
 ssJavaTest;%0A
+import org.apache.derbyTesting.junit.Derby;%0A
 import org.a
@@ -2518,23 +2518,24 @@
 tSuite(%22
-jdbcapi
+derbynet
 : old ha
@@ -2553,16 +2553,83 @@
 tests%22);
+%0A        %0A        if (!Derby.hasServer())%0A            return suite;
 %0A%0A      

Make NetHarnessjavaTest run no fixtures if network server is not in the classpath.