forked from INRIA/spoon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(SniperJavaPrettyPrinter): add javax related error (issue INRIA#3321
) (INRIA#3324)
- Loading branch information
Showing
6 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
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
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,16 @@ | ||
package spoon.test.issue3321; | ||
|
||
import spoon.processing.AbstractProcessor; | ||
import spoon.reflect.declaration.CtClass; | ||
|
||
/** | ||
* @author Gibah Joseph | ||
* Email: gibahjoe@gmail.com | ||
* Apr, 2020 | ||
**/ | ||
public class CtClassProcessor extends AbstractProcessor<CtClass> { | ||
@Override | ||
public void process(CtClass element) { | ||
|
||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/test/java/spoon/test/issue3321/SniperPrettyPrinterJavaxTest.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,31 @@ | ||
package spoon.test.issue3321; | ||
|
||
import org.junit.Test; | ||
import org.junit.Ignore; | ||
import spoon.Launcher; | ||
import spoon.compiler.Environment; | ||
import spoon.support.sniper.SniperJavaPrettyPrinter; | ||
import spoon.test.GitHubIssue; | ||
|
||
/** | ||
* @author Gibah Joseph | ||
* Email: gibahjoe@gmail.com | ||
* Apr, 2020 | ||
**/ | ||
public class SniperPrettyPrinterJavaxTest { | ||
@Test | ||
@GitHubIssue(issueNumber = 3321) | ||
@Ignore("UnresolvedBug") | ||
public void testThatCanGenerateSniperPrettyPrintedSourceForJavaxAnnotatedClasses() { | ||
final Launcher l = new Launcher(); | ||
Environment e = l.getEnvironment(); | ||
|
||
e.setPrettyPrinterCreator(() -> new SniperJavaPrettyPrinter(e)); | ||
e.setNoClasspath(true); | ||
e.setAutoImports(true); | ||
l.addProcessor(new CtClassProcessor()); | ||
l.addInputResource("src/test/java/spoon/test/issue3321/source/JavaxImportTestSource.java"); | ||
l.setSourceOutputDirectory("src/test/resources"); | ||
l.run(); | ||
} | ||
} |
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,9 @@ | ||
package spoon.test.issue3321; | ||
|
||
/** | ||
* @author Gibah Joseph | ||
* Email: gibahjoe@gmail.com | ||
* Apr, 2020 | ||
**/ | ||
public class SomeObjectDto { | ||
} |
39 changes: 39 additions & 0 deletions
39
src/test/java/spoon/test/issue3321/source/JavaxImportTestSource.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,39 @@ | ||
package spoon.test.issue3321.source; | ||
|
||
import spoon.test.issue3321.SomeObjectDto; | ||
|
||
import javax.validation.Valid; | ||
import javax.validation.constraints.NotNull; | ||
|
||
/** | ||
* @author Gibah Joseph | ||
* Email: gibahjoe@gmail.com | ||
* Apr, 2020 | ||
**/ | ||
public class JavaxImportTestSource { | ||
private String firstName; | ||
private String lastName; | ||
|
||
public String getFirstName() { | ||
return firstName; | ||
} | ||
|
||
public JavaxImportTestSource setObject(@NotNull @Valid SomeObjectDto someObjectDto) { | ||
|
||
return this; | ||
} | ||
|
||
public JavaxImportTestSource setFirstName(@NotNull @Valid String firstName) { | ||
this.firstName = firstName; | ||
return this; | ||
} | ||
|
||
public String getLastName() { | ||
return lastName; | ||
} | ||
|
||
public JavaxImportTestSource setLastName(String lastName) { | ||
this.lastName = lastName; | ||
return this; | ||
} | ||
} |
Empty file.