Java Code Examples for org.apache.derbyTesting.junit.TestConfiguration#clientServerSuite()

The following examples show how to use org.apache.derbyTesting.junit.TestConfiguration#clientServerSuite() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ClientConnectionPoolDataSourceTest.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
/**
 * Returns a suite that will run only in the client-server configuration.
 *
 * @return A client-server suite with all the tests.
 */
public static Test suite() {
    // The tests are run in the client-server configuration only, because
    // the code being tests does not exist in the embedded driver.
    return TestConfiguration.clientServerSuite(
            ClientConnectionPoolDataSourceTest.class);
}
 
Example 2
Source File: NetworkServerControlApiTest.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
/**
     * Add decorators to a test run. Context is established in the reverse order
     * that decorators are declared here. That is, decorators compose in reverse
     * order. The order of the setup methods is:
     *
     * <ul>
     * <li>Copy security policy to visible location.</li>
     * <li>Install a security manager.</li>
     * <li>Run the tests.</li>
     * </ul>
     */
    private static Test decorateTest()
    {
        
        String serverPolicyName = new NetworkServerControlApiTest("test").makeServerPolicyName();
        Test test = TestConfiguration.clientServerSuite(NetworkServerControlApiTest.class);
        //
        // Install a security manager using the initial policy file.
        //
// GemStone changes BEGIN
        // security manager does not work well with GemFireXD yet
        /* (original code)
        test = new SecurityManagerSetup( test,serverPolicyName );
        
        
        //
        // Copy over the policy file we want to use.
        //
        test = new SupportFilesSetup
            (
             test,
             null,
             new String[] { POLICY_FILE_NAME },
             null,
             new String[] { TARGET_POLICY_FILE_NAME}
             );
        */
// GemStone changes END

       
        return test;
    }
 
Example 3
Source File: DRDAProtocolTest.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
public static Test suite() {
    Test test;
    test = TestConfiguration.clientServerSuite(DRDAProtocolTest.class);
    test = TestConfiguration.additionalDatabaseDecorator(test, "FIRSTDB1");
    test = TestConfiguration.additionalDatabaseDecorator(test, "SECONDDB2");
    return test;
}
 
Example 4
Source File: ClientConnectionPoolDataSourceTest.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
/**
 * Returns a suite that will run only in the client-server configuration.
 *
 * @return A client-server suite with all the tests.
 */
public static Test suite() {
    // The tests are run in the client-server configuration only, because
    // the code being tests does not exist in the embedded driver.
    return TestConfiguration.clientServerSuite(
            ClientConnectionPoolDataSourceTest.class);
}
 
Example 5
Source File: NetworkServerControlApiTest.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
/**
     * Add decorators to a test run. Context is established in the reverse order
     * that decorators are declared here. That is, decorators compose in reverse
     * order. The order of the setup methods is:
     *
     * <ul>
     * <li>Copy security policy to visible location.</li>
     * <li>Install a security manager.</li>
     * <li>Run the tests.</li>
     * </ul>
     */
    private static Test decorateTest()
    {
        
        String serverPolicyName = new NetworkServerControlApiTest("test").makeServerPolicyName();
        Test test = TestConfiguration.clientServerSuite(NetworkServerControlApiTest.class);
        //
        // Install a security manager using the initial policy file.
        //
// GemStone changes BEGIN
        // security manager does not work well with GemFireXD yet
        /* (original code)
        test = new SecurityManagerSetup( test,serverPolicyName );
        
        
        //
        // Copy over the policy file we want to use.
        //
        test = new SupportFilesSetup
            (
             test,
             null,
             new String[] { POLICY_FILE_NAME },
             null,
             new String[] { TARGET_POLICY_FILE_NAME}
             );
        */
// GemStone changes END

       
        return test;
    }
 
Example 6
Source File: DRDAProtocolTest.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
public static Test suite() {
    Test test;
    test = TestConfiguration.clientServerSuite(DRDAProtocolTest.class);
    test = TestConfiguration.additionalDatabaseDecorator(test, "FIRSTDB1");
    test = TestConfiguration.additionalDatabaseDecorator(test, "SECONDDB2");
    return test;
}
 
Example 7
Source File: BadConnectionTest.java    From gemfirexd-oss with Apache License 2.0 4 votes vote down vote up
public static Test suite()
{
	return TestConfiguration.clientServerSuite(BadConnectionTest.class);
}
 
Example 8
Source File: LOBLocatorReleaseTest.java    From gemfirexd-oss with Apache License 2.0 4 votes vote down vote up
/**
 * Returns a default suite running in a client-server environment.
 * <p>
 * The tests in this class is only meant to be run with client-server.
 *
 * @return A test suite.
 */
public static Test suite() {
    return new CleanDatabaseTestSetup(
            TestConfiguration.clientServerSuite(
                                            LOBLocatorReleaseTest.class)) {
        /**
         * Populates two tables with LOB data.
         */
        protected void decorateSQL(Statement s) throws SQLException {
            s.executeUpdate("create table LOBLOC_NO_NULLS " +
                    "(dBlob BLOB not null, dClob CLOB not null)");
            Connection con = s.getConnection();
            PreparedStatement ps = con.prepareStatement(
                    "insert into LOBLOC_NO_NULLS values (?,?)");
            String cContent = "A little test Clob";
            byte[] bContent;
            try {
                bContent = cContent.getBytes("US-ASCII");
            } catch (UnsupportedEncodingException uee) {
                SQLException sqle = new SQLException();
                sqle.initCause(uee);
                throw sqle;
            }
            for (int i=0; i < 25; i++) {
                ps.setBytes(1, bContent);
                ps.setString(2, cContent);
                ps.executeUpdate();
            }
            ps.close();
            s.executeUpdate("create table LOBLOC_WITH_NULLS " +
                    "(dBlob BLOB, dClob CLOB)");
            ps = con.prepareStatement(
                    "insert into LOBLOC_WITH_NULLS values (?,?)");
            for (int i=0; i < 25; i++) {
                if (i % 3 == 0) {
                    ps.setNull(1, Types.BLOB);
                } else {
                    ps.setBytes(1, bContent);
                }
                if (i % 4 == 0) {
                    ps.setNull(2, Types.CLOB);
                } else {
                    ps.setString(2, cContent);
                }
                ps.executeUpdate();
            }
            ps.close();
            con.commit();
        }
    };
}
 
