PageRenderTime 22ms CodeModel.GetById 19ms app.highlight 2ms RepoModel.GetById 0ms app.codeStats 0ms

/simulatest-environment/src/test/java/org/simulatest/environment/test/EnvironmentJUnitRunnerTest.java

http://github.com/gabrielsuch/simulatest
Java | 48 lines | 28 code | 12 blank | 8 comment | 0 complexity | 44b3865fed43f1192c6d504b652747ed MD5 | raw file
 1package org.simulatest.environment.test;
 2
 3import static org.junit.Assert.assertEquals;
 4
 5import org.junit.Before;
 6import org.junit.Test;
 7import org.junit.runner.Description;
 8import org.junit.runners.model.InitializationError;
 9import org.simulatest.environment.environment.BigBangEnvironment;
10import org.simulatest.environment.junit.EnvironmentJUnitRunner;
11import org.simulatest.environment.test.testdouble.DummyTest;
12
13public class EnvironmentJUnitRunnerTest {
14	
15	private EnvironmentJUnitRunner runner;
16	
17	@Before
18	public void setup() throws InitializationError {
19		runner = new EnvironmentJUnitRunner(DummyTest.class);
20	}
21	
22	@Test
23	public void testDescriptions() {
24		Description root = Description.createSuiteDescription(BigBangEnvironment.class.getName());
25		Description son = Description.createSuiteDescription(DummyTest.class.getName());
26		
27		root.addChild(son);
28		
29		String dummyTestQualifiedName = DummyTest.class.getName();
30		
31		son.addChild(Description.createSuiteDescription("testSum(" + dummyTestQualifiedName + ")"));
32		son.addChild(Description.createSuiteDescription("testSubtract(" + dummyTestQualifiedName + ")"));
33		son.addChild(Description.createSuiteDescription("testMultiply(" + dummyTestQualifiedName + ")"));
34		son.addChild(Description.createSuiteDescription("testDivision(" + dummyTestQualifiedName + ")"));
35		
36		/*
37		 * -BigBang
38		 *     -DummyTest
39		 *         -testSum
40		 *         -testSubtract
41		 *         -testMultiply
42		 *         -testDivision
43		 */
44		
45		assertEquals(root, runner.getDescription());
46	}
47
48}