Package net.mindengine.galen.runner

Examples of net.mindengine.galen.runner.JsTestCollector


        List<GalenTest> tests = new LinkedList<GalenTest>();
        for (File file : basicTestFiles) {
            tests.addAll(reader.read(file));
        }
       
        JsTestCollector testCollector = new JsTestCollector(tests);
        for (File jsFile: jsTestFiles) {
            testCollector.execute(jsFile);
        }
       
        testCollector.getEventHandler().invokeBeforeTestSuiteEvents();
       
        runTests(testCollector.getEventHandler(), arguments, tests, listener);
       
        testCollector.getEventHandler().invokeAfterTestSuiteEvents();
    }
View Full Code Here


public class JsTestCollectorTest {

   
    @Test
    public void shouldExecuteJavascript_andCollectTests() throws Exception {
        JsTestCollector testCollector = new JsTestCollector();
       
        JsTestRegistry.get().clear();
        testCollector.execute(new File(getClass().getResource("/js-tests/simple.test.js").getFile()));
       
        List<GalenTest> tests = testCollector.getCollectedTests();
       
        assertThat("Amount of tests should be", tests.size(), is(3));
        assertThat("Name of #1 test should be", tests.get(0).getName(), is("Test number 1"));
        assertThat("Name of #1 test should be", tests.get(1).getName(), is("Test number 2"));
        assertThat("Name of #1 test should be", tests.get(2).getName(), is("Test number 3"));
View Full Code Here

    }


    @Test
    public void shouldAllow_toUse_testFilter() throws IOException {
        JsTestCollector testCollector = new JsTestCollector();
        JsTestRegistry.get().clear();
        testCollector.execute(new File(getClass().getResource("/js-tests/testfilter.test.js").getFile()));

        List<GalenTest> tests = testCollector.getCollectedTests();
        assertThat(tests.get(0).getName(), is("Test A"));
        assertThat(tests.get(1).getName(), is("Test B"));
        assertThat(tests.get(2).getName(), is("Test C"));
        assertThat(tests.get(3).getName(), is("Test D"));
    }
View Full Code Here

    }


    @Test
    public void shouldLoadOtherScripts_onlyOnce() throws IOException {
        JsTestCollector testCollector = new JsTestCollector();
        JsTestRegistry.get().clear();
        testCollector.execute(new File(getClass().getResource("/js-tests/multilevel/main.test.js").getFile()));
        testCollector.execute(new File(getClass().getResource("/js-tests/multilevel/folder/second.test.js").getFile()));


        List<String> events = JsTestRegistry.get().getEvents();
        assertThat("Events amount should be", events.size(), is(3));
View Full Code Here

TOP

Related Classes of net.mindengine.galen.runner.JsTestCollector

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.