assertj-assertions-generator icon indicating copy to clipboard operation
assertj-assertions-generator copied to clipboard

Generator appears to skip some classes in jars

Open msackman opened this issue 9 years ago • 4 comments

Hopefully reproducible with the following:

> wget -O assertj-assertions-generator-2.0.0-unix.zip https://search.maven.org/remotecontent?filepath=org/assertj/assertj-assertions-generator/2.0.0/assertj-assertions-generator-2.0.0-unix.zip
> unzip assertj-assertions-generator-2.0.0-unix.zip
> cd assertion-generator/
assertion-generator> mkdir tmp
assertion-generator> cd tmp
tmp> wget https://jitpack.io/com/github/ga4gh/schemas/d6cc80d/schemas-d6cc80d.jar
tmp> wget http://central.maven.org/maven2/com/google/protobuf/protobuf-java/3.0.0-beta-2/protobuf-java-3.0.0-beta-2.jar
tmp> cd ..
assertion-generator> java -cp "tmp/*:lib/*" org.assertj.assertions.generator.cli.AssertionGeneratorLauncher ga4gh
assertion-generator> find ga4gh/ -type f -name "*.java" | wc -l
9

So 9 files have been generated.

assertion-generator> rm -rf ga4gh
assertion-generator> cd tmp
tmp> unzip schemas-d6cc80d.jar
tmp> cd ..
assertion-generator> java -cp "tmp:tmp/*:lib/*" org.assertj.assertions.generator.cli.AssertionGeneratorLauncher ga4gh
assertion-generator> find ga4gh/ -type f -name "*.java" | wc -l
143

Now 143 files have been generated, which is more what I was expecting.

Is this something really odd with what I'm doing? This looks to me like a bug in how the generator locates classes to generate for.

msackman avatar Feb 10 '16 15:02 msackman

I'll look into this after my holidays :-)

joel-costigliola avatar Feb 11 '16 23:02 joel-costigliola

If you are reusing the same tmp folder without cleaning I suspect you are generating classes for previously generated ones.

joel-costigliola avatar Apr 19 '16 21:04 joel-costigliola

Hey,

I just want to tell you how much I appreciate your help, and therefore I want to share some great stuff with you, just take a look here http://spiquyntythe.gtechlabs.com/lngimpka

All the best, [email protected]

msackman avatar Jul 11 '16 05:07 msackman

@msackman I finally had time to work on that, in my latest master version, I have only 9 classes generated, the changes I made lately is to only generate assertion for public classes, I believe the additional classes you see came from non public ones (I could not find your sources to be sure of that).

joel-costigliola avatar Aug 28 '17 10:08 joel-costigliola