Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
impl/src/test/java/org/jboss/forge/test/parser/java/JavaSourceCompatibilityTest.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,28 @@ | ||
package org.jboss.forge.test.parser.java; | ||
|
||
import org.jboss.forge.parser.JavaParser; | ||
import org.jboss.forge.parser.java.JavaClass; | ||
import org.jboss.forge.parser.java.JavaSource; | ||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
public class JavaSourceCompatibilityTest { | ||
|
||
@Test | ||
public void testSupportsGenericsSource() throws Exception { | ||
JavaSource<?> source = JavaParser.parse("public class Test{public void test() {java.util.List<String> s = new java.util.ArrayList<String>(); for (String item : s){}}}"); | ||
Assert.assertFalse(source.hasSyntaxErrors()); | ||
} | ||
@Test | ||
public void testSupportsGenericsSourceFromConstructor() throws Exception { | ||
JavaSource<?> source = JavaParser.parse("public class Test{public Test() {java.util.List<String> s = new java.util.ArrayList<String>(); for (String item : s){}}}"); | ||
Assert.assertFalse(source.hasSyntaxErrors()); | ||
} | ||
|
||
@Test | ||
public void testSupportsGenericsSourceFromMethod() throws Exception { | ||
JavaClass source = JavaParser.parse(JavaClass.class,"public class Test{}"); | ||
source.addMethod("public void test() {java.util.List<String> s = new java.util.ArrayList<String>(); for (String item : s){}}"); | ||
Assert.assertFalse(source.hasSyntaxErrors()); | ||
} | ||
} |