Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static inner classes can be manipulated by javassist #12

Merged
merged 9 commits into from May 19, 2014

Conversation

stephanenicolas
Copy link
Contributor

The static inner classes can be manipulated, but the non static inner classes can't (limitation of javassist documented in the plugin code).

This commit allows ClassTransformers to transform all inner classes, I think the javassist APIs don't allow to check wether a class is an inner class or not, and neither to check if an inner class is static or not.

Nevertheless, I needed to be able to transform static inner classes and I achieved to do it with the plugin thanks to this change.

Would you accept the PR ?

@stephanenicolas
Copy link
Contributor Author

@barthel @drochetti, I added the first unit tests with this commit as well. Sorry to have merged them with the current PR.

So this PR also addresses issue #11.

@barthel
Copy link
Contributor

barthel commented May 19, 2014

@stephanenicolas Thx for your work.

I don't like to instrument inner classes by default in respect to the javassist documentation.
They sey:

  • Inner classes or anonymous classes are not supported.

in http://www.csg.ci.i.u-tokyo.ac.jp/~chiba/javassist/tutorial/tutorial2.html (chapter 4.7).

But perhaps we build a extended (configurable) transformer or a class file iterator implementation for doing so.
WDYT?

@barthel barthel self-assigned this May 19, 2014
@stephanenicolas
Copy link
Contributor Author

Hi @barthel,

I pushed a commit that makes this behavior optional, and defaults to not
using inner classes.

From a technical point of view, I believe the page you mentioned to be
inexact as static inner classes bytecode doesn't differ at all from root
classes. Only non-static inner classes are more difficult to handle (and
even vary from a compiler to another). And, it worked for me :)

I fixed the code, docs and tests to take this change into account.

S.

2014-05-19 17:36 GMT+02:00 barthel notifications@github.com:

@stephanenicolas https://github.com/stephanenicolas Thx for your work.

I don't like to instrument inner classes by default in respect to the
javassist documentation.
They sey:

But perhaps we build a extended (configurable) transformer or a class file
iterator implementation for doing so.


Reply to this email directly or view it on GitHubhttps://github.com//pull/12#issuecomment-43519702
.

@barthel
Copy link
Contributor

barthel commented May 19, 2014

@stephanenicolas
That's fine and it's a good compromise.
Thx a lot.

barthel added a commit that referenced this pull request May 19, 2014
Static inner classes can be manipulated by javassist
@barthel barthel merged commit 28e6561 into icon-Systemhaus-GmbH:master May 19, 2014
@stephanenicolas
Copy link
Contributor Author

Thx for merging.

I got 2 requests for you : 1) is to release on central and 2) is to add a
travis file to get an unbreakable build. I can take the second one in
charge. Can you take the first one ?

PS : I would happily join the contributor team if there is some room left.

S.

@stephanenicolas
Copy link
Contributor Author

More details on the static vs non static :
jboss-javassist/javassist#6

@barthel
Copy link
Contributor

barthel commented May 19, 2014

In my company already runs a CI environment.
The sources are not yet ready for the first release. I'm working on deployment on central via sonatype.
Your patch breaks two tests:

Tests in error:
testOverrideBuildDirAndTestDir(com.github.drochetti.javassist.maven.JavassistMojoTest): Parameter 'directory' is not a directory
testSimpleConfig(com.github.drochetti.javassist.maven.JavassistMojoTest): Parameter 'directory' is not a directory

Tests run: 9, Failures: 0, Errors: 2, Skipped: 0

Please check and fix these tests.

@stephanenicolas
Copy link
Contributor Author

Hi @barthel,

I could not reproduce the failing test, they all passed on my side.
Well, I understand you got a CI at your place, but Travis costs nothing and
is easy to setup (and would have avoided the current situation :) ).

Can you be more precise about what breaks ? Any full stack trace ? I really
wonder where the difference between our test run comes form.. Do you use
mvn clean install or something else ?

S.

2014-05-19 23:12 GMT+02:00 barthel notifications@github.com:

In my company already runs a CI environment.
The sources are not yet ready for the first release. I'm working on
deployment on central via sonatype.
Your patch breaks two tests:

Tests in error:
testOverrideBuildDirAndTestDir(com.github.drochetti.javassist.maven.JavassistMojoTest):
Parameter 'directory' is not a directory
testSimpleConfig(com.github.drochetti.javassist.maven.JavassistMojoTest):
Parameter 'directory' is not a directory

Tests run: 9, Failures: 0, Errors: 2, Skipped: 0

Please check and fix these tests.


Reply to this email directly or view it on GitHubhttps://github.com//pull/12#issuecomment-43558809
.

@barthel
Copy link
Contributor

