Package com.github.timurstrekalov.saga.core.cfg

Examples of com.github.timurstrekalov.saga.core.cfg.InstanceFieldPerPropertyConfig


    private static final Logger logger = LoggerFactory.getLogger(DefaultCoverageGenerator.class);

    private final Config config;

    DefaultCoverageGenerator() {
        this(new InstanceFieldPerPropertyConfig());
    }
View Full Code Here


    private InstanceFieldPerPropertyConfig config;
    private DefaultCoverageGenerator generator;

    @Test
    public void test_instrumentAndGenerateReports() throws Exception {
        config = new InstanceFieldPerPropertyConfig();
        config.setBaseDir(getClass().getResource("/tests").toURI().toASCIIString());
        config.setOutputDir(new File(Data.getProperty("build.directory") + "/coverage-htmlunit"));
        config.setIncludes("**/*Test*.html");
        config.setBackgroundJavaScriptTimeout(5000L);

View Full Code Here

    @Ignore
    public void test_instrumentAndGenerateReports_with_phantomjs() throws Exception {
        final FileServer fileServer = new FileServer(getClass().getResource("/tests").toURI().toASCIIString());
        final int fileServerPort = fileServer.start();

        config = new InstanceFieldPerPropertyConfig();
        // localhost/127.0.0.1 don't work - requests never hit the proxy, and there's no way to tell phantomjs to proxy local requests
        config.setBaseDir("http://192.168.1.100:" + fileServerPort + "/ClassTest.html");
        config.setOutputDir(new File(Data.getProperty("build.directory") + "/coverage-phantomjs"));
        config.setBackgroundJavaScriptTimeout(2000L);
View Full Code Here

    public void setUp() throws Exception {
        when(factory.enterContext()).thenReturn(context);
    }

    private void verifyClassJsData(String sourceName, String expectedSourceName) {
        final ScriptInstrumenter instrumenter = new HtmlUnitBasedScriptInstrumenter(new InstanceFieldPerPropertyConfig());
        instrumenter.instrument(Data.getClassJsSourceCode(), sourceName, 1);

        assertEquals(1, instrumenter.getScriptDataList().size());

        final ScriptData classJsData = instrumenter.getScriptDataList().get(0);
View Full Code Here

    private int proxyServerPort;
    private int fileServerPort;

    @Before
    public void setUp() throws Exception {
        final InstanceFieldPerPropertyConfig config = new InstanceFieldPerPropertyConfig();

        proxyServer = new InstrumentingProxyServer(new HtmlUnitBasedScriptInstrumenter(config));
        fileServer = new FileServer(new File(getClass().getResource("/tests").toURI()).getAbsolutePath());

        proxyServerPort = proxyServer.start();
        fileServerPort = fileServer.start();

        final String proxyUrl = "localhost:" + proxyServerPort;

        final Proxy proxy = new Proxy()
                .setProxyType(Proxy.ProxyType.MANUAL)
                .setHttpProxy(proxyUrl)
                .setSslProxy(proxyUrl);

        final DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
        desiredCapabilities.setCapability(CapabilityType.PROXY, proxy);
        desiredCapabilities.setCapability(CapabilityType.SUPPORTS_JAVASCRIPT, true);
        desiredCapabilities.setBrowserName(BrowserType.FIREFOX);

        driver = new HtmlUnitDriver(desiredCapabilities) {
            @Override
            protected WebClient newWebClient(final BrowserVersion version) {
                config.setBrowserVersion(version);
                return WebClientFactory.newInstance(config);
            }
        };
    }
View Full Code Here

TOP

Related Classes of com.github.timurstrekalov.saga.core.cfg.InstanceFieldPerPropertyConfig

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.