Skip to content
This repository has been archived by the owner on Aug 7, 2020. It is now read-only.

Exception caught while instrumenting code #99

Open
mikhaelsantos opened this issue Jul 2, 2013 · 2 comments
Open

Exception caught while instrumenting code #99

mikhaelsantos opened this issue Jul 2, 2013 · 2 comments

Comments

@mikhaelsantos
Copy link

Hi guys,
First of all thanks for a great plugin 👍 .

Now even though the reports are being generated I get an exception on maven:

13:58:32.960 [main] INFO com.github.timurstrekalov.saga.core.DefaultCoverageGen
erator - Using the following no-instrument patterns:
./OpenLayers.
.+_from\d+\d+to\d+\d+$
./spec/.
.+#\d+(eval)(\d+)
.+JavaScriptStringJob
./jquery/.
13:58:33.287 [pool-6-thread-1] INFO com.github.timurstrekalov.saga.core.Default
CoverageGenerator - Running test at http://localhost:61907
13:58:34.106 [pool-6-thread-1] ERROR com.github.timurstrekalov.saga.core.instrum
entation.ScriptInstrumenter - Exception caught while instrumenting code
java.lang.IllegalArgumentException: null

I can seem to understand why its having problems, anyway of solving this exception?

thanks

@timurstrekalov
Copy link
Owner

Ugh, the exception is not exactly descriptive.

Is it possible to get a list of the <script> URLs from the test that causes the problem (i.e. from the test runner, i guess)? I have a feeling that this is caused by a URI.create() call.

@mikhaelsantos
Copy link
Author

  <plugin>
    <groupId>com.github.searls</groupId>
    <artifactId>jasmine-maven-plugin</artifactId>
    <version>1.3.1.2</version>
    <executions>
        <execution>
            <goals>
                <goal>test</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <skipTests>false</skipTests>
        <keepServerAlive>true</keepServerAlive>
        <!--<autoRefreshInterval>10</autoRefreshInterval>-->
        <jsSrcDir>${project.basedir}/src/main</jsSrcDir>
        <jasmineTargetDir>${project.build.directory}${file.separator}tests</jasmineTargetDir>
        <preloadSources>
          <source>webapp/include/jquery/jquery.js</source>
          <source>webapp/js/OpenLayers.js</source>
          <source>webapp/js/ol/Control/ViewAttributes.js</source>
          <source>webapp/js/ol/Control/ModifyAttributes.js</source>
          <source>webapp/js/ol/Control/MergeCables.js</source>
        </preloadSources>
        <srcDirectoryName>webapp</srcDirectoryName>
        <sourceIncludes>
            <include>js/ol/Control/MergeCables.js</include>
         </sourceIncludes>
        <jsTestSrcDir>tests/js/spec</jsTestSrcDir>
    </configuration>
  </plugin>
  <plugin>
    <groupId>com.github.timurstrekalov</groupId>
    <artifactId>saga-maven-plugin</artifactId>
    <version>1.4.2</version>
    <executions>
      <execution>
        <goals>
          <goal>coverage</goal>
        </goals>
      </execution>
    </executions>
    <configuration>
        <skipTests>false</skipTests>
      <baseDir>http://localhost:${jasmine.serverPort}</baseDir>
      <outputDir>${project.build.directory}/tests</outputDir>
      <noInstrumentPatterns>
        <pattern>.*/spec/.*</pattern> <!-- Don't instrument specs -->
        <pattern>.*/jquery/.*</pattern>
        <pattern>.*/OpenLayers.*</pattern>
        <pattern>.*/ViewAttributes.*</pattern>
        <pattern>.*/ModifyAttributes.*</pattern>
      </noInstrumentPatterns>
    </configuration>
  </plugin>

http://localhost:8234/webapp/webapp/include/jquery/jquery.js
http://localhost:8234/webapp/webapp/js/OpenLayers.js
http://localhost:8234/webapp/webapp/js/ol/Control/ViewAttributes.js
http://localhost:8234/webapp/webapp/js/ol/Control/ModifyAttributes.js
http://localhost:8234/webapp/webapp/js/ol/Control/MergeCables.js
http://localhost:8234/spec/MergeCable.js

I just noticed the "webapp/webapp" but if I remove the webapp on the preloadSources the test dont run, keeping it the tests run fine and coverage report is generated.
Hope this helps.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants