Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mbenson committed Aug 6, 2013
2 parents 31b11ca + dfced4a commit 7866ab0
Showing 1 changed file with 28 additions and 0 deletions.
@@ -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());
}
}

0 comments on commit 7866ab0

Please sign in to comment.