Skip to content

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
@jira-importer
Copy link

Resolve #546

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

Successfully merging this pull request may close these issues.

3 participants