[jira] Updated: (MSUREFIRE-77) Service providers are not available during unit testing when defined by dependencies
[ http://jira.codehaus.org/browse/MSUREFIRE-77?page=all ] Brett Porter updated MSUREFIRE-77: -- Attachment: MSUREFIRE-77.tar.bz2 ok, reproducible. Here's a tarball that is easier to test with as its self contained Service providers are not available during unit testing when defined by dependencies Key: MSUREFIRE-77 URL: http://jira.codehaus.org/browse/MSUREFIRE-77 Project: Maven 2.x Surefire Plugin Issue Type: Bug Reporter: Christian Schulte Attachments: jcharset-1.2.1.jar, MSUREFIRE-77.tar.bz2, MSUREFIRE77TestCase.java, pom.xml If a dependency defines some service provider by e.g. a file like META-INF/services/java.nio.charset.spi.CharsetProvider these providers are not available during unit testing. For this example an UnsupportedEncodingException would be thrown when using a charset defined in the file during unit testing. For Reference see: http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#Service%20Provider or http://java.sun.com/j2se/1.5.0/docs/api/java/nio/charset/spi/CharsetProvider.html. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (MSUREFIRE-77) Service providers are not available during unit testing when defined by dependencies
[ http://jira.codehaus.org/browse/MSUREFIRE-77?page=all ] Stephen Cresswell updated MSUREFIRE-77: --- Attachment: jcharset-1.2.1.jar pom.xml MSUREFIRE77TestCase.java I've attached a junit test case, my pom and jcharset.jar (the jar containing the GSM charsets). Running the test case in eclipse works fine, but from mvn -e test I get the following... Running uk.co.henriettasms.MSUREFIRE77TestCase java.io.UnsupportedEncodingException: GSM_0338 at sun.io.Converters.getConverterClass(Unknown Source) at sun.io.Converters.newConverter(Unknown Source) at sun.io.ByteToCharConverter.getConverter(Unknown Source) at java.lang.StringCoding.decode(Unknown Source) at java.lang.String.init(Unknown Source) at java.lang.String.init(Unknown Source) at uk.co.henriettasms.MSUREFIRE77TestCase.testThatICanUseCharsets(MSUREFIRE77TestCase.java:12) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at junit.framework.TestCase.runTest(TestCase.java:164) at junit.framework.TestCase.runBare(TestCase.java:130) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:120) at junit.framework.TestSuite.runTest(TestSuite.java:228) at junit.framework.TestSuite.run(TestSuite.java:223) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:210) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:135 ) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:122) at org.apache.maven.surefire.Surefire.run(Surefire.java:129) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:225) at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:747) Workaround I'm using at the moment is to add jcharset to JRE/lib/ext. It's my first attempt using maven so apologies if I've missed something obvious. Service providers are not available during unit testing when defined by dependencies Key: MSUREFIRE-77 URL: http://jira.codehaus.org/browse/MSUREFIRE-77 Project: Maven 2.x Surefire Plugin Issue Type: Bug Reporter: Christian Schulte Attachments: jcharset-1.2.1.jar, MSUREFIRE77TestCase.java, pom.xml If a dependency defines some service provider by e.g. a file like META-INF/services/java.nio.charset.spi.CharsetProvider these providers are not available during unit testing. For this example an UnsupportedEncodingException would be thrown when using a charset defined in the file during unit testing. For Reference see: http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#Service%20Provider or http://java.sun.com/j2se/1.5.0/docs/api/java/nio/charset/spi/CharsetProvider.html. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira