Skip to content

Commit

Permalink
WINDUP-269: Some tests run too many rulleproviders + small test refac…
Browse files Browse the repository at this point in the history
…toring
  • Loading branch information
Matej Briskar committed Oct 2, 2014
1 parent 02b565a commit eff0bbe
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.jboss.windup.config.WindupRuleProvider;
import org.jboss.windup.engine.WindupConfiguration;
import org.jboss.windup.engine.WindupProcessor;
import org.jboss.windup.engine.predicates.RuleProviderWithDependenciesPredicate;
import org.jboss.windup.graph.GraphContext;
import org.jboss.windup.graph.GraphContextFactory;
import org.jboss.windup.graph.GraphLifecycleListener;
Expand Down Expand Up @@ -73,7 +74,7 @@ public static ForgeArchive getDeployment()
private GraphContextFactory factory;

@Test
public void testIterationVariableResolving() throws IOException
public void testJavaClassCondition() throws IOException, InstantiationException, IllegalAccessException
{
try (GraphContext context = factory.create())
{
Expand Down Expand Up @@ -106,7 +107,7 @@ public void postOpen(GraphContext context)

// Create FileModel for $inputDir/HintsClassificationsTest.java
FileModel fileModel = context.getFramed().addVertex(null, FileModel.class);
fileModel.setFilePath(inputDir + "/HintsClassificationsTest.java");
fileModel.setFilePath(inputDir + "/JavaHintsClassificationsTest.java");
fileModel.setProjectModel(pm);
pm.addFileModel(fileModel);

Expand All @@ -132,30 +133,8 @@ public void preShutdown(GraphContext context)

final WindupConfiguration processorConfig = new WindupConfiguration().setOutputDirectory(outputPath);
processorConfig.setGraphListener(initializer);
processorConfig.setRuleProviderFilter(new Predicate<WindupRuleProvider>()
{
private Set<String> skip = new HashSet<>();
{
skip.add("CreateApplicationReportIndexRuleProvider");
skip.add("CreateJavaApplicationOverviewReportRuleProvider");
skip.add("RenderSourceReportRuleProvider");
}

public boolean accept(WindupRuleProvider type)
{
return !skip.remove(type.getClass().getSimpleName());
}
});

processorConfig.setGraphContext(context).setRuleProviderFilter(new Predicate<WindupRuleProvider>()
{
private Set<String> done = new HashSet<>();

public boolean accept(WindupRuleProvider type)
{
return done.add(type.getClass().getSimpleName());
}
});
processorConfig.setRuleProviderFilter(new RuleProviderWithDependenciesPredicate(TestJavaClassTestRuleProvider.class));
processorConfig.setGraphContext(context).setRuleProviderFilter(new RuleProviderWithDependenciesPredicate(TestJavaClassTestRuleProvider.class));

try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
import org.ocpsoft.rewrite.context.EvaluationContext;

@RunWith(Arquillian.class)
public class HintsClassificationsTest
public class JavaHintsClassificationsTest
{
@Deployment
@Dependencies({
Expand Down Expand Up @@ -88,7 +88,7 @@ public static ForgeArchive getDeployment()
private GraphContextFactory factory;

@Test
public void testIterationVariableResolving() throws Exception
public void testHintsAndClassificationOperation() throws Exception
{
try (GraphContext context = factory.create())
{
Expand Down Expand Up @@ -117,7 +117,7 @@ public void postOpen(GraphContext context)
pm.setRootFileModel(inputPathFrame);

FileModel fileModel = context.getFramed().addVertex(null, FileModel.class);
fileModel.setFilePath(INPUT_PATH + "/HintsClassificationsTest.java");
fileModel.setFilePath(INPUT_PATH + "/JavaHintsClassificationsTest.java");
fileModel.setProjectModel(pm);

pm.addFileModel(inputPathFrame);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public static ForgeArchive getDeployment()
private GraphContextFactory factory;

@Test
public void testIterationVariableResolving() throws IOException
public void testHintAndClassificationOperation() throws IOException
{
try (GraphContext context = factory.create())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static ForgeArchive getDeployment()
private GraphContextFactory factory;

@Test
public void testIterationVariableResolving() throws IOException
public void testXSLTTransformation() throws IOException
{
try (GraphContext context = factory.create())
{
Expand Down

0 comments on commit eff0bbe

Please sign in to comment.