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

[MCOMPILER-341] Compile module descriptors with TestCompilerMojo #4

Merged
merged 1 commit into from
Jun 2, 2018
Merged

[MCOMPILER-341] Compile module descriptors with TestCompilerMojo #4

merged 1 commit into from
Jun 2, 2018

Conversation

sormuras
Copy link
Contributor

Prior to this commit module descriptors module-info.java were not compiled by the TestCompilerMojo. This commit introduces support for test sources organized with module descriptors.

See motivation: https://twitter.com/rfscholte/status/927132319374331904

Supersedes: apache/maven-plugins#139

@Test
void moduleNameIsFoo()
{
Assumptions.assumeTrue( Foo.class.getModule().isNamed(), "Calculator resides in a named module" );
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix copy and paste error: Foo it is, not Calculator.

def jpmsArgs = new File( basedir, 'target/test-classes/META-INF/jpms.args' )
def lines = jpmsArgs.readLines()
assert lines[0] == "--patch-module" // TODO --patch-module is not required here!
assert lines[1] == "foo="
Copy link
Contributor Author

@sormuras sormuras May 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

foo= points to an empty value. It shoud point to the src/main/java directory.

Prior to this commit module descriptors `module-info.java` were not
compiled by the TestCompilerMojo. This commit introduces support for
test sources organized with module descriptors.

See motivation: https://twitter.com/rfscholte/status/927132319374331904

https://issues.apache.org/jira/browse/MCOMPILER-341
@sormuras sormuras changed the title Introduce white-box testing modules [MCOMPILER-341] Compile module descriptors with TestCompilerMojo May 13, 2018
@sormuras
Copy link
Contributor Author

2 black-box and 1 white-box integration tests implemented:

image

@asfgit asfgit merged commit 8b26d49 into apache:master Jun 2, 2018
@sormuras sormuras deleted the module-info-in-test-folder branch June 2, 2018 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants