Skip to content

Commit

Permalink
Add Ellipsis support test
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Feb 24, 2017
1 parent b736f44 commit 2ff2b5e
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,18 @@ public void testPreserveParameterGenericTypes() throws Exception
newMethod.addParameter("Class<T>", "as");
Assert.assertThat(clazz.toString(), containsString("public final <T> T name(int index, Class<T> as)"));
}

@Test
public void testEllipsisSupport() throws Exception
{
JavaClassSource clazz = Roaster.create(JavaClassSource.class).setName("TestClass");
final MethodSource<JavaClassSource> newMethod = clazz.addMethod()
.setName("name")
.setPublic()
.setReturnTypeVoid()
.setFinal(true);
newMethod.addParameter("String", "name").setVarArgs(true);
Assert.assertThat(clazz.toString(), containsString("public final void name(String... name)"));
}

}

0 comments on commit 2ff2b5e

Please sign in to comment.