barthel commented May 19, 2014

If u like, create a travis CI.
The release and deployment will be created by the CI at my company. The artifacts will be signed with there keys.

barthel@q35:~/work/sources/github.com/icon-Systemhaus-GmbH/javassist-maven-plugin$ mvn --version
Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 17:22:22+0200)
Maven home: /home/barthel/work/app/maven
Java version: 1.6.0_31, vendor: Sun Microsystems Inc.
Java home: /usr/lib/jvm/java-6-openjdk-i386/jre
Default locale: de_DE, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-27-generic", arch: "i386", family: "unix"
barthel@q35:~/work/sources/github.com/icon-Systemhaus-GmbH/javassist-maven-plugin$ reset && mvn clean test
[ERROR] Parameter 'directory' is not a directory
java.lang.IllegalArgumentException: Parameter 'directory' is not a directory
    at org.apache.commons.io.FileUtils.validateListFilesParameters(FileUtils.java:545)
    at org.apache.commons.io.FileUtils.listFiles(FileUtils.java:521)
    at org.apache.commons.io.FileUtils.iterateFiles(FileUtils.java:628)
    at com.github.drochetti.javassist.maven.ClassTransformer.iterateClassnames(ClassTransformer.java:211)
    at com.github.drochetti.javassist.maven.ClassTransformer.transform(ClassTransformer.java:136)
    at com.github.drochetti.javassist.maven.JavassistTransformerExecutor.execute(JavassistTransformerExecutor.java:107)
    at com.github.drochetti.javassist.maven.JavassistTransformerExecutor.execute(JavassistTransformerExecutor.java:98)
    at com.github.drochetti.javassist.maven.JavassistMojo.execute(JavassistMojo.java:89)
    at com.github.drochetti.javassist.maven.JavassistMojoTest.testSimpleConfig(JavassistMojoTest.java:44)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:622)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.apache.maven.plugin.testing.MojoRule$2.evaluate(MojoRule.java:303)
    at org.junit.rules.RunRules.evaluate(RunRules.java:20)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:622)
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
    at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 3.355 sec <<< FAILURE!
testOverrideBuildDirAndTestDir(com.github.drochetti.javassist.maven.JavassistMojoTest)  Time elapsed: 2.545 sec  <<< ERROR!
org.apache.maven.plugin.MojoExecutionException: Parameter 'directory' is not a directory
    at com.github.drochetti.javassist.maven.JavassistMojo.execute(JavassistMojo.java:100)
    at com.github.drochetti.javassist.maven.JavassistMojoTest.testOverrideBuildDirAndTestDir(JavassistMojoTest.java:70)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:622)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.apache.maven.plugin.testing.MojoRule$2.evaluate(MojoRule.java:303)
    at org.junit.rules.RunRules.evaluate(RunRules.java:20)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:622)
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
    at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: java.lang.IllegalArgumentException: Parameter 'directory' is not a directory
    at org.apache.commons.io.FileUtils.validateListFilesParameters(FileUtils.java:545)
    at org.apache.commons.io.FileUtils.listFiles(FileUtils.java:521)
    at org.apache.commons.io.FileUtils.iterateFiles(FileUtils.java:628)
    at com.github.drochetti.javassist.maven.ClassTransformer.iterateClassnames(ClassTransformer.java:211)
    at com.github.drochetti.javassist.maven.ClassTransformer.transform(ClassTransformer.java:136)
    at com.github.drochetti.javassist.maven.JavassistTransformerExecutor.execute(JavassistTransformerExecutor.java:107)
    at com.github.drochetti.javassist.maven.JavassistTransformerExecutor.execute(JavassistTransformerExecutor.java:98)
    at com.github.drochetti.javassist.maven.JavassistMojo.execute(JavassistMojo.java:89)
    ... 32 more

@stephanenicolas
Copy link
Contributor Author

I am working on it. I think I got it. I will update the PR and let you know
it.

Btw, I will also add a travis script. Would you mind to activate on the
repo ?

S.

2014-05-19 23:33 GMT+02:00 barthel notifications@github.com:

If u like, create a travis CI.
The release and deployment will be created by the CI at my company. The
artifacts will be signed with there keys.

barthel@q35:~/work/sources/github.com/icon-Systemhaus-GmbH/javassist-maven-plugin$ mvn --version
Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 17:22:22+0200)
Maven home: /home/barthel/work/app/maven
Java version: 1.6.0_31, vendor: Sun Microsystems Inc.
Java home: /usr/lib/jvm/java-6-openjdk-i386/jre
Default locale: de_DE, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-27-generic", arch: "i386", family: "unix"

