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

MavenITmng5669ReadPomsOnce and BF collector #248

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/maven-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
cache: 'maven'

- name: Set up Maven
run: mvn --errors --batch-mode --show-version wrapper:wrapper "-Dmaven=3.8.7"
run: mvn --errors --batch-mode --show-version wrapper:wrapper "-Dmaven=4.0.0-alpha-4"

- name: Running integration tests
run: "./mvnw -B clean install -Prun-its,embedded -Dmaven.repo.local=`pwd`/repo"
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,30 @@ public MavenITmng5669ReadPomsOnce()
}

@Test
public void testWithoutBuildConsumer()
public void testWithoutBuildConsumerDF() throws Exception
{
testWithoutBuildConsumer( "df" );
}

@Test
public void testWithoutBuildConsumerBF() throws Exception
{
testWithoutBuildConsumer( "bf" );
}

@Test
public void testWithBuildConsumerDF() throws Exception
{
testWithBuildConsumer( "df" );
}

@Test
public void testWithBuildConsumerBF() throws Exception
{
testWithBuildConsumer( "bf" );
}

public void testWithoutBuildConsumer(String dependencyCollector)
throws Exception
{
// prepare JavaAgent
Expand All @@ -59,15 +82,17 @@ public void testWithoutBuildConsumer()
verifier.getArtifactPath( "org.apache.maven.its", "core-it-javaagent", "2.1-SNAPSHOT", "jar" ) );
verifier.filterFile( ".mvn/jvm.config", ".mvn/jvm.config", null, filterProperties );

verifier.setLogFileName( dependencyCollector + "-log.txt" );
verifier.setForkJvm( true ); // pick up agent
verifier.setAutoclean( false );
verifier.addCliArgument( "-q" );
verifier.addCliArgument( "-U" );
verifier.addCliArgument( "-Daether.dependencyCollector.impl=" + dependencyCollector );
verifier.addCliArgument( "-Dmaven.experimental.buildconsumer=false" );
verifier.addCliArgument( "verify");
verifier.execute();

List<String> logTxt = verifier.loadLines( "log.txt", "utf-8" );
List<String> logTxt = verifier.loadLines( dependencyCollector + "-log.txt", "utf-8" );

// count source items
Map<String, Long> sourceMap = logTxt.stream()
Expand All @@ -84,8 +109,7 @@ public void testWithoutBuildConsumer()
assertTrue("Duplicate items: " + String.join(System.lineSeparator(), duplicates), duplicates.isEmpty());
}

@Test
public void testWithBuildConsumer()
public void testWithBuildConsumer(String dependencyCollector)
throws Exception
{
// prepare JavaAgent
Expand All @@ -96,16 +120,17 @@ public void testWithBuildConsumer()
verifier.getArtifactPath( "org.apache.maven.its", "core-it-javaagent", "2.1-SNAPSHOT", "jar" ) );
verifier.filterFile( ".mvn/jvm.config", ".mvn/jvm.config", null, filterProperties );

verifier.setLogFileName( "log-bc.txt" );
verifier.setLogFileName( dependencyCollector + "-log-bc.txt" );
verifier.setForkJvm( true ); // pick up agent
verifier.setAutoclean( false );
verifier.addCliArgument( "-q" );
verifier.addCliArgument( "-U" );
verifier.addCliArgument( "-Daether.dependencyCollector.impl=" + dependencyCollector );
verifier.addCliArgument( "-Dmaven.experimental.buildconsumer=true" );
verifier.addCliArgument( "verify" );
verifier.execute();

List<String> logTxt = verifier.loadLines( "log-bc.txt", "utf-8" );
List<String> logTxt = verifier.loadLines( dependencyCollector + "-log-bc.txt", "utf-8" );

// count source items
Map<String, Long> sourceMap = logTxt.stream()
Expand Down