Example 9
Source File: BadConnectionTest.java    From gemfirexd-oss with Apache License 2.0 4 votes vote down vote up
public static Test suite()
{
	return TestConfiguration.clientServerSuite(BadConnectionTest.class);
}
 
Example 10
Source File: LOBLocatorReleaseTest.java    From gemfirexd-oss with Apache License 2.0 4 votes vote down vote up
/**
 * Returns a default suite running in a client-server environment.
 * <p>
 * The tests in this class is only meant to be run with client-server.
 *
 * @return A test suite.
 */
public static Test suite() {
    return new CleanDatabaseTestSetup(
            TestConfiguration.clientServerSuite(
                                            LOBLocatorReleaseTest.class)) {
        /**
         * Populates two tables with LOB data.
         */
        protected void decorateSQL(Statement s) throws SQLException {
            s.executeUpdate("create table LOBLOC_NO_NULLS " +
                    "(dBlob BLOB not null, dClob CLOB not null)");
            Connection con = s.getConnection();
            PreparedStatement ps = con.prepareStatement(
                    "insert into LOBLOC_NO_NULLS values (?,?)");
            String cContent = "A little test Clob";
            byte[] bContent;
            try {
                bContent = cContent.getBytes("US-ASCII");
            } catch (UnsupportedEncodingException uee) {
                SQLException sqle = new SQLException();
                sqle.initCause(uee);
                throw sqle;
            }
            for (int i=0; i < 25; i++) {
                ps.setBytes(1, bContent);
                ps.setString(2, cContent);
                ps.executeUpdate();
            }
            ps.close();
            s.executeUpdate("create table LOBLOC_WITH_NULLS " +
                    "(dBlob BLOB, dClob CLOB)");
            ps = con.prepareStatement(
                    "insert into LOBLOC_WITH_NULLS values (?,?)");
            for (int i=0; i < 25; i++) {
                if (i % 3 == 0) {
                    ps.setNull(1, Types.BLOB);
                } else {
                    ps.setBytes(1, bContent);
                }
                if (i % 4 == 0) {
                    ps.setNull(2, Types.CLOB);
                } else {
                    ps.setString(2, cContent);
                }
                ps.executeUpdate();
            }
            ps.close();
            con.commit();
        }
    };
}
 
Example 11
Source File: JDBCStatementCacheTest.java    From gemfirexd-oss with Apache License 2.0 3 votes vote down vote up
/**
 * Returns the appropriate tests.
 * <p>
 * Run only client/server, because the code being tested does not live
 * in the embedded driver (yet).
 * 
 * @return A suite of tests (may be empty).
 */
public static Test suite() {
    // Run only client/server, because the code being tested does not live
    // in the embedded driver (yet).
    return TestConfiguration.clientServerSuite(
            JDBCStatementCacheTest.class);
}
 
Example 12
Source File: StatementKeyFactoryTest.java    From gemfirexd-oss with Apache License 2.0 3 votes vote down vote up
/**
 * Returns the appropriate tests.
 * <p>
 * Run only client/server, because the code being tested does not live
 * in the embedded driver (yet).
 * 
 * @return A suite of tests (may be empty).
 */
public static Test suite() {
    // Run only client/server, because the code being tested does not live
    // in the embedded driver (yet).
    return TestConfiguration.clientServerSuite(
            StatementKeyFactoryTest.class);
}
 
Example 13
Source File: JDBCStatementCacheTest.java    From gemfirexd-oss with Apache License 2.0 3 votes vote down vote up
/**
 * Returns the appropriate tests.
 * <p>
 * Run only client/server, because the code being tested does not live
 * in the embedded driver (yet).
 * 
 * @return A suite of tests (may be empty).
 */
public static Test suite() {
    // Run only client/server, because the code being tested does not live
    // in the embedded driver (yet).
    return TestConfiguration.clientServerSuite(
            JDBCStatementCacheTest.class);
}
 
Example 14
Source File: StatementKeyFactoryTest.java    From gemfirexd-oss with Apache License 2.0 3 votes vote down vote up
/**
 * Returns the appropriate tests.
 * <p>
 * Run only client/server, because the code being tested does not live
 * in the embedded driver (yet).
 * 
 * @return A suite of tests (may be empty).
 */
public static Test suite() {
    // Run only client/server, because the code being tested does not live
    // in the embedded driver (yet).
    return TestConfiguration.clientServerSuite(
            StatementKeyFactoryTest.class);
}
 
Example 15
Source File: LogicalStatementEntityTest.java    From gemfirexd-oss with Apache License 2.0 2 votes vote down vote up
/**
 * Returns a suite of tests running in a client-server environment.
 *
 * @return A test suite.
 */
public static Test suite() {
    return TestConfiguration.clientServerSuite(
            LogicalStatementEntityTest.class);
}
 
Example 16
Source File: LogicalStatementEntityTest.java    From gemfirexd-oss with Apache License 2.0 2 votes vote down vote up
/**
 * Returns a suite of tests running in a client-server environment.
 *
 * @return A test suite.
 */
public static Test suite() {
    return TestConfiguration.clientServerSuite(
            LogicalStatementEntityTest.class);
}