Skip to content

Commit

Permalink
Cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
matozoid committed Dec 21, 2018
1 parent 676761e commit 6741cdb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Expand Up @@ -152,7 +152,7 @@ public void annotationDeclarationNameExampleModified() throws IOException {
}

@Test
public void annotationDeclaratioJavadocExampleOriginal() throws IOException {
public void annotationDeclarationJavadocExampleOriginal() throws IOException {
considerExample("AnnotationDeclaration_Example3_original");
AnnotationDeclaration annotationDeclaration = (AnnotationDeclaration)cu.getType(0);
CsmElement element = ConcreteSyntaxModel.forClass(annotationDeclaration.getClass());
Expand Down Expand Up @@ -185,7 +185,7 @@ public void annotationDeclaratioJavadocExampleOriginal() throws IOException {
}

@Test
public void annotationDeclaratioJavadocExampleAddingJavadoc() throws IOException {
public void annotationDeclarationJavadocExampleAddingJavadoc() throws IOException {
considerExample("AnnotationDeclaration_Example3_original");
AnnotationDeclaration annotationDeclaration = (AnnotationDeclaration)cu.getType(0);
CsmElement element = ConcreteSyntaxModel.forClass(annotationDeclaration.getClass());
Expand Down
Expand Up @@ -78,15 +78,15 @@ public void example7() throws IOException {
@Test
public void example8() throws IOException {
considerExample("Example8_original");
FieldDeclaration fd = (FieldDeclaration) cu.getClassByName("A").get().getMember(0).asFieldDeclaration();
FieldDeclaration fd = cu.getClassByName("A").get().getMember(0).asFieldDeclaration();
fd.addVariable(new VariableDeclarator(PrimitiveType.intType(), "b"));
assertTransformed("Example8", cu);
}

@Test
public void example9() throws IOException {
considerExample("Example9_original");
FieldDeclaration fd = (FieldDeclaration) cu.getClassByName("A").get().getMember(0).asFieldDeclaration();
FieldDeclaration fd = cu.getClassByName("A").get().getMember(0).asFieldDeclaration();
fd.addVariable(new VariableDeclarator(new ArrayType(PrimitiveType.intType()), "b"));
assertTransformed("Example9", cu);
}
Expand All @@ -101,15 +101,15 @@ public void example10() throws IOException {
@Test
public void exampleParam1() throws IOException {
considerExample("Example_param1_original");
MethodDeclaration md = (MethodDeclaration) cu.getClassByName("A").get().getMember(0).asMethodDeclaration();
MethodDeclaration md = cu.getClassByName("A").get().getMember(0).asMethodDeclaration();
md.addParameter("int", "p1");
assertTransformed("Example_param1", cu);
}

@Test
public void exampleParam2() throws IOException {
considerExample("Example_param1_original");
MethodDeclaration md = (MethodDeclaration) cu.getClassByName("A").get().getMember(0).asMethodDeclaration();
MethodDeclaration md = cu.getClassByName("A").get().getMember(0).asMethodDeclaration();
md.addParameter(new ArrayType(PrimitiveType.intType()), "p1");
md.addParameter("char", "p2");
assertTransformed("Example_param2", cu);
Expand All @@ -118,23 +118,23 @@ public void exampleParam2() throws IOException {
@Test
public void exampleParam3() throws IOException {
considerExample("Example_param3_original");
MethodDeclaration md = (MethodDeclaration) cu.getClassByName("A").get().getMember(0).asMethodDeclaration();
MethodDeclaration md = cu.getClassByName("A").get().getMember(0).asMethodDeclaration();
md.getParameters().remove(0);
assertTransformed("Example_param3", cu);
}

@Test
public void exampleParam4() throws IOException {
considerExample("Example_param3_original");
MethodDeclaration md = (MethodDeclaration) cu.getClassByName("A").get().getMember(0).asMethodDeclaration();
MethodDeclaration md = cu.getClassByName("A").get().getMember(0).asMethodDeclaration();
md.getParameters().remove(1);
assertTransformed("Example_param4", cu);
}

@Test
public void exampleParam5() throws IOException {
considerExample("Example_param3_original");
MethodDeclaration md = (MethodDeclaration) cu.getClassByName("A").get().getMember(0).asMethodDeclaration();
MethodDeclaration md = cu.getClassByName("A").get().getMember(0).asMethodDeclaration();
md.setType(PrimitiveType.intType());
assertTransformed("Example_param5b", cu);
md.getBody().get().getStatements().add(new ReturnStmt(new NameExpr("p1")));
Expand Down

0 comments on commit 6741cdb

Please sign in to comment.