Package org.apache.derbyTesting.junit

Examples of org.apache.derbyTesting.junit.TestConfiguration


    }

    private void    connectToServer()
        throws Exception
    {
        final TestConfiguration config = getTestConfiguration();
        String  url
            = ( "jdbc:derby://localhost:" + config.getPort()
                + "/" + "wombat;create=true"
                + ";user=" + config.getUserName()
                + ";password=" + config.getUserPassword() );

        println( "XXX in connectToServer(). url = " + url );

        // just try to get a connection
        Class.forName( "org.apache.derby.jdbc.ClientDriver" );
View Full Code Here


        // First establish a connection so that the database is created.
        getConnection().close();

        // Then shut down the database cleanly so that it can be used
        // to seed the replication slave.
        final TestConfiguration config = TestConfiguration.getCurrent();
        config.shutdownDatabase();

        // Copy the database to the slave.
        final String masterDb = config.getDatabasePath(MASTER_DB);
        final String slaveDb = config.getDatabasePath(SLAVE_DB);
        PrivilegedFileOpsForTests.copy(new File(masterDb), new File(slaveDb));

        // And start the slave.
        DataSource startSlaveDS = JDBCDataSource.getDataSource(SLAVE_DB);
        JDBCDataSource.setBeanProperty(startSlaveDS, "connectionAttributes",
                "startSlave=true;slaveHost=" + config.getHostName() +
                ";slavePort=" + config.getPort());
        SlaveThread slave = new SlaveThread(startSlaveDS);
        slave.start();

        // Start the master. This will fail until the slave is up, so do
        // it in a loop until successful or time runs out.
        DataSource startMasterDS = JDBCDataSource.getDataSource();
        JDBCDataSource.setBeanProperty(startMasterDS, "connectionAttributes",
                "startMaster=true;slaveHost=" + config.getHostName() +
                ";slavePort=" + config.getPort());
        long giveUp =
            System.currentTimeMillis() + NetworkServerTestSetup.getWaitTime();
        Connection c = null;
        while (c == null) {
            try {
View Full Code Here

    protected void setUp() throws SQLException
    {
        UpgradeChange.phase.set(new Integer(phase));
        UpgradeChange.oldVersion.set(version);
       
        TestConfiguration config = TestConfiguration.getCurrent();
        trace = config.doTrace();
        if ( trace )
        {
            String versStr = ((int[]) UpgradeChange.oldVersion.get())[0]
                    + "." ((int[]) UpgradeChange.oldVersion.get())[1]
                    + "." ((int[]) UpgradeChange.oldVersion.get())[2]
View Full Code Here

    }

    private void    connectToServer()
        throws Exception
    {
        final TestConfiguration config = getTestConfiguration();
        String  url
            = ( "jdbc:derby://localhost:" + config.getPort()
                + "/" + "wombat;create=true"
                + ";user=" + config.getUserName()
                + ";password=" + config.getUserPassword() );

        println( "XXX in connectToServer(). url = " + url );

        // just try to get a connection
        Class.forName( "org.apache.derby.jdbc.ClientDriver" );
View Full Code Here

    private boolean setSecurityMechanism(String derby_security_mechanism)
    throws Exception {
        try {
            // getting a networkservercontrol to shutdown the currently running
            // server, before setting the next security mechanism
            final TestConfiguration config = TestConfiguration.getCurrent();
            NetworkServerControl server = new NetworkServerControl(
                InetAddress.getByName(config.getHostName()),
                config.getPort(),
                config.getUserName(),
                config.getUserPassword());

            // shut down the server
            server.shutdown();
        } catch (Exception e) {
            if (!(e.getMessage().substring(0,17).equals("DRDA_InvalidValue")))
View Full Code Here

    }

    private void    connectToServer()
        throws Exception
    {
        final TestConfiguration config = getTestConfiguration();
        String  url
            = ( "jdbc:derby://localhost:" + config.getPort()
                + "/" + "wombat;create=true"
                + ";user=" + config.getUserName()
                + ";password=" + config.getUserPassword() );

        println( "XXX in connectToServer(). url = " + url );

        // just try to get a connection
        Class.forName( "org.apache.derby.jdbc.ClientDriver" );
View Full Code Here

    private boolean setSecurityMechanism(String derby_security_mechanism)
    throws Exception {
        try {
            // getting a networkservercontrol to shutdown the currently running
            // server, before setting the next security mechanism
            final TestConfiguration config = TestConfiguration.getCurrent();
            NetworkServerControl server = new NetworkServerControl(
                InetAddress.getByName(config.getHostName()),
                config.getPort(),
                config.getUserName(),
                config.getUserPassword());

            // shut down the server
            server.shutdown();
        } catch (Exception e) {
            if (!(e.getMessage().substring(0,17).equals("DRDA_InvalidValue")))
View Full Code Here

    }

    private void    connectToServer()
        throws Exception
    {
        final TestConfiguration config = getTestConfiguration();
        String  url
            = ( "jdbc:derby://localhost:" + config.getPort()
                + "/" + "wombat;create=true"
                + ";user=" + config.getUserName()
                + ";password=" + config.getUserPassword() );

        println( "XXX in connectToServer(). url = " + url );

        // just try to get a connection
        Class.forName( "org.apache.derby.jdbc.ClientDriver" );
View Full Code Here

        cs.close();
    }

    private void verifyNewLocations(int noOfObjects)
            throws SQLException {
        TestConfiguration tc = TestConfiguration.getCurrent();
        String dbPath = tc.getPhysicalDatabaseName(tc.getDefaultDatabaseName());
        String jarDirName =
            "system" + File.separator + dbPath + File.separator + "jar";
        File jarDir = new File(jarDirName);

        assertTrue(jarDir.isDirectory());
View Full Code Here

    protected void setUp() throws SQLException
    {
        UpgradeChange.phase.set(new Integer(phase));
        UpgradeChange.oldVersion.set(version);
       
        TestConfiguration config = TestConfiguration.getCurrent();
        trace = config.doTrace();
        if ( trace )
        {
            String versStr = ((int[]) UpgradeChange.oldVersion.get())[0]
                    + "." ((int[]) UpgradeChange.oldVersion.get())[1]
                    + "." ((int[]) UpgradeChange.oldVersion.get())[2]
View Full Code Here

TOP

Related Classes of org.apache.derbyTesting.junit.TestConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.