use of fr.inria.stamp.test.listener.TestListener in project dspot by STAMP-project.
the class TestLauncherTest method testLauncherWithResourcesInsideTheSourcesFolders.
@Test
public void testLauncherWithResourcesInsideTheSourcesFolders() throws Exception {
Utils.init("src/test/resources/project-with-resources/project-with-resources.properties");
final CtClass aClass = Utils.findClass("textresources.in.sources.TestResourcesInSources");
final String classPath = AmplificationHelper.getClassPath(Utils.getCompiler(), Utils.getInputConfiguration());
final TestListener run = TestLauncher.run(Utils.getInputConfiguration(), classPath, aClass);
assertEquals(1, run.getPassingTests().size());
assertEquals(1, run.getRunningTests().size());
assertEquals(0, run.getFailingTests().size());
assertTrue(run.getFailingTests().isEmpty());
}
use of fr.inria.stamp.test.listener.TestListener in project dspot by STAMP-project.
the class DefaultTestRunnerTest method testRunTestMethods.
@Test
public void testRunTestMethods() throws Exception {
TestRunner runner = new DefaultTestRunner(new String[] { "src/test/resources/example-0.0.1-SNAPSHOT.jar", "src/test/resources/example-0.0.1-SNAPSHOT-tests.jar" });
TestListener results = runner.run("example.TestSuiteExample", Arrays.asList(new String[] { "test3", "test1" }));
assertEquals(2, results.getRunningTests().size());
assertEquals(1, results.getFailingTests().size());
assertEquals(1, results.getPassingTests().size());
assertEquals(0, results.getAssumptionFailingTests().size());
assertEquals(0, results.getIgnoredTests().size());
}
use of fr.inria.stamp.test.listener.TestListener in project dspot by STAMP-project.
the class DefaultTestRunnerTest method testParameterizedTestSpecificMethod.
@Test
public void testParameterizedTestSpecificMethod() throws Exception {
TestRunner runner = new DefaultTestRunner(new String[] { "src/test/resources/parametized-0.0.1-SNAPSHOT.jar", "src/test/resources/parametized-0.0.1-SNAPSHOT-tests.jar" });
TestListener results = runner.run("example.ConstructorParameterizedTest", "test_addTwoNumber");
assertEquals(5, results.getRunningTests().size());
assertEquals(0, results.getFailingTests().size());
assertEquals(5, results.getPassingTests().size());
assertEquals(0, results.getAssumptionFailingTests().size());
assertEquals(0, results.getIgnoredTests().size());
}
use of fr.inria.stamp.test.listener.TestListener in project dspot by STAMP-project.
the class DefaultTestRunnerTest method testParameterizedTest.
@Test
public void testParameterizedTest() throws Exception {
/*
test the stamp.fr.inria.runner on parametized test:
- Injection of parameters with constructors
- Injection of parameters with fields
*/
TestRunner runner = new DefaultTestRunner(new String[] { "src/test/resources/parametized-0.0.1-SNAPSHOT.jar", "src/test/resources/parametized-0.0.1-SNAPSHOT-tests.jar" });
TestListener results = runner.run("example.ConstructorParameterizedTest");
assertEquals(10, results.getRunningTests().size());
assertEquals(0, results.getFailingTests().size());
assertEquals(10, results.getPassingTests().size());
assertEquals(0, results.getAssumptionFailingTests().size());
assertEquals(0, results.getIgnoredTests().size());
results = runner.run("example.ParameterizedTest");
assertEquals(5, results.getRunningTests().size());
assertEquals(0, results.getFailingTests().size());
assertEquals(5, results.getPassingTests().size());
assertEquals(0, results.getAssumptionFailingTests().size());
assertEquals(0, results.getIgnoredTests().size());
}
use of fr.inria.stamp.test.listener.TestListener in project dspot by STAMP-project.
the class MockitoTestRunnerTest method testRunTestClass.
@Test
public void testRunTestClass() throws Exception {
TestRunner runner = new DefaultTestRunner("src/test/resources/MockitoDemo-1.0-SNAPSHOT.jar" + System.getProperty("path.separator") + "src/test/resources/MockitoDemo-1.0-SNAPSHOT-tests.jar");
TestListener results = runner.run("info.sanaulla.dal.BookDALTest");
assertEquals(5, results.getRunningTests().size());
assertEquals(1, results.getFailingTests().size());
assertEquals(4, results.getPassingTests().size());
assertEquals(0, results.getAssumptionFailingTests().size());
assertEquals(0, results.getIgnoredTests().size());
}
Aggregations