Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

refactor: move resources to testclasses in fieldaccesses #2168

Merged
merged 3 commits into from
Jul 5, 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
12 changes: 7 additions & 5 deletions src/test/java/spoon/test/fieldaccesses/FieldAccessTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@
import spoon.reflect.visitor.filter.TypeFilter;
import spoon.test.fieldaccesses.testclasses.B;
import spoon.test.fieldaccesses.testclasses.Kuu;
import spoon.test.fieldaccesses.testclasses.Mouse;
import spoon.test.fieldaccesses.testclasses.Panini;
import spoon.test.fieldaccesses.testclasses.Pozole;
import spoon.test.fieldaccesses.testclasses.Tacos;
import spoon.test.fieldaccesses.testclasses.MyClass;
import spoon.testing.utils.ModelUtils;

import java.util.List;
Expand All @@ -50,7 +52,7 @@ public class FieldAccessTest {

@Test
public void testModelBuildingFieldAccesses() throws Exception {
CtType<?> type = build("spoon.test.fieldaccesses", "Mouse");
CtType<?> type = build("spoon.test.fieldaccesses.testclasses", "Mouse");
assertEquals("Mouse", type.getSimpleName());

CtMethod<?> meth1 = type.getElements(
Expand Down Expand Up @@ -98,7 +100,7 @@ public void testModelBuildingFieldAccesses() throws Exception {

@Test
public void testBCUBug20140402() throws Exception {
CtType<?> type = build("spoon.test.fieldaccesses",
CtType<?> type = build("spoon.test.fieldaccesses.testclasses",
"BCUBug20140402");
assertEquals("BCUBug20140402", type.getSimpleName());

Expand Down Expand Up @@ -140,7 +142,7 @@ public void testBCUBug20140402() throws Exception {

@Test
public void testBUG20160112() throws Exception {
CtType<?> type = build("spoon.test.fieldaccesses", "BUG20160112");
CtType<?> type = build("spoon.test.fieldaccesses.testclasses", "BUG20160112");
assertEquals("BUG20160112", type.getSimpleName());
CtOperatorAssignment<?, ?> ass = type.getElements(
new TypeFilter<CtOperatorAssignment<?, ?>>(CtOperatorAssignment.class)).get(0);
Expand All @@ -151,7 +153,7 @@ public void testBUG20160112() throws Exception {

@Test
public void testTargetedAccessPosition() throws Exception {
CtType<?> type = build("spoon.test.fieldaccesses", "TargetedAccessPosition");
CtType<?> type = build("spoon.test.fieldaccesses.testclasses", "TargetedAccessPosition");
List<CtFieldAccess<?>> vars = type.getElements(
new TypeFilter<CtFieldAccess<?>>(CtFieldAccess.class));
//vars is [t.ta.ta, t.ta]
Expand Down Expand Up @@ -185,7 +187,7 @@ public void testFieldAccessInLambda() throws Exception {
assertEquals("LOG", logFieldAccess.getVariable().getSimpleName());
assertEquals(MyClass.class, logFieldAccess.getVariable().getDeclaringType().getActualClass());

String expectedLambda = "() -> {" + System.lineSeparator() + " spoon.test.fieldaccesses.MyClass.LOG.info(\"bla\");" + System.lineSeparator() + "}";
String expectedLambda = "() -> {" + System.lineSeparator() + " spoon.test.fieldaccesses.testclasses.MyClass.LOG.info(\"bla\");" + System.lineSeparator() + "}";
assertEquals(expectedLambda, logFieldAccess.getParent(CtLambda.class).toString());
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package spoon.test.fieldaccesses;
package spoon.test.fieldaccesses.testclasses;

public class BCUBug20140402 {
Object[] data = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package spoon.test.fieldaccesses;
package spoon.test.fieldaccesses.testclasses;

public class BUG20160112 {
BUG20160112 a;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package spoon.test.fieldaccesses;
package spoon.test.fieldaccesses.testclasses;

public class Mouse {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package spoon.test.fieldaccesses;
package spoon.test.fieldaccesses.testclasses;

import java.util.logging.Logger;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package spoon.test.fieldaccesses;
package spoon.test.fieldaccesses.testclasses;

public class TargetedAccessPosition {
public TargetedAccessPosition ta;
Expand Down