本文整理汇总了Java中osmo.common.TestUtils.startOutputCapture方法的典型用法代码示例。如果您正苦于以下问题:Java TestUtils.startOutputCapture方法的具体用法?Java TestUtils.startOutputCapture怎么用?Java TestUtils.startOutputCapture使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osmo.common.TestUtils
的用法示例。
在下文中一共展示了TestUtils.startOutputCapture方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: before
import osmo.common.TestUtils; //导入方法依赖的package包/类
@BeforeMethod
public void before() throws Exception {
//create a test server to capture the data at the other end of the tunnel
int serverPort = PortManager.port();
int proxyPort = PortManager.port();
server = new UDPTestServer(serverPort);
server.start();
while (!server.isStarted()) {
//first wait for server to start up before sending it something
Thread.sleep(100);
}
//configure the tunnel to accept connections on proxyport and forward them to localhost:serverport
params = new Params(proxyPort, "localhost", serverPort);
params.setUDP(true);
params.setPrint(false);
TestUtils.startOutputCapture();
}
示例2: testSetup
import osmo.common.TestUtils; //导入方法依赖的package包/类
@Before
public void testSetup() {
TestUtils.startOutputCapture();
osmo = new OSMOTester();
listener = new TestSequenceListener();
osmo.addListener(listener);
}
示例3: defaultFactory
import osmo.common.TestUtils; //导入方法依赖的package包/类
@Test
public void defaultFactory() {
MultiOSMO mosmo = new MultiOSMO(4);
TestUtils.startOutputCapture();
try {
mosmo.generate(new Time(1), 444);
fail("Generation without any model objects should fail.");
} catch (Exception e) {
//expected
}
String output = TestUtils.getOutput();
assertEquals("Message for default factory", MultiOSMO.ERROR_MSG+System.getProperty("line.separator"), output);
}
示例4: initTest
import osmo.common.TestUtils; //导入方法依赖的package包/类
@Before
public void initTest() {
TestUtils.startOutputCapture();
gc = new ScoreConfiguration();
gc.setStepWeight(0);
gc.setLengthWeight(0);
gc.setStepPairWeight(0);
gc.setDefaultValueWeight(0);
gc.setVariableCountWeight(0);
gc.setRequirementWeight(0);
oc = new OSMOConfiguration();
}
示例5: defaultFactory
import osmo.common.TestUtils; //导入方法依赖的package包/类
@Test
public void defaultFactory() {
GreedyOptimizer greedy = new GreedyOptimizer(oc, gc);
oc.setFactory(new SingleInstanceModelFactory());
TestUtils.startOutputCapture();
try {
greedy.search(8);
fail("Generation without any model objects should fail.");
} catch (Exception e) {
//expected
}
String output = TestUtils.getOutput();
assertEquals("Message for default factory", MultiOSMO.ERROR_MSG + System.getProperty("line.separator"), output);
}
示例6: initTest
import osmo.common.TestUtils; //导入方法依赖的package包/类
@Before
public void initTest() {
TestUtils.startOutputCapture();
}
示例7: before
import osmo.common.TestUtils; //导入方法依赖的package包/类
@BeforeMethod
public void before() {
TestUtils.startOutputCapture();
}