-
-
Notifications
You must be signed in to change notification settings - Fork 351
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
1 parent
4a89309
commit 76b3648
Showing
3 changed files
with
52 additions
and
10 deletions.
There are no files selected for viewing
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
32 changes: 32 additions & 0 deletions
32
src/test/java/spoon/test/imports/ImportAndExtendWithPackageNameTest.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,32 @@ | ||
package spoon.test.imports; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
import spoon.Launcher; | ||
import spoon.reflect.declaration.CtType; | ||
import spoon.reflect.reference.CtTypeReference; | ||
|
||
import java.util.Collection; | ||
|
||
public class ImportAndExtendWithPackageNameTest { | ||
|
||
private static final String inputResource = | ||
"./src/test/resources/import-resources/ImportAndExtendWithPackageName.java"; | ||
|
||
@Test | ||
public void testBuildModel() { | ||
final Launcher runLaunch = new Launcher(); | ||
runLaunch.getEnvironment().setNoClasspath(true); | ||
runLaunch.addInputResource(inputResource); | ||
runLaunch.buildModel(); | ||
|
||
final Collection<CtType<?>> types = runLaunch.getModel().getAllTypes(); | ||
Assert.assertSame(1, types.size()); | ||
|
||
final CtType type = types.iterator().next(); | ||
Assert.assertEquals("ImportAndExtendWithPackageName", type.getSimpleName()); | ||
|
||
final CtTypeReference superClass = type.getSuperclass(); | ||
Assert.assertEquals("LLkParser", superClass.getSimpleName()); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
src/test/resources/import-resources/ImportAndExtendWithPackageName.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,5 @@ | ||
import antlr.*; | ||
|
||
public class ImportAndExtendWithPackageName extends antlr.LLkParser { | ||
public static void main(final String[] args) {} | ||
} |