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

[MRESOLVER-247] IT update for resolver behaviour change #140

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ public MavenITmng5669ReadPomsOnce()
super( "[4.0.0-alpha-1,)" );
}

/*
* "Original" resolver w/ DFS and w/o skipper: it did resolve things that were actually later unused.
*/
// private static final int EXPECTED_LOG_SIZE_DFS = 168;

/*
* "Modern" resolver w/ BFS and w/ skipper: it does not resolve unnecessary things.
*/
// private static final int EXPECTED_LOG_SIZE_BFS = 145;

public void testWithoutBuildConsumer()
throws Exception
{
Expand Down Expand Up @@ -74,10 +84,11 @@ public void testWithoutBuildConsumer()
break;
}
}
assertEquals( logTxt.toString(), 168, logTxt.size() );
final int expectedLogSize = logTxt.size();
assertTrue( expectedLogSize + " > 140", expectedLogSize > 140 ); // we expect AT LEAST 140 reads

// analyze lines. It is a Hashmap, so we can't rely on the order
Set<String> uniqueBuildingSources = new HashSet<>( 168 );
Set<String> uniqueBuildingSources = new HashSet<>( expectedLogSize );
final String buildSourceKey = "org.apache.maven.model.building.source=";
final int keyLength = buildSourceKey.length();
for ( String line : logTxt )
Expand All @@ -95,7 +106,7 @@ public void testWithoutBuildConsumer()
}
uniqueBuildingSources.add( line.substring( start + keyLength, end ) );
}
assertEquals( uniqueBuildingSources.size(), 167 /* is 168 minus superpom */ );
assertEquals( uniqueBuildingSources.size(), expectedLogSize - 1 /* minus superpom */ );
}

public void testWithBuildConsumer()
Expand Down Expand Up @@ -128,11 +139,11 @@ public void testWithBuildConsumer()
break;
}
}
assertEquals( logTxt.toString(), 168 + 4 /* reactor poms are read twice: file + raw (=XMLFilters) */,
logTxt.size() );
final int expectedLogSize = logTxt.size() - 4; /* reactor poms are read twice: file + raw (=XMLFilters) */
assertTrue( expectedLogSize + " > 140", expectedLogSize > 140 ); // we expect AT LEAST 140 reads

// analyze lines. It is a Hashmap, so we can't rely on the order
Set<String> uniqueBuildingSources = new HashSet<>( 168 );
Set<String> uniqueBuildingSources = new HashSet<>( expectedLogSize );
final String buildSourceKey = "org.apache.maven.model.building.source=";
final int keyLength = buildSourceKey.length();
for ( String line : logTxt )
Expand All @@ -150,7 +161,7 @@ public void testWithBuildConsumer()
}
uniqueBuildingSources.add( line.substring( start + keyLength, end ) );
}
assertEquals( uniqueBuildingSources.size(), 167 /* is 168 minus superpom */ );
assertEquals( uniqueBuildingSources.size(), expectedLogSize - 1 /* minus superpom */ );
}

}