Search in sources :

Example 96 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 97 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 98 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 99 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)

Example 100 with VoltProjectBuilder

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

the class TestShutdown method getBuilderForTest.

static VoltProjectBuilder getBuilderForTest() throws IOException {
    VoltProjectBuilder builder = new VoltProjectBuilder();
    builder.addLiteralSchema("");
    return builder;
}
Also used : VoltProjectBuilder(org.voltdb.compiler.VoltProjectBuilder)

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