/** * Creates a simple database with two columns: one integer (a) and one string (b). It also insertes one default row * from parameters a, b. * * @throws EngineException */ public static void createFooDatabase(String where, int a, String b) throws SQLException, JSONSerDeException, ClassNotFoundException, EngineException { File dbFolder = new File(where); dbFolder.mkdir(); final SQLite4JavaManager manager = new SQLite4JavaManager(); SploutConfiguration testConfig = SploutConfiguration.getTestConfig(); manager.init(new File(where + "/" + "foo.db"), testConfig, null); manager.query("DROP TABLE IF EXISTS t;", 100); manager.query("CREATE TABLE t (a INT, b TEXT);", 100); manager.query("INSERT INTO t (a, b) VALUES (" + a + ", \"" + b + "\")", 100); manager.close(); }
public void runForever(int nDNodes) throws Exception { SploutConfiguration config = SploutConfiguration.getTestConfig(); for (int i = 0; i < nDNodes; i++) { config = SploutConfiguration.getTestConfig(); // we need to change some props for avoiding conflicts, ports, etc config.setProperty(DNodeProperties.PORT, config.getInt(DNodeProperties.PORT) + i); config.setProperty(DNodeProperties.DATA_FOLDER, config.getString(DNodeProperties.DATA_FOLDER) + "-" + i); config.setProperty(FetcherProperties.TEMP_DIR, config.getString(FetcherProperties.TEMP_DIR) + "-" + i); DNode dnode = new DNode(config, new DNodeHandler()); dnode.init(); } }
public void runForever() throws Exception { SploutConfiguration config = SploutConfiguration.getTestConfig(); DNode dnode = new DNode(config, new DNodeHandler()); dnode.init(); QNode qnode = new QNode(); qnode.start(config, new QNodeHandler()); }