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();
}
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;
}
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;
}
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);
}
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;
}
Aggregations