aboutsummaryrefslogtreecommitdiff
path: root/javaparser-symbol-solver-testing
diff options
context:
space:
mode:
authorFederico Tomassetti <federico@tomassetti.me>2018-01-10 17:07:46 +0100
committerFederico Tomassetti <federico@tomassetti.me>2018-01-10 17:07:46 +0100
commit1a4090914e1d808fa01f0ee1fb644ae18b4c2b05 (patch)
tree218664018f18a4d901466a4c98ebfb450e90d610 /javaparser-symbol-solver-testing
parent5b6a12815069b7039dd1c3c7c3b31a022e35758d (diff)
downloadjavaparser-1a4090914e1d808fa01f0ee1fb644ae18b4c2b05.tar.gz
handling remaining JDK9 differences for JSS tests
Diffstat (limited to 'javaparser-symbol-solver-testing')
-rw-r--r--javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/AnalyseNewJavaParserTest.java12
-rw-r--r--javaparser-symbol-solver-testing/src/test/resources/javaparser_methodcalls_expected_output/com_github_javaparser_ast_Modifier_J9.txt4
-rw-r--r--javaparser-symbol-solver-testing/src/test/resources/javasymbolsolver_0_6_0/expected_output/java-symbol-solver-core/com_github_javaparser_symbolsolver_javaparsermodel_TypeExtractor_J9.txt2
-rw-r--r--javaparser-symbol-solver-testing/src/test/resources/javasymbolsolver_0_6_0/expected_output/java-symbol-solver-model/com_github_javaparser_symbolsolver_model_typesystem_PrimitiveType_J9.txt33
4 files changed, 49 insertions, 2 deletions
diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/AnalyseNewJavaParserTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/AnalyseNewJavaParserTest.java
index c033a4d2d..a06dd058d 100644
--- a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/AnalyseNewJavaParserTest.java
+++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/AnalyseNewJavaParserTest.java
@@ -71,9 +71,19 @@ public class AnalyseNewJavaParserTest extends AbstractResolutionTest {
sourceFileInfoExtractor.solveMethodCalls(sourceFile);
String output = outErrStream.toString();
- String path = adaptPath(new File("src/test/resources/javaparser_methodcalls_expected_output")).getPath() + "/" + fileName.replaceAll("/", "_") + ".txt";
+ File expectedOutput = new File("src/test/resources/javaparser_methodcalls_expected_output");
+ String path = adaptPath(expectedOutput).getPath() + "/" + fileName.replaceAll("/", "_") + ".txt";
File dstFile = new File(path);
+ if (isJava9()) {
+ String path9 = adaptPath(expectedOutput).getPath() + "/" + fileName.replaceAll("/", "_") + "_J9.txt";
+ File dstFile9 = new File(path9);
+ if (dstFile9.exists()) {
+ path = path9;
+ dstFile = dstFile9;
+ }
+ }
+
if (DEBUG && (sourceFileInfoExtractor.getKo() != 0 || sourceFileInfoExtractor.getUnsupported() != 0)) {
System.err.println(output);
}
diff --git a/javaparser-symbol-solver-testing/src/test/resources/javaparser_methodcalls_expected_output/com_github_javaparser_ast_Modifier_J9.txt b/javaparser-symbol-solver-testing/src/test/resources/javaparser_methodcalls_expected_output/com_github_javaparser_ast_Modifier_J9.txt
new file mode 100644
index 000000000..c17b5bfce
--- /dev/null
+++ b/javaparser-symbol-solver-testing/src/test/resources/javaparser_methodcalls_expected_output/com_github_javaparser_ast_Modifier_J9.txt
@@ -0,0 +1,4 @@
+ Line 32) EnumSet.of(this) ==> java.util.Set.of(E...)
+ Line 36) modifiers.contains(Modifier.PUBLIC) ==> java.util.AbstractCollection.contains(java.lang.Object)
+ Line 38) modifiers.contains(Modifier.PROTECTED) ==> java.util.AbstractCollection.contains(java.lang.Object)
+ Line 40) modifiers.contains(Modifier.PRIVATE) ==> java.util.AbstractCollection.contains(java.lang.Object)
diff --git a/javaparser-symbol-solver-testing/src/test/resources/javasymbolsolver_0_6_0/expected_output/java-symbol-solver-core/com_github_javaparser_symbolsolver_javaparsermodel_TypeExtractor_J9.txt b/javaparser-symbol-solver-testing/src/test/resources/javasymbolsolver_0_6_0/expected_output/java-symbol-solver-core/com_github_javaparser_symbolsolver_javaparsermodel_TypeExtractor_J9.txt
index 9291a06b5..28c113fd7 100644
--- a/javaparser-symbol-solver-testing/src/test/resources/javasymbolsolver_0_6_0/expected_output/java-symbol-solver-core/com_github_javaparser_symbolsolver_javaparsermodel_TypeExtractor_J9.txt
+++ b/javaparser-symbol-solver-testing/src/test/resources/javasymbolsolver_0_6_0/expected_output/java-symbol-solver-core/com_github_javaparser_symbolsolver_javaparsermodel_TypeExtractor_J9.txt
@@ -40,7 +40,7 @@
Line 146) node.getType() ==> com.github.javaparser.ast.expr.ClassExpr.getType()
Line 147) facade.convertToUsage(astType, node.getType()) ==> com.github.javaparser.symbolsolver.javaparsermodel.JavaParserFacade.convertToUsage(com.github.javaparser.ast.type.Type, com.github.javaparser.ast.Node)
Line 147) node.getType() ==> com.github.javaparser.ast.expr.ClassExpr.getType()
- Line 148) ImmutableList.of(jssType) ==> com.google.common.collect.ImmutableList.of(E)
+ Line 148) ImmutableList.of(jssType) ==> java.util.List.of(E...)
Line 153) node.getThenExpr().accept(this, solveLambdas) ==> com.github.javaparser.ast.visitor.Visitable.accept(com.github.javaparser.ast.visitor.GenericVisitor<R, A>, A)
Line 153) node.getThenExpr() ==> com.github.javaparser.ast.expr.ConditionalExpr.getThenExpr()
Line 158) node.getInner().accept(this, solveLambdas) ==> com.github.javaparser.ast.visitor.Visitable.accept(com.github.javaparser.ast.visitor.GenericVisitor<R, A>, A)
diff --git a/javaparser-symbol-solver-testing/src/test/resources/javasymbolsolver_0_6_0/expected_output/java-symbol-solver-model/com_github_javaparser_symbolsolver_model_typesystem_PrimitiveType_J9.txt b/javaparser-symbol-solver-testing/src/test/resources/javasymbolsolver_0_6_0/expected_output/java-symbol-solver-model/com_github_javaparser_symbolsolver_model_typesystem_PrimitiveType_J9.txt
new file mode 100644
index 000000000..57a7c2a04
--- /dev/null
+++ b/javaparser-symbol-solver-testing/src/test/resources/javasymbolsolver_0_6_0/expected_output/java-symbol-solver-model/com_github_javaparser_symbolsolver_model_typesystem_PrimitiveType_J9.txt
@@ -0,0 +1,33 @@
+ Line 32) Byte.class.getCanonicalName() ==> java.lang.Class.getCanonicalName()
+ Line 32) ImmutableList.of() ==> com.google.common.collect.ImmutableList.of()
+ Line 33) Short.class.getCanonicalName() ==> java.lang.Class.getCanonicalName()
+ Line 33) ImmutableList.of(BYTE) ==> java.util.List.of(E...)
+ Line 34) Character.class.getCanonicalName() ==> java.lang.Class.getCanonicalName()
+ Line 34) ImmutableList.of() ==> com.google.common.collect.ImmutableList.of()
+ Line 35) Integer.class.getCanonicalName() ==> java.lang.Class.getCanonicalName()
+ Line 35) ImmutableList.of(BYTE, SHORT, CHAR) ==> java.util.List.of(E...)
+ Line 36) Long.class.getCanonicalName() ==> java.lang.Class.getCanonicalName()
+ Line 36) ImmutableList.of(BYTE, SHORT, INT, CHAR) ==> java.util.List.of(E...)
+ Line 37) Boolean.class.getCanonicalName() ==> java.lang.Class.getCanonicalName()
+ Line 37) ImmutableList.of() ==> com.google.common.collect.ImmutableList.of()
+ Line 38) Float.class.getCanonicalName() ==> java.lang.Class.getCanonicalName()
+ Line 38) ImmutableList.of(LONG, INT, SHORT, BYTE, CHAR) ==> java.util.List.of(E...)
+ Line 39) Double.class.getCanonicalName() ==> java.lang.Class.getCanonicalName()
+ Line 39) ImmutableList.of(FLOAT, LONG, INT, SHORT, BYTE, CHAR) ==> java.util.List.of(E...)
+ Line 40) ImmutableList.of(INT, BOOLEAN, LONG, CHAR, FLOAT, DOUBLE, SHORT, BYTE) ==> java.util.List.of(E...)
+ Line 57) name.toLowerCase() ==> java.lang.String.toLowerCase()
+ Line 59) ptu.describe().equals(name) ==> java.lang.String.equals(java.lang.Object)
+ Line 59) ptu.describe() ==> com.github.javaparser.symbolsolver.model.typesystem.PrimitiveType.describe()
+ Line 104) other.isPrimitive() ==> com.github.javaparser.symbolsolver.model.typesystem.Type.isPrimitive()
+ Line 105) promotionTypes.contains(other) ==> java.util.List.contains(java.lang.Object)
+ Line 106) other.isReferenceType() ==> com.github.javaparser.symbolsolver.model.typesystem.Type.isReferenceType()
+ Line 107) other.asReferenceType().getQualifiedName().equals(boxTypeQName) ==> java.lang.String.equals(java.lang.Object)
+ Line 107) other.asReferenceType().getQualifiedName() ==> com.github.javaparser.symbolsolver.model.typesystem.ReferenceType.getQualifiedName()
+ Line 107) other.asReferenceType() ==> com.github.javaparser.symbolsolver.model.typesystem.Type.asReferenceType()
+ Line 111) other.asReferenceType().getQualifiedName().equals(promotion.boxTypeQName) ==> java.lang.String.equals(java.lang.Object)
+ Line 111) other.asReferenceType().getQualifiedName() ==> com.github.javaparser.symbolsolver.model.typesystem.ReferenceType.getQualifiedName()
+ Line 111) other.asReferenceType() ==> com.github.javaparser.symbolsolver.model.typesystem.Type.asReferenceType()
+ Line 116) other.isConstraint() ==> com.github.javaparser.symbolsolver.model.typesystem.Type.isConstraint()
+ Line 117) this.isAssignableBy(other.asConstraintType().getBound()) ==> com.github.javaparser.symbolsolver.model.typesystem.PrimitiveType.isAssignableBy(com.github.javaparser.symbolsolver.model.typesystem.Type)
+ Line 117) other.asConstraintType().getBound() ==> com.github.javaparser.symbolsolver.model.typesystem.LambdaConstraintType.getBound()
+ Line 117) other.asConstraintType() ==> com.github.javaparser.symbolsolver.model.typesystem.Type.asConstraintType()