Search in sources :

Example 76 with VoltProjectBuilder

use of org.voltdb.compiler.VoltProjectBuilder in project voltdb by VoltDB.

the class TestInternalPort method setUp.

/**
     * JUnit special method called to setup the test. This instance will start
     * the VoltDB server using the VoltServerConfig instance provided.
     */
@Before
public void setUp() throws Exception {
    rport = SecureRandom.getInstance("SHA1PRNG").nextInt(2000) + 22000;
    System.out.println("Random Internal port is: " + rport);
    ncprocess = new PortListener(rport);
    try {
        //Build the catalog
        VoltProjectBuilder builder = new VoltProjectBuilder();
        builder.addLiteralSchema("");
        String catalogJar = "dummy.jar";
        LocalCluster config = new LocalCluster(catalogJar, 2, 1, 0, BackendTarget.NATIVE_EE_JNI);
        //We dont expect the process to initialize as its goint to wait for leader.
        config.setExpectedToInitialize(false);
        config.setHasLocalServer(false);
        boolean success = config.compile(builder);
        assertTrue(success);
        config.portGenerator.enablePortProvider();
        config.portGenerator.pprovider.setInternalPort(rport);
        config.startUp();
        pf = config.m_pipes.get(0);
        Thread.sleep(10000);
    } catch (IOException ex) {
        fail(ex.getMessage());
    } finally {
    }
}
Also used : VoltProjectBuilder(org.voltdb.compiler.VoltProjectBuilder) IOException(java.io.IOException) Before(org.junit.Before)

Example 77 with VoltProjectBuilder

use of org.voltdb.compiler.VoltProjectBuilder in project voltdb by VoltDB.

the class TestIndexMemoryOwnershipSuite method suite.

public static junit.framework.Test suite() {
    VoltServerConfig config = null;
    MultiConfigSuiteBuilder builder = new MultiConfigSuiteBuilder(TestIndexMemoryOwnershipSuite.class);
    VoltProjectBuilder project = new VoltProjectBuilder();
    project.addSchema(TestIndexMemoryOwnershipSuite.class.getResource("testindexmemoryownership-ddl.sql"));
    project.addPartitionInfo("t1", "a");
    project.addStmtProcedure("InsertT1", "insert into t1 values (?, ?, ?);", "t1.a:0");
    project.addStmtProcedure("UpdateT1c", "update t1 set c = ? where a = ?;", "t1.a:1");
    project.addStmtProcedure("UpdateT1b", "update t1 set b = ? where a = ?;", "t1.a:1");
    project.addStmtProcedure("DeleteT1", "delete from t1 where c = ?;");
    project.addStmtProcedure("LookupT1b", "select * from t1 where b = ?;");
    project.addStmtProcedure("MVLookup", "select * from mv where b = ? and a = ?;", "t1.a:1");
    project.addStmtProcedure("MVAll", "select * from mv;");
    boolean success;
    // JNI
    config = new LocalCluster("updatememoryownership.jar", 1, 1, 0, BackendTarget.NATIVE_EE_JNI);
    success = config.compile(project);
    assertTrue(success);
    builder.addServerConfig(config);
    return builder;
}
Also used : VoltProjectBuilder(org.voltdb.compiler.VoltProjectBuilder)

Example 78 with VoltProjectBuilder

use of org.voltdb.compiler.VoltProjectBuilder in project voltdb by VoltDB.

the class TestSQLTypesSuite method suite.

public static junit.framework.Test suite() {
    VoltServerConfig config = null;
    final MultiConfigSuiteBuilder builder = new MultiConfigSuiteBuilder(TestSQLTypesSuite.class);
    final VoltProjectBuilder project = new VoltProjectBuilder();
    project.addSchema(TestSQLTypesSuite.class.getResource("sqltypessuite-ddl.sql"));
    project.addSchema(TestSQLTypesSuite.class.getResource("sqltypessuite-nonulls-ddl.sql"));
    project.addPartitionInfo("NO_NULLS", "PKEY");
    project.addPartitionInfo("NO_NULLS_GRP", "PKEY");
    project.addPartitionInfo("ALLOW_NULLS", "PKEY");
    project.addPartitionInfo("ALLOW_NULLS_GRP", "PKEY");
    project.addPartitionInfo("WITH_DEFAULTS", "PKEY");
    project.addPartitionInfo("WITH_NULL_DEFAULTS", "PKEY");
    project.addPartitionInfo("EXPRESSIONS_WITH_NULLS", "PKEY");
    project.addPartitionInfo("EXPRESSIONS_NO_NULLS", "PKEY");
    project.addPartitionInfo("JUMBO_ROW", "PKEY");
    project.addProcedures(PROCEDURES);
    project.addStmtProcedure("PassObjectNull", "insert into ALLOW_NULLS values ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);", "NO_NULLS.PKEY: 0");
    project.addStmtProcedure("InsertDecimal", "INSERT INTO WITH_DEFAULTS (PKEY, A_DECIMAL) VALUES (?, ?);");
    boolean success;
    // JNI
    config = new LocalCluster("sqltypes-onesite.jar", 1, 1, 0, BackendTarget.NATIVE_EE_JNI);
    success = config.compile(project);
    assertTrue(success);
    builder.addServerConfig(config);
    // CLUSTER?
    config = new LocalCluster("sqltypes-cluster.jar", 2, 2, 1, BackendTarget.NATIVE_EE_JNI);
    success = config.compile(project);
    assertTrue(success);
    builder.addServerConfig(config);
    return builder;
}
Also used : VoltProjectBuilder(org.voltdb.compiler.VoltProjectBuilder)

Example 79 with VoltProjectBuilder

use of org.voltdb.compiler.VoltProjectBuilder in project voltdb by VoltDB.

the class TestSecurityNoAdminUser method setUp.

@Before
public void setUp() throws Exception {
    try {
        //Build the catalog
        VoltProjectBuilder builder = new VoltProjectBuilder();
        builder.addLiteralSchema("");
        builder.setSecurityEnabled(true, false);
        String catalogJar = "dummy.jar";
        config = new LocalCluster(catalogJar, 2, 1, 0, BackendTarget.NATIVE_EE_JNI);
        config.setHasLocalServer(false);
        //We expect it to crash
        config.setExpectedToCrash(true);
        boolean success = config.compile(builder);
        assertTrue(success);
        config.startUp();
        pf = config.m_pipes.get(0);
        Thread.currentThread().sleep(10000);
    } catch (IOException ex) {
        fail(ex.getMessage());
    } finally {
    }
}
Also used : VoltProjectBuilder(org.voltdb.compiler.VoltProjectBuilder) IOException(java.io.IOException) Before(org.junit.Before)

Example 80 with VoltProjectBuilder

use of org.voltdb.compiler.VoltProjectBuilder in project voltdb by VoltDB.

the class TestSQLFeaturesNewSuite method suite.

/**
     * Build a list of the tests that will be run when TestTPCCSuite gets run by JUnit.
     * Use helper classes that are part of the RegressionSuite framework.
     * This particular class runs all tests on the the local JNI backend with both
     * one and two partition configurations, as well as on the hsql backend.
     *
     * @return The TestSuite containing all the tests to be run.
     */
public static Test suite() {
    LocalCluster config = null;
    // the suite made here will all be using the tests from this class
    MultiConfigSuiteBuilder builder = new MultiConfigSuiteBuilder(TestSQLFeaturesNewSuite.class);
    // build up a project builder for the workload
    VoltProjectBuilder project = new VoltProjectBuilder();
    project.addSchema(BatchedMultiPartitionTest.class.getResource("sqlfeatures-new-ddl.sql"));
    project.addProcedures(PROCEDURES);
    project.setUseDDLSchema(true);
    boolean success;
    //* <-- Change this comment to 'block style' to toggle over to just the one single-server IPC DEBUG config.
    // IF (! DEBUG config) ...
    /////////////////////////////////////////////////////////////
    // CONFIG #1: 1 Local Site/Partitions running on JNI backend
    /////////////////////////////////////////////////////////////
    // get a server config for the native backend with one sites/partitions
    config = new LocalCluster("sqlfeatures-new-onesite.jar", 1, 1, 0, BackendTarget.NATIVE_EE_JNI);
    config.setMaxHeap(3300);
    // build the jarfile
    success = config.compile(project);
    assert (success);
    // add this config to the set of tests to run
    builder.addServerConfig(config);
    /////////////////////////////////////////////////////////////
    // CONFIG #2: 1 Local Site/Partition running on HSQL backend
    /////////////////////////////////////////////////////////////
    config = new LocalCluster("sqlfeatures-new-hsql.jar", 1, 1, 0, BackendTarget.HSQLDB_BACKEND);
    config.setMaxHeap(3300);
    success = config.compile(project);
    assert (success);
    builder.addServerConfig(config);
    /////////////////////////////////////////////////////////////
    // CONFIG #3: Local Cluster (of processes)
    /////////////////////////////////////////////////////////////
    config = new LocalCluster("sqlfeatures-new-cluster-rejoin.jar", 2, 3, 1, BackendTarget.NATIVE_EE_JNI);
    config.setMaxHeap(3800);
    // Commented out until ENG-3076, ENG-3434 are resolved.
    //config = new LocalCluster("sqlfeatures-cluster-rejoin.jar", 2, 3, 1, BackendTarget.NATIVE_EE_JNI,
    //                          LocalCluster.FailureState.ONE_FAILURE, false);
    success = config.compile(project);
    assert (success);
    builder.addServerConfig(config);
    return builder;
}
Also used : VoltProjectBuilder(org.voltdb.compiler.VoltProjectBuilder) BatchedMultiPartitionTest(org.voltdb_testprocs.regressionsuites.sqlfeatureprocs.BatchedMultiPartitionTest)

Aggregations

VoltProjectBuilder (org.voltdb.compiler.VoltProjectBuilder)269 Configuration (org.voltdb.VoltDB.Configuration)89 IOException (java.io.IOException)49 Test (org.junit.Test)45 File (java.io.File)40 ProcCallException (org.voltdb.client.ProcCallException)38 ClientResponse (org.voltdb.client.ClientResponse)37 VoltDB (org.voltdb.VoltDB)22 LocalCluster (org.voltdb.regressionsuites.LocalCluster)18 Client (org.voltdb.client.Client)17 Before (org.junit.Before)14 HashMap (java.util.HashMap)13 VoltTable (org.voltdb.VoltTable)13 ServerThread (org.voltdb.ServerThread)12 InMemoryJarfile (org.voltdb.utils.InMemoryJarfile)12 VoltCompiler (org.voltdb.compiler.VoltCompiler)11 HttpResponse (org.apache.http.HttpResponse)10 BeforeClass (org.junit.BeforeClass)8 ClientConfig (org.voltdb.client.ClientConfig)7 UserInfo (org.voltdb.compiler.VoltProjectBuilder.UserInfo)7