barthel@q35:~/work/sources/github.com/icon-Systemhaus-GmbH/javassist-maven-plugin$ reset && mvn clean test

[ERROR] Parameter 'directory' is not a directory
java.lang.IllegalArgumentException: Parameter 'directory' is not a directory
at org.apache.commons.io.FileUtils.validateListFilesParameters(FileUtils.java:545)
at org.apache.commons.io.FileUtils.listFiles(FileUtils.java:521)
at org.apache.commons.io.FileUtils.iterateFiles(FileUtils.java:628)
at com.github.drochetti.javassist.maven.ClassTransformer.iterateClassnames(ClassTransformer.java:211)
at com.github.drochetti.javassist.maven.ClassTransformer.transform(ClassTransformer.java:136)
at com.github.drochetti.javassist.maven.JavassistTransformerExecutor.execute(JavassistTransformerExecutor.java:107)
at com.github.drochetti.javassist.maven.JavassistTransformerExecutor.execute(JavassistTransformerExecutor.java:98)
at com.github.drochetti.javassist.maven.JavassistMojo.execute(JavassistMojo.java:89)
at com.github.drochetti.javassist.maven.JavassistMojoTest.testSimpleConfig(JavassistMojoTest.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:622)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.apache.maven.plugin.testing.MojoRule$2.evaluate(MojoRule.java:303)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:622)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 3.355 sec <<< FAILURE!
testOverrideBuildDirAndTestDir(com.github.drochetti.javassist.maven.JavassistMojoTest) Time elapsed: 2.545 sec <<< ERROR!
org.apache.maven.plugin.MojoExecutionException: Parameter 'directory' is not a directory
at com.github.drochetti.javassist.maven.JavassistMojo.execute(JavassistMojo.java:100)
at com.github.drochetti.javassist.maven.JavassistMojoTest.testOverrideBuildDirAndTestDir(JavassistMojoTest.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:622)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.apache.maven.plugin.testing.MojoRule$2.evaluate(MojoRule.java:303)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:622)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: java.lang.IllegalArgumentException: Parameter 'directory' is not a directory
at org.apache.commons.io.FileUtils.validateListFilesParameters(FileUtils.java:545)
at org.apache.commons.io.FileUtils.listFiles(FileUtils.java:521)
at org.apache.commons.io.FileUtils.iterateFiles(FileUtils.java:628)
at com.github.drochetti.javassist.maven.ClassTransformer.iterateClassnames(ClassTransformer.java:211)
at com.github.drochetti.javassist.maven.ClassTransformer.transform(ClassTransformer.java:136)
at com.github.drochetti.javassist.maven.JavassistTransformerExecutor.execute(JavassistTransformerExecutor.java:107)
at com.github.drochetti.javassist.maven.JavassistTransformerExecutor.execute(JavassistTransformerExecutor.java:98)
at com.github.drochetti.javassist.maven.JavassistMojo.execute(JavassistMojo.java:89)
... 32 more


Reply to this email directly or view it on GitHubhttps://github.com//pull/12#issuecomment-43561339
.

@stephanenicolas
Copy link
Contributor Author

It will work with the last commit of the PR :
https://travis-ci.org/stephanenicolas/javassist-maven-plugin/builds/25555097

Empty folders are not stored in a git tree, I had to create empty files in
the resources to make the tests pass. This is quite usual.
All should be ok now, please cherry-pick last commit from master.

Travis script works for the project. Can you enable it ?

Stéphane
PS : would it be possible to rebase the feature branches to get a more
clear git tree ?

2014-05-19 23:52 GMT+02:00 Stéphane NICOLAS steff.nicolas@gmail.com:

I am working on it. I think I got it. I will update the PR and let you
know it.

Btw, I will also add a travis script. Would you mind to activate on the
repo ?

S.

2014-05-19 23:33 GMT+02:00 barthel notifications@github.com:

If u like, create a travis CI.

The release and deployment will be created by the CI at my company. The
artifacts will be signed with there keys.

barthel@q35:~/work/sources/github.com/icon-Systemhaus-GmbH/javassist-maven-plugin$ mvn --version
Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 17:22:22+0200)
Maven home: /home/barthel/work/app/maven
Java version: 1.6.0_31, vendor: Sun Microsystems Inc.
Java home: /usr/lib/jvm/java-6-openjdk-i386/jre
Default locale: de_DE, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-27-generic", arch: "i386", family: "unix"

barthel@q35:~/work/sources/github.com/icon-Systemhaus-GmbH/javassist-maven-plugin$ reset && mvn clean test

[ERROR] Parameter 'directory' is not a directory
java.lang.IllegalArgumentException: Parameter 'directory' is not a directory
at org.apache.commons.io.FileUtils.validateListFilesParameters(FileUtils.java:545)
at org.apache.commons.io.FileUtils.listFiles(FileUtils.java:521)
at org.apache.commons.io.FileUtils.iterateFiles(FileUtils.java:628)
at com.github.drochetti.javassist.maven.ClassTransformer.iterateClassnames(ClassTransformer.java:211)
at com.github.drochetti.javassist.maven.ClassTransformer.transform(ClassTransformer.java:136)
at com.github.drochetti.javassist.maven.JavassistTransformerExecutor.execute(JavassistTransformerExecutor.java:107)
at com.github.drochetti.javassist.maven.JavassistTransformerExecutor.execute(JavassistTransformerExecutor.java:98)
at com.github.drochetti.javassist.maven.JavassistMojo.execute(JavassistMojo.java:89)
at com.github.drochetti.javassist.maven.JavassistMojoTest.testSimpleConfig(JavassistMojoTest.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:622)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.apache.maven.plugin.testing.MojoRule$2.evaluate(MojoRule.java:303)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:622)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 3.355 sec <<< FAILURE!
testOverrideBuildDirAndTestDir(com.github.drochetti.javassist.maven.JavassistMojoTest) Time elapsed: 2.545 sec <<< ERROR!
org.apache.maven.plugin.MojoExecutionException: Parameter 'directory' is not a directory
at com.github.drochetti.javassist.maven.JavassistMojo.execute(JavassistMojo.java:100)
at com.github.drochetti.javassist.maven.JavassistMojoTest.testOverrideBuildDirAndTestDir(JavassistMojoTest.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:622)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.apache.maven.plugin.testing.MojoRule$2.evaluate(MojoRule.java:303)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:622)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: java.lang.IllegalArgumentException: Parameter 'directory' is not a directory
at org.apache.commons.io.FileUtils.validateListFilesParameters(FileUtils.java:545)
at org.apache.commons.io.FileUtils.listFiles(FileUtils.java:521)
at org.apache.commons.io.FileUtils.iterateFiles(FileUtils.java:628)
at com.github.drochetti.javassist.maven.ClassTransformer.iterateClassnames(ClassTransformer.java:211)
at com.github.drochetti.javassist.maven.ClassTransformer.transform(ClassTransformer.java:136)
at com.github.drochetti.javassist.maven.JavassistTransformerExecutor.execute(JavassistTransformerExecutor.java:107)
at com.github.drochetti.javassist.maven.JavassistTransformerExecutor.execute(JavassistTransformerExecutor.java:98)
at com.github.drochetti.javassist.maven.JavassistMojo.execute(JavassistMojo.java:89)
... 32 more


Reply to this email directly or view it on GitHubhttps://github.com//pull/12#issuecomment-43561339
.

@barthel
Copy link
Contributor

barthel commented May 20, 2014

@stephanenicolas Thx for fixing the tests and enable travis.

I would like to go the github way and work with PR.
It's easier to manage also without a PC (like tablet) ;-).
Supports travis Java 6 too?

@stephanenicolas
Copy link
Contributor Author

What do you mean by "Supports travis Java 6" ?

@barthel , btw, I think we were wrong with the support for inner classes : they are even more supported than what I thought and it should not be an option. I got some details from the author of javassist :
jboss-javassist/javassist#6 (comment)

S.

2014-05-20 6:49 GMT+02:00 barthel notifications@github.com:

@stephanenicolas https://github.com/stephanenicolas Thx for fixing the
tests and enable travis.

I would like to go the github way and work with PR.
It's easier to manage also without a PC (like tablet) ;-).
Supports travis Java 6 too?


Reply to this email directly or view it on GitHubhttps://github.com//pull/12#issuecomment-43586185
.

@barthel
Copy link
Contributor

barthel commented May 20, 2014

Thx @stephanenicolas for clarify the support of inner/nested classes.
I opened #15 for removing the internal filter implementation.

What do you mean by "Supports travis Java 6" ?

I've not read the documentation on travis-ci.org.
Offers travis-ci.org Java 6 as a JVM option?

@stephanenicolas
Copy link
Contributor Author

Yes it does, but why should we use it to build and pass tests ?

@barthel
Copy link
Contributor

barthel commented May 20, 2014

I need a Java 6 compiled plugin.
The infrastructure where this plugin will be used isn't Java 7 ready yet :-|.
Maybe we use travis to execute the tests on multiple JVM versions.

Btw. the source settings of the compiler plugin aren't set also.

https://travis-ci.org/icon-Systemhaus-GmbH/javassist-maven-plugin#L1463

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

Successfully merging this pull request may close these issues.

None yet

2 participants