/** * TODO FIXME: Someone who understands all the parameters please add sane defaults. */ public static final class TestNodeParameters { /** The UDP port number. Each test node must have a different port number. */ public int port; /** The UDP opennet port number. Each test node must have a different port number. */ public int opennetPort; /** The directory where the test node will put all its data. <br> * Will be created automatically if it does not exist.<br> * {@link NodeStarter#createTestNode(TestNodeParameters)} will NOT fail if this exists. * You should make sure on your own to delete this before and after tests to ensure * a clean state. Notice that JUnit provides a mechanism for automatic creation * and deletion of test directories (TemporaryFolder).<br> * Notice that a subdirectory with the name being the port number of the node will be * created there, and all data of the node will be put into it. So you can and should use * the same baseDirectory when calling {@link NodeStarter#globalTestInit(File, boolean, * LogLevel, String, boolean, RandomSource)} (which you have to do once for each Java VM): * Each one will start with a fresh empty subdirectory for as long as each of them uses a * unique port number. */ public File baseDirectory = new File("freenet-test-node-" + UUID.randomUUID().toString()); public boolean disableProbabilisticHTLs; public short maxHTL; public int dropProb; public RandomSource random; public Executor executor; public int threadLimit = 500; public long storeSize; public boolean ramStore; public boolean enableSwapping;
NodeStarter.globalTestInit(dir, false, Logger.LogLevel.ERROR, "", true, random); TestNodeParameters params = new TestNodeParameters(); params.random = new DummyRandomSource(253121); params.ramStore = true; assertTrue(blobBucket.size() > 0); params = new TestNodeParameters(); params.random = new DummyRandomSource(253121); params.ramStore = true;
NodeStarter.globalTestInit(dir, false, Logger.LogLevel.ERROR, "", true, random); TestNodeParameters params = new TestNodeParameters(); params.random = new DummyRandomSource(253121); params.ramStore = true;