google-code-export / gwt-test-utils

Automatically exported from code.google.com/p/gwt-test-utils
1 stars 0 forks source link

scan-package throws an error if the same package appears in the class path twice #93

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a META-INF/gwt-test-utils.properties file with a scan-package 
statement.
2. Run tests with the source tree and the generated classes directory in the 
classpath.

What is the expected output? What do you see instead?

When I run tests, I get the following assertion:

Caused by: com.octo.gwt.test.exceptions.GwtTestConfigurationException: 
'scan-package' mechanism is used to scan the same package twice : 'patchers'
    at com.octo.gwt.test.internal.ConfigurationLoader.process(ConfigurationLoader.java:103)
    at com.octo.gwt.test.internal.ConfigurationLoader.readFiles(ConfigurationLoader.java:166)
    at com.octo.gwt.test.internal.ConfigurationLoader.<init>(ConfigurationLoader.java:77)
    at com.octo.gwt.test.internal.ConfigurationLoader.createInstance(ConfigurationLoader.java:44)
    at com.octo.gwt.test.internal.GwtClassLoader.<init>(GwtClassLoader.java:53)
    at com.octo.gwt.test.internal.GwtClassLoader.<clinit>(GwtClassLoader.java:36)
    ... 22 more

I have been unable to remove the duplicate from the classpath because it is 
being added by my IntelliJ IDE.  Ideally gwt-test-utils would just skip the 
duplicate packages.  I have commented out the offending throw in 
ConfigurationLoader and it appears to function as expected.

What version of the product are you using? On what operating system?

0.35-SNAPSHOT

Please provide any additional information below.

Original issue reported on code.google.com by snstan...@gmail.com on 18 Nov 2011 at 12:26

GoogleCodeExporter commented 9 years ago

Original comment by gael.laz...@gmail.com on 18 Nov 2011 at 6:50

GoogleCodeExporter commented 9 years ago
This has been fixed in the lastest 0.35-SNAPSHOT I've just deployed.
Actually, ConfigurationLoader now allows the same gwt-test-utils.properties 
configuration file to be processed more than once by ignoring duplicated 
properties.

Could you please give it a try and give me some feedback so I could merge the 
fix with the other gwt-test-utils version and close this issue ?

Original comment by gael.laz...@gmail.com on 29 Nov 2011 at 6:59

GoogleCodeExporter commented 9 years ago
I'm now running into problems because the second occurrence throws:

com.octo.gwt.test.exceptions.GwtTestConfigurationException: Error in 
'/C:/commander/main/web/gwt/ec/target/test-classes/META-INF/gwt-test-utils.prope
rties' : unknown value 'module-file'
    at com.octo.gwt.test.internal.ConfigurationLoader.process(ConfigurationLoader.java:122)
    at com.octo.gwt.test.internal.ConfigurationLoader.readFiles(ConfigurationLoader.java:171)
    at com.octo.gwt.test.internal.ConfigurationLoader.<init>(ConfigurationLoader.java:81)
    at com.octo.gwt.test.internal.ConfigurationLoader.createInstance(ConfigurationLoader.java:42)
    at com.octo.gwt.test.internal.GwtClassLoader.<init>(GwtClassLoader.java:53)
    at com.octo.gwt.test.internal.GwtClassLoader.<clinit>(GwtClassLoader.java:36)
    ... 17 more

The tests for key membership need to be inside the tests for the value name in 
ConfigurationLoader.process() so the value will be ignored properly.

Original comment by snstan...@gmail.com on 29 Nov 2011 at 11:09

GoogleCodeExporter commented 9 years ago
I still can't remember what I smoked before coding the fix... The lastest 
0.35-SNAPSHOT I've just deploy is now expected to solve the issue correctly. 
Could you give it a try ?

Original comment by gael.laz...@gmail.com on 30 Nov 2011 at 12:21

GoogleCodeExporter commented 9 years ago
Looks like you got it this time.  Thanks!

Original comment by snstan...@gmail.com on 3 Dec 2011 at 12:42

GoogleCodeExporter commented 9 years ago

Original comment by gael.laz...@gmail.com on 3 Dec 2011 at 11:46