├── cute
└── src
│ ├── test
│ ├── resources
│ │ ├── compiletests
│ │ │ ├── classpathtest
│ │ │ │ ├── AR
│ │ │ │ ├── BR
│ │ │ │ └── resourceFile.txt
│ │ │ ├── tata.txt
│ │ │ ├── TestClass.java
│ │ │ ├── javafileobjectutilstest
│ │ │ │ └── JavaSourceFromResourceTestClass.java
│ │ │ ├── withmultiplerelatedsourcefiles
│ │ │ │ ├── JustOutput.java
│ │ │ │ └── TestClassWithImplementedInterface.java
│ │ │ ├── generatedclasstest
│ │ │ │ └── TestClass.java
│ │ │ ├── exceptionthrown
│ │ │ │ └── ExceptionThrownUsecase.java
│ │ │ ├── passintest
│ │ │ │ ├── PassInTestClass.java
│ │ │ │ ├── PassInTestClassMultipleAnnotatedWithoutPassIn.java
│ │ │ │ └── PassInTestClassMultipleAnnotatedWithMultiplePassIn.java
│ │ │ └── compileroptionstest
│ │ │ │ └── Java8Code.java
│ │ ├── TestClass.java
│ │ ├── integrationtest
│ │ │ ├── AnnotationProcessorAppliedTestClass.java
│ │ │ └── CompiledClassesAndGeneratedFilesExistTestcase.java
│ │ ├── BrokenTestClass.java
│ │ ├── TestClassWithInnerClasses.java
│ │ ├── TestClassWithImplementedInterface.java
│ │ └── AnnotationProcessorUnitTestTestClass.java
│ └── java
│ │ └── io
│ │ └── toolisticon
│ │ └── cute
│ │ ├── testcases
│ │ ├── SimpleTestInterface.java
│ │ ├── TestAnnotationProcessor.java
│ │ └── TestAnnotationProcessorWithMissingNoArgConstructor.java
│ │ ├── common
│ │ ├── SimpleTestProcessor1Interface.java
│ │ ├── ExceptionThrowerAnnotation.java
│ │ ├── SimpleTestAnnotation2.java
│ │ ├── SimpleTestAnnotation3.java
│ │ ├── SimpleTestAnnotation1.java
│ │ ├── SimpleTestProcessor2.java
│ │ ├── SimpleTestProcessor3.java
│ │ ├── ExceptionThrowerProcessor.java
│ │ └── SimpleTestProcessor1.java
│ │ ├── matchers
│ │ ├── RegexGeneratedFileObjectMatcherTest.java
│ │ ├── WellFormedXmlGerneratedFileObjectMatcherTest.java
│ │ ├── BinaryGeneratedFileObjectMatcherTest.java
│ │ ├── IgnoreLineEndingsGeneratedFileObjectMatcherTest.java
│ │ ├── ContainsStringsGeneratedFileObjectMatcherTest.java
│ │ └── CoreGeneratedFileObjectMatchersTest.java
│ │ ├── TestUtilities.java
│ │ ├── FileObjectUtilsTest.java
│ │ ├── integrationtest
│ │ └── ProcessorWasAppliedTest.java
│ │ └── CompilerMessageCheckTest.java
│ └── main
│ ├── java
│ └── io
│ │ └── toolisticon
│ │ └── cute
│ │ ├── package-info.java
│ │ ├── CuteClassLoader.java
│ │ ├── GeneratedClassesTest.java
│ │ ├── UnitTestBase.java
│ │ ├── GeneratedClassesTestForSpecificClass.java
│ │ ├── PassIn.java
│ │ ├── InvalidTestConfigurationException.java
│ │ ├── FailingAssertionException.java
│ │ ├── TestAnnotation.java
│ │ ├── UnitTestWithoutPassIn.java
│ │ ├── GeneratedFileObjectMatcher.java
│ │ ├── Java9SupportCheck.java
│ │ ├── CommonUtilities.java
│ │ ├── UnitTestForTestingAnnotationProcessorsWithoutPassIn.java
│ │ ├── UnitTest.java
│ │ ├── UnitTestForTestingAnnotationProcessors.java
│ │ ├── matchers
│ │ ├── ContainsStringsGeneratedFileObjectMatcher.java
│ │ ├── RegexGeneratedFileObjectMatcher.java
│ │ ├── WellFormedXmlGeneratedFileObjectMatcher.java
│ │ ├── BinaryGeneratedFileObjectMatcher.java
│ │ ├── CoreGeneratedFileObjectMatchers.java
│ │ └── IgnoreLineEndingsGeneratedFileObjectMatcher.java
│ │ ├── UnitTestAnnotationProcessorClassWithPassIn.java
│ │ ├── CompilationResult.java
│ │ ├── UnitTestAnnotationProcessorClassWithoutPassIn.java
│ │ ├── UnitTestAnnotationProcessorClass.java
│ │ ├── CuteClassLoaderImpl.java
│ │ ├── AbstractUnitTestAnnotationProcessorClass.java
│ │ ├── UnitTestAnnotationProcessorClassForTestingAnnotationProcessorsWithoutPassIn.java
│ │ ├── UnitTestAnnotationProcessorClassForTestingAnnotationProcessorsWithPassIn.java
│ │ ├── UnitTestAnnotationProcessorClassForTestingAnnotationProcessors.java
│ │ ├── CompileTestUtilities.java
│ │ └── AbstractUnitTestAnnotationProcessorWithPassIn.java
│ └── resources
│ └── AnnotationProcessorUnitTestClass.java
├── .mvn
└── wrapper
│ ├── maven-wrapper.jar
│ └── maven-wrapper.properties
├── .gitignore
├── legacy
├── src
│ └── test
│ │ ├── resources
│ │ └── compiletests
│ │ │ ├── TestClass.java
│ │ │ ├── javafileobjectutilstest
│ │ │ └── JavaSourceFromResourceTestClass.java
│ │ │ └── passintest
│ │ │ ├── PassInTestClass.java
│ │ │ ├── PassInTestClassMultipleAnnotatedWithoutPassIn.java
│ │ │ └── PassInTestClassMultipleAnnotatedWithMultiplePassIn.java
│ │ └── java
│ │ └── io
│ │ └── toolisticon
│ │ └── cute
│ │ └── common
│ │ ├── SimpleTestAnnotation1.java
│ │ ├── SimpleTestAnnotation2.java
│ │ ├── SimpleTestAnnotation3.java
│ │ ├── SimpleTestProcessor2.java
│ │ ├── SimpleTestProcessor3.java
│ │ └── SimpleTestProcessor1.java
└── pom.xml
├── doRelease.sh
├── config
└── findbugs-excludes.xml
├── integration-test
├── java9
│ ├── regularTestModule
│ │ ├── src
│ │ │ └── main
│ │ │ │ └── java
│ │ │ │ ├── module-info.java
│ │ │ │ └── io
│ │ │ │ └── toolisticon
│ │ │ │ └── cute
│ │ │ │ └── integrationtest
│ │ │ │ └── javanine
│ │ │ │ └── regularmodule
│ │ │ │ ├── notexported
│ │ │ │ └── NotExportedClass.java
│ │ │ │ └── RegularModuleTestClass.java
│ │ ├── pom.xml
│ │ └── pom.xml.releaseBackup
│ ├── test
│ │ ├── src
│ │ │ └── test
│ │ │ │ ├── resources
│ │ │ │ └── testcases
│ │ │ │ │ ├── unitTest
│ │ │ │ │ ├── module-info.java
│ │ │ │ │ └── Test.java
│ │ │ │ │ ├── bindNamedAutomaticJavaModule
│ │ │ │ │ ├── module-info.java
│ │ │ │ │ └── Test.java
│ │ │ │ │ ├── accessNotExportedClass
│ │ │ │ │ ├── module-info.java
│ │ │ │ │ └── Test.java
│ │ │ │ │ ├── bindRegularJavaModule
│ │ │ │ │ ├── module-info.java
│ │ │ │ │ └── Test.java
│ │ │ │ │ └── bindUnnamedAutomaticJavaModule
│ │ │ │ │ ├── module-info.java
│ │ │ │ │ └── Test.java
│ │ │ │ └── java
│ │ │ │ └── io
│ │ │ │ └── toolisticon
│ │ │ │ └── cute
│ │ │ │ └── integrationtest
│ │ │ │ └── java9
│ │ │ │ └── IntegrationTest.java
│ │ ├── pom.xml
│ │ └── pom.xml.releaseBackup
│ ├── namedAutomaticModule
│ │ ├── src
│ │ │ └── main
│ │ │ │ └── java
│ │ │ │ └── io
│ │ │ │ └── toolisticon
│ │ │ │ └── cute
│ │ │ │ └── integrationtest
│ │ │ │ └── javanine
│ │ │ │ └── namednonmodule
│ │ │ │ └── NamedAutomaticModuleTestClass.java
│ │ ├── pom.xml
│ │ └── pom.xml.releaseBackup
│ ├── unnamedAutomaticModule
│ │ ├── src
│ │ │ └── main
│ │ │ │ └── java
│ │ │ │ └── io
│ │ │ │ └── toolisticon
│ │ │ │ └── cute
│ │ │ │ └── integrationtest
│ │ │ │ └── javanine
│ │ │ │ └── unnamednonmodule
│ │ │ │ └── UnnamedAutomaticModuleTestClass.java
│ │ ├── pom.xml
│ │ └── pom.xml.releaseBackup
│ ├── pom.xml
│ └── pom.xml.releaseBackup
├── junit4
│ ├── pom.xml
│ ├── pom.xml.releaseBackup
│ └── src
│ │ └── test
│ │ └── java
│ │ └── io
│ │ └── toolisticon
│ │ └── cute
│ │ └── integrationtest
│ │ └── junit4
│ │ └── Junit4Test.java
├── testng
│ ├── pom.xml
│ ├── pom.xml.releaseBackup
│ └── src
│ │ └── test
│ │ └── java
│ │ └── io
│ │ └── toolisticon
│ │ └── cute
│ │ └── integrationtest
│ │ └── testng
│ │ └── TestNgTest.java
├── junit5
│ ├── pom.xml
│ ├── pom.xml.releaseBackup
│ └── src
│ │ └── test
│ │ └── java
│ │ └── io
│ │ └── toolisticon
│ │ └── cute
│ │ └── integrationtest
│ │ └── junit5
│ │ └── Junit5Test.java
├── pom.xml
└── pom.xml.releaseBackup
├── extension
├── api
│ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── io
│ │ │ └── toolisticon
│ │ │ └── cute
│ │ │ └── extension
│ │ │ └── api
│ │ │ ├── ModuleSupportSpi.java
│ │ │ └── AssertionSpi.java
│ ├── pom.xml
│ └── pom.xml.releaseBackup
├── testng
│ ├── src
│ │ ├── main
│ │ │ └── java
│ │ │ │ └── io
│ │ │ │ └── toolisticon
│ │ │ │ └── cute
│ │ │ │ └── extension
│ │ │ │ └── testng
│ │ │ │ └── TestNGAssertion.java
│ │ └── test
│ │ │ └── java
│ │ │ └── io
│ │ │ └── toolisticon
│ │ │ └── cute
│ │ │ └── extension
│ │ │ └── testng
│ │ │ └── TestNGAssertionTest.java
│ └── pom.xml
├── junit5
│ ├── src
│ │ ├── main
│ │ │ └── java
│ │ │ │ └── io
│ │ │ │ └── toolisticon
│ │ │ │ └── cute
│ │ │ │ └── extension
│ │ │ │ └── junit5
│ │ │ │ └── JUnit5Assertion.java
│ │ └── test
│ │ │ └── java
│ │ │ └── io
│ │ │ └── toolisticon
│ │ │ └── cute
│ │ │ └── extension
│ │ │ └── junit5
│ │ │ └── JUnit5AssertionTest.java
│ └── pom.xml
├── plainjava
│ ├── src
│ │ ├── main
│ │ │ └── java
│ │ │ │ └── io
│ │ │ │ └── toolisticon
│ │ │ │ └── cute
│ │ │ │ └── extension
│ │ │ │ └── plainjava
│ │ │ │ └── AssertionErrorAssertion.java
│ │ └── test
│ │ │ └── java
│ │ │ └── io
│ │ │ └── toolisticon
│ │ │ └── cute
│ │ │ └── extension
│ │ │ └── plainjava
│ │ │ └── AssertionErrorAssertionTest.java
│ └── pom.xml
├── junit4
│ ├── src
│ │ ├── main
│ │ │ └── java
│ │ │ │ └── io
│ │ │ │ └── toolisticon
│ │ │ │ └── cute
│ │ │ │ └── extension
│ │ │ │ └── junit4
│ │ │ │ └── JUnit4Assertion.java
│ │ └── test
│ │ │ └── java
│ │ │ └── io
│ │ │ └── toolisticon
│ │ │ └── cute
│ │ │ └── extension
│ │ │ └── junit4
│ │ │ └── JUnit4AssertionTest.java
│ └── pom.xml
├── pom.xml
├── pom.xml.releaseBackup
└── modulesupport
│ └── pom.xml
├── .github
└── workflows
│ ├── default.yml
│ ├── jacoco.yml
│ └── release.yml
├── LICENSE
└── coverage
├── pom.xml
└── pom.xml.releaseBackup
/cute/src/test/resources/compiletests/classpathtest/AR:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/cute/src/test/resources/compiletests/classpathtest/BR:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/cute/src/test/resources/compiletests/tata.txt:
--------------------------------------------------------------------------------
1 | TATA!
--------------------------------------------------------------------------------
/cute/src/test/resources/compiletests/classpathtest/resourceFile.txt:
--------------------------------------------------------------------------------
1 | TATA!
--------------------------------------------------------------------------------
/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/toolisticon/cute/HEAD/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/cute/src/test/resources/compiletests/TestClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.annotationprocessortoolkit.testhelper;
2 |
3 | public class TestClass {
4 |
5 | }
6 |
7 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Build and Release Folders
2 | target
3 | .settings
4 | .project
5 | .classpath
6 | *.iml
7 | .idea
8 | atlassian-ide-plugin.xml
9 | *.factorypath
10 |
--------------------------------------------------------------------------------
/legacy/src/test/resources/compiletests/TestClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.annotationprocessortoolkit.testhelper;
2 |
3 | public class TestClass {
4 |
5 | }
6 |
7 |
--------------------------------------------------------------------------------
/doRelease.sh:
--------------------------------------------------------------------------------
1 | ./mvnw -B -Darguments="-Dmaven.deploy.skip=true" -Dmaven.test.skip=true -Dresume=false -DreleaseVersion=$1 -DdevelopmentVersion=$2 release:prepare release:perform
2 |
--------------------------------------------------------------------------------
/cute/src/test/java/io/toolisticon/cute/testcases/SimpleTestInterface.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute.testcases;
2 |
3 | public interface SimpleTestInterface {
4 | String saySomething();
5 | }
6 |
--------------------------------------------------------------------------------
/config/findbugs-excludes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/cute/src/main/java/io/toolisticon/cute/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This package contains all public classes and interfaces intentioned to be used as part of the public api.
3 | */
4 | package io.toolisticon.cute;
--------------------------------------------------------------------------------
/cute/src/test/java/io/toolisticon/cute/common/SimpleTestProcessor1Interface.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute.common;
2 |
3 | public interface SimpleTestProcessor1Interface {
4 | String getOutput ();
5 | }
6 |
--------------------------------------------------------------------------------
/cute/src/main/java/io/toolisticon/cute/CuteClassLoader.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute;
2 |
3 | public interface CuteClassLoader {
4 |
5 | Class> getClass(String binaryClassName) throws ClassNotFoundException;
6 |
7 | }
8 |
--------------------------------------------------------------------------------
/integration-test/java9/regularTestModule/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | module io.toolisticon.cute.integrationtest.javanine.regularmodule {
2 |
3 | exports io.toolisticon.cute.integrationtest.javanine.regularmodule;
4 |
5 | }
--------------------------------------------------------------------------------
/cute/src/main/java/io/toolisticon/cute/GeneratedClassesTest.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute;
2 |
3 | public interface GeneratedClassesTest {
4 |
5 | void doTests(CuteClassLoader cuteClassLoader) throws Exception;
6 |
7 | }
8 |
--------------------------------------------------------------------------------
/integration-test/java9/test/src/test/resources/testcases/unitTest/module-info.java:
--------------------------------------------------------------------------------
1 | module io.toolisticon.cute.integrationtest.javanine {
2 | exports io.toolisticon.cute.integrationtest.javanine;
3 | requires cute;
4 | }
5 |
6 |
--------------------------------------------------------------------------------
/cute/src/test/resources/compiletests/javafileobjectutilstest/JavaSourceFromResourceTestClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.annotationprocessortoolkit.testhelper.compiletest;
2 |
3 | public class JavaSourceFromResourceTestClass {
4 |
5 |
6 |
7 | }
--------------------------------------------------------------------------------
/cute/src/test/resources/compiletests/withmultiplerelatedsourcefiles/JustOutput.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute;
2 |
3 | public class JustOutput {
4 |
5 | public static String getString() {
6 | return "WHATS UP???";
7 | }
8 | }
--------------------------------------------------------------------------------
/legacy/src/test/resources/compiletests/javafileobjectutilstest/JavaSourceFromResourceTestClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.annotationprocessortoolkit.testhelper.compiletest;
2 |
3 | public class JavaSourceFromResourceTestClass {
4 |
5 |
6 |
7 | }
--------------------------------------------------------------------------------
/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.1/apache-maven-3.6.1-bin.zip
2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar
3 |
--------------------------------------------------------------------------------
/cute/src/main/java/io/toolisticon/cute/UnitTestBase.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute;
2 |
3 | /**
4 | * Base interface used to store unit tests in backing bean.
5 | * Will be later handled via instanceof.
6 | */
7 | public interface UnitTestBase {
8 | }
9 |
--------------------------------------------------------------------------------
/cute/src/test/resources/TestClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute;
2 |
3 | import io.toolisticon.cute.TestAnnotation;
4 |
5 | /**
6 | * Test class for annotation processor tools.
7 | */
8 | @TestAnnotation
9 | public class TestClass {
10 |
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/cute/src/main/java/io/toolisticon/cute/GeneratedClassesTestForSpecificClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute;
2 |
3 | public interface GeneratedClassesTestForSpecificClass {
4 |
5 | void doTests(Class> clazz, CuteClassLoader cuteClassLoader) throws Exception;
6 |
7 | }
8 |
--------------------------------------------------------------------------------
/integration-test/java9/regularTestModule/src/main/java/io/toolisticon/cute/integrationtest/javanine/regularmodule/notexported/NotExportedClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute.integrationtest.javanine.regularmodule.notexported;
2 |
3 | public class NotExportedClass {
4 |
5 | }
6 |
--------------------------------------------------------------------------------
/cute/src/test/resources/integrationtest/AnnotationProcessorAppliedTestClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute.integrationtest;
2 |
3 | import io.toolisticon.cute.common.SimpleTestAnnotation1;
4 |
5 | @SimpleTestAnnotation1
6 | public class AnnotationProcessorAppliedTestClass {
7 |
8 | }
9 |
--------------------------------------------------------------------------------
/cute/src/test/resources/integrationtest/CompiledClassesAndGeneratedFilesExistTestcase.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute.integrationtest;
2 |
3 | import io.toolisticon.cute.common.SimpleTestAnnotation1;
4 |
5 | @SimpleTestAnnotation1
6 | public class CompiledClassesAndGeneratedFilesExistTestcase {
7 |
8 |
9 | }
--------------------------------------------------------------------------------
/cute/src/test/resources/BrokenTestClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute;
2 |
3 | import io.toolisticon.cute.TestAnnotation;
4 |
5 | /**
6 | * Test class for annotation processor tools.
7 | */
8 | @TestAnnotation
9 | public class BrokenTestClass {
10 | // invalid code => leads to compiler error
11 | sdasdasd
12 | }
13 |
--------------------------------------------------------------------------------
/cute/src/main/java/io/toolisticon/cute/PassIn.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute;
2 |
3 | import java.lang.annotation.Retention;
4 | import java.lang.annotation.RetentionPolicy;
5 |
6 | /**
7 | * Annotation to mark elements to pass into unit test.
8 | */
9 | @Retention(RetentionPolicy.RUNTIME)
10 |
11 | public @interface PassIn {
12 | }
13 |
--------------------------------------------------------------------------------
/integration-test/java9/regularTestModule/src/main/java/io/toolisticon/cute/integrationtest/javanine/regularmodule/RegularModuleTestClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute.integrationtest.javanine.regularmodule;
2 |
3 | public class RegularModuleTestClass {
4 |
5 | public String testMethod() {
6 | return "OK";
7 | }
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/integration-test/java9/namedAutomaticModule/src/main/java/io/toolisticon/cute/integrationtest/javanine/namednonmodule/NamedAutomaticModuleTestClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute.integrationtest.javanine.namednonmodule;
2 |
3 | public class NamedAutomaticModuleTestClass {
4 |
5 | public String testMethod() {
6 | return "OK";
7 | }
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/integration-test/java9/test/src/test/resources/testcases/bindNamedAutomaticJavaModule/module-info.java:
--------------------------------------------------------------------------------
1 | module io.toolisticon.cute.integrationtest.javanine {
2 | requires java.compiler;
3 | requires java.logging;
4 | requires transitive integration.test.javanine.namedautomaticmodule;
5 |
6 | exports io.toolisticon.cute.integrationtest.javanine;
7 | }
8 |
9 |
--------------------------------------------------------------------------------
/cute/src/test/resources/compiletests/generatedclasstest/TestClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute.testhelper.compiletest;
2 |
3 | import io.toolisticon.cute.common.SimpleTestAnnotation1;
4 | import io.toolisticon.cute.common.SimpleTestAnnotation2;
5 |
6 | @SimpleTestAnnotation1("WORKS!!!")
7 | @SimpleTestAnnotation2
8 | public class TestClass {
9 |
10 |
11 |
12 | }
--------------------------------------------------------------------------------
/integration-test/java9/test/src/test/resources/testcases/accessNotExportedClass/module-info.java:
--------------------------------------------------------------------------------
1 | module io.toolisticon.cute.integrationtest.javanine {
2 | requires java.compiler;
3 | requires java.logging;
4 | requires transitive io.toolisticon.cute.integrationtest.javanine.regularmodule;
5 |
6 | exports io.toolisticon.cute.integrationtest.javanine;
7 | }
8 |
9 |
--------------------------------------------------------------------------------
/integration-test/java9/test/src/test/resources/testcases/bindRegularJavaModule/module-info.java:
--------------------------------------------------------------------------------
1 | module io.toolisticon.cute.integrationtest.javanine {
2 | requires java.compiler;
3 | requires java.logging;
4 | requires transitive io.toolisticon.cute.integrationtest.javanine.regularmodule;
5 |
6 | exports io.toolisticon.cute.integrationtest.javanine;
7 | }
8 |
9 |
--------------------------------------------------------------------------------
/integration-test/java9/unnamedAutomaticModule/src/main/java/io/toolisticon/cute/integrationtest/javanine/unnamednonmodule/UnnamedAutomaticModuleTestClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute.integrationtest.javanine.unnamednonmodule;
2 |
3 | public class UnnamedAutomaticModuleTestClass {
4 |
5 | public String testMethod() {
6 | return "OK";
7 | }
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/cute/src/main/resources/AnnotationProcessorUnitTestClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.compiletesting.test;
2 |
3 | import io.toolisticon.cute.TestAnnotation;
4 |
5 | /**
6 | * Test class for annotation processor tools.
7 | * Useed for as the entry point for executing unit tests.
8 | */
9 | @TestAnnotation
10 | public class AnnotationProcessorUnitTestClass {
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/cute/src/test/resources/compiletests/exceptionthrown/ExceptionThrownUsecase.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute.testhelper.compiletest;
2 |
3 | import io.toolisticon.cute.common.ExceptionThrowerAnnotation;
4 | import io.toolisticon.cute.common.SimpleTestAnnotation1;
5 |
6 | @ExceptionThrowerAnnotation
7 | @SimpleTestAnnotation1
8 | public class ExceptionThrownUsecase {
9 |
10 | }
--------------------------------------------------------------------------------
/integration-test/java9/test/src/test/resources/testcases/bindUnnamedAutomaticJavaModule/module-info.java:
--------------------------------------------------------------------------------
1 |
2 | module io.toolisticon.cute.integrationtest.javanine {
3 | requires java.compiler;
4 | requires java.logging;
5 | requires transitive integration.test.javanine.unnamedautomaticmodule;
6 |
7 | exports io.toolisticon.cute.integrationtest.javanine;
8 | }
9 |
10 |
--------------------------------------------------------------------------------
/cute/src/main/java/io/toolisticon/cute/InvalidTestConfigurationException.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute;
2 |
3 | /**
4 | * Exception thrown in case of an configuration error.
5 | */
6 | public class InvalidTestConfigurationException extends RuntimeException {
7 |
8 | public InvalidTestConfigurationException(String message) {
9 | super(message);
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/integration-test/java9/test/src/test/resources/testcases/unitTest/Test.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute.integrationtest.javanine;
2 |
3 | import io.toolisticon.cute.PassIn;
4 |
5 | @PassIn
6 | public class Test {
7 |
8 | public static void testCall() {
9 |
10 | }
11 |
12 | public static void secondTestCall(String testClass) {
13 |
14 | }
15 |
16 |
17 | }
18 |
19 |
--------------------------------------------------------------------------------
/cute/src/test/resources/compiletests/passintest/PassInTestClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.annotationprocessortoolkit.testhelper.compiletest;
2 |
3 | import io.toolisticon.cute.PassIn;
4 | import io.toolisticon.cute.TestAnnotation;
5 |
6 | @TestAnnotation
7 | public class PassInTestClass {
8 |
9 | @PassIn
10 | @TestAnnotation
11 | public static class InnerTestClass {
12 |
13 | }
14 |
15 | }
--------------------------------------------------------------------------------
/legacy/src/test/resources/compiletests/passintest/PassInTestClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.annotationprocessortoolkit.testhelper.compiletest;
2 |
3 | import io.toolisticon.cute.PassIn;
4 | import io.toolisticon.cute.TestAnnotation;
5 |
6 | @TestAnnotation
7 | public class PassInTestClass {
8 |
9 | @PassIn
10 | @TestAnnotation
11 | public static class InnerTestClass {
12 |
13 | }
14 |
15 | }
--------------------------------------------------------------------------------
/cute/src/test/java/io/toolisticon/cute/common/ExceptionThrowerAnnotation.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute.common;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | @Target(ElementType.TYPE)
9 | @Retention(RetentionPolicy.RUNTIME)
10 | public @interface ExceptionThrowerAnnotation {
11 | }
12 |
--------------------------------------------------------------------------------
/cute/src/test/java/io/toolisticon/cute/common/SimpleTestAnnotation2.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute.common;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 |
9 | @Target(ElementType.TYPE)
10 | @Retention(RetentionPolicy.RUNTIME)
11 | public @interface SimpleTestAnnotation2 {
12 | }
13 |
--------------------------------------------------------------------------------
/legacy/src/test/java/io/toolisticon/cute/common/SimpleTestAnnotation1.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute.common;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 |
9 | @Target(ElementType.TYPE)
10 | @Retention(RetentionPolicy.RUNTIME)
11 | public @interface SimpleTestAnnotation1 {
12 | }
13 |
--------------------------------------------------------------------------------
/legacy/src/test/java/io/toolisticon/cute/common/SimpleTestAnnotation2.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute.common;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 |
9 | @Target(ElementType.TYPE)
10 | @Retention(RetentionPolicy.RUNTIME)
11 | public @interface SimpleTestAnnotation2 {
12 | }
13 |
--------------------------------------------------------------------------------
/cute/src/test/java/io/toolisticon/cute/common/SimpleTestAnnotation3.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute.common;
2 |
3 |
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 |
9 | @Target(ElementType.TYPE)
10 | @Retention(RetentionPolicy.RUNTIME)
11 | public @interface SimpleTestAnnotation3 {
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/legacy/src/test/java/io/toolisticon/cute/common/SimpleTestAnnotation3.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute.common;
2 |
3 |
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 |
9 | @Target(ElementType.TYPE)
10 | @Retention(RetentionPolicy.RUNTIME)
11 | public @interface SimpleTestAnnotation3 {
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/legacy/src/test/resources/compiletests/passintest/PassInTestClassMultipleAnnotatedWithoutPassIn.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.annotationprocessortoolkit.testhelper.compiletest;
2 |
3 | import io.toolisticon.cute.PassIn;
4 | import io.toolisticon.cute.TestAnnotation;
5 |
6 | @PassIn
7 | public class PassInTestClassMultipleAnnotatedWithoutPassIn {
8 |
9 | @PassIn
10 | public static class InnerTestClass {
11 |
12 | }
13 |
14 | }
--------------------------------------------------------------------------------
/cute/src/test/resources/compiletests/compileroptionstest/Java8Code.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute.testcases;
2 |
3 | import java.util.Arrays;
4 | import java.util.Collections;
5 | import java.util.List;
6 | import java.util.stream.Collectors;
7 |
8 | public class Java8Code {
9 | public static void main(String[] args) {
10 | Arrays.asList("A", "B", "C").stream().filter(e -> e.equals("B")).collect(Collectors.toSet());
11 | }
12 | }
--------------------------------------------------------------------------------
/cute/src/test/resources/compiletests/passintest/PassInTestClassMultipleAnnotatedWithoutPassIn.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.annotationprocessortoolkit.testhelper.compiletest;
2 |
3 | import io.toolisticon.cute.PassIn;
4 | import io.toolisticon.cute.TestAnnotation;
5 |
6 | @TestAnnotation
7 | public class PassInTestClassMultipleAnnotatedWithoutPassIn {
8 |
9 | @TestAnnotation
10 | public static class InnerTestClass {
11 |
12 | }
13 |
14 | }
--------------------------------------------------------------------------------
/cute/src/test/java/io/toolisticon/cute/common/SimpleTestAnnotation1.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute.common;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 |
9 | @Target(ElementType.TYPE)
10 | @Retention(RetentionPolicy.RUNTIME)
11 | public @interface SimpleTestAnnotation1 {
12 | String value() default "";
13 | }
14 |
--------------------------------------------------------------------------------
/cute/src/main/java/io/toolisticon/cute/FailingAssertionException.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute;
2 |
3 | /**
4 | * Exception to signal failing Assertion
5 | */
6 | public class FailingAssertionException extends RuntimeException {
7 |
8 | public FailingAssertionException(String message) {
9 | super(message);
10 | }
11 |
12 | public FailingAssertionException(String message, Throwable e) {
13 | super(message,e);
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/cute/src/main/java/io/toolisticon/cute/TestAnnotation.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | /**
9 | * This is the annotation for the default unit test processor.
10 | */
11 | @Retention(RetentionPolicy.RUNTIME)
12 | @Target(value = ElementType.TYPE)
13 | public @interface TestAnnotation {
14 | }
15 |
--------------------------------------------------------------------------------
/cute/src/test/resources/TestClassWithInnerClasses.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute;
2 |
3 | import io.toolisticon.cute.TestAnnotation;
4 |
5 | /**
6 | * Test class for annotation processor tools.
7 | */
8 | @TestAnnotation
9 | public class TestClassWithInnerClasses {
10 |
11 | public class InnerClass {
12 |
13 | }
14 |
15 | public static class StaticInnerClass {
16 |
17 |
18 | }
19 |
20 | public interface InnerInterface {
21 |
22 | }
23 |
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/cute/src/test/resources/compiletests/passintest/PassInTestClassMultipleAnnotatedWithMultiplePassIn.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.annotationprocessortoolkit.testhelper.compiletest;
2 |
3 | import io.toolisticon.cute.PassIn;
4 | import io.toolisticon.cute.TestAnnotation;
5 |
6 | @PassIn
7 | @TestAnnotation
8 | public class PassInTestClassMultipleAnnotatedWithMultiplePassIn {
9 |
10 | @PassIn
11 | @TestAnnotation
12 | public static class InnerTestClass {
13 |
14 | }
15 |
16 | }
--------------------------------------------------------------------------------
/legacy/src/test/resources/compiletests/passintest/PassInTestClassMultipleAnnotatedWithMultiplePassIn.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.annotationprocessortoolkit.testhelper.compiletest;
2 |
3 | import io.toolisticon.cute.PassIn;
4 | import io.toolisticon.cute.TestAnnotation;
5 |
6 | @PassIn
7 | @TestAnnotation
8 | public class PassInTestClassMultipleAnnotatedWithMultiplePassIn {
9 |
10 | @PassIn
11 | @TestAnnotation
12 | public static class InnerTestClass {
13 |
14 | }
15 |
16 | }
--------------------------------------------------------------------------------
/cute/src/test/resources/TestClassWithImplementedInterface.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute;
2 |
3 | import io.toolisticon.cute.TestAnnotation;
4 | import io.toolisticon.cute.testcases.SimpleTestInterface;
5 |
6 | /**
7 | * Test class for annotation processor tools.
8 | */
9 | @TestAnnotation
10 | public class TestClassWithImplementedInterface implements SimpleTestInterface {
11 |
12 | @Override
13 | public String saySomething() {
14 | return "WHATS UP?";
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/cute/src/test/resources/compiletests/withmultiplerelatedsourcefiles/TestClassWithImplementedInterface.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute;
2 |
3 | import io.toolisticon.cute.TestAnnotation;
4 | import io.toolisticon.cute.testcases.SimpleTestInterface;
5 |
6 | /**
7 | * Test class for annotation processor tools.
8 | */
9 | @TestAnnotation
10 | public class TestClassWithImplementedInterface implements SimpleTestInterface {
11 |
12 | @Override
13 | public String saySomething() {
14 | return JustOutput.getString();
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/integration-test/java9/test/src/test/resources/testcases/bindRegularJavaModule/Test.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute.integrationtest.javanine;
2 |
3 | import io.toolisticon.cute.integrationtest.javanine.regularmodule.RegularModuleTestClass;
4 |
5 | import javax.annotation.processing.Processor;
6 |
7 | public class Test {
8 |
9 | public static void testCall(Processor processor) {
10 |
11 | }
12 |
13 | public static void secondTestCall(RegularModuleTestClass testClass) {
14 | testClass.testMethod();
15 | }
16 |
17 |
18 | }
19 |
20 |
--------------------------------------------------------------------------------
/extension/api/src/main/java/io/toolisticon/cute/extension/api/ModuleSupportSpi.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute.extension.api;
2 |
3 | import io.toolisticon.spiap.api.Spi;
4 |
5 | import javax.tools.JavaCompiler;
6 | import javax.tools.StandardJavaFileManager;
7 | import java.util.Set;
8 |
9 | @Spi
10 | public interface ModuleSupportSpi {
11 |
12 | void applyModulePath(StandardJavaFileManager stdJavaFileManager, JavaCompiler.CompilationTask compilationTask, Set modules);
13 |
14 | void writeModuleDebugOutput(StringBuilder stringBuilder);
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/integration-test/java9/test/src/test/resources/testcases/bindNamedAutomaticJavaModule/Test.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute.integrationtest.javanine;
2 |
3 | import io.toolisticon.cute.integrationtest.javanine.namednonmodule.NamedAutomaticModuleTestClass;
4 |
5 | import javax.annotation.processing.Processor;
6 |
7 | public class Test {
8 |
9 | public static void testCall(Processor processor) {
10 |
11 | }
12 |
13 | public static void secondTestCall(NamedAutomaticModuleTestClass testClass) {
14 | testClass.testMethod();
15 | }
16 |
17 |
18 | }
19 |
20 |
--------------------------------------------------------------------------------
/integration-test/java9/test/src/test/resources/testcases/bindUnnamedAutomaticJavaModule/Test.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute.integrationtest.javanine;
2 |
3 | import io.toolisticon.cute.integrationtest.javanine.unnamednonmodule.UnnamedAutomaticModuleTestClass;
4 |
5 | import javax.annotation.processing.Processor;
6 |
7 | public class Test {
8 |
9 | public static void testCall(Processor processor) {
10 |
11 | }
12 |
13 | public static void secondTestCall(UnnamedAutomaticModuleTestClass testClass) {
14 | testClass.testMethod();
15 | }
16 |
17 |
18 | }
19 |
20 |
--------------------------------------------------------------------------------
/cute/src/main/java/io/toolisticon/cute/UnitTestWithoutPassIn.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute;
2 |
3 | import javax.annotation.processing.ProcessingEnvironment;
4 |
5 | /**
6 | * Interface that is used during unit test creation. It allows setting up a unit test without the need to create a valid annotation processor.
7 | *
8 | * Please use {@link UnitTestForTestingAnnotationProcessors} if you want to unit test annotation processor methods.
9 | */
10 | public interface UnitTestWithoutPassIn extends UnitTestBase{
11 |
12 | /**
13 | * The unit test method.
14 | *
15 | * @param processingEnvironment the processingEnvironment
16 | */
17 | void unitTest(ProcessingEnvironment processingEnvironment);
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/integration-test/java9/test/src/test/resources/testcases/accessNotExportedClass/Test.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute.integrationtest.javanine;
2 |
3 | import io.toolisticon.cute.integrationtest.javanine.regularmodule.RegularModuleTestClass;
4 | import io.toolisticon.cute.integrationtest.javanine.regularmodule.notexported.NotExportedClass;
5 |
6 | import javax.annotation.processing.Processor;
7 |
8 | public class Test {
9 |
10 | final static NotExportedClass instance = new NotExportedClass();
11 |
12 | public static void testCall(Processor processor) {
13 |
14 | }
15 |
16 | public static void secondTestCall(RegularModuleTestClass testClass) {
17 | testClass.testMethod();
18 | }
19 |
20 |
21 | }
22 |
23 |
--------------------------------------------------------------------------------
/cute/src/test/java/io/toolisticon/cute/testcases/TestAnnotationProcessor.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute.testcases;
2 |
3 | import javax.annotation.processing.AbstractProcessor;
4 | import javax.annotation.processing.RoundEnvironment;
5 | import javax.annotation.processing.SupportedAnnotationTypes;
6 | import javax.lang.model.element.TypeElement;
7 | import java.util.Set;
8 |
9 | /**
10 | * Test annotation processor. Does nothing.
11 | */
12 |
13 | @SupportedAnnotationTypes("io.toolisticon.cute.TestAnnotation")
14 | public class TestAnnotationProcessor extends AbstractProcessor {
15 |
16 | @Override
17 | public boolean process(Set extends TypeElement> annotations, RoundEnvironment roundEnv) {
18 | return false;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/cute/src/main/java/io/toolisticon/cute/GeneratedFileObjectMatcher.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute;
2 |
3 | import javax.tools.FileObject;
4 | import java.io.IOException;
5 |
6 | /**
7 | * Interface to allow custom checks in fluent api.
8 | *
9 | */
10 | public interface GeneratedFileObjectMatcher {
11 |
12 | /**
13 | * Method to check
14 | *
15 | * @param fileObject the file object to check
16 | * @return true if check is done successfully, otherwise false
17 | * @throws IOException might be thrown during access of passed fileObject
18 | * @throws FailingAssertionException can be thrown to provide a detailed assertion message in case of a failing assertion.
19 | */
20 | boolean check(FileObject fileObject) throws IOException;
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/cute/src/test/java/io/toolisticon/cute/common/SimpleTestProcessor2.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute.common;
2 |
3 | import javax.annotation.processing.AbstractProcessor;
4 | import javax.annotation.processing.RoundEnvironment;
5 | import javax.lang.model.element.TypeElement;
6 | import java.util.Arrays;
7 | import java.util.HashSet;
8 | import java.util.Set;
9 |
10 | public class SimpleTestProcessor2 extends AbstractProcessor {
11 | @Override
12 | public boolean process(Set extends TypeElement> annotations, RoundEnvironment roundEnv) {
13 | return false;
14 | }
15 |
16 | @Override
17 | public Set getSupportedAnnotationTypes() {
18 |
19 | return new HashSet(Arrays.asList(SimpleTestAnnotation2.class.getCanonicalName()));
20 |
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/cute/src/test/java/io/toolisticon/cute/common/SimpleTestProcessor3.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute.common;
2 |
3 | import javax.annotation.processing.AbstractProcessor;
4 | import javax.annotation.processing.RoundEnvironment;
5 | import javax.lang.model.element.TypeElement;
6 | import java.util.Arrays;
7 | import java.util.HashSet;
8 | import java.util.Set;
9 |
10 | public class SimpleTestProcessor3 extends AbstractProcessor {
11 | @Override
12 | public boolean process(Set extends TypeElement> annotations, RoundEnvironment roundEnv) {
13 | return false;
14 | }
15 |
16 | @Override
17 | public Set getSupportedAnnotationTypes() {
18 |
19 | return new HashSet(Arrays.asList(SimpleTestAnnotation3.class.getCanonicalName()));
20 |
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/legacy/src/test/java/io/toolisticon/cute/common/SimpleTestProcessor2.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute.common;
2 |
3 | import javax.annotation.processing.AbstractProcessor;
4 | import javax.annotation.processing.RoundEnvironment;
5 | import javax.lang.model.element.TypeElement;
6 | import java.util.Arrays;
7 | import java.util.HashSet;
8 | import java.util.Set;
9 |
10 | public class SimpleTestProcessor2 extends AbstractProcessor {
11 | @Override
12 | public boolean process(Set extends TypeElement> annotations, RoundEnvironment roundEnv) {
13 | return false;
14 | }
15 |
16 | @Override
17 | public Set getSupportedAnnotationTypes() {
18 |
19 | return new HashSet(Arrays.asList(SimpleTestAnnotation2.class.getCanonicalName()));
20 |
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/legacy/src/test/java/io/toolisticon/cute/common/SimpleTestProcessor3.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute.common;
2 |
3 | import javax.annotation.processing.AbstractProcessor;
4 | import javax.annotation.processing.RoundEnvironment;
5 | import javax.lang.model.element.TypeElement;
6 | import java.util.Arrays;
7 | import java.util.HashSet;
8 | import java.util.Set;
9 |
10 | public class SimpleTestProcessor3 extends AbstractProcessor {
11 | @Override
12 | public boolean process(Set extends TypeElement> annotations, RoundEnvironment roundEnv) {
13 | return false;
14 | }
15 |
16 | @Override
17 | public Set getSupportedAnnotationTypes() {
18 |
19 | return new HashSet(Arrays.asList(SimpleTestAnnotation3.class.getCanonicalName()));
20 |
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/.github/workflows/default.yml:
--------------------------------------------------------------------------------
1 | name: default
2 |
3 | on:
4 | push:
5 | branches:
6 | - '*'
7 | - '**/*'
8 | - '!master'
9 |
10 | jobs:
11 | build:
12 | runs-on: ${{ matrix.os }}
13 | strategy:
14 | matrix:
15 | os: [ ubuntu-latest,macos-latest,windows-latest ]
16 | java: [ 8, 11, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23 ]
17 |
18 | steps:
19 | - uses: actions/checkout@v4
20 |
21 | - name: Set up JDK ${{ matrix.java }}
22 | uses: actions/setup-java@v4
23 | with:
24 | distribution: 'zulu'
25 | java-version: ${{ matrix.java }}
26 | cache: 'maven'
27 |
28 | - name: Prepare mvnw
29 | run: chmod +x ./mvnw
30 |
31 | - name: Build
32 | run: ./mvnw clean package
33 |
34 |
--------------------------------------------------------------------------------
/cute/src/main/java/io/toolisticon/cute/Java9SupportCheck.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute;
2 |
3 | /**
4 | * Utility class to check if java 9 api is unsupported.
5 | */
6 | final class Java9SupportCheck {
7 |
8 | /**
9 | * Constant to check if JAVA 9 API is unsupported.
10 | */
11 | final static boolean UNSUPPORTED_JAVA_VERSION;
12 |
13 | static {
14 |
15 | // get ModuleFinderClass
16 | Class> moduleFinderClass = null;
17 | try {
18 | moduleFinderClass = Class.forName("java.lang.module.ModuleFinder");
19 | } catch (Exception e) {
20 | // ignore
21 | }
22 |
23 | UNSUPPORTED_JAVA_VERSION = moduleFinderClass == null;
24 |
25 | }
26 |
27 | /**
28 | * Hidden constructor.
29 | */
30 | private Java9SupportCheck() {
31 |
32 | }
33 |
34 | }
--------------------------------------------------------------------------------
/integration-test/java9/pom.xml:
--------------------------------------------------------------------------------
1 |
3 | 4.0.0
4 |
5 | integration-test-java9-parent
6 | pom
7 |
8 |
9 | io.toolisticon.cute
10 | integration-test-parent
11 | 1.9.1-SNAPSHOT
12 |
13 |
14 | integration-test-java9-parent
15 |
16 |
17 | regularTestModule
18 | namedAutomaticModule
19 | unnamedAutomaticModule
20 | test
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/integration-test/java9/pom.xml.releaseBackup:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 |
4 | integration-test-java9-parent
5 | pom
6 |
7 |
8 | io.toolisticon.compiletesting
9 | integration-test-parent
10 | 0.7.1-SNAPSHOT
11 |
12 |
13 | integration-test-java9-parent
14 |
15 |
16 | regularTestModule
17 | namedAutomaticModule
18 | unnamedAutomaticModule
19 | test
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/cute/src/main/java/io/toolisticon/cute/CommonUtilities.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute;
2 |
3 | import java.util.Random;
4 |
5 | /**
6 | * Some common utility functions.
7 | */
8 | final class CommonUtilities {
9 |
10 | /**
11 | * Hidden constructor.
12 | */
13 | private CommonUtilities() {
14 |
15 | }
16 |
17 | public static String getRandomString(int length) {
18 |
19 | int leftLimit = 97; // letter 'a'
20 | int rightLimit = 122; // letter 'z'
21 | Random random = new Random();
22 | StringBuilder buffer = new StringBuilder(length);
23 | for (int i = 0; i < length; i++) {
24 | int randomLimitedInt = leftLimit + (int)
25 | (random.nextFloat() * (rightLimit - leftLimit + 1));
26 | buffer.append((char) randomLimitedInt);
27 | }
28 | return buffer.toString();
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/cute/src/test/java/io/toolisticon/cute/testcases/TestAnnotationProcessorWithMissingNoArgConstructor.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute.testcases;
2 |
3 |
4 | import javax.annotation.processing.AbstractProcessor;
5 | import javax.annotation.processing.RoundEnvironment;
6 | import javax.annotation.processing.SupportedAnnotationTypes;
7 | import javax.lang.model.element.TypeElement;
8 | import java.util.Set;
9 |
10 | /**
11 | * Test annotation processor. Does nothing.
12 | */
13 |
14 | @SupportedAnnotationTypes("io.toolisticon.cute.TestAnnotation")
15 | public class TestAnnotationProcessorWithMissingNoArgConstructor extends AbstractProcessor {
16 |
17 | public TestAnnotationProcessorWithMissingNoArgConstructor(String x) {
18 |
19 | }
20 |
21 | @Override
22 | public boolean process(Set extends TypeElement> annotations, RoundEnvironment roundEnv) {
23 | return false;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/extension/api/src/main/java/io/toolisticon/cute/extension/api/AssertionSpi.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute.extension.api;
2 |
3 | import java.util.Set;
4 |
5 | import io.toolisticon.spiap.api.Spi;
6 |
7 | /**
8 | * Spi to set a failing assertion during compile testing.
9 | */
10 | @Spi
11 | public interface AssertionSpi {
12 |
13 | /**
14 | * Triggers a failing assertion.
15 | *
16 | * @param message the failing assertion message
17 | */
18 | void fail(String message);
19 |
20 | /**
21 | * Triggers a failing assertion.
22 | *
23 | * @param message the failing assertion message
24 | */
25 | void fail(String message, Throwable cause);
26 |
27 | /**
28 | * Get the differt assertion error types used by the framework.
29 | * @return
30 | */
31 | Set> getSupportedAssertionTypes();
32 |
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/legacy/src/test/java/io/toolisticon/cute/common/SimpleTestProcessor1.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute.common;
2 |
3 | import javax.annotation.processing.AbstractProcessor;
4 | import javax.annotation.processing.ProcessingEnvironment;
5 | import javax.annotation.processing.RoundEnvironment;
6 | import javax.lang.model.element.TypeElement;
7 | import java.util.Arrays;
8 | import java.util.HashSet;
9 | import java.util.Set;
10 |
11 |
12 | public class SimpleTestProcessor1 extends AbstractProcessor {
13 | @Override
14 | public boolean process(Set extends TypeElement> annotations, RoundEnvironment roundEnv) {
15 | return false;
16 | }
17 |
18 |
19 | @Override
20 | public Set getSupportedAnnotationTypes() {
21 |
22 | return new HashSet(Arrays.asList(SimpleTestAnnotation1.class.getCanonicalName()));
23 |
24 | }
25 |
26 | public ProcessingEnvironment getProcessingEnvironment() {
27 | return this.processingEnv;
28 | }
29 | }
--------------------------------------------------------------------------------
/cute/src/test/java/io/toolisticon/cute/matchers/RegexGeneratedFileObjectMatcherTest.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.cute.matchers;
2 |
3 | import io.toolisticon.cute.FailingAssertionException;
4 | import io.toolisticon.cute.JavaFileObjectUtils;
5 | import org.junit.Test;
6 |
7 | import java.io.IOException;
8 |
9 |
10 | /**
11 | * Unit test for {@link RegexGeneratedFileObjectMatcher}.
12 | */
13 | public class RegexGeneratedFileObjectMatcherTest {
14 |
15 | @Test
16 | public void testForRegexMatcher_valid() throws IOException {
17 |
18 | CoreGeneratedFileObjectMatchers.createRegexMatcher(".*head.*").check(JavaFileObjectUtils.readFromString("war\nheadwarbody"));
19 |
20 | }
21 |
22 | @Test(expected = FailingAssertionException.class)
23 | public void testForRegexMatcher_invalid() throws IOException {
24 |
25 | CoreGeneratedFileObjectMatchers.createRegexMatcher(".*abc.*").check(JavaFileObjectUtils.readFromString("\n\n\nbody>\n\n