Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

Commit

Permalink
Added test to verify classpath attributes are not dropped
Browse files Browse the repository at this point in the history
  • Loading branch information
WonderCsabo committed Sep 9, 2014
1 parent e5a1bae commit ee76d8f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
Expand Up @@ -75,6 +75,9 @@
<configuration>
<source>1.6</source>
<target>1.6</target>
<includes>
<include>**/*.java</include>
</includes>
</configuration>
</plugin>
</plugins>
Expand Down
Expand Up @@ -26,6 +26,7 @@
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.jobs.Job;
Expand Down Expand Up @@ -283,4 +284,12 @@ static boolean booleanAttribute(String attributeName, IClasspathEntry entry) {
return false;
}

static boolean containsIncludePattern(String expectedPattern, IClasspathEntry entry) {
for (IPath inclusionPattern : entry.getInclusionPatterns()) {
if (inclusionPattern.toOSString().equals(expectedPattern)) {
return true;
}
}
return false;
}
}
Expand Up @@ -282,4 +282,9 @@ public void testConfigureDoesNotSetIgnoreWarnings() throws Exception {
IClasspathEntry gen = findSourceEntry(javaProject.getRawClasspath(), "gen");
assertFalse("external assets folder isn't linked", booleanAttribute(IGNORE_OPTIONAL_PROBLEMS, gen));
}

public void testConfigureDoesNotRemoveIncludesFromEntry() throws Exception {
IClasspathEntry mainJava = findSourceEntry(javaProject.getRawClasspath(), "src" + separator + "main" + separator + "java");
assertTrue("inclusion pattern removed", containsIncludePattern("**" + separator + "*.java", mainJava));
}
}

0 comments on commit ee76d8f

Please sign in to comment.