Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

refactor: move Castings.java to testclasses #2155

Merged
merged 1 commit into from
Jul 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/test/java/spoon/test/casts/CastTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import spoon.reflect.visitor.Query;
import spoon.reflect.visitor.filter.NamedElementFilter;
import spoon.reflect.visitor.filter.TypeFilter;
import spoon.test.casts.testclasses.Castings;
import spoon.testing.utils.ModelUtils;

import static org.junit.Assert.assertEquals;
Expand Down Expand Up @@ -75,7 +76,7 @@ public void testCast3() {
public void testCase4() throws Exception {
// contract: If the invocation is to a method where the returned type is a generic type,
// getType returns the actual type bound to this particular invocation.
CtType<?> type = build("spoon.test.casts", "Castings");
CtType<?> type = build("spoon.test.casts.testclasses", "Castings");

final CtMethod<?> getValueMethod = type.getMethodsByName("getValue").get(0);
final CtInvocation<?> getValueInvocation = Query.getElements(type, new TypeFilter<CtInvocation<?>>(CtInvocation.class) {
Expand All @@ -97,6 +98,6 @@ public void testTypeAnnotationOnCast() throws Exception {
final CtLocalVariable local = aCastings.getMethod("bar").getElements(new TypeFilter<>(CtLocalVariable.class)).get(0);

assertEquals(1, ((CtTypeReference) local.getDefaultExpression().getTypeCasts().get(0)).getAnnotations().size());
assertEquals("((java.lang.@spoon.test.casts.Castings.TypeAnnotation(integer = 1)" + System.lineSeparator() + "String) (\"\"))", local.getDefaultExpression().toString());
assertEquals("((java.lang.@spoon.test.casts.testclasses.Castings.TypeAnnotation(integer = 1)" + System.lineSeparator() + "String) (\"\"))", local.getDefaultExpression().toString());
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package spoon.test.casts;
package spoon.test.casts.testclasses;

import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
Expand Down