Package com.github.timurstrekalov.saga.core.model

Examples of com.github.timurstrekalov.saga.core.model.ScriptData


            final boolean separateFile = isSeparateFile(sourceName, normalizedSourceName);
            final URI sourceUri = URI.create(normalizedSourceName).normalize();

            if (config.isCacheInstrumentedCode() && instrumentedScriptCache.containsKey(sourceUri)) {
                final ScriptData data = instrumentedScriptCache.get(sourceUri);
                scriptDataList.add(data);
                return data.getInstrumentedSourceCode();
            }

            final ScriptData data = addNewScriptData(sourceCode, separateFile, sourceUri);

            final String instrumentedCode = instrument(lineNumber, data);
            data.setInstrumentedSourceCode(instrumentedCode);

            maybeCache(sourceUri, data);
            maybeWriteInstrumentedCodeToDisk(separateFile, sourceUri, instrumentedCode);

            return instrumentedCode;
View Full Code Here


        return buf.toString();
    }

    private ScriptData addNewScriptData(final String sourceCode, final boolean separateFile, final URI sourceUri) {
        final ScriptData data = new ScriptData(sourceUri, sourceCode, separateFile);
        scriptDataList.add(data);
        return data;
    }
View Full Code Here

        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);
        assertEquals(expectedSourceName, classJsData.getSourceUriAsString());
        assertEquals(5, classJsData.getLineNumberOfFirstStatement());
        assertEquals(114, classJsData.getNumberOfStatements());
        assertEqualsIgnoreCRLF(Data.getClassJsInstrumented(expectedSourceName), classJsData.getInstrumentedSourceCode());
    }
View Full Code Here

TOP

Related Classes of com.github.timurstrekalov.saga.core.model.ScriptData

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.