-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add codes and tests for unsolved field access
- Loading branch information
1 parent
85741c1
commit 90a4b52
Showing
24 changed files
with
348 additions
and
7 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
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
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
18 changes: 18 additions & 0 deletions
18
src/test/java/org/checkerframework/specimin/UnsolvedStaticQualifiedField.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,18 @@ | ||
package org.checkerframework.specimin; | ||
|
||
import org.junit.Test; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* This test checks that if Specimin will work if there is an unsolved, static field in a qualified name form used by a target method. | ||
*/ | ||
public class UnsolvedStaticQualifiedField { | ||
@Test | ||
public void runTest() throws IOException { | ||
SpeciminTestExecutor.runTestWithoutJarPaths( | ||
"unsolvedstaticqualifiedfield", | ||
new String[] {"com/example/Foo.java"}, | ||
new String[] {"com.example.Foo#bar()"}); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/test/java/org/checkerframework/specimin/UnsolvedStaticSimpleField.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,18 @@ | ||
package org.checkerframework.specimin; | ||
|
||
import org.junit.Test; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* This test checks that if Specimin will work if there is an unsolved, static field in a simple name form used by target methods | ||
*/ | ||
public class UnsolvedStaticSimpleField { | ||
@Test | ||
public void runTest() throws IOException { | ||
SpeciminTestExecutor.runTestWithoutJarPaths( | ||
"unsolvedstaticsimplefield", | ||
new String[] {"com/example/Foo.java"}, | ||
new String[] {"com.example.Foo#bar()"}); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/test/java/org/checkerframework/specimin/UnsolvedStaticSimplePrimitiveField.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,18 @@ | ||
package org.checkerframework.specimin; | ||
|
||
import org.junit.Test; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* This test checks that if Specimin will work if there is an unsolved, static field in a simple name form with a primitive type. | ||
*/ | ||
public class UnsolvedStaticSimplePrimitiveField { | ||
@Test | ||
public void runTest() throws IOException { | ||
SpeciminTestExecutor.runTestWithoutJarPaths( | ||
"unsolvedstaticsimpleprimitivefield", | ||
new String[] {"com/example/Foo.java"}, | ||
new String[] {"com.example.Foo#bar()"}); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/test/resources/unsolvednonstaticfield/expected/com/example/Foo.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,11 @@ | ||
package com.example; | ||
|
||
import org.sampling.Baz; | ||
|
||
class Foo { | ||
|
||
void test() { | ||
Baz testing = new Baz(); | ||
testing.cal.doAddition(); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/test/resources/unsolvednonstaticfield/expected/org/sampling/Baz.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,10 @@ | ||
package org.sampling; | ||
|
||
public class Baz { | ||
|
||
public OrgSamplingBazCalType cal; | ||
|
||
public Baz() { | ||
throw new Error(); | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
src/test/resources/unsolvednonstaticfield/expected/org/sampling/DoAdditionReturnType.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,4 @@ | ||
package org.sampling; | ||
|
||
public class DoAdditionReturnType { | ||
} |
8 changes: 8 additions & 0 deletions
8
src/test/resources/unsolvednonstaticfield/expected/org/sampling/OrgSamplingBazCalType.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,8 @@ | ||
package org.sampling; | ||
|
||
public class OrgSamplingBazCalType { | ||
|
||
public DoAdditionReturnType doAddition() { | ||
throw new Error(); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/test/resources/unsolvednonstaticfield/input/com/example/Foo.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,8 @@ | ||
package com.example; | ||
import org.sampling.Baz; | ||
class Foo { | ||
void test() { | ||
Baz testing = new Baz(); | ||
testing.cal.doAddition(); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/test/resources/unsolvedstaticqualifiedfield/expected/com/example/Foo.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,8 @@ | ||
package com.example; | ||
|
||
class Foo { | ||
|
||
void bar() { | ||
org.sampling.Baz.myField.doAddition(); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/test/resources/unsolvedstaticqualifiedfield/expected/org/sampling/Baz.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,6 @@ | ||
package org.sampling; | ||
|
||
public class Baz { | ||
|
||
public static OrgSamplingBazMyFieldType myField; | ||
} |
4 changes: 4 additions & 0 deletions
4
...st/resources/unsolvedstaticqualifiedfield/expected/org/sampling/DoAdditionReturnType.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,4 @@ | ||
package org.sampling; | ||
|
||
public class DoAdditionReturnType { | ||
} |
8 changes: 8 additions & 0 deletions
8
...sources/unsolvedstaticqualifiedfield/expected/org/sampling/OrgSamplingBazMyFieldType.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,8 @@ | ||
package org.sampling; | ||
|
||
public class OrgSamplingBazMyFieldType { | ||
|
||
public DoAdditionReturnType doAddition() { | ||
throw new Error(); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/test/resources/unsolvedstaticqualifiedfield/input/com/example/Foo.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,8 @@ | ||
package com.example; | ||
|
||
class Foo { | ||
void bar() { | ||
org.sampling.Baz.myField.doAddition(); | ||
} | ||
} | ||
|
Oops, something went wrong.