Skip to content

Commit

Permalink
Revert "test: Add javac facade to test reflection tree builder (#4988)"
Browse files Browse the repository at this point in the history
This reverts commit b8ee5e9.
  • Loading branch information
MartinWitt committed Oct 31, 2022
1 parent 941bc02 commit 94a0e7d
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 215 deletions.
33 changes: 0 additions & 33 deletions src/test/java/spoon/support/util/compilation/ClassFileManager.java

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

73 changes: 0 additions & 73 deletions src/test/java/spoon/support/util/compilation/JavacFacade.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import static org.hamcrest.CoreMatchers.hasItem;
import static org.hamcrest.CoreMatchers.hasItems;
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
Expand Down Expand Up @@ -100,10 +99,8 @@
import spoon.support.reflect.code.CtConditionalImpl;
import spoon.support.reflect.declaration.CtEnumValueImpl;
import spoon.support.reflect.declaration.CtFieldImpl;
import spoon.support.util.compilation.JavacFacade;
import spoon.support.visitor.equals.EqualsChecker;
import spoon.support.visitor.equals.EqualsVisitor;
import spoon.test.GitHubIssue;
import spoon.test.generics.testclasses3.ComparableComparatorBug;
import spoon.test.innerclasses.InnerClasses;
import spoon.test.pkg.PackageTest;
Expand Down Expand Up @@ -843,23 +840,4 @@ void testInnerClassesConstructorParameters() {
assertThat(asClass.getConstructors().size(), equalTo(1));
assertThat(asClass.getConstructors().iterator().next().getParameters().size(), equalTo(inners.size()));
}

@GitHubIssue(issueNumber = 4972, fixed = false)
void parameterNamesAreParsedWhenCompilingWithParametersFlag() throws ClassNotFoundException {
ClassLoader loader = JavacFacade.compileFiles(
Map.of(
"Test",
"class Test {\n"
+ " public void foo(String bar) {}\n" +
"}\n"
),
List.of("-parameters")
);
CtType<?> test = new JavaReflectionTreeBuilder(createFactory()).scan(loader.loadClass("Test"));
CtMethod<?> method = test.getMethodsByName("foo").get(0);
CtParameter<?> parameter = method.getParameters().get(0);

assertThat(parameter.getSimpleName(), is("bar"));
}

}
3 changes: 1 addition & 2 deletions src/test/java/spoon/test/main/MainTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ public void testTest() {
// this helps a lot to easily automatically differentiate app classes and test classes
for (CtType t : launcher.getFactory().getModel().getAllTypes()) {
if ("spoon.metamodel".equals(t.getPackage().getQualifiedName())
|| t.getPackage().getQualifiedName().startsWith("spoon.generating")
|| t.getPackage().getQualifiedName().startsWith("spoon.support.util.compilation")) {
|| t.getPackage().getQualifiedName().startsWith("spoon.generating")) {
//Meta model classes doesn't have to follow test class naming conventions
continue;
}
Expand Down

0 comments on commit 94a0e7d

Please sign in to comment.