Search in sources :

Example 1 with SuiteConfiguration

use of org.eclipse.reddeer.junit.internal.configuration.SuiteConfiguration in project reddeer by eclipse.

the class RequirementOrderCallWithFailsTest method testFailingTest.

@Test
public void testFailingTest() throws InitializationError {
    SuiteConfiguration config = new SuiteConfiguration(RequirementOrderFailedTest.class);
    List<Runner> runners = RedDeerSuite.createSuites(RequirementOrderFailedTest.class, config);
    Runner myRunner = runners.get(0);
    RunNotifier notifier = new RunNotifier();
    // runner.run executes the test and static values could be retrieved
    myRunner.run(notifier);
    String sequenceDiff = TestSequence.diffRealSequence(RequirementsOrderRunnerSuite.getStaticExpectedSequence());
    assertTrue("Test sequence is different than expected. " + sequenceDiff, sequenceDiff == null);
}
Also used : Runner(org.junit.runner.Runner) RunNotifier(org.junit.runner.notification.RunNotifier) SuiteConfiguration(org.eclipse.reddeer.junit.internal.configuration.SuiteConfiguration) Test(org.junit.Test) RequirementOrderPassedTest(org.eclipse.reddeer.junit.test.integration.runner.order.RequirementsOrderRunnerSuite.RequirementOrderPassedTest) RequirementOrderFailedTest(org.eclipse.reddeer.junit.test.integration.runner.order.RequirementsOrderRunnerSuite.RequirementOrderFailedTest) RequirementOrderErroneousTest(org.eclipse.reddeer.junit.test.integration.runner.order.RequirementsOrderRunnerSuite.RequirementOrderErroneousTest)

Example 2 with SuiteConfiguration

use of org.eclipse.reddeer.junit.internal.configuration.SuiteConfiguration in project reddeer by eclipse.

the class RequirementOrderCallWithFailsTest method testErroneousTest.

@Test
public void testErroneousTest() throws InitializationError {
    SuiteConfiguration config = new SuiteConfiguration(RequirementOrderErroneousTest.class);
    List<Runner> runners = RedDeerSuite.createSuites(RequirementOrderErroneousTest.class, config);
    Runner myRunner = runners.get(0);
    RunNotifier notifier = new RunNotifier();
    // runner.run executes the test and static values could be retrieved
    myRunner.run(notifier);
    String sequenceDiff = TestSequence.diffRealSequence(RequirementsOrderRunnerSuite.getStaticExpectedSequence());
    assertTrue("Test sequence is different than expected. " + sequenceDiff, sequenceDiff == null);
}
Also used : Runner(org.junit.runner.Runner) RunNotifier(org.junit.runner.notification.RunNotifier) SuiteConfiguration(org.eclipse.reddeer.junit.internal.configuration.SuiteConfiguration) Test(org.junit.Test) RequirementOrderPassedTest(org.eclipse.reddeer.junit.test.integration.runner.order.RequirementsOrderRunnerSuite.RequirementOrderPassedTest) RequirementOrderFailedTest(org.eclipse.reddeer.junit.test.integration.runner.order.RequirementsOrderRunnerSuite.RequirementOrderFailedTest) RequirementOrderErroneousTest(org.eclipse.reddeer.junit.test.integration.runner.order.RequirementsOrderRunnerSuite.RequirementOrderErroneousTest)

Example 3 with SuiteConfiguration

use of org.eclipse.reddeer.junit.internal.configuration.SuiteConfiguration in project reddeer by eclipse.

the class ComplexConfigurationTest method numberOfTestRunsWithConfig.

@Test
public void numberOfTestRunsWithConfig() throws InitializationError {
    System.setProperty(RedDeerProperties.CONFIG_FILE.getName(), JAVA_CONFIG_FILE);
    config = new SuiteConfiguration(RequirementJavaClass.class);
    assertThat(config.getConfigurationSetsSuites().keySet().size(), is(3));
    System.clearProperty(RedDeerProperties.CONFIG_FILE.getName());
}
Also used : SuiteConfiguration(org.eclipse.reddeer.junit.internal.configuration.SuiteConfiguration) Test(org.junit.Test)

Example 4 with SuiteConfiguration

use of org.eclipse.reddeer.junit.internal.configuration.SuiteConfiguration in project reddeer by eclipse.

the class RedDeerSuiteTest method testRequirementsSuiteWithConfiguration.

@Test
public void testRequirementsSuiteWithConfiguration() throws InitializationError {
    System.setProperty(RedDeerProperties.CONFIG_FILE.getName(), REDDEER_SUITE_CONFIG);
    SuiteConfiguration config = new SuiteConfiguration(RequirementSuite.class);
    List<Runner> runners = RedDeerSuite.createSuites(RequirementSuite.class, config);
    String java7config = "java-1.7";
    String tomcat2 = "server-tomcat2";
    assertThat(runners.size(), is(6));
    assertThat(runners, hasItem(new NamedSuiteMatcher(java7config)));
    assertThat(runners, hasItem(new NamedSuiteMatcher(tomcat2)));
    assertThat(runners, hasItem(new NamedSuiteMatcher("no-configuration")));
}
Also used : Runner(org.junit.runner.Runner) SuiteConfiguration(org.eclipse.reddeer.junit.internal.configuration.SuiteConfiguration) Test(org.junit.Test)

Example 5 with SuiteConfiguration

use of org.eclipse.reddeer.junit.internal.configuration.SuiteConfiguration in project reddeer by eclipse.

the class RedDeerSuiteTest method testSingleTestWithoutConfiguration.

@Test
public void testSingleTestWithoutConfiguration() throws InitializationError {
    System.setProperty(RedDeerProperties.CONFIG_FILE.getName(), REDDEER_SUITE_CONFIG);
    SuiteConfiguration config = new SuiteConfiguration(SimpleTestClass.class);
    List<Runner> runners = RedDeerSuite.createSuites(SimpleTestClass.class, config);
    assertThat(runners.size(), is(1));
    assertThat(runners, hasItem(new NamedSuiteMatcher("no-configuration")));
}
Also used : Runner(org.junit.runner.Runner) SuiteConfiguration(org.eclipse.reddeer.junit.internal.configuration.SuiteConfiguration) Test(org.junit.Test)

Aggregations

SuiteConfiguration (org.eclipse.reddeer.junit.internal.configuration.SuiteConfiguration)9 Test (org.junit.Test)8 Runner (org.junit.runner.Runner)7 RequirementOrderErroneousTest (org.eclipse.reddeer.junit.test.integration.runner.order.RequirementsOrderRunnerSuite.RequirementOrderErroneousTest)3 RequirementOrderFailedTest (org.eclipse.reddeer.junit.test.integration.runner.order.RequirementsOrderRunnerSuite.RequirementOrderFailedTest)3 RequirementOrderPassedTest (org.eclipse.reddeer.junit.test.integration.runner.order.RequirementsOrderRunnerSuite.RequirementOrderPassedTest)3 RunNotifier (org.junit.runner.notification.RunNotifier)3 TestsWithoutExecutionSuite (org.eclipse.reddeer.junit.internal.runner.TestsWithoutExecutionSuite)1