-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
77 additions
and
0 deletions.
There are no files selected for viewing
77 changes: 77 additions & 0 deletions
77
cast/java/ecj/src/test/java/com/ibm/wala/cast/java/test/ECJJava15IRTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package com.ibm.wala.cast.java.test; | ||
|
||
import com.ibm.wala.cast.java.client.ECJJavaSourceAnalysisEngine; | ||
import com.ibm.wala.cast.java.client.JavaSourceAnalysisEngine; | ||
import com.ibm.wala.cast.java.ipa.callgraph.JavaSourceAnalysisScope; | ||
import com.ibm.wala.client.AbstractAnalysisEngine; | ||
import com.ibm.wala.core.tests.callGraph.CallGraphTestUtil; | ||
import com.ibm.wala.ipa.callgraph.CallGraphBuilder; | ||
import com.ibm.wala.ipa.callgraph.Entrypoint; | ||
import com.ibm.wala.ipa.callgraph.impl.Util; | ||
import com.ibm.wala.ipa.callgraph.propagation.InstanceKey; | ||
import com.ibm.wala.ipa.cha.IClassHierarchy; | ||
import com.ibm.wala.util.CancelException; | ||
import java.io.IOException; | ||
import java.util.Collection; | ||
import java.util.List; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class ECJJava15IRTest extends IRTests { | ||
|
||
public ECJJava15IRTest() { | ||
super(null); | ||
dump = true; | ||
} | ||
|
||
@Override | ||
protected AbstractAnalysisEngine<InstanceKey, CallGraphBuilder<InstanceKey>, ?> getAnalysisEngine( | ||
final String[] mainClassDescriptors, Collection<String> sources, List<String> libs) { | ||
JavaSourceAnalysisEngine engine = | ||
new ECJJavaSourceAnalysisEngine() { | ||
@Override | ||
protected Iterable<Entrypoint> makeDefaultEntrypoints(IClassHierarchy cha) { | ||
return Util.makeMainEntrypoints( | ||
JavaSourceAnalysisScope.SOURCE, cha, mainClassDescriptors); | ||
} | ||
}; | ||
engine.setExclusionsFile(CallGraphTestUtil.REGRESSION_EXCLUSIONS); | ||
populateScope(engine, sources, libs); | ||
return engine; | ||
} | ||
|
||
@Test | ||
public void testVarargsOverriding() | ||
throws IllegalArgumentException, CancelException, IOException { | ||
runTest( | ||
singlePkgTestSrc("javaonepointfive"), | ||
rtJar, | ||
simplePkgTestEntryPoint("javaonepointfive"), | ||
emptyList, | ||
true, | ||
null); | ||
} | ||
|
||
@Test | ||
public void testEnumSwitch() | ||
throws IllegalArgumentException, CancelException, IOException { | ||
runTest( | ||
singlePkgTestSrc("javaonepointfive"), | ||
rtJar, | ||
simplePkgTestEntryPoint("javaonepointfive"), | ||
emptyList, | ||
true, | ||
null); | ||
} | ||
|
||
@Test | ||
public void testOverridesOnePointFour() | ||
throws IllegalArgumentException, CancelException, IOException { | ||
runTest( | ||
singlePkgTestSrc("javaonepointfive"), | ||
rtJar, | ||
simplePkgTestEntryPoint("javaonepointfive"), | ||
emptyList, | ||
true, | ||
null); | ||
} | ||
} |