Package net.thucydides.core.util

Examples of net.thucydides.core.util.EnvironmentVariables


    }

    public static class TestCountListenerProvider implements Provider<StepListener> {

        public StepListener get() {
            EnvironmentVariables environmentVariables = Injectors.getInjector().getProvider(EnvironmentVariables.class).get() ;
            TestCount testCount = Injectors.getInjector().getInstance(TestCount.class);
            return new TestCountListener(environmentVariables, testCount);
        }
View Full Code Here


    }

    @Test
    public void source_should_not_be_mandatory() throws MojoFailureException, MojoExecutionException, IOException {

        EnvironmentVariables environmentVariables = new MockEnvironmentVariables();
        environmentVariables.setProperty("thucydides.adaptors.fileless","net.thucydides.maven.plugins.FilelessAdaptor");

        ThucydidesAdaptorMojo plugin = new ThucydidesAdaptorMojo(environmentVariables);
        plugin.setFormat("fileless");
        plugin.setOutputDirectory(outputDirectory);
View Full Code Here

    }

    @Test
    public void a_test_outcome_should_record_issue_keys_using_the_project_key_if_not_provided() {
        TestOutcome outcome = TestOutcome.forTest("should_do_some_other_thing", SomeTestScenario.class);
        EnvironmentVariables environmentVariables = new MockEnvironmentVariables();

        environmentVariables.setProperty("thucydides.project.key", "ISSUE");
        outcome.setEnvironmentVariables(environmentVariables);


        assertThat(outcome.getIssueKeys(), hasItem("ISSUE-789"));
    }
View Full Code Here

    final static class CSVDataDrivenTestScenarioFromSpecifiedDataDirectory {}

    @Test
    public void should_load_test_data_from_a_specified_directory() throws IOException {

        EnvironmentVariables environmentVariables = new MockEnvironmentVariables();
        environmentVariables.setProperty("thucydides.data.dir","test-data");
        TestClass testClass = new TestClass(CSVDataDrivenTestScenarioFromSpecifiedDataDirectory.class);

        List<PersonTestScenario> testScenarios
                = DataDrivenAnnotations.forClass(testClass)
                                       .usingEnvironmentVariables(environmentVariables)
View Full Code Here

public class WhenObtainingADataDrivenTestSource {

    @Test
    public void should_convert_data_file_path_to_operating_system_localized_path() {
        EnvironmentVariables environmentVariables = new MockEnvironmentVariables();
        environmentVariables.setProperty("thucydides.data.dir","C:\\some\\dir");

        FilePathParser testDataSourcePath = new FilePathParser(environmentVariables) {
            @Override
            protected String getFileSeparator() {
                return "\\";
View Full Code Here

        assertThat(testDataSourcePath.getInstanciatedPath("${DATADIR}/simple-semicolon-data.csv"), is("C:\\some\\dir\\simple-semicolon-data.csv"));
    }

    @Test
    public void should_convert_data_file_path_to_operating_system_localized_path_in_unix() {
        EnvironmentVariables environmentVariables = new MockEnvironmentVariables();
        environmentVariables.setProperty("thucydides.data.dir","/some/dir");

        FilePathParser testDataSourcePath = new FilePathParser(environmentVariables) {
            @Override
            protected String getFileSeparator() {
                return "/";
View Full Code Here

        assertThat(testDataSourcePath.getInstanciatedPath("${DATADIR}/simple-semicolon-data.csv"), is("/some/dir/simple-semicolon-data.csv"));
    }

    @Test
    public void should_inject_user_home_directory_into_path() {
        EnvironmentVariables environmentVariables = new MockEnvironmentVariables();
        environmentVariables.setProperty("user.home","/home/john");
        FilePathParser testDataSourcePath = new FilePathParser(environmentVariables) {
            @Override
            protected String getFileSeparator() {
                return "/";
            }
View Full Code Here

    }

    @Test
    public void should_inject_user_home_directory_into_path_using_HOME_variable() {
        EnvironmentVariables environmentVariables = new MockEnvironmentVariables();
        environmentVariables.setProperty("user.home","/home/john");
        FilePathParser testDataSourcePath = new FilePathParser(environmentVariables) {
            @Override
            protected String getFileSeparator() {
                return "/";
            }
View Full Code Here

        assertThat(testDataSourcePath.getInstanciatedPath("$HOME/simple-semicolon-data.csv"), is("/home/john/simple-semicolon-data.csv"));
    }

    @Test
    public void should_inject_current_directory_into_path() {
        EnvironmentVariables environmentVariables = new MockEnvironmentVariables();
        environmentVariables.setProperty("user.dir","/home/john/work");
        FilePathParser testDataSourcePath = new FilePathParser(environmentVariables) {
            @Override
            protected String getFileSeparator() {
                return "/";
            }
View Full Code Here

    }

    @Test
    public void should_inject_current_directory_into_path_using_USERDIR_variable() {
        EnvironmentVariables environmentVariables = new MockEnvironmentVariables();
        environmentVariables.setProperty("user.dir","/home/john/work");
        FilePathParser testDataSourcePath = new FilePathParser(environmentVariables) {
            @Override
            protected String getFileSeparator() {
                return "/";
            }
View Full Code Here

TOP

Related Classes of net.thucydides.core.util.EnvironmentVariables

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.