tx = config.begin(); if (propertiesFile == null || propertiesFile.length() == 0)
@Test(expected = NetworkReactiveAuditException.class) public void select_l() throws IOException { ReactiveAudit.config.begin().debug(true).commit(); try (Selector r = Selector.open()) { TestTools.strict.commit(); r.select(100); } } }
@Test(expected = NetworkReactiveAuditException.class) public void select() throws IOException { ReactiveAudit.config.begin().debug(true).commit(); try (Selector r = Selector.open()) { TestTools.strict.commit(); r.select(); } }
@Test(expected = NetworkReactiveAuditException.class) public void accept() throws IOException { ReactiveAudit.off.commit(); try (ServerSocket socket = new ServerSocket(PORT)) { TestTools.strict.commit(); ReactiveAudit.config.begin().debug(true).commit(); socket.accept(); } } }
@Test public void currentThread_nothing() { config.begin().threadPattern("(?!)").commit(); assertFalse(config.isThreadNameMatch(Thread.currentThread().getName())); }
@Test(expected = IllegalArgumentException.class) public void lockTransaction() { config.reset(); config.begin() .seal() .threadPattern("abc"); }
config.begin() .threadPattern(".*") .latencyFile("LOW")
@Test public void logIfNewLoop() { config.reset(); config.begin() .threadPattern(".*") .logOutput(LoadParams.DEFAULT_LOG_OUTPUT,LoadParams.DEFAULT_LOG_FORMAT,LoadParams.DEFAULT_LOG_SIZE) .latencyFile("LOW") .throwExceptions(false) .commit(); try { addHandler(); for (int i = 0; i < 5; ++i) { log[0] = 0; latencyCall1(); if (i == 0) assertEquals(1, log[0]); else assertEquals(0, log[0]); } } finally { removeHandler(); } }