Search in sources :

Example 6 with LocalCluster

use of org.voltdb.regressionsuites.LocalCluster in project voltdb by VoltDB.

the class TestNTProcs method testRunEverywhereNTRoundTripCluster.

public void testRunEverywhereNTRoundTripCluster() throws Exception {
    VoltProjectBuilder pb = new VoltProjectBuilder();
    pb.addLiteralSchema(SCHEMA);
    LocalCluster cluster = new LocalCluster("compileNT.jar", 4, 3, 1, BackendTarget.NATIVE_EE_JNI);
    boolean success = cluster.compile(pb);
    assertTrue(success);
    cluster.startUp();
    Client client = ClientFactory.createClient();
    client.createConnection(cluster.getListenerAddress(0));
    ClientResponseImpl response;
    response = (ClientResponseImpl) client.callProcedure("TestNTProcs$RunEverywhereNTProc");
    assertEquals(ClientResponse.SUCCESS, response.getStatus());
    System.out.println("Client got trivial response");
    System.out.println(response.toJSONString());
    // CHECK STATS
    VoltTable statsT = getStats(client, "PROCEDURE");
    assertTrue(VoltTableUtil.tableContainsString(statsT, "RunEverywhereNTProc", true));
    assertTrue(VoltTableUtil.tableContainsString(statsT, "TrivialNTProcPriority", true));
    Map<String, Long> stats = aggregateProcRow(client, RunEverywhereNTProc.class.getName());
    assertEquals(1, stats.get("INVOCATIONS").longValue());
    stats = aggregateProcRow(client, TrivialNTProcPriority.class.getName());
    assertEquals(3, stats.get("INVOCATIONS").longValue());
    client.close();
    cluster.shutDown();
}
Also used : LocalCluster(org.voltdb.regressionsuites.LocalCluster) VoltProjectBuilder(org.voltdb.compiler.VoltProjectBuilder) AtomicLong(java.util.concurrent.atomic.AtomicLong) Client(org.voltdb.client.Client)

Example 7 with LocalCluster

use of org.voltdb.regressionsuites.LocalCluster in project voltdb by VoltDB.

the class TestJDBCConnectionFail method suite.

public static Test suite() throws IOException {
    // the suite made here will all be using the tests from this class
    MultiConfigSuiteBuilder builder = new MultiConfigSuiteBuilder(TestJDBCConnectionFail.class);
    // build up a project builder for the workload
    VoltProjectBuilder project = getBuilderForTest();
    boolean success;
    m_config = new LocalCluster("decimal-default.jar", 4, 5, kfactor, BackendTarget.NATIVE_EE_JNI);
    m_config.setHasLocalServer(true);
    success = m_config.compile(project);
    assertTrue(success);
    // add this config to the set of tests to run
    builder.addServerConfig(m_config);
    return builder;
}
Also used : LocalCluster(org.voltdb.regressionsuites.LocalCluster) VoltProjectBuilder(org.voltdb.compiler.VoltProjectBuilder) MultiConfigSuiteBuilder(org.voltdb.regressionsuites.MultiConfigSuiteBuilder)

Example 8 with LocalCluster

use of org.voltdb.regressionsuites.LocalCluster in project voltdb by VoltDB.

the class TestImportSuite method suite.

public static junit.framework.Test suite() throws Exception {
    LocalCluster config;
    Map<String, String> additionalEnv = new HashMap<>();
    //Specify bundle location
    String bundleLocation = System.getProperty("user.dir") + "/bundles";
    System.out.println("Bundle location is: " + bundleLocation);
    additionalEnv.put("voltdbbundlelocation", bundleLocation);
    final MultiConfigSuiteBuilder builder = new MultiConfigSuiteBuilder(TestImportSuite.class);
    VoltProjectBuilder project = new VoltProjectBuilder();
    project.setUseDDLSchema(true);
    project.addSchema(TestSQLTypesSuite.class.getResource("sqltypessuite-import-ddl.sql"));
    // configure socket importer
    Properties props = buildProperties("port", "7001", "decode", "true", "procedure", "importTable.insert");
    project.addImport(true, "custom", "tsv", "socketstream.jar", props);
    project.addPartitionInfo("importTable", "PKEY");
    // configure log4j socket handler importer
    props = buildProperties("port", "6060", "procedure", "log_events.insert", "log-event-table", "log_events");
    project.addImport(true, "custom", null, "log4jsocketimporter.jar", props);
    /*
         * compile the catalog all tests start with
         */
    config = new LocalCluster("import-ddl-cluster-rep.jar", 4, 1, 0, BackendTarget.NATIVE_EE_JNI, LocalCluster.FailureState.ALL_RUNNING, true, false, additionalEnv);
    config.setHasLocalServer(false);
    boolean compile = config.compile(project);
    assertTrue(compile);
    builder.addServerConfig(config, false);
    return builder;
}
Also used : LocalCluster(org.voltdb.regressionsuites.LocalCluster) TestSQLTypesSuite(org.voltdb.regressionsuites.TestSQLTypesSuite) HashMap(java.util.HashMap) VoltProjectBuilder(org.voltdb.compiler.VoltProjectBuilder) MultiConfigSuiteBuilder(org.voltdb.regressionsuites.MultiConfigSuiteBuilder) Properties(java.util.Properties)

Example 9 with LocalCluster

use of org.voltdb.regressionsuites.LocalCluster in project voltdb by VoltDB.

the class TestStartWithSchema method setUp.

@Before
public void setUp() throws Exception {
    // Creates a cluster on the local machine using NewCLI, staging the specified schema.
    // Catalog compilation is taken care of by VoltDB itself - no need to do so explicitly.
    cluster = new LocalCluster(schema, null, siteCount, hostCount, kfactor, clusterID, BackendTarget.NATIVE_EE_JNI, FailureState.ALL_RUNNING, false, false, null);
    cluster.setHasLocalServer(false);
    cluster.overrideAnyRequestForValgrind();
    VoltProjectBuilder builder = new VoltProjectBuilder();
    builder.setUseDDLSchema(true);
    cluster.compileDeploymentOnly(builder);
    new File(builder.getPathToDeployment()).deleteOnExit();
    // positive tests should succeed; negative tests look for the exception
    cluster.setExpectedToCrash(false);
}
Also used : LocalCluster(org.voltdb.regressionsuites.LocalCluster) VoltProjectBuilder(org.voltdb.compiler.VoltProjectBuilder) VoltFile(org.voltdb.utils.VoltFile) File(java.io.File) Before(org.junit.Before)

Example 10 with LocalCluster

use of org.voltdb.regressionsuites.LocalCluster in project voltdb by VoltDB.

the class TestSnapshotConverter method suite.

//
// Build a list of the tests to be run. Use the regression suite
// helpers to allow multiple backends.
// JUnit magic that uses the regression suite helper classes.
//
public static Test suite() throws IOException {
    MultiConfigSuiteBuilder builder = new MultiConfigSuiteBuilder(TestSnapshotConverter.class);
    VoltProjectBuilder project = new VoltProjectBuilder();
    project.addLiteralSchema("CREATE TABLE T_SP(A2 VARCHAR(128), A1 INTEGER NOT NULL, A3 VARCHAR(64), A4 VARCHAR(64));" + "CREATE TABLE T_MP(A2 VARCHAR(128), A1 INTEGER NOT NULL, A3 VARCHAR(64), A4 VARCHAR(64));");
    project.addPartitionInfo("T_SP", "A1");
    LocalCluster lcconfig = new LocalCluster("testsnapshotstatus.jar", 8, 1, 0, BackendTarget.NATIVE_EE_JNI);
    assertTrue(lcconfig.compile(project));
    builder.addServerConfig(lcconfig);
    return builder;
}
Also used : LocalCluster(org.voltdb.regressionsuites.LocalCluster) VoltProjectBuilder(org.voltdb.compiler.VoltProjectBuilder) MultiConfigSuiteBuilder(org.voltdb.regressionsuites.MultiConfigSuiteBuilder)

Aggregations

LocalCluster (org.voltdb.regressionsuites.LocalCluster)19 VoltProjectBuilder (org.voltdb.compiler.VoltProjectBuilder)18 MultiConfigSuiteBuilder (org.voltdb.regressionsuites.MultiConfigSuiteBuilder)7 Client (org.voltdb.client.Client)6 File (java.io.File)5 Test (org.junit.Test)5 HashMap (java.util.HashMap)4 ClientResponse (org.voltdb.client.ClientResponse)4 Properties (java.util.Properties)3 Before (org.junit.Before)3 ClientConfig (org.voltdb.client.ClientConfig)3 TestSQLTypesSuite (org.voltdb.regressionsuites.TestSQLTypesSuite)3 VoltTable (org.voltdb.VoltTable)2 ProcCallException (org.voltdb.client.ProcCallException)2 VoltCompiler (org.voltdb.compiler.VoltCompiler)2 JUnit4LocalClusterTest (org.voltdb.regressionsuites.JUnit4LocalClusterTest)2 InMemoryJarfile (org.voltdb.utils.InMemoryJarfile)2 VoltFile (org.voltdb.utils.VoltFile)2 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1