From 7c1bea3fbc38d8031d8b9c3f6e84c289b909f4e0 Mon Sep 17 00:00:00 2001 From: Mathieu Boretti Date: Wed, 20 May 2020 19:02:14 +0200 Subject: [PATCH] Issue #293 ; Issue #292 - Create IT and isolate hamcrest --- .bettercodehub.yml | 2 + .codebeatignore | 1 + .travis.yml | 25 +- .travisci/codecov.sh | 18 + .travisci/getcodacy.sh | 9 + .travisci/reportci.sh | 11 + pom.xml | 166 ++---- src/assemble/only-factory.xml | 43 -- src/assemble/only-providematchers.xml | 24 - src/it/archetype-it-jdk8/params.properties | 2 + src/it/archetype-it-jdk8/pom.xml | 31 ++ src/it/archetype-it-jdk8/verify.bsh | 7 + .../params.properties | 2 + src/it/beanmatchers-it-jdk8-existing/pom.xml | 278 ++++++++++ .../extensions/beanmatchers/MyTestPojo.java | 0 .../extensions/beanmatchers/SampleClass.java | 0 .../beanmatchers/SampleClassMatchersTest.java | 0 .../beanmatchers-it-jdk8-existing/verify.bsh | 26 + .../params.properties | 3 + src/it/beanmatchers-it-jdk8-missing/pom.xml | 272 ++++++++++ .../extensions/beanmatchers/MyTestPojo.java | 44 ++ .../extensions/beanmatchers/SampleClass.java | 15 + .../beanmatchers/SampleClassMatchersTest.java | 20 + .../beanmatchers-it-jdk8-missing/verify.bsh | 26 + .../params.properties | 2 + src/it/beanmatchers-it-jdk9+-existing/pom.xml | 282 ++++++++++ .../extensions/beanmatchers/MyTestPojo.java | 44 ++ .../extensions/beanmatchers/SampleClass.java | 15 + .../beanmatchers/SampleClassMatchersTest.java | 20 + .../beanmatchers-it-jdk9+-existing/verify.bsh | 26 + .../params.properties | 3 + src/it/beanmatchers-it-jdk9+-missing/pom.xml | 277 ++++++++++ .../extensions/beanmatchers/MyTestPojo.java | 44 ++ .../extensions/beanmatchers/SampleClass.java | 15 + .../beanmatchers/SampleClassMatchersTest.java | 20 + .../beanmatchers-it-jdk9+-missing/verify.bsh | 26 + src/it/full-it-jdk8/params.properties | 2 + src/it/full-it-jdk8/pom.xml | 310 +++++++++++ .../matchers/samples/MapSample.java | 0 .../extensions/matchers/samples/Pojo1.java | 0 .../extensions/matchers/samples/Pojo2.java | 74 +-- .../extensions/matchers/samples/Pojo3.java | 134 ++--- .../extensions/matchers/samples/Pojo4.java | 94 ++-- .../matchers/samples/PojoClass.java | 74 +-- .../matchers/samples/PojoShort.java | 64 +-- .../extensions/matchers/samples/Sample.java | 34 +- .../matchers/samples/SampleLocalDateTime.java | 36 +- .../matchers/samples/SampleOptional.java | 0 .../matchers/samples/SampleSupplier.java | 26 +- .../matchers/samples/SimplePojo.java | 16 +- .../matchers/samples/TwoFieldsPojo.java | 20 +- .../addmatcher/PojoWithOverrideField.java | 60 +-- .../matchers/samples/extension/Includer.java | 0 .../matchers/samples/extension/MyPair.java | 0 .../matchers/samples/extension/MyPair2.java | 0 .../extension/MyTestWithoutGeneric.java | 0 .../extension/MyTestWithoutGeneric2.java | 0 .../iterable/PojoWithSameRoundList.java | 88 ++-- .../samples/iterable/PojoWithStringList.java | 88 ++-- .../samples/iterable/PojoWithStringSet.java | 0 .../matchers/samples/others/Pojo42.java | 170 +++--- .../matchers/samples/others/Pojo43.java | 64 +-- .../samples/others/PojoRenameMatcher.java | 64 +-- .../others/PojoRenameParentMatcher.java | 30 +- .../samples/third/ExtendedPojo43.java | 66 +-- .../matchers/samples/third/OneFunnyOne.java | 0 .../samples/third/SimpleFullyOne.java | 56 +- .../matchers/samples/MapSampleTest.java | 0 .../matchers/samples/Pojo1MatcherTest.java | 0 .../matchers/samples/Pojo2MatcherTest.java | 92 ++-- .../matchers/samples/Pojo3MatcherTest.java | 78 +-- .../samples/PojoClassMatchersTest.java | 72 +-- .../samples/SampleLocalDateTimeTest.java | 70 +-- .../samples/SampleOptionalMatchersTest.java | 0 .../matchers/samples/SampleOptionalTest.java | 0 .../matchers/samples/SampleSupplierTest.java | 72 +-- .../PojoWithSameRoundListMatchersTest.java | 282 +++++----- .../PojoWithStringListMatchersTest.java | 258 +++++----- .../PojoWithStringSetMatchersTest.java | 258 +++++----- .../third/OneFunnyOneMatchersTest.java | 0 src/it/full-it-jdk8/verify.bsh | 7 + src/it/full-it-jdk9+/params.properties | 2 + src/it/full-it-jdk9+/pom.xml | 316 ++++++++++++ .../matchers/samples/MapSample.java | 22 + .../extensions/matchers/samples/Pojo1.java | 97 ++++ .../extensions/matchers/samples/Pojo2.java | 37 ++ .../extensions/matchers/samples/Pojo3.java | 67 +++ .../extensions/matchers/samples/Pojo4.java | 47 ++ .../matchers/samples/PojoClass.java | 37 ++ .../matchers/samples/PojoShort.java | 32 ++ .../extensions/matchers/samples/Sample.java | 17 + .../matchers/samples/SampleLocalDateTime.java | 18 + .../matchers/samples/SampleOptional.java | 52 ++ .../matchers/samples/SampleSupplier.java | 13 + .../matchers/samples/SimplePojo.java | 8 + .../matchers/samples/TwoFieldsPojo.java | 10 + .../addmatcher/PojoWithOverrideField.java | 30 ++ .../matchers/samples/extension/Includer.java | 10 + .../matchers/samples/extension/MyPair.java | 27 + .../matchers/samples/extension/MyPair2.java | 27 + .../extension/MyTestWithoutGeneric.java | 15 + .../extension/MyTestWithoutGeneric2.java | 22 + .../iterable/PojoWithSameRoundList.java | 44 ++ .../samples/iterable/PojoWithStringList.java | 44 ++ .../samples/iterable/PojoWithStringSet.java | 44 ++ .../matchers/samples/others/Pojo42.java | 85 +++ .../matchers/samples/others/Pojo43.java | 32 ++ .../samples/others/PojoRenameMatcher.java | 32 ++ .../others/PojoRenameParentMatcher.java | 15 + .../samples/third/ExtendedPojo43.java | 33 ++ .../matchers/samples/third/OneFunnyOne.java | 46 ++ .../samples/third/SimpleFullyOne.java | 28 + .../matchers/samples/MapSampleTest.java | 24 + .../matchers/samples/Pojo1MatcherTest.java | 229 +++++++++ .../matchers/samples/Pojo2MatcherTest.java | 46 ++ .../matchers/samples/Pojo3MatcherTest.java | 39 ++ .../samples/PojoClassMatchersTest.java | 36 ++ .../samples/SampleLocalDateTimeTest.java | 35 ++ .../samples/SampleOptionalMatchersTest.java | 133 +++++ .../matchers/samples/SampleOptionalTest.java | 71 +++ .../matchers/samples/SampleSupplierTest.java | 36 ++ .../PojoWithSameRoundListMatchersTest.java | 142 +++++ .../PojoWithStringListMatchersTest.java | 130 +++++ .../PojoWithStringSetMatchersTest.java | 130 +++++ .../third/OneFunnyOneMatchersTest.java | 55 ++ src/it/full-it-jdk9+/verify.bsh | 7 + .../params.properties | 2 + src/it/hamcrestdate-it-jdk8-existing/pom.xml | 278 ++++++++++ .../hamcrestdate/SampleLocalDate.java | 0 .../hamcrestdate/SampleLocalDateTimeV2.java | 0 .../hamcrestdate/SampleLocalTime.java | 0 .../hamcrestdate/SampleZonedDateTime.java | 0 .../SampleLocalDateMatchersTest.java | 0 .../SampleLocalDateTimeV2MatchersTest.java | 0 .../SampleLocalTimeMatchersTest.java | 0 .../SampleZonedDateTimeMatchersTest.java | 0 .../hamcrestdate-it-jdk8-existing/verify.bsh | 26 + .../params.properties | 3 + src/it/hamcrestdate-it-jdk8-missing/pom.xml | 272 ++++++++++ .../hamcrestdate/SampleLocalDate.java | 18 + .../hamcrestdate/SampleLocalDateTimeV2.java | 18 + .../hamcrestdate/SampleLocalTime.java | 18 + .../hamcrestdate/SampleZonedDateTime.java | 18 + .../SampleLocalDateMatchersTest.java | 15 + .../SampleLocalDateTimeV2MatchersTest.java | 16 + .../SampleLocalTimeMatchersTest.java | 15 + .../SampleZonedDateTimeMatchersTest.java | 18 + .../hamcrestdate-it-jdk8-missing/verify.bsh | 26 + .../params.properties | 2 + src/it/hamcrestdate-it-jdk9+-existing/pom.xml | 283 ++++++++++ .../hamcrestdate/SampleLocalDate.java | 18 + .../hamcrestdate/SampleLocalDateTimeV2.java | 18 + .../hamcrestdate/SampleLocalTime.java | 18 + .../hamcrestdate/SampleZonedDateTime.java | 18 + .../SampleLocalDateMatchersTest.java | 15 + .../SampleLocalDateTimeV2MatchersTest.java | 16 + .../SampleLocalTimeMatchersTest.java | 15 + .../SampleZonedDateTimeMatchersTest.java | 18 + .../hamcrestdate-it-jdk9+-existing/verify.bsh | 26 + .../params.properties | 3 + src/it/hamcrestdate-it-jdk9+-missing/pom.xml | 277 ++++++++++ .../hamcrestdate/SampleLocalDate.java | 18 + .../hamcrestdate/SampleLocalDateTimeV2.java | 18 + .../hamcrestdate/SampleLocalTime.java | 18 + .../hamcrestdate/SampleZonedDateTime.java | 18 + .../SampleLocalDateMatchersTest.java | 15 + .../SampleLocalDateTimeV2MatchersTest.java | 16 + .../SampleLocalTimeMatchersTest.java | 15 + .../SampleZonedDateTimeMatchersTest.java | 18 + .../hamcrestdate-it-jdk9+-missing/verify.bsh | 26 + .../params.properties | 2 + .../hamcrestutility-it-jdk8-existing/pom.xml | 278 ++++++++++ .../hamcrestutility/HamcrestUtililtyPojo.java | 12 + .../HamcrestUtililtyPojoMatchersTest.java | 17 + .../verify.bsh | 26 + .../params.properties | 3 + .../hamcrestutility-it-jdk8-missing/pom.xml | 272 ++++++++++ .../hamcrestutility/HamcrestUtililtyPojo.java | 13 + .../HamcrestUtililtyPojoMatchersTest.java | 17 + .../verify.bsh | 26 + .../params.properties | 2 + .../hamcrestutility-it-jdk9+-existing/pom.xml | 283 ++++++++++ .../hamcrestutility/HamcrestUtililtyPojo.java | 12 + .../HamcrestUtililtyPojoMatchersTest.java | 17 + .../verify.bsh | 26 + .../params.properties | 3 + .../hamcrestutility-it-jdk9+-missing/pom.xml | 277 ++++++++++ .../hamcrestutility/HamcrestUtililtyPojo.java | 12 + .../HamcrestUtililtyPojoMatchersTest.java | 17 + .../verify.bsh | 26 + .../params.properties | 2 + .../provider-factory-disabled-it-jdk/pom.xml | 273 ++++++++++ .../extensions/matchers/samples/Pojo1.java | 94 ++++ .../matchers/samples/Pojo1MatcherTest.java | 156 ++++++ .../verify.bsh | 13 + .../params.properties | 2 + .../pom.xml | 279 ++++++++++ .../extensions/matchers/samples/Pojo1.java | 94 ++++ .../matchers/samples/Pojo1MatcherTest.java | 156 ++++++ .../verify.bsh | 13 + .../params.properties | 2 + .../provider-factory-enabled-it-jdk/pom.xml | 273 ++++++++++ .../extensions/matchers/samples/Pojo1.java | 94 ++++ .../matchers/samples/Pojo1MatcherTest.java | 156 ++++++ .../verify.bsh | 13 + .../params.properties | 2 + .../provider-factory-enabled-it-jdk9+/pom.xml | 279 ++++++++++ .../extensions/matchers/samples/Pojo1.java | 94 ++++ .../matchers/samples/Pojo1MatcherTest.java | 156 ++++++ .../verify.bsh | 13 + src/it/settings.xml | 35 ++ src/it/setup/params.properties | 1 + src/it/setup/pom.xml | 285 ++++++++++ src/it/setup/verify.bsh | 7 + .../params.properties | 2 + src/it/simple-it-jdk8-hamcrest21/pom.xml | 278 ++++++++++ .../extensions/matchers/samples/Pojo1.java | 94 ++++ .../matchers/samples/Pojo1MatcherTest.java | 156 ++++++ src/it/simple-it-jdk8-hamcrest21/verify.bsh | 7 + .../params.properties | 2 + src/it/simple-it-jdk8-hamcrest22/pom.xml | 278 ++++++++++ .../extensions/matchers/samples/Pojo1.java | 94 ++++ .../matchers/samples/Pojo1MatcherTest.java | 156 ++++++ src/it/simple-it-jdk8-hamcrest22/verify.bsh | 7 + .../params.properties | 3 + src/it/simple-it-jdk8-missinghamcrest/pom.xml | 267 ++++++++++ .../extensions/matchers/samples/Pojo1.java | 94 ++++ .../matchers/samples/Pojo1MatcherTest.java | 156 ++++++ .../simple-it-jdk8-missinghamcrest/verify.bsh | 7 + src/it/simple-it-jdk8/params.properties | 2 + src/it/simple-it-jdk8/pom.xml | 272 ++++++++++ .../extensions/matchers/samples/Pojo1.java | 94 ++++ .../matchers/samples/Pojo1MatcherTest.java | 156 ++++++ src/it/simple-it-jdk8/verify.bsh | 7 + .../params.properties | 2 + src/it/simple-it-jdk9+-hamcrest21/pom.xml | 283 ++++++++++ .../extensions/matchers/samples/Pojo1.java | 94 ++++ .../matchers/samples/Pojo1MatcherTest.java | 156 ++++++ src/it/simple-it-jdk9+-hamcrest21/verify.bsh | 7 + .../params.properties | 2 + src/it/simple-it-jdk9+-hamcrest22/pom.xml | 283 ++++++++++ .../extensions/matchers/samples/Pojo1.java | 94 ++++ .../matchers/samples/Pojo1MatcherTest.java | 156 ++++++ src/it/simple-it-jdk9+-hamcrest22/verify.bsh | 7 + .../params.properties | 3 + .../simple-it-jdk9+-missinghamcrest/pom.xml | 273 ++++++++++ .../extensions/matchers/samples/Pojo1.java | 94 ++++ .../matchers/samples/Pojo1MatcherTest.java | 156 ++++++ .../verify.bsh | 7 + src/it/simple-it-jdk9+/params.properties | 2 + src/it/simple-it-jdk9+/pom.xml | 278 ++++++++++ .../extensions/matchers/samples/Pojo1.java | 94 ++++ .../matchers/samples/Pojo1MatcherTest.java | 156 ++++++ src/it/simple-it-jdk9+/verify.bsh | 7 + .../params.properties | 2 + src/it/spotify-it-jdk8-existing/pom.xml | 278 ++++++++++ .../extensions/spotify/SpotifySample.java | 0 .../spotify/SpotifySampleMatchersTest.java | 0 src/it/spotify-it-jdk8-existing/verify.bsh | 26 + .../spotify-it-jdk8-missing/params.properties | 3 + src/it/spotify-it-jdk8-missing/pom.xml | 272 ++++++++++ .../extensions/spotify/SpotifySample.java | 16 + .../spotify/SpotifySampleMatchersTest.java | 16 + src/it/spotify-it-jdk8-missing/verify.bsh | 26 + .../params.properties | 2 + src/it/spotify-it-jdk9+-existing/pom.xml | 283 ++++++++++ .../extensions/spotify/SpotifySample.java | 16 + .../spotify/SpotifySampleMatchersTest.java | 16 + src/it/spotify-it-jdk9+-existing/verify.bsh | 26 + .../params.properties | 3 + src/it/spotify-it-jdk9+-missing/pom.xml | 277 ++++++++++ .../extensions/spotify/SpotifySample.java | 16 + .../spotify/SpotifySampleMatchersTest.java | 16 + src/it/spotify-it-jdk9+-missing/verify.bsh | 26 + .../wrongannotation-it-jdk8/params.properties | 2 + src/it/wrongannotation-it-jdk8/pom.xml | 272 ++++++++++ .../matchers/samples/WrongAnnotatedEnum.java | 0 .../samples/WrongAnnotatedInterface.java | 0 .../matchers/samples/WrongIgnoreCase1.java | 0 .../matchers/samples/WrongIgnoreCase2.java | 0 src/it/wrongannotation-it-jdk8/verify.bsh | 22 + .../params.properties | 2 + src/it/wrongannotation-it-jdk9+/pom.xml | 278 ++++++++++ .../matchers/samples/WrongAnnotatedEnum.java} | 9 +- .../samples/WrongAnnotatedInterface.java | 31 ++ .../matchers/samples/WrongIgnoreCase1.java | 19 + .../matchers/samples/WrongIgnoreCase2.java | 21 + src/it/wrongannotation-it-jdk9+/verify.bsh | 22 + .../archetype/archetype-resources/pom.xml | 16 +- .../javax.annotation.processing.Processor | 1 - .../javax.annotation.processing.Processor | 1 - .../extensions/matchers/ProvideMatchers.java | 2 +- .../common/AbstractElementMirror.java | 20 +- .../common/AbstractTypeElementMirror.java | 7 +- .../FactoryAnnotatedElementMirror.java | 106 ---- .../FactoryAnnotationsProcessor.java | 97 ---- .../FactoryElementVisitor.java | 32 -- .../factoryprocessor/FactoryGroup.java | 82 --- .../factoryprocessor/RoundMirror.java | 44 -- .../ProvideMatchersMirror.java | 19 +- ...rovidesMatchersAnnotatedElementMirror.java | 4 +- .../provideprocessor/dsl/DSLMethod.java | 2 +- .../fields/FieldDescriptionMetaData.java | 1 - src/main/javadoc/overview.html | 106 ++-- .../javax.annotation.processing.Processor | 3 +- src/main/xslt/only-factory.xsl | 44 -- src/main/xslt/only-providematchers.xsl | 44 -- src/site/apt/archetype.apt | 485 +++++++++--------- src/site/apt/index.apt | 307 +++++------ .../common/AbstractElementMirrorTest.java | 35 +- .../common/AbstractTypeElementMirrorTest.java | 12 +- .../FactoryAnnotatedElementMirrorTest.java | 178 ------- .../FactoryAnnotationProcessorTest.java | 180 ------- .../FactoryElementVisitorTest.java | 83 --- .../factoryprocessor/FactoryGroupTest.java | 131 ----- .../NameExtractorVisitorTest.java | 1 - ...desMatchersAnnotatedElementMirrorTest.java | 4 +- .../provideprocessor/dsl/DSLMethodTest.java | 2 +- ...onStringSpotifyAutomatedExtensionTest.java | 183 ++++--- 319 files changed, 17892 insertions(+), 3069 deletions(-) create mode 100644 .codebeatignore create mode 100644 .travisci/codecov.sh create mode 100644 .travisci/getcodacy.sh create mode 100644 .travisci/reportci.sh delete mode 100644 src/assemble/only-factory.xml delete mode 100644 src/assemble/only-providematchers.xml create mode 100644 src/it/archetype-it-jdk8/params.properties create mode 100644 src/it/archetype-it-jdk8/pom.xml create mode 100644 src/it/archetype-it-jdk8/verify.bsh create mode 100644 src/it/beanmatchers-it-jdk8-existing/params.properties create mode 100644 src/it/beanmatchers-it-jdk8-existing/pom.xml rename src/{test => it/beanmatchers-it-jdk8-existing/src/main}/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/MyTestPojo.java (100%) rename src/{test => it/beanmatchers-it-jdk8-existing/src/main}/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClass.java (100%) rename src/{ => it/beanmatchers-it-jdk8-existing/src}/test/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClassMatchersTest.java (100%) create mode 100644 src/it/beanmatchers-it-jdk8-existing/verify.bsh create mode 100644 src/it/beanmatchers-it-jdk8-missing/params.properties create mode 100644 src/it/beanmatchers-it-jdk8-missing/pom.xml create mode 100644 src/it/beanmatchers-it-jdk8-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/MyTestPojo.java create mode 100644 src/it/beanmatchers-it-jdk8-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClass.java create mode 100644 src/it/beanmatchers-it-jdk8-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClassMatchersTest.java create mode 100644 src/it/beanmatchers-it-jdk8-missing/verify.bsh create mode 100644 src/it/beanmatchers-it-jdk9+-existing/params.properties create mode 100644 src/it/beanmatchers-it-jdk9+-existing/pom.xml create mode 100644 src/it/beanmatchers-it-jdk9+-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/MyTestPojo.java create mode 100644 src/it/beanmatchers-it-jdk9+-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClass.java create mode 100644 src/it/beanmatchers-it-jdk9+-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClassMatchersTest.java create mode 100644 src/it/beanmatchers-it-jdk9+-existing/verify.bsh create mode 100644 src/it/beanmatchers-it-jdk9+-missing/params.properties create mode 100644 src/it/beanmatchers-it-jdk9+-missing/pom.xml create mode 100644 src/it/beanmatchers-it-jdk9+-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/MyTestPojo.java create mode 100644 src/it/beanmatchers-it-jdk9+-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClass.java create mode 100644 src/it/beanmatchers-it-jdk9+-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClassMatchersTest.java create mode 100644 src/it/beanmatchers-it-jdk9+-missing/verify.bsh create mode 100644 src/it/full-it-jdk8/params.properties create mode 100644 src/it/full-it-jdk8/pom.xml rename src/{test => it/full-it-jdk8/src/main}/java/ch/powerunit/extensions/matchers/samples/MapSample.java (100%) rename src/{test => it/full-it-jdk8/src/main}/java/ch/powerunit/extensions/matchers/samples/Pojo1.java (100%) rename src/{test => it/full-it-jdk8/src/main}/java/ch/powerunit/extensions/matchers/samples/Pojo2.java (96%) rename src/{test => it/full-it-jdk8/src/main}/java/ch/powerunit/extensions/matchers/samples/Pojo3.java (96%) rename src/{test => it/full-it-jdk8/src/main}/java/ch/powerunit/extensions/matchers/samples/Pojo4.java (96%) rename src/{test => it/full-it-jdk8/src/main}/java/ch/powerunit/extensions/matchers/samples/PojoClass.java (96%) rename src/{test => it/full-it-jdk8/src/main}/java/ch/powerunit/extensions/matchers/samples/PojoShort.java (96%) rename src/{test => it/full-it-jdk8/src/main}/java/ch/powerunit/extensions/matchers/samples/Sample.java (94%) rename src/{test => it/full-it-jdk8/src/main}/java/ch/powerunit/extensions/matchers/samples/SampleLocalDateTime.java (94%) rename src/{test => it/full-it-jdk8/src/main}/java/ch/powerunit/extensions/matchers/samples/SampleOptional.java (100%) rename src/{test => it/full-it-jdk8/src/main}/java/ch/powerunit/extensions/matchers/samples/SampleSupplier.java (95%) rename src/{test => it/full-it-jdk8/src/main}/java/ch/powerunit/extensions/matchers/samples/SimplePojo.java (95%) rename src/{test => it/full-it-jdk8/src/main}/java/ch/powerunit/extensions/matchers/samples/TwoFieldsPojo.java (95%) rename src/{test => it/full-it-jdk8/src/main}/java/ch/powerunit/extensions/matchers/samples/addmatcher/PojoWithOverrideField.java (97%) rename src/{test => it/full-it-jdk8/src/main}/java/ch/powerunit/extensions/matchers/samples/extension/Includer.java (100%) rename src/{test => it/full-it-jdk8/src/main}/java/ch/powerunit/extensions/matchers/samples/extension/MyPair.java (100%) rename src/{test => it/full-it-jdk8/src/main}/java/ch/powerunit/extensions/matchers/samples/extension/MyPair2.java (100%) rename src/{test => it/full-it-jdk8/src/main}/java/ch/powerunit/extensions/matchers/samples/extension/MyTestWithoutGeneric.java (100%) rename src/{test => it/full-it-jdk8/src/main}/java/ch/powerunit/extensions/matchers/samples/extension/MyTestWithoutGeneric2.java (100%) rename src/{test => it/full-it-jdk8/src/main}/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithSameRoundList.java (96%) rename src/{test => it/full-it-jdk8/src/main}/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringList.java (96%) rename src/{test => it/full-it-jdk8/src/main}/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringSet.java (100%) rename src/{test => it/full-it-jdk8/src/main}/java/ch/powerunit/extensions/matchers/samples/others/Pojo42.java (95%) rename src/{test => it/full-it-jdk8/src/main}/java/ch/powerunit/extensions/matchers/samples/others/Pojo43.java (97%) rename src/{test => it/full-it-jdk8/src/main}/java/ch/powerunit/extensions/matchers/samples/others/PojoRenameMatcher.java (96%) rename src/{test => it/full-it-jdk8/src/main}/java/ch/powerunit/extensions/matchers/samples/others/PojoRenameParentMatcher.java (94%) rename src/{test => it/full-it-jdk8/src/main}/java/ch/powerunit/extensions/matchers/samples/third/ExtendedPojo43.java (96%) rename src/{test => it/full-it-jdk8/src/main}/java/ch/powerunit/extensions/matchers/samples/third/OneFunnyOne.java (100%) rename src/{test => it/full-it-jdk8/src/main}/java/ch/powerunit/extensions/matchers/samples/third/SimpleFullyOne.java (97%) rename src/{ => it/full-it-jdk8/src}/test/java/ch/powerunit/extensions/matchers/samples/MapSampleTest.java (100%) rename src/{ => it/full-it-jdk8/src}/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java (100%) rename src/{ => it/full-it-jdk8/src}/test/java/ch/powerunit/extensions/matchers/samples/Pojo2MatcherTest.java (96%) rename src/{ => it/full-it-jdk8/src}/test/java/ch/powerunit/extensions/matchers/samples/Pojo3MatcherTest.java (96%) rename src/{ => it/full-it-jdk8/src}/test/java/ch/powerunit/extensions/matchers/samples/PojoClassMatchersTest.java (97%) rename src/{ => it/full-it-jdk8/src}/test/java/ch/powerunit/extensions/matchers/samples/SampleLocalDateTimeTest.java (97%) rename src/{ => it/full-it-jdk8/src}/test/java/ch/powerunit/extensions/matchers/samples/SampleOptionalMatchersTest.java (100%) rename src/{ => it/full-it-jdk8/src}/test/java/ch/powerunit/extensions/matchers/samples/SampleOptionalTest.java (100%) rename src/{ => it/full-it-jdk8/src}/test/java/ch/powerunit/extensions/matchers/samples/SampleSupplierTest.java (96%) rename src/{ => it/full-it-jdk8/src}/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithSameRoundListMatchersTest.java (97%) rename src/{ => it/full-it-jdk8/src}/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringListMatchersTest.java (97%) rename src/{ => it/full-it-jdk8/src}/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringSetMatchersTest.java (97%) rename src/{ => it/full-it-jdk8/src}/test/java/ch/powerunit/extensions/matchers/samples/third/OneFunnyOneMatchersTest.java (100%) create mode 100644 src/it/full-it-jdk8/verify.bsh create mode 100644 src/it/full-it-jdk9+/params.properties create mode 100644 src/it/full-it-jdk9+/pom.xml create mode 100644 src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/MapSample.java create mode 100644 src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java create mode 100644 src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo2.java create mode 100644 src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo3.java create mode 100644 src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo4.java create mode 100644 src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/PojoClass.java create mode 100644 src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/PojoShort.java create mode 100644 src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/Sample.java create mode 100644 src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/SampleLocalDateTime.java create mode 100644 src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/SampleOptional.java create mode 100644 src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/SampleSupplier.java create mode 100644 src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/SimplePojo.java create mode 100644 src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/TwoFieldsPojo.java create mode 100644 src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/addmatcher/PojoWithOverrideField.java create mode 100644 src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/extension/Includer.java create mode 100644 src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/extension/MyPair.java create mode 100644 src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/extension/MyPair2.java create mode 100644 src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/extension/MyTestWithoutGeneric.java create mode 100644 src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/extension/MyTestWithoutGeneric2.java create mode 100644 src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithSameRoundList.java create mode 100644 src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringList.java create mode 100644 src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringSet.java create mode 100644 src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/others/Pojo42.java create mode 100644 src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/others/Pojo43.java create mode 100644 src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/others/PojoRenameMatcher.java create mode 100644 src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/others/PojoRenameParentMatcher.java create mode 100644 src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/third/ExtendedPojo43.java create mode 100644 src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/third/OneFunnyOne.java create mode 100644 src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/third/SimpleFullyOne.java create mode 100644 src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/MapSampleTest.java create mode 100644 src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java create mode 100644 src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo2MatcherTest.java create mode 100644 src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo3MatcherTest.java create mode 100644 src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/PojoClassMatchersTest.java create mode 100644 src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/SampleLocalDateTimeTest.java create mode 100644 src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/SampleOptionalMatchersTest.java create mode 100644 src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/SampleOptionalTest.java create mode 100644 src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/SampleSupplierTest.java create mode 100644 src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithSameRoundListMatchersTest.java create mode 100644 src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringListMatchersTest.java create mode 100644 src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringSetMatchersTest.java create mode 100644 src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/third/OneFunnyOneMatchersTest.java create mode 100644 src/it/full-it-jdk9+/verify.bsh create mode 100644 src/it/hamcrestdate-it-jdk8-existing/params.properties create mode 100644 src/it/hamcrestdate-it-jdk8-existing/pom.xml rename src/{test => it/hamcrestdate-it-jdk8-existing/src/main}/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDate.java (100%) rename src/{test => it/hamcrestdate-it-jdk8-existing/src/main}/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateTimeV2.java (100%) rename src/{test => it/hamcrestdate-it-jdk8-existing/src/main}/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalTime.java (100%) rename src/{test => it/hamcrestdate-it-jdk8-existing/src/main}/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleZonedDateTime.java (100%) rename src/{ => it/hamcrestdate-it-jdk8-existing/src}/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateMatchersTest.java (100%) rename src/{ => it/hamcrestdate-it-jdk8-existing/src}/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateTimeV2MatchersTest.java (100%) rename src/{ => it/hamcrestdate-it-jdk8-existing/src}/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalTimeMatchersTest.java (100%) rename src/{ => it/hamcrestdate-it-jdk8-existing/src}/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleZonedDateTimeMatchersTest.java (100%) create mode 100644 src/it/hamcrestdate-it-jdk8-existing/verify.bsh create mode 100644 src/it/hamcrestdate-it-jdk8-missing/params.properties create mode 100644 src/it/hamcrestdate-it-jdk8-missing/pom.xml create mode 100644 src/it/hamcrestdate-it-jdk8-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDate.java create mode 100644 src/it/hamcrestdate-it-jdk8-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateTimeV2.java create mode 100644 src/it/hamcrestdate-it-jdk8-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalTime.java create mode 100644 src/it/hamcrestdate-it-jdk8-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleZonedDateTime.java create mode 100644 src/it/hamcrestdate-it-jdk8-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateMatchersTest.java create mode 100644 src/it/hamcrestdate-it-jdk8-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateTimeV2MatchersTest.java create mode 100644 src/it/hamcrestdate-it-jdk8-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalTimeMatchersTest.java create mode 100644 src/it/hamcrestdate-it-jdk8-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleZonedDateTimeMatchersTest.java create mode 100644 src/it/hamcrestdate-it-jdk8-missing/verify.bsh create mode 100644 src/it/hamcrestdate-it-jdk9+-existing/params.properties create mode 100644 src/it/hamcrestdate-it-jdk9+-existing/pom.xml create mode 100644 src/it/hamcrestdate-it-jdk9+-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDate.java create mode 100644 src/it/hamcrestdate-it-jdk9+-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateTimeV2.java create mode 100644 src/it/hamcrestdate-it-jdk9+-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalTime.java create mode 100644 src/it/hamcrestdate-it-jdk9+-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleZonedDateTime.java create mode 100644 src/it/hamcrestdate-it-jdk9+-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateMatchersTest.java create mode 100644 src/it/hamcrestdate-it-jdk9+-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateTimeV2MatchersTest.java create mode 100644 src/it/hamcrestdate-it-jdk9+-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalTimeMatchersTest.java create mode 100644 src/it/hamcrestdate-it-jdk9+-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleZonedDateTimeMatchersTest.java create mode 100644 src/it/hamcrestdate-it-jdk9+-existing/verify.bsh create mode 100644 src/it/hamcrestdate-it-jdk9+-missing/params.properties create mode 100644 src/it/hamcrestdate-it-jdk9+-missing/pom.xml create mode 100644 src/it/hamcrestdate-it-jdk9+-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDate.java create mode 100644 src/it/hamcrestdate-it-jdk9+-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateTimeV2.java create mode 100644 src/it/hamcrestdate-it-jdk9+-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalTime.java create mode 100644 src/it/hamcrestdate-it-jdk9+-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleZonedDateTime.java create mode 100644 src/it/hamcrestdate-it-jdk9+-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateMatchersTest.java create mode 100644 src/it/hamcrestdate-it-jdk9+-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateTimeV2MatchersTest.java create mode 100644 src/it/hamcrestdate-it-jdk9+-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalTimeMatchersTest.java create mode 100644 src/it/hamcrestdate-it-jdk9+-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleZonedDateTimeMatchersTest.java create mode 100644 src/it/hamcrestdate-it-jdk9+-missing/verify.bsh create mode 100644 src/it/hamcrestutility-it-jdk8-existing/params.properties create mode 100644 src/it/hamcrestutility-it-jdk8-existing/pom.xml create mode 100644 src/it/hamcrestutility-it-jdk8-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojo.java create mode 100644 src/it/hamcrestutility-it-jdk8-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojoMatchersTest.java create mode 100644 src/it/hamcrestutility-it-jdk8-existing/verify.bsh create mode 100644 src/it/hamcrestutility-it-jdk8-missing/params.properties create mode 100644 src/it/hamcrestutility-it-jdk8-missing/pom.xml create mode 100644 src/it/hamcrestutility-it-jdk8-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojo.java create mode 100644 src/it/hamcrestutility-it-jdk8-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojoMatchersTest.java create mode 100644 src/it/hamcrestutility-it-jdk8-missing/verify.bsh create mode 100644 src/it/hamcrestutility-it-jdk9+-existing/params.properties create mode 100644 src/it/hamcrestutility-it-jdk9+-existing/pom.xml create mode 100644 src/it/hamcrestutility-it-jdk9+-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojo.java create mode 100644 src/it/hamcrestutility-it-jdk9+-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojoMatchersTest.java create mode 100644 src/it/hamcrestutility-it-jdk9+-existing/verify.bsh create mode 100644 src/it/hamcrestutility-it-jdk9+-missing/params.properties create mode 100644 src/it/hamcrestutility-it-jdk9+-missing/pom.xml create mode 100644 src/it/hamcrestutility-it-jdk9+-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojo.java create mode 100644 src/it/hamcrestutility-it-jdk9+-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojoMatchersTest.java create mode 100644 src/it/hamcrestutility-it-jdk9+-missing/verify.bsh create mode 100644 src/it/provider-factory-disabled-it-jdk/params.properties create mode 100644 src/it/provider-factory-disabled-it-jdk/pom.xml create mode 100644 src/it/provider-factory-disabled-it-jdk/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java create mode 100644 src/it/provider-factory-disabled-it-jdk/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java create mode 100644 src/it/provider-factory-disabled-it-jdk/verify.bsh create mode 100644 src/it/provider-factory-disabled-it-jdk9+/params.properties create mode 100644 src/it/provider-factory-disabled-it-jdk9+/pom.xml create mode 100644 src/it/provider-factory-disabled-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java create mode 100644 src/it/provider-factory-disabled-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java create mode 100644 src/it/provider-factory-disabled-it-jdk9+/verify.bsh create mode 100644 src/it/provider-factory-enabled-it-jdk/params.properties create mode 100644 src/it/provider-factory-enabled-it-jdk/pom.xml create mode 100644 src/it/provider-factory-enabled-it-jdk/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java create mode 100644 src/it/provider-factory-enabled-it-jdk/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java create mode 100644 src/it/provider-factory-enabled-it-jdk/verify.bsh create mode 100644 src/it/provider-factory-enabled-it-jdk9+/params.properties create mode 100644 src/it/provider-factory-enabled-it-jdk9+/pom.xml create mode 100644 src/it/provider-factory-enabled-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java create mode 100644 src/it/provider-factory-enabled-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java create mode 100644 src/it/provider-factory-enabled-it-jdk9+/verify.bsh create mode 100644 src/it/settings.xml create mode 100644 src/it/setup/params.properties create mode 100644 src/it/setup/pom.xml create mode 100644 src/it/setup/verify.bsh create mode 100644 src/it/simple-it-jdk8-hamcrest21/params.properties create mode 100644 src/it/simple-it-jdk8-hamcrest21/pom.xml create mode 100644 src/it/simple-it-jdk8-hamcrest21/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java create mode 100644 src/it/simple-it-jdk8-hamcrest21/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java create mode 100644 src/it/simple-it-jdk8-hamcrest21/verify.bsh create mode 100644 src/it/simple-it-jdk8-hamcrest22/params.properties create mode 100644 src/it/simple-it-jdk8-hamcrest22/pom.xml create mode 100644 src/it/simple-it-jdk8-hamcrest22/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java create mode 100644 src/it/simple-it-jdk8-hamcrest22/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java create mode 100644 src/it/simple-it-jdk8-hamcrest22/verify.bsh create mode 100644 src/it/simple-it-jdk8-missinghamcrest/params.properties create mode 100644 src/it/simple-it-jdk8-missinghamcrest/pom.xml create mode 100644 src/it/simple-it-jdk8-missinghamcrest/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java create mode 100644 src/it/simple-it-jdk8-missinghamcrest/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java create mode 100644 src/it/simple-it-jdk8-missinghamcrest/verify.bsh create mode 100644 src/it/simple-it-jdk8/params.properties create mode 100644 src/it/simple-it-jdk8/pom.xml create mode 100644 src/it/simple-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java create mode 100644 src/it/simple-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java create mode 100644 src/it/simple-it-jdk8/verify.bsh create mode 100644 src/it/simple-it-jdk9+-hamcrest21/params.properties create mode 100644 src/it/simple-it-jdk9+-hamcrest21/pom.xml create mode 100644 src/it/simple-it-jdk9+-hamcrest21/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java create mode 100644 src/it/simple-it-jdk9+-hamcrest21/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java create mode 100644 src/it/simple-it-jdk9+-hamcrest21/verify.bsh create mode 100644 src/it/simple-it-jdk9+-hamcrest22/params.properties create mode 100644 src/it/simple-it-jdk9+-hamcrest22/pom.xml create mode 100644 src/it/simple-it-jdk9+-hamcrest22/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java create mode 100644 src/it/simple-it-jdk9+-hamcrest22/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java create mode 100644 src/it/simple-it-jdk9+-hamcrest22/verify.bsh create mode 100644 src/it/simple-it-jdk9+-missinghamcrest/params.properties create mode 100644 src/it/simple-it-jdk9+-missinghamcrest/pom.xml create mode 100644 src/it/simple-it-jdk9+-missinghamcrest/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java create mode 100644 src/it/simple-it-jdk9+-missinghamcrest/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java create mode 100644 src/it/simple-it-jdk9+-missinghamcrest/verify.bsh create mode 100644 src/it/simple-it-jdk9+/params.properties create mode 100644 src/it/simple-it-jdk9+/pom.xml create mode 100644 src/it/simple-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java create mode 100644 src/it/simple-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java create mode 100644 src/it/simple-it-jdk9+/verify.bsh create mode 100644 src/it/spotify-it-jdk8-existing/params.properties create mode 100644 src/it/spotify-it-jdk8-existing/pom.xml rename src/{test => it/spotify-it-jdk8-existing/src/main}/java/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySample.java (100%) rename src/{ => it/spotify-it-jdk8-existing/src}/test/java/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySampleMatchersTest.java (100%) create mode 100644 src/it/spotify-it-jdk8-existing/verify.bsh create mode 100644 src/it/spotify-it-jdk8-missing/params.properties create mode 100644 src/it/spotify-it-jdk8-missing/pom.xml create mode 100644 src/it/spotify-it-jdk8-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySample.java create mode 100644 src/it/spotify-it-jdk8-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySampleMatchersTest.java create mode 100644 src/it/spotify-it-jdk8-missing/verify.bsh create mode 100644 src/it/spotify-it-jdk9+-existing/params.properties create mode 100644 src/it/spotify-it-jdk9+-existing/pom.xml create mode 100644 src/it/spotify-it-jdk9+-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySample.java create mode 100644 src/it/spotify-it-jdk9+-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySampleMatchersTest.java create mode 100644 src/it/spotify-it-jdk9+-existing/verify.bsh create mode 100644 src/it/spotify-it-jdk9+-missing/params.properties create mode 100644 src/it/spotify-it-jdk9+-missing/pom.xml create mode 100644 src/it/spotify-it-jdk9+-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySample.java create mode 100644 src/it/spotify-it-jdk9+-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySampleMatchersTest.java create mode 100644 src/it/spotify-it-jdk9+-missing/verify.bsh create mode 100644 src/it/wrongannotation-it-jdk8/params.properties create mode 100644 src/it/wrongannotation-it-jdk8/pom.xml rename src/{test => it/wrongannotation-it-jdk8/src/main}/java/ch/powerunit/extensions/matchers/samples/WrongAnnotatedEnum.java (100%) rename src/{test => it/wrongannotation-it-jdk8/src/main}/java/ch/powerunit/extensions/matchers/samples/WrongAnnotatedInterface.java (100%) rename src/{test => it/wrongannotation-it-jdk8/src/main}/java/ch/powerunit/extensions/matchers/samples/WrongIgnoreCase1.java (100%) rename src/{test => it/wrongannotation-it-jdk8/src/main}/java/ch/powerunit/extensions/matchers/samples/WrongIgnoreCase2.java (100%) create mode 100644 src/it/wrongannotation-it-jdk8/verify.bsh create mode 100644 src/it/wrongannotation-it-jdk9+/params.properties create mode 100644 src/it/wrongannotation-it-jdk9+/pom.xml rename src/{main/java/ch/powerunit/extensions/matchers/factoryprocessor/package-info.java => it/wrongannotation-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/WrongAnnotatedEnum.java} (83%) create mode 100644 src/it/wrongannotation-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/WrongAnnotatedInterface.java create mode 100644 src/it/wrongannotation-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/WrongIgnoreCase1.java create mode 100644 src/it/wrongannotation-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/WrongIgnoreCase2.java create mode 100644 src/it/wrongannotation-it-jdk9+/verify.bsh delete mode 100644 src/main/dedicated-jar/factory/META-INF/services/javax.annotation.processing.Processor delete mode 100644 src/main/dedicated-jar/providematchers/META-INF/services/javax.annotation.processing.Processor delete mode 100644 src/main/java/ch/powerunit/extensions/matchers/factoryprocessor/FactoryAnnotatedElementMirror.java delete mode 100644 src/main/java/ch/powerunit/extensions/matchers/factoryprocessor/FactoryAnnotationsProcessor.java delete mode 100644 src/main/java/ch/powerunit/extensions/matchers/factoryprocessor/FactoryElementVisitor.java delete mode 100644 src/main/java/ch/powerunit/extensions/matchers/factoryprocessor/FactoryGroup.java delete mode 100644 src/main/java/ch/powerunit/extensions/matchers/factoryprocessor/RoundMirror.java delete mode 100644 src/main/xslt/only-factory.xsl delete mode 100644 src/main/xslt/only-providematchers.xsl delete mode 100644 src/test/java/ch/powerunit/extensions/matchers/factoryprocessor/FactoryAnnotatedElementMirrorTest.java delete mode 100644 src/test/java/ch/powerunit/extensions/matchers/factoryprocessor/FactoryAnnotationProcessorTest.java delete mode 100644 src/test/java/ch/powerunit/extensions/matchers/factoryprocessor/FactoryElementVisitorTest.java delete mode 100644 src/test/java/ch/powerunit/extensions/matchers/factoryprocessor/FactoryGroupTest.java diff --git a/.bettercodehub.yml b/.bettercodehub.yml index 6a8c6cc91..60022f48b 100644 --- a/.bettercodehub.yml +++ b/.bettercodehub.yml @@ -1,3 +1,5 @@ component_depth: 8 languages: - java +exclude: +- /src/it/.* \ No newline at end of file diff --git a/.codebeatignore b/.codebeatignore new file mode 100644 index 000000000..7b12ef6be --- /dev/null +++ b/.codebeatignore @@ -0,0 +1 @@ +src/it/** diff --git a/.travis.yml b/.travis.yml index 058a0df50..5403fac71 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,19 +15,32 @@ addons: before_install: - cp .travis.settings.xml $HOME/.m2/settings.xml - if [[ "$TRAVIS_OS_NAME" = linux ]]; then sudo apt-get install jshon ; fi + - mkdir -p $HOME/.script + - curl -s https://report.ci/annotate.py > $HOME/.script/annotate.py + - curl -s https://report.ci/upload.py > $HOME/.script/upload.py + - curl -s https://codecov.io/bash > $HOME/.script/codecov.bash + - chmod +x $HOME/.script/codecov.bash + - chmod +x .travisci/*.sh install: - "mvn dependency:resolve dependency:resolve-plugins" +- .travisci/getcodacy.sh script: -- "mvn -e clean install" +- set -o pipefail +- "mvn -e clean install 2>&1 | tee maven.log" +after_failure: +- set +o pipefail +- rm -rf target/local-repo +- .travisci/reportci.sh after_success: +- set +o pipefail +- rm -rf target/local-repo +- .travisci/reportci.sh - "mvn jacoco:report coveralls:report -DrepoToken=${repoToken}" -- "bash <(curl -s https://codecov.io/bash) -c -Funit$TRAVIS_OS_NAME$TRAVIS_JDK_VERSION" -- "mvn jacoco:report-integration" -- "bash <(curl -s https://codecov.io/bash) -c -Fcompiler$TRAVIS_OS_NAME$TRAVIS_JDK_VERSION" -- "mvn org.apache.maven.plugins:maven-dependency-plugin:copy -Dartifact=com.codacy:codacy-coverage-reporter:5.0.310:jar:assembly -Dtransitive" +- .travisci/codecov.sh - "mvn jacoco:merge -Djacoco.destFile=target/jacoco-aggregate.exe" - "mvn jacoco:report -Djacoco.dataFile=target/jacoco-aggregate.exe" -- "(cd target/dependency && java -jar codacy-coverage-reporter-5.0.310-assembly.jar report -l Java -r ../site/jacoco/jacoco.xml)" +- "(java -jar $HOME/.script/codacy-coverage-reporter.jar report -l Java -r target/site/jacoco/jacoco.xml)" +- "$HOME/.script/codecov.bash -Ffull$TRAVIS_OS_NAME$TRAVIS_JDK_VERSION" - "mvn site" before_deploy: - git config --local user.name "powerunitci" diff --git a/.travisci/codecov.sh b/.travisci/codecov.sh new file mode 100644 index 000000000..b30f4ae83 --- /dev/null +++ b/.travisci/codecov.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +mvn jacoco:report +"$HOME/.script/codecov.bash" -F"unit$TRAVIS_OS_NAME$TRAVIS_JDK_VERSION" +mvn jacoco:report-integration +"$HOME/.script/codecov.bash" -F"compiler$TRAVIS_OS_NAME$TRAVIS_JDK_VERSION" + +(cd target/it && + for name in * ; do + (cd "$name" && test -e "build.log" && + ( + mvn jacoco:report && + "$HOME/.script/codecov.bash" -s . -F"unit$(echo "$name" | sed 's/[+-]//g')$TRAVIS_OS_NAME$TRAVIS_JDK_VERSION" || echo 'NOT POSSIBLE'; + mvn jacoco:report-integration && + "$HOME/.script/codecov.bash" -s . -F"compiler$(echo "$name" | sed 's/[+-]//g')$TRAVIS_OS_NAME$TRAVIS_JDK_VERSION" || echo 'NOT POSSIBLE'; + ) + ); + done;) diff --git a/.travisci/getcodacy.sh b/.travisci/getcodacy.sh new file mode 100644 index 000000000..cfedfa68d --- /dev/null +++ b/.travisci/getcodacy.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +if test "$TRAVIS_JDK_VERSION" = openjdk8 ; then + mvn org.apache.maven.plugins:maven-dependency-plugin:copy -Dartifact=com.codacy:codacy-coverage-reporter:5.0.310:jar:assembly -Dmdep.stripVersion=true -Dmdep.stripClassifier=true -Dtransitive; +else + mvn org.apache.maven.plugins:maven-dependency-plugin:copy -Dartifact=com.codacy:codacy-coverage-reporter:6.0.0:jar:assembly -Dmdep.stripVersion=true -Dmdep.stripClassifier=true -Dtransitive; +fi; + +cp target/dependency/codacy-coverage-reporter.jar "$HOME/.script" diff --git a/.travisci/reportci.sh b/.travisci/reportci.sh new file mode 100644 index 000000000..4f5c5e32d --- /dev/null +++ b/.travisci/reportci.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +python - --name "annotate$TRAVIS_OS_NAME$TRAVIS_JDK_VERSION" --tool java --input maven.log < "$HOME/.script/annotate.py" + +python - --name "upload$TRAVIS_OS_NAME$TRAVIS_JDK_VERSION" --include='*.xml' --framework=junit < "$HOME/.script/upload.py" + +(cd target/it && + for name in * ; do + python - --name "$name-$TRAVIS_OS_NAME$TRAVIS_JDK_VERSION" --tool java --input "$name/build.log" < "$HOME/.script/annotate.py" || echo 'NOT FOUND'; + done;) + diff --git a/pom.xml b/pom.xml index bd0a6ac1f..d1af9fcf1 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,6 @@ 1.8 1.8 UTF-8 - 1.3 2.22.2 https://oss.sonatype.org/content/repositories/snapshots oss-snapshots @@ -294,6 +293,7 @@ ${project.build.directory} *.exec + it/**/*.exec @@ -318,6 +318,43 @@ + + maven-invoker-plugin + + ${project.build.directory}/it + ${project.build.directory}/local-repo + prepare.bsh + verify.bsh + src/it/settings.xml + params.properties + true + 3 + + org.hamcrest:hamcrest:2.2:jar + org.hamcrest:hamcrest:2.1:jar + + + + + integration-test + + install + run + + + + + + maven-archetype-plugin + + + install + + update-local-catalog + + + + org.apache.maven.plugins maven-javadoc-plugin @@ -333,9 +370,6 @@ ch.powerunit.extensions.matchers.factoryprocessor*:ch.powerunit.extensions.matchers.provideprocessor*:ch.powerunit.extensions.matchers.common* true false - - http://hamcrest.org/JavaHamcrest/javadoc/1.3/ -
]]>
@@ -379,7 +413,6 @@ true -J${testcompileargs} - -Ach.powerunit.extensions.matchers.factoryprocessor.FactoryAnnotationsProcessor.targets=.*:ch.powerunit.extensions.matchers.samples.AllMatchers -Ach.powerunit.extensions.matchers.provideprocessor.ProvidesMatchersAnnotationsProcessor.factory=ch.powerunit.extensions.matchers.samples.AllMatchersAlternate @@ -426,36 +459,6 @@ - - ${basedir} - ${project.build.directory} - - pom.xml - - src/main/xslt/only-providematchers.xsl - - - .xml$ - -only-providematchers.xml - - - - - ${basedir} - ${project.build.directory} - - pom.xml - - src/main/xslt/only-factory.xsl - - - .xml$ - -only-factory.xml - - - ${basedir} ${project.build.directory} @@ -474,38 +477,11 @@ -
maven-assembly-plugin - - only-providematchers - package - - single - - - - src/assemble/only-providematchers.xml - - false - - - - only-factory - package - - single - - - - src/assemble/only-factory.xml - - false - - archetype package @@ -538,16 +514,19 @@ ${project.build.directory}/pom-archetype.xml - - - - maven-archetype-plugin - - install + install archetype for test + pre-integration-test - update-local-catalog + install-file + + ${project.build.directory}/${project.artifactId}-${project.version}-archetype.jar + ${project.artifactId}-archetype + ${project.groupId} + ${project.build.directory}/pom-archetype.xml + ${project.build.directory}/local-repo + @@ -557,6 +536,13 @@ 4.3.0 + + + javax.xml.bind + jaxb-api + 2.3.1 + + @@ -619,40 +605,6 @@ sign - - sign-and-deploy-provide - deploy - - sign-and-deploy-file - - - ${deploy.url} - ${project.build.directory}/${project.artifactId}-${project.version}-only-providematchers.jar - ${project.artifactId}-providematchers - ${project.groupId} - ${project.build.directory}/pom-only-providematchers.xml - ${deploy.id} - ${project.build.directory}/${project.artifactId}-${project.version}-javadoc.jar - ${project.build.directory}/${project.artifactId}-${project.version}-sources.jar - - - - sign-and-deploy-factory - deploy - - sign-and-deploy-file - - - ${deploy.url} - ${project.build.directory}/${project.artifactId}-${project.version}-only-factory.jar - ${project.artifactId}-factory - ${project.groupId} - ${project.build.directory}/pom-only-factory.xml - ${deploy.id} - ${project.build.directory}/${project.artifactId}-${project.version}-javadoc.jar - ${project.build.directory}/${project.artifactId}-${project.version}-sources.jar - - sign-and-deploy-archetype deploy @@ -687,9 +639,6 @@ ch.powerunit.extensions.matchers.factoryprocessor*:ch.powerunit.extensions.matchers.provideprocessor*:ch.powerunit.extensions.matchers.common* true true - - http://hamcrest.org/JavaHamcrest/javadoc/1.3/ -
]]>
@@ -743,11 +692,6 @@ - - org.hamcrest - hamcrest-all - ${hamcrest.version} - ch.powerunit powerunit diff --git a/src/assemble/only-factory.xml b/src/assemble/only-factory.xml deleted file mode 100644 index 46453339a..000000000 --- a/src/assemble/only-factory.xml +++ /dev/null @@ -1,43 +0,0 @@ - - only-factory - - jar - - false - - - / - true - true - runtime - - org.hamcrest:hamcrest-all - - - - **/Factory.class - - - - - - - - target/classes - / - - **/provideprocessor/** - **/ProvideMatchers* - **/*Matcher* - META-INF/services/javax.annotation.processing.Processor - - - - src/main/dedicated-jar/factory - / - - - \ No newline at end of file diff --git a/src/assemble/only-providematchers.xml b/src/assemble/only-providematchers.xml deleted file mode 100644 index 0b7179a3d..000000000 --- a/src/assemble/only-providematchers.xml +++ /dev/null @@ -1,24 +0,0 @@ - - only-providematchers - - jar - - false - - - target/classes - / - - **/factoryprocessor/** - META-INF/services/javax.annotation.processing.Processor - - - - src/main/dedicated-jar/providematchers - / - - - \ No newline at end of file diff --git a/src/it/archetype-it-jdk8/params.properties b/src/it/archetype-it-jdk8/params.properties new file mode 100644 index 000000000..69906a592 --- /dev/null +++ b/src/it/archetype-it-jdk8/params.properties @@ -0,0 +1,2 @@ +invoker.java.version=1.8,!9,!10,!11 +invoker.goals=org.apache.maven.plugins:maven-archetype-plugin:generate -DgroupId=ch.test -DartifactId=testme1 -Dversion=1.0-SNAPSHOT -Dpackage=ch.test.testme -DarchetypeCatalog=local \ No newline at end of file diff --git a/src/it/archetype-it-jdk8/pom.xml b/src/it/archetype-it-jdk8/pom.xml new file mode 100644 index 000000000..d2d41774f --- /dev/null +++ b/src/it/archetype-it-jdk8/pom.xml @@ -0,0 +1,31 @@ + + 4.0.0 + ch.powerunit.extensions + powerunit-extensions-matchers-it51 + @project.version@ + + pom + + + false + ch.powerunit.extensions + powerunit-extensions-matchers-archetype + @project.version@ + clean install -s ../../../interpolated-settings.xml -Dmaven.repo.local=${basedir}/../../local-repo -B + ${basedir}/target + + + + + + + org.apache.maven.plugins + maven-archetype-plugin + 3.1.2 + + + + + + \ No newline at end of file diff --git a/src/it/archetype-it-jdk8/verify.bsh b/src/it/archetype-it-jdk8/verify.bsh new file mode 100644 index 000000000..9adc23f13 --- /dev/null +++ b/src/it/archetype-it-jdk8/verify.bsh @@ -0,0 +1,7 @@ +import java.io.*; + +File file = new File( basedir, "build.log" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not build log: " + file ); +} diff --git a/src/it/beanmatchers-it-jdk8-existing/params.properties b/src/it/beanmatchers-it-jdk8-existing/params.properties new file mode 100644 index 000000000..ab922d13c --- /dev/null +++ b/src/it/beanmatchers-it-jdk8-existing/params.properties @@ -0,0 +1,2 @@ +invoker.java.version=1.8,!9,!10,!11 +invoker.goals=clean install diff --git a/src/it/beanmatchers-it-jdk8-existing/pom.xml b/src/it/beanmatchers-it-jdk8-existing/pom.xml new file mode 100644 index 000000000..e90b006ee --- /dev/null +++ b/src/it/beanmatchers-it-jdk8-existing/pom.xml @@ -0,0 +1,278 @@ + + 4.0.0 + ch.powerunit.extensions + powerunit-extensions-matchers-it50 + @project.version@ + + jar + + + 1.8 + 1.8 + UTF-8 + 1.3 + 2.22.2 + 0.5.0 + + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.11.2 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.5 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.13.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-archetype-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + + ch.powerunit + powerunit + ${powerunit.version} + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.9.0 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.version} + + + com.github.github + site-maven-plugin + 0.12 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + org.codehaus.mojo + jaxb2-maven-plugin + 2.5.0 + + + org.apache.maven.plugins + maven-changes-plugin + 2.12.1 + + + GitHub + + + + + org.codehaus.mojo + sonar-maven-plugin + 3.7.0.1746 + + + maven-invoker-plugin + 3.2.1 + + + maven-assembly-plugin + 3.3.0 + + + org.codehaus.mojo + xml-maven-plugin + 1.0.2 + + + maven-deploy-plugin + 2.8.2 + + + maven-install-plugin + 2.5.2 + + + + + + org.jacoco + jacoco-maven-plugin + + + + ${project.build.directory} + + *.exec + + + + + + + default-prepare-agent-1 + + prepare-agent + + + + default-prepare-agent-2 + initialize + + prepare-agent-integration + + + testcompileargs + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + jar + test-jar + + + + + true + false + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.source.version} + ${java.target.version} + true + + -J${testcompileargs} + + + + + + + + + org.hamcrest + hamcrest-all + ${hamcrest.version} + + + ch.powerunit + powerunit + ${powerunit.version} + test + + + ch.powerunit.extensions + powerunit-extensions-matchers + @project.version@ + + + com.google.code.bean-matchers + bean-matchers + 0.12 + true + + + \ No newline at end of file diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/MyTestPojo.java b/src/it/beanmatchers-it-jdk8-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/MyTestPojo.java similarity index 100% rename from src/test/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/MyTestPojo.java rename to src/it/beanmatchers-it-jdk8-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/MyTestPojo.java diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClass.java b/src/it/beanmatchers-it-jdk8-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClass.java similarity index 100% rename from src/test/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClass.java rename to src/it/beanmatchers-it-jdk8-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClass.java diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClassMatchersTest.java b/src/it/beanmatchers-it-jdk8-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClassMatchersTest.java similarity index 100% rename from src/test/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClassMatchersTest.java rename to src/it/beanmatchers-it-jdk8-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClassMatchersTest.java diff --git a/src/it/beanmatchers-it-jdk8-existing/verify.bsh b/src/it/beanmatchers-it-jdk8-existing/verify.bsh new file mode 100644 index 000000000..7956527f8 --- /dev/null +++ b/src/it/beanmatchers-it-jdk8-existing/verify.bsh @@ -0,0 +1,26 @@ +import java.io.*; + +File file = new File( basedir, "build.log" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not build log: " + file ); +} + + +file = new File( basedir, "target/generated-sources/annotations/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClassMatchers.java" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find generated Matcher: " + file ); +} + +file = new File( basedir, "target/classes/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClassMatchers.class" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find compiled Matcher: " + file ); +} + +file = new File( basedir, "target/test-classes/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClassMatchersTest.class" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find compiled Test of the matcher: " + file ); +} diff --git a/src/it/beanmatchers-it-jdk8-missing/params.properties b/src/it/beanmatchers-it-jdk8-missing/params.properties new file mode 100644 index 000000000..1a20829cb --- /dev/null +++ b/src/it/beanmatchers-it-jdk8-missing/params.properties @@ -0,0 +1,3 @@ +invoker.java.version=1.8,!9,!10,!11 +invoker.goals=clean install +invoker.buildResult = failure \ No newline at end of file diff --git a/src/it/beanmatchers-it-jdk8-missing/pom.xml b/src/it/beanmatchers-it-jdk8-missing/pom.xml new file mode 100644 index 000000000..7ca685f04 --- /dev/null +++ b/src/it/beanmatchers-it-jdk8-missing/pom.xml @@ -0,0 +1,272 @@ + + 4.0.0 + ch.powerunit.extensions + powerunit-extensions-matchers-it42 + @project.version@ + + jar + + + 1.8 + 1.8 + UTF-8 + 1.3 + 2.22.2 + 0.5.0 + + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.11.2 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.5 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.13.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-archetype-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + + ch.powerunit + powerunit + ${powerunit.version} + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.9.0 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.version} + + + com.github.github + site-maven-plugin + 0.12 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + org.codehaus.mojo + jaxb2-maven-plugin + 2.5.0 + + + org.apache.maven.plugins + maven-changes-plugin + 2.12.1 + + + GitHub + + + + + org.codehaus.mojo + sonar-maven-plugin + 3.7.0.1746 + + + maven-invoker-plugin + 3.2.1 + + + maven-assembly-plugin + 3.3.0 + + + org.codehaus.mojo + xml-maven-plugin + 1.0.2 + + + maven-deploy-plugin + 2.8.2 + + + maven-install-plugin + 2.5.2 + + + + + + org.jacoco + jacoco-maven-plugin + + + + ${project.build.directory} + + *.exec + + + + + + + default-prepare-agent-1 + + prepare-agent + + + + default-prepare-agent-2 + initialize + + prepare-agent-integration + + + testcompileargs + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + jar + test-jar + + + + + true + false + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.source.version} + ${java.target.version} + true + + -J${testcompileargs} + + + + + + + + + org.hamcrest + hamcrest-all + ${hamcrest.version} + + + ch.powerunit + powerunit + ${powerunit.version} + test + + + ch.powerunit.extensions + powerunit-extensions-matchers + @project.version@ + + + \ No newline at end of file diff --git a/src/it/beanmatchers-it-jdk8-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/MyTestPojo.java b/src/it/beanmatchers-it-jdk8-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/MyTestPojo.java new file mode 100644 index 000000000..8b10045df --- /dev/null +++ b/src/it/beanmatchers-it-jdk8-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/MyTestPojo.java @@ -0,0 +1,44 @@ +package ch.powerunit.extensions.matchers.samples.extensions.beanmatchers; + +public class MyTestPojo { + private String test; + + public String getTest() { + return test; + } + + public void setTest(String test) { + this.test = test; + } + + @Override + public String toString() { + return "MyTestPojo [test=" + test + "]"; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((test == null) ? 0 : test.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + MyTestPojo other = (MyTestPojo) obj; + if (test == null) { + if (other.test != null) + return false; + } else if (!test.equals(other.test)) + return false; + return true; + } + +} diff --git a/src/it/beanmatchers-it-jdk8-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClass.java b/src/it/beanmatchers-it-jdk8-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClass.java new file mode 100644 index 000000000..814f0043b --- /dev/null +++ b/src/it/beanmatchers-it-jdk8-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClass.java @@ -0,0 +1,15 @@ +/** + * + */ +package ch.powerunit.extensions.matchers.samples.extensions.beanmatchers; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * + */ +@ProvideMatchers +public class SampleClass { + public Class underTest; +} diff --git a/src/it/beanmatchers-it-jdk8-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClassMatchersTest.java b/src/it/beanmatchers-it-jdk8-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClassMatchersTest.java new file mode 100644 index 000000000..0b283d775 --- /dev/null +++ b/src/it/beanmatchers-it-jdk8-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClassMatchersTest.java @@ -0,0 +1,20 @@ +/** + * + */ +package ch.powerunit.extensions.matchers.samples.extensions.beanmatchers; + +import ch.powerunit.Test; +import ch.powerunit.TestSuite; + +/** + * @author borettim + * + */ +public class SampleClassMatchersTest implements TestSuite { + @Test + public void testBeanMatcher() { + SampleClass sc = new SampleClass(); + sc.underTest = MyTestPojo.class; + assertThat(sc).is(SampleClassMatchers.sampleClassWith().underTestIsAValidBean()); + } +} diff --git a/src/it/beanmatchers-it-jdk8-missing/verify.bsh b/src/it/beanmatchers-it-jdk8-missing/verify.bsh new file mode 100644 index 000000000..d0b06ab0b --- /dev/null +++ b/src/it/beanmatchers-it-jdk8-missing/verify.bsh @@ -0,0 +1,26 @@ +import java.io.*; + +File file = new File( basedir, "build.log" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not build log: " + file ); +} + + +file = new File( basedir, "target/generated-sources/annotations/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClassMatchers.java" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find generated Matcher: " + file ); +} + +file = new File( basedir, "target/classes/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClassMatchers.class" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find compiled Matcher: " + file ); +} + +file = new File( basedir, "target/test-classes/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClassMatchersTest.class" ); +if ( file.isFile() ) +{ + throw new FileNotFoundException( "Find compiled tester of the matcher, but should not: " + file ); +} diff --git a/src/it/beanmatchers-it-jdk9+-existing/params.properties b/src/it/beanmatchers-it-jdk9+-existing/params.properties new file mode 100644 index 000000000..714c1431d --- /dev/null +++ b/src/it/beanmatchers-it-jdk9+-existing/params.properties @@ -0,0 +1,2 @@ +invoker.java.version=!1.8,9,10,11+ +invoker.goals=clean install diff --git a/src/it/beanmatchers-it-jdk9+-existing/pom.xml b/src/it/beanmatchers-it-jdk9+-existing/pom.xml new file mode 100644 index 000000000..3f7d2b407 --- /dev/null +++ b/src/it/beanmatchers-it-jdk9+-existing/pom.xml @@ -0,0 +1,282 @@ + + 4.0.0 + ch.powerunit.extensions + powerunit-extensions-matchers-it40 + @project.version@ + + jar + + + 1.8 + 1.8 + UTF-8 + 1.3 + 2.22.2 + 0.5.0 + + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.11.2 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.5 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.13.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-archetype-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + + ch.powerunit + powerunit + ${powerunit.version} + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.9.0 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.version} + + + com.github.github + site-maven-plugin + 0.12 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + org.codehaus.mojo + jaxb2-maven-plugin + 2.5.0 + + + org.apache.maven.plugins + maven-changes-plugin + 2.12.1 + + + GitHub + + + + + org.codehaus.mojo + sonar-maven-plugin + 3.7.0.1746 + + + maven-invoker-plugin + 3.2.1 + + + maven-assembly-plugin + 3.3.0 + + + org.codehaus.mojo + xml-maven-plugin + 1.0.2 + + + maven-deploy-plugin + 2.8.2 + + + maven-install-plugin + 2.5.2 + + + + + + org.jacoco + jacoco-maven-plugin + + + + ${project.build.directory} + + *.exec + + + + + + + default-prepare-agent-1 + + prepare-agent + + + + default-prepare-agent-2 + initialize + + prepare-agent-integration + + + testcompileargs + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + jar + test-jar + + + + + true + false + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.source.version} + ${java.target.version} + true + + -J${testcompileargs} + + + + + + + + + org.hamcrest + hamcrest-all + ${hamcrest.version} + + + ch.powerunit + powerunit + ${powerunit.version} + test + + + ch.powerunit.extensions + powerunit-extensions-matchers + @project.version@ + + + com.google.code.bean-matchers + bean-matchers + 0.12 + true + + javax.annotation + javax.annotation-api + 1.3.2 + + + \ No newline at end of file diff --git a/src/it/beanmatchers-it-jdk9+-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/MyTestPojo.java b/src/it/beanmatchers-it-jdk9+-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/MyTestPojo.java new file mode 100644 index 000000000..8b10045df --- /dev/null +++ b/src/it/beanmatchers-it-jdk9+-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/MyTestPojo.java @@ -0,0 +1,44 @@ +package ch.powerunit.extensions.matchers.samples.extensions.beanmatchers; + +public class MyTestPojo { + private String test; + + public String getTest() { + return test; + } + + public void setTest(String test) { + this.test = test; + } + + @Override + public String toString() { + return "MyTestPojo [test=" + test + "]"; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((test == null) ? 0 : test.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + MyTestPojo other = (MyTestPojo) obj; + if (test == null) { + if (other.test != null) + return false; + } else if (!test.equals(other.test)) + return false; + return true; + } + +} diff --git a/src/it/beanmatchers-it-jdk9+-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClass.java b/src/it/beanmatchers-it-jdk9+-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClass.java new file mode 100644 index 000000000..814f0043b --- /dev/null +++ b/src/it/beanmatchers-it-jdk9+-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClass.java @@ -0,0 +1,15 @@ +/** + * + */ +package ch.powerunit.extensions.matchers.samples.extensions.beanmatchers; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * + */ +@ProvideMatchers +public class SampleClass { + public Class underTest; +} diff --git a/src/it/beanmatchers-it-jdk9+-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClassMatchersTest.java b/src/it/beanmatchers-it-jdk9+-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClassMatchersTest.java new file mode 100644 index 000000000..0b283d775 --- /dev/null +++ b/src/it/beanmatchers-it-jdk9+-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClassMatchersTest.java @@ -0,0 +1,20 @@ +/** + * + */ +package ch.powerunit.extensions.matchers.samples.extensions.beanmatchers; + +import ch.powerunit.Test; +import ch.powerunit.TestSuite; + +/** + * @author borettim + * + */ +public class SampleClassMatchersTest implements TestSuite { + @Test + public void testBeanMatcher() { + SampleClass sc = new SampleClass(); + sc.underTest = MyTestPojo.class; + assertThat(sc).is(SampleClassMatchers.sampleClassWith().underTestIsAValidBean()); + } +} diff --git a/src/it/beanmatchers-it-jdk9+-existing/verify.bsh b/src/it/beanmatchers-it-jdk9+-existing/verify.bsh new file mode 100644 index 000000000..7956527f8 --- /dev/null +++ b/src/it/beanmatchers-it-jdk9+-existing/verify.bsh @@ -0,0 +1,26 @@ +import java.io.*; + +File file = new File( basedir, "build.log" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not build log: " + file ); +} + + +file = new File( basedir, "target/generated-sources/annotations/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClassMatchers.java" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find generated Matcher: " + file ); +} + +file = new File( basedir, "target/classes/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClassMatchers.class" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find compiled Matcher: " + file ); +} + +file = new File( basedir, "target/test-classes/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClassMatchersTest.class" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find compiled Test of the matcher: " + file ); +} diff --git a/src/it/beanmatchers-it-jdk9+-missing/params.properties b/src/it/beanmatchers-it-jdk9+-missing/params.properties new file mode 100644 index 000000000..973dfe1d2 --- /dev/null +++ b/src/it/beanmatchers-it-jdk9+-missing/params.properties @@ -0,0 +1,3 @@ +invoker.java.version=!1.8,9,10,11+ +invoker.goals=clean install +invoker.buildResult = failure \ No newline at end of file diff --git a/src/it/beanmatchers-it-jdk9+-missing/pom.xml b/src/it/beanmatchers-it-jdk9+-missing/pom.xml new file mode 100644 index 000000000..576a0e0ee --- /dev/null +++ b/src/it/beanmatchers-it-jdk9+-missing/pom.xml @@ -0,0 +1,277 @@ + + 4.0.0 + ch.powerunit.extensions + powerunit-extensions-matchers-it38 + @project.version@ + + jar + + + 1.8 + 1.8 + UTF-8 + 1.3 + 2.22.2 + 0.5.0 + + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.11.2 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.5 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.13.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-archetype-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + + ch.powerunit + powerunit + ${powerunit.version} + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.9.0 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.version} + + + com.github.github + site-maven-plugin + 0.12 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + org.codehaus.mojo + jaxb2-maven-plugin + 2.5.0 + + + org.apache.maven.plugins + maven-changes-plugin + 2.12.1 + + + GitHub + + + + + org.codehaus.mojo + sonar-maven-plugin + 3.7.0.1746 + + + maven-invoker-plugin + 3.2.1 + + + maven-assembly-plugin + 3.3.0 + + + org.codehaus.mojo + xml-maven-plugin + 1.0.2 + + + maven-deploy-plugin + 2.8.2 + + + maven-install-plugin + 2.5.2 + + + + + + org.jacoco + jacoco-maven-plugin + + + + ${project.build.directory} + + *.exec + + + + + + + default-prepare-agent-1 + + prepare-agent + + + + default-prepare-agent-2 + initialize + + prepare-agent-integration + + + testcompileargs + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + jar + test-jar + + + + + true + false + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.source.version} + ${java.target.version} + true + + -J${testcompileargs} + + + + + + + + + org.hamcrest + hamcrest-all + ${hamcrest.version} + + + ch.powerunit + powerunit + ${powerunit.version} + test + + + ch.powerunit.extensions + powerunit-extensions-matchers + @project.version@ + + + javax.annotation + javax.annotation-api + 1.3.2 + + + \ No newline at end of file diff --git a/src/it/beanmatchers-it-jdk9+-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/MyTestPojo.java b/src/it/beanmatchers-it-jdk9+-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/MyTestPojo.java new file mode 100644 index 000000000..8b10045df --- /dev/null +++ b/src/it/beanmatchers-it-jdk9+-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/MyTestPojo.java @@ -0,0 +1,44 @@ +package ch.powerunit.extensions.matchers.samples.extensions.beanmatchers; + +public class MyTestPojo { + private String test; + + public String getTest() { + return test; + } + + public void setTest(String test) { + this.test = test; + } + + @Override + public String toString() { + return "MyTestPojo [test=" + test + "]"; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((test == null) ? 0 : test.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + MyTestPojo other = (MyTestPojo) obj; + if (test == null) { + if (other.test != null) + return false; + } else if (!test.equals(other.test)) + return false; + return true; + } + +} diff --git a/src/it/beanmatchers-it-jdk9+-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClass.java b/src/it/beanmatchers-it-jdk9+-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClass.java new file mode 100644 index 000000000..814f0043b --- /dev/null +++ b/src/it/beanmatchers-it-jdk9+-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClass.java @@ -0,0 +1,15 @@ +/** + * + */ +package ch.powerunit.extensions.matchers.samples.extensions.beanmatchers; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * + */ +@ProvideMatchers +public class SampleClass { + public Class underTest; +} diff --git a/src/it/beanmatchers-it-jdk9+-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClassMatchersTest.java b/src/it/beanmatchers-it-jdk9+-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClassMatchersTest.java new file mode 100644 index 000000000..0b283d775 --- /dev/null +++ b/src/it/beanmatchers-it-jdk9+-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClassMatchersTest.java @@ -0,0 +1,20 @@ +/** + * + */ +package ch.powerunit.extensions.matchers.samples.extensions.beanmatchers; + +import ch.powerunit.Test; +import ch.powerunit.TestSuite; + +/** + * @author borettim + * + */ +public class SampleClassMatchersTest implements TestSuite { + @Test + public void testBeanMatcher() { + SampleClass sc = new SampleClass(); + sc.underTest = MyTestPojo.class; + assertThat(sc).is(SampleClassMatchers.sampleClassWith().underTestIsAValidBean()); + } +} diff --git a/src/it/beanmatchers-it-jdk9+-missing/verify.bsh b/src/it/beanmatchers-it-jdk9+-missing/verify.bsh new file mode 100644 index 000000000..d0b06ab0b --- /dev/null +++ b/src/it/beanmatchers-it-jdk9+-missing/verify.bsh @@ -0,0 +1,26 @@ +import java.io.*; + +File file = new File( basedir, "build.log" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not build log: " + file ); +} + + +file = new File( basedir, "target/generated-sources/annotations/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClassMatchers.java" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find generated Matcher: " + file ); +} + +file = new File( basedir, "target/classes/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClassMatchers.class" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find compiled Matcher: " + file ); +} + +file = new File( basedir, "target/test-classes/ch/powerunit/extensions/matchers/samples/extensions/beanmatchers/SampleClassMatchersTest.class" ); +if ( file.isFile() ) +{ + throw new FileNotFoundException( "Find compiled tester of the matcher, but should not: " + file ); +} diff --git a/src/it/full-it-jdk8/params.properties b/src/it/full-it-jdk8/params.properties new file mode 100644 index 000000000..ab922d13c --- /dev/null +++ b/src/it/full-it-jdk8/params.properties @@ -0,0 +1,2 @@ +invoker.java.version=1.8,!9,!10,!11 +invoker.goals=clean install diff --git a/src/it/full-it-jdk8/pom.xml b/src/it/full-it-jdk8/pom.xml new file mode 100644 index 000000000..96f4b8154 --- /dev/null +++ b/src/it/full-it-jdk8/pom.xml @@ -0,0 +1,310 @@ + + 4.0.0 + ch.powerunit.extensions + powerunit-extensions-matchers-it33 + @project.version@ + + jar + + + 1.8 + 1.8 + UTF-8 + 1.3 + 2.22.2 + 0.5.0 + + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.11.2 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.5 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.13.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-archetype-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + + ch.powerunit + powerunit + ${powerunit.version} + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.9.0 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.version} + + + com.github.github + site-maven-plugin + 0.12 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + org.codehaus.mojo + jaxb2-maven-plugin + 2.5.0 + + + org.apache.maven.plugins + maven-changes-plugin + 2.12.1 + + + GitHub + + + + + org.codehaus.mojo + sonar-maven-plugin + 3.7.0.1746 + + + maven-invoker-plugin + 3.2.1 + + + maven-assembly-plugin + 3.3.0 + + + org.codehaus.mojo + xml-maven-plugin + 1.0.2 + + + maven-deploy-plugin + 2.8.2 + + + maven-install-plugin + 2.5.2 + + + + + + org.jacoco + jacoco-maven-plugin + + + + ${project.build.directory} + + *.exec + + + + + + + default-prepare-agent-1 + + prepare-agent + + + + default-prepare-agent-2 + initialize + + prepare-agent-integration + + + testcompileargs + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + jar + test-jar + + + + + true + false + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.source.version} + ${java.target.version} + true + + -J${testcompileargs} + + + + + default-compile + + compile + + + + -J${testcompileargs} + -Ach.powerunit.extensions.matchers.provideprocessor.ProvidesMatchersAnnotationsProcessor.factory=ch.powerunit.extensions.matchers.samples.AllMatchers + + + + + + + + + + + org.hamcrest + hamcrest-all + ${hamcrest.version} + + + ch.powerunit + powerunit + ${powerunit.version} + test + + + ch.powerunit.extensions + powerunit-extensions-matchers + @project.version@ + + + com.google.code.bean-matchers + bean-matchers + 0.12 + true + + + org.exparity + hamcrest-date + 2.0.7 + true + + + com.nitorcreations + matchers + 1.3 + true + + + com.spotify + hamcrest-jackson + 1.1.5 + true + + + \ No newline at end of file diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/MapSample.java b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/MapSample.java similarity index 100% rename from src/test/java/ch/powerunit/extensions/matchers/samples/MapSample.java rename to src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/MapSample.java diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1.java b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java similarity index 100% rename from src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1.java rename to src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo2.java b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo2.java similarity index 96% rename from src/test/java/ch/powerunit/extensions/matchers/samples/Pojo2.java rename to src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo2.java index 68ca4a788..5ff8953e8 100644 --- a/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo2.java +++ b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo2.java @@ -1,37 +1,37 @@ -/** - * Powerunit - A JDK1.8 test framework - * Copyright (C) 2014 Mathieu Boretti. - * - * This file is part of Powerunit - * - * Powerunit is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Powerunit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Powerunit. If not, see . - */ -package ch.powerunit.extensions.matchers.samples; - -/** - * @author borettim - * - */ -public class Pojo2 extends Pojo1 { - private char msg10; - - public char getMsg10() { - return msg10; - } - - public void setMsg10(char msg10) { - this.msg10 = msg10; - } - -} +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +/** + * @author borettim + * + */ +public class Pojo2 extends Pojo1 { + private char msg10; + + public char getMsg10() { + return msg10; + } + + public void setMsg10(char msg10) { + this.msg10 = msg10; + } + +} diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo3.java b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo3.java similarity index 96% rename from src/test/java/ch/powerunit/extensions/matchers/samples/Pojo3.java rename to src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo3.java index 3d6e4749d..8fed294d8 100644 --- a/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo3.java +++ b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo3.java @@ -1,67 +1,67 @@ -/** - * Powerunit - A JDK1.8 test framework - * Copyright (C) 2014 Mathieu Boretti. - * - * This file is part of Powerunit - * - * Powerunit is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Powerunit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Powerunit. If not, see . - */ -package ch.powerunit.extensions.matchers.samples; - -import java.io.Serializable; -import java.util.List; - -import ch.powerunit.extensions.matchers.ComplementaryExpositionMethod; -import ch.powerunit.extensions.matchers.ProvideMatchers; - -/** - * @author borettim - * @param - * This is T - * @param - * This is O - * - */ -@ProvideMatchers(comments = "this is a \"comment\"", moreMethod = { ComplementaryExpositionMethod.CONTAINS, - ComplementaryExpositionMethod.ARRAYCONTAINING, ComplementaryExpositionMethod.HAS_ITEMS, - ComplementaryExpositionMethod.ANY_OF }) -public class Pojo3 { - public String msg1; - - public T msg2; - - public O msg3; - - private T msg4; - - public T[] msg5; - - public List msg6; - - /** - * @return the msg4 - */ - public T getMsg4() { - return msg4; - } - - /** - * @param msg4 - * the msg4 to set - */ - public void setMsg4(T msg4) { - this.msg4 = msg4; - } - -} +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import java.io.Serializable; +import java.util.List; + +import ch.powerunit.extensions.matchers.ComplementaryExpositionMethod; +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * @param + * This is T + * @param + * This is O + * + */ +@ProvideMatchers(comments = "this is a \"comment\"", moreMethod = { ComplementaryExpositionMethod.CONTAINS, + ComplementaryExpositionMethod.ARRAYCONTAINING, ComplementaryExpositionMethod.HAS_ITEMS, + ComplementaryExpositionMethod.ANY_OF }) +public class Pojo3 { + public String msg1; + + public T msg2; + + public O msg3; + + private T msg4; + + public T[] msg5; + + public List msg6; + + /** + * @return the msg4 + */ + public T getMsg4() { + return msg4; + } + + /** + * @param msg4 + * the msg4 to set + */ + public void setMsg4(T msg4) { + this.msg4 = msg4; + } + +} diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo4.java b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo4.java similarity index 96% rename from src/test/java/ch/powerunit/extensions/matchers/samples/Pojo4.java rename to src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo4.java index 6e723952b..a87f6fb23 100644 --- a/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo4.java +++ b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo4.java @@ -1,47 +1,47 @@ -/** - * Powerunit - A JDK1.8 test framework - * Copyright (C) 2014 Mathieu Boretti. - * - * This file is part of Powerunit - * - * Powerunit is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Powerunit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Powerunit. If not, see . - */ -package ch.powerunit.extensions.matchers.samples; - -import java.io.Serializable; - -/** - * @author borettim - * - * @param - * A... - * @param - * B... - * @see org.hamcrest.Matcher - * - */ -public class Pojo4> extends Pojo3 { - private char msg10; - - public char getMsg10() { - return msg10; - } - - public void setMsg10(char msg10) { - this.msg10 = msg10; - } - - public B test; - -} +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import java.io.Serializable; + +/** + * @author borettim + * + * @param + * A... + * @param + * B... + * @see org.hamcrest.Matcher + * + */ +public class Pojo4> extends Pojo3 { + private char msg10; + + public char getMsg10() { + return msg10; + } + + public void setMsg10(char msg10) { + this.msg10 = msg10; + } + + public B test; + +} diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/PojoClass.java b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/PojoClass.java similarity index 96% rename from src/test/java/ch/powerunit/extensions/matchers/samples/PojoClass.java rename to src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/PojoClass.java index 74dd1638d..f777d380e 100644 --- a/src/test/java/ch/powerunit/extensions/matchers/samples/PojoClass.java +++ b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/PojoClass.java @@ -1,37 +1,37 @@ -/** - * Powerunit - A JDK1.8 test framework - * Copyright (C) 2014 Mathieu Boretti. - * - * This file is part of Powerunit - * - * Powerunit is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Powerunit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Powerunit. If not, see . - */ -package ch.powerunit.extensions.matchers.samples; - -import ch.powerunit.extensions.matchers.ProvideMatchers; - -/** - * @author borettim - * - */ -@ProvideMatchers() -public class PojoClass { - public Class clazzNoGeneric; - - public Class clazzWildcard; - - public Class clazzExtends; - - public Class clazzSuper; -} +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * + */ +@ProvideMatchers() +public class PojoClass { + public Class clazzNoGeneric; + + public Class clazzWildcard; + + public Class clazzExtends; + + public Class clazzSuper; +} diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/PojoShort.java b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/PojoShort.java similarity index 96% rename from src/test/java/ch/powerunit/extensions/matchers/samples/PojoShort.java rename to src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/PojoShort.java index 303f2b144..1c3bbce8f 100644 --- a/src/test/java/ch/powerunit/extensions/matchers/samples/PojoShort.java +++ b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/PojoShort.java @@ -1,32 +1,32 @@ -/** - * Powerunit - A JDK1.8 test framework - * Copyright (C) 2014 Mathieu Boretti. - * - * This file is part of Powerunit - * - * Powerunit is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Powerunit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Powerunit. If not, see . - */ -package ch.powerunit.extensions.matchers.samples; - -import ch.powerunit.extensions.matchers.ProvideMatchers; - -/** - * @author borettim - * - */ -@ProvideMatchers -public class PojoShort { - public String msg1; - -} +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * + */ +@ProvideMatchers +public class PojoShort { + public String msg1; + +} diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/Sample.java b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/Sample.java similarity index 94% rename from src/test/java/ch/powerunit/extensions/matchers/samples/Sample.java rename to src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/Sample.java index fbcd0fc3c..371add391 100644 --- a/src/test/java/ch/powerunit/extensions/matchers/samples/Sample.java +++ b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/Sample.java @@ -1,17 +1,17 @@ -package ch.powerunit.extensions.matchers.samples; - -import ch.powerunit.extensions.matchers.ProvideMatchers; - -@ProvideMatchers -public class Sample { - private String field1; - - public String getField1() { - return field1; - } - - public void setField1(String field1) { - this.field1 = field1; - } - -} +package ch.powerunit.extensions.matchers.samples; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers +public class Sample { + private String field1; + + public String getField1() { + return field1; + } + + public void setField1(String field1) { + this.field1 = field1; + } + +} diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/SampleLocalDateTime.java b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/SampleLocalDateTime.java similarity index 94% rename from src/test/java/ch/powerunit/extensions/matchers/samples/SampleLocalDateTime.java rename to src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/SampleLocalDateTime.java index b0c8382ef..5d912da1f 100644 --- a/src/test/java/ch/powerunit/extensions/matchers/samples/SampleLocalDateTime.java +++ b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/SampleLocalDateTime.java @@ -1,18 +1,18 @@ -package ch.powerunit.extensions.matchers.samples; - -import java.time.LocalDateTime; - -import ch.powerunit.extensions.matchers.ProvideMatchers; - -@ProvideMatchers -public class SampleLocalDateTime { - private LocalDateTime opt; - - public LocalDateTime getOpt() { - return opt; - } - - public void setOpt(LocalDateTime opt) { - this.opt = opt; - } -} +package ch.powerunit.extensions.matchers.samples; + +import java.time.LocalDateTime; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers +public class SampleLocalDateTime { + private LocalDateTime opt; + + public LocalDateTime getOpt() { + return opt; + } + + public void setOpt(LocalDateTime opt) { + this.opt = opt; + } +} diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/SampleOptional.java b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/SampleOptional.java similarity index 100% rename from src/test/java/ch/powerunit/extensions/matchers/samples/SampleOptional.java rename to src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/SampleOptional.java diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/SampleSupplier.java b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/SampleSupplier.java similarity index 95% rename from src/test/java/ch/powerunit/extensions/matchers/samples/SampleSupplier.java rename to src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/SampleSupplier.java index abdbbbbc1..306d0eae6 100644 --- a/src/test/java/ch/powerunit/extensions/matchers/samples/SampleSupplier.java +++ b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/SampleSupplier.java @@ -1,13 +1,13 @@ -package ch.powerunit.extensions.matchers.samples; - -import java.util.List; -import java.util.function.Supplier; - -import ch.powerunit.extensions.matchers.ProvideMatchers; - -@ProvideMatchers -public class SampleSupplier { - public Supplier s1; - - public Supplier> s2; -} +package ch.powerunit.extensions.matchers.samples; + +import java.util.List; +import java.util.function.Supplier; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers +public class SampleSupplier { + public Supplier s1; + + public Supplier> s2; +} diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/SimplePojo.java b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/SimplePojo.java similarity index 95% rename from src/test/java/ch/powerunit/extensions/matchers/samples/SimplePojo.java rename to src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/SimplePojo.java index fce96dab4..2f648de20 100644 --- a/src/test/java/ch/powerunit/extensions/matchers/samples/SimplePojo.java +++ b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/SimplePojo.java @@ -1,8 +1,8 @@ -package ch.powerunit.extensions.matchers.samples; - -import ch.powerunit.extensions.matchers.ProvideMatchers; - -@ProvideMatchers -public class SimplePojo { - public String oneField; -} +package ch.powerunit.extensions.matchers.samples; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers +public class SimplePojo { + public String oneField; +} diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/TwoFieldsPojo.java b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/TwoFieldsPojo.java similarity index 95% rename from src/test/java/ch/powerunit/extensions/matchers/samples/TwoFieldsPojo.java rename to src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/TwoFieldsPojo.java index 6912b69fc..5cebbe139 100644 --- a/src/test/java/ch/powerunit/extensions/matchers/samples/TwoFieldsPojo.java +++ b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/TwoFieldsPojo.java @@ -1,10 +1,10 @@ -package ch.powerunit.extensions.matchers.samples; - -import ch.powerunit.extensions.matchers.ProvideMatchers; - -@ProvideMatchers -public class TwoFieldsPojo { - public String firstField; - - public String secondField; -} +package ch.powerunit.extensions.matchers.samples; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers +public class TwoFieldsPojo { + public String firstField; + + public String secondField; +} diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/addmatcher/PojoWithOverrideField.java b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/addmatcher/PojoWithOverrideField.java similarity index 97% rename from src/test/java/ch/powerunit/extensions/matchers/samples/addmatcher/PojoWithOverrideField.java rename to src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/addmatcher/PojoWithOverrideField.java index 00071d786..7b52739a9 100644 --- a/src/test/java/ch/powerunit/extensions/matchers/samples/addmatcher/PojoWithOverrideField.java +++ b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/addmatcher/PojoWithOverrideField.java @@ -1,30 +1,30 @@ -/** - * Powerunit - A JDK1.8 test framework - * Copyright (C) 2014 Mathieu Boretti. - * - * This file is part of Powerunit - * - * Powerunit is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Powerunit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Powerunit. If not, see . - */ -package ch.powerunit.extensions.matchers.samples.addmatcher; - -import ch.powerunit.extensions.matchers.AddToMatcher; -import ch.powerunit.extensions.matchers.ProvideMatchers; - -@ProvideMatchers -public class PojoWithOverrideField { - @AddToMatcher(suffix = "Suffix", argument = "", body = "// Does nothing, just for sample") - @AddToMatcher(suffix = "SuffixTest", argument = "java.lang.String test", body = "// Does nothing, just for sample") - public String field; -} +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples.addmatcher; + +import ch.powerunit.extensions.matchers.AddToMatcher; +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers +public class PojoWithOverrideField { + @AddToMatcher(suffix = "Suffix", argument = "", body = "// Does nothing, just for sample") + @AddToMatcher(suffix = "SuffixTest", argument = "java.lang.String test", body = "// Does nothing, just for sample") + public String field; +} diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/extension/Includer.java b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/extension/Includer.java similarity index 100% rename from src/test/java/ch/powerunit/extensions/matchers/samples/extension/Includer.java rename to src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/extension/Includer.java diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/extension/MyPair.java b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/extension/MyPair.java similarity index 100% rename from src/test/java/ch/powerunit/extensions/matchers/samples/extension/MyPair.java rename to src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/extension/MyPair.java diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/extension/MyPair2.java b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/extension/MyPair2.java similarity index 100% rename from src/test/java/ch/powerunit/extensions/matchers/samples/extension/MyPair2.java rename to src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/extension/MyPair2.java diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/extension/MyTestWithoutGeneric.java b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/extension/MyTestWithoutGeneric.java similarity index 100% rename from src/test/java/ch/powerunit/extensions/matchers/samples/extension/MyTestWithoutGeneric.java rename to src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/extension/MyTestWithoutGeneric.java diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/extension/MyTestWithoutGeneric2.java b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/extension/MyTestWithoutGeneric2.java similarity index 100% rename from src/test/java/ch/powerunit/extensions/matchers/samples/extension/MyTestWithoutGeneric2.java rename to src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/extension/MyTestWithoutGeneric2.java diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithSameRoundList.java b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithSameRoundList.java similarity index 96% rename from src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithSameRoundList.java rename to src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithSameRoundList.java index 6e850510a..50b78a464 100644 --- a/src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithSameRoundList.java +++ b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithSameRoundList.java @@ -1,44 +1,44 @@ -/** - * Powerunit - A JDK1.8 test framework - * Copyright (C) 2014 Mathieu Boretti. - * - * This file is part of Powerunit - * - * Powerunit is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Powerunit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Powerunit. If not, see . - */ -package ch.powerunit.extensions.matchers.samples.iterable; - -import java.util.List; -import java.util.Objects; - -import ch.powerunit.extensions.matchers.ProvideMatchers; - -/** - * @author borettim - * - */ -@ProvideMatchers -public class PojoWithSameRoundList { - public List field; - - public PojoWithSameRoundList(List field) { - this.field = field; - } - - @Override - public String toString() { - return "PojoWithStringList [field=" + Objects.toString(field) + "]"; - } - -} +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples.iterable; + +import java.util.List; +import java.util.Objects; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * + */ +@ProvideMatchers +public class PojoWithSameRoundList { + public List field; + + public PojoWithSameRoundList(List field) { + this.field = field; + } + + @Override + public String toString() { + return "PojoWithStringList [field=" + Objects.toString(field) + "]"; + } + +} diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringList.java b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringList.java similarity index 96% rename from src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringList.java rename to src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringList.java index 70e2d683f..003359481 100644 --- a/src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringList.java +++ b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringList.java @@ -1,44 +1,44 @@ -/** - * Powerunit - A JDK1.8 test framework - * Copyright (C) 2014 Mathieu Boretti. - * - * This file is part of Powerunit - * - * Powerunit is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Powerunit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Powerunit. If not, see . - */ -package ch.powerunit.extensions.matchers.samples.iterable; - -import java.util.List; -import java.util.Objects; - -import ch.powerunit.extensions.matchers.ProvideMatchers; - -/** - * @author borettim - * - */ -@ProvideMatchers -public class PojoWithStringList { - public List field; - - public PojoWithStringList(List field) { - this.field = field; - } - - @Override - public String toString() { - return "PojoWithStringList [field=" + Objects.toString(field) + "]"; - } - -} +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples.iterable; + +import java.util.List; +import java.util.Objects; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * + */ +@ProvideMatchers +public class PojoWithStringList { + public List field; + + public PojoWithStringList(List field) { + this.field = field; + } + + @Override + public String toString() { + return "PojoWithStringList [field=" + Objects.toString(field) + "]"; + } + +} diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringSet.java b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringSet.java similarity index 100% rename from src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringSet.java rename to src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringSet.java diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/others/Pojo42.java b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/others/Pojo42.java similarity index 95% rename from src/test/java/ch/powerunit/extensions/matchers/samples/others/Pojo42.java rename to src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/others/Pojo42.java index cafc1bcc2..6924b1243 100644 --- a/src/test/java/ch/powerunit/extensions/matchers/samples/others/Pojo42.java +++ b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/others/Pojo42.java @@ -1,85 +1,85 @@ -/** - * Powerunit - A JDK1.8 test framework - * Copyright (C) 2014 Mathieu Boretti. - * - * This file is part of Powerunit - * - * Powerunit is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Powerunit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Powerunit. If not, see . - */ -package ch.powerunit.extensions.matchers.samples.others; - -import java.util.Collection; -import java.util.List; -import java.util.Set; - -import ch.powerunit.extensions.matchers.ProvideMatchers; - -/** - * @author borettim - * - */ -@ProvideMatchers -public class Pojo42 { - private String msg1; - - public String msg2; - - public int msg3; - - public String[] msg4; - - public int[] msg5; - - public List msg6; - - public List msg7; - - public List[] msg8; - - public Collection msg9; - - public Set msg12; - - public String getMsg1() { - return msg1; - } - - public void setMsg1(String msg1) { - this.msg1 = msg1; - } - - public boolean myBoolean; - - private boolean oneBoolean; - - public boolean isOneBoolean() { - return oneBoolean; - } - - public void setOneBoolean(boolean oneBoolean) { - this.oneBoolean = oneBoolean; - } - - public Pojo42() { - } - - public Pojo42(String msg1) { - this.msg1 = msg1; - } - - public Pojo42(List msg6) { - this.msg6 = msg6; - } - -} +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples.others; + +import java.util.Collection; +import java.util.List; +import java.util.Set; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * + */ +@ProvideMatchers +public class Pojo42 { + private String msg1; + + public String msg2; + + public int msg3; + + public String[] msg4; + + public int[] msg5; + + public List msg6; + + public List msg7; + + public List[] msg8; + + public Collection msg9; + + public Set msg12; + + public String getMsg1() { + return msg1; + } + + public void setMsg1(String msg1) { + this.msg1 = msg1; + } + + public boolean myBoolean; + + private boolean oneBoolean; + + public boolean isOneBoolean() { + return oneBoolean; + } + + public void setOneBoolean(boolean oneBoolean) { + this.oneBoolean = oneBoolean; + } + + public Pojo42() { + } + + public Pojo42(String msg1) { + this.msg1 = msg1; + } + + public Pojo42(List msg6) { + this.msg6 = msg6; + } + +} diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/others/Pojo43.java b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/others/Pojo43.java similarity index 97% rename from src/test/java/ch/powerunit/extensions/matchers/samples/others/Pojo43.java rename to src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/others/Pojo43.java index 695f451b8..f182fa89c 100644 --- a/src/test/java/ch/powerunit/extensions/matchers/samples/others/Pojo43.java +++ b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/others/Pojo43.java @@ -1,32 +1,32 @@ -/** - * Powerunit - A JDK1.8 test framework - * Copyright (C) 2014 Mathieu Boretti. - * - * This file is part of Powerunit - * - * Powerunit is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Powerunit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Powerunit. If not, see . - */ -package ch.powerunit.extensions.matchers.samples.others; - -import ch.powerunit.extensions.matchers.ProvideMatchers; - -/** - * @author borettim - * - */ -@ProvideMatchers(matchersPackageName = "ch.powerunit.extensions.matchers.samples.others2") -public class Pojo43 { - public String nameMe; - -} +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples.others; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * + */ +@ProvideMatchers(matchersPackageName = "ch.powerunit.extensions.matchers.samples.others2") +public class Pojo43 { + public String nameMe; + +} diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/others/PojoRenameMatcher.java b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/others/PojoRenameMatcher.java similarity index 96% rename from src/test/java/ch/powerunit/extensions/matchers/samples/others/PojoRenameMatcher.java rename to src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/others/PojoRenameMatcher.java index f0019e04d..2b515432c 100644 --- a/src/test/java/ch/powerunit/extensions/matchers/samples/others/PojoRenameMatcher.java +++ b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/others/PojoRenameMatcher.java @@ -1,32 +1,32 @@ -/** - * Powerunit - A JDK1.8 test framework - * Copyright (C) 2014 Mathieu Boretti. - * - * This file is part of Powerunit - * - * Powerunit is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Powerunit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Powerunit. If not, see . - */ -package ch.powerunit.extensions.matchers.samples.others; - -import ch.powerunit.extensions.matchers.ProvideMatchers; - -/** - * @author borettim - * - */ -@ProvideMatchers(matchersClassName="PojoRenameMatchersToOtherName") -public class PojoRenameMatcher { - public String msg1; - -} +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples.others; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * + */ +@ProvideMatchers(matchersClassName="PojoRenameMatchersToOtherName") +public class PojoRenameMatcher { + public String msg1; + +} diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/others/PojoRenameParentMatcher.java b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/others/PojoRenameParentMatcher.java similarity index 94% rename from src/test/java/ch/powerunit/extensions/matchers/samples/others/PojoRenameParentMatcher.java rename to src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/others/PojoRenameParentMatcher.java index a6a4390d5..dc5e5bb00 100644 --- a/src/test/java/ch/powerunit/extensions/matchers/samples/others/PojoRenameParentMatcher.java +++ b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/others/PojoRenameParentMatcher.java @@ -1,15 +1,15 @@ -/** - * - */ -package ch.powerunit.extensions.matchers.samples.others; - -import ch.powerunit.extensions.matchers.ProvideMatchers; - -/** - * @author borettim - * - */ -@ProvideMatchers -public class PojoRenameParentMatcher extends PojoRenameMatcher { - public String testMe; -} +/** + * + */ +package ch.powerunit.extensions.matchers.samples.others; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * + */ +@ProvideMatchers +public class PojoRenameParentMatcher extends PojoRenameMatcher { + public String testMe; +} diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/third/ExtendedPojo43.java b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/third/ExtendedPojo43.java similarity index 96% rename from src/test/java/ch/powerunit/extensions/matchers/samples/third/ExtendedPojo43.java rename to src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/third/ExtendedPojo43.java index 2790c2170..9a8a9901b 100644 --- a/src/test/java/ch/powerunit/extensions/matchers/samples/third/ExtendedPojo43.java +++ b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/third/ExtendedPojo43.java @@ -1,33 +1,33 @@ -/** - * Powerunit - A JDK1.8 test framework - * Copyright (C) 2014 Mathieu Boretti. - * - * This file is part of Powerunit - * - * Powerunit is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Powerunit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Powerunit. If not, see . - */ -package ch.powerunit.extensions.matchers.samples.third; - -import ch.powerunit.extensions.matchers.ProvideMatchers; -import ch.powerunit.extensions.matchers.samples.others.Pojo43; - -/** - * @author borettim - * - */ -@ProvideMatchers() -public class ExtendedPojo43 extends Pojo43{ - public String nameMe2; - -} +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples.third; + +import ch.powerunit.extensions.matchers.ProvideMatchers; +import ch.powerunit.extensions.matchers.samples.others.Pojo43; + +/** + * @author borettim + * + */ +@ProvideMatchers() +public class ExtendedPojo43 extends Pojo43{ + public String nameMe2; + +} diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/third/OneFunnyOne.java b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/third/OneFunnyOne.java similarity index 100% rename from src/test/java/ch/powerunit/extensions/matchers/samples/third/OneFunnyOne.java rename to src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/third/OneFunnyOne.java diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/third/SimpleFullyOne.java b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/third/SimpleFullyOne.java similarity index 97% rename from src/test/java/ch/powerunit/extensions/matchers/samples/third/SimpleFullyOne.java rename to src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/third/SimpleFullyOne.java index 13befca46..29646d926 100644 --- a/src/test/java/ch/powerunit/extensions/matchers/samples/third/SimpleFullyOne.java +++ b/src/it/full-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/third/SimpleFullyOne.java @@ -1,28 +1,28 @@ -/** - * Powerunit - A JDK1.8 test framework - * Copyright (C) 2014 Mathieu Boretti. - * - * This file is part of Powerunit - * - * Powerunit is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Powerunit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Powerunit. If not, see . - */ -package ch.powerunit.extensions.matchers.samples.third; - -import ch.powerunit.extensions.matchers.ProvideMatchers; -import ch.powerunit.extensions.matchers.samples.Pojo1; - -@ProvideMatchers -public class SimpleFullyOne { - public Pojo1 onePojo1; -} +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples.third; + +import ch.powerunit.extensions.matchers.ProvideMatchers; +import ch.powerunit.extensions.matchers.samples.Pojo1; + +@ProvideMatchers +public class SimpleFullyOne { + public Pojo1 onePojo1; +} diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/MapSampleTest.java b/src/it/full-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/MapSampleTest.java similarity index 100% rename from src/test/java/ch/powerunit/extensions/matchers/samples/MapSampleTest.java rename to src/it/full-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/MapSampleTest.java diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java b/src/it/full-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java similarity index 100% rename from src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java rename to src/it/full-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo2MatcherTest.java b/src/it/full-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo2MatcherTest.java similarity index 96% rename from src/test/java/ch/powerunit/extensions/matchers/samples/Pojo2MatcherTest.java rename to src/it/full-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo2MatcherTest.java index 252b815b9..91b927e21 100644 --- a/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo2MatcherTest.java +++ b/src/it/full-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo2MatcherTest.java @@ -1,46 +1,46 @@ -/** - * Powerunit - A JDK1.8 test framework - * Copyright (C) 2014 Mathieu Boretti. - * - * This file is part of Powerunit - * - * Powerunit is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Powerunit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Powerunit. If not, see . - */ -package ch.powerunit.extensions.matchers.samples; - -import ch.powerunit.Ignore; -import ch.powerunit.Test; -import ch.powerunit.TestSuite; - -public class Pojo2MatcherTest implements TestSuite { - @Test - public void testOKMatcher() { - Pojo2 p = new Pojo2(); - assertThat(p).is(AllMatchers.DSL.pojo2With()); - } - - @Test - @Ignore - public void testKOMatcher() { - Pojo2 p = new Pojo2(); - assertThat(p).is(AllMatchers.DSL.pojo2With(AllMatchers.DSL.pojo1With().msg1("x"))); - } - - @Test - public void testOKMatcherForParent() { - Pojo2 p = new Pojo2(); - p.msg2 = "12"; - assertThat(p).is(AllMatchers.DSL.pojo2WithParent().msg2("12").end()); - } -} +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import ch.powerunit.Ignore; +import ch.powerunit.Test; +import ch.powerunit.TestSuite; + +public class Pojo2MatcherTest implements TestSuite { + @Test + public void testOKMatcher() { + Pojo2 p = new Pojo2(); + assertThat(p).is(AllMatchers.DSL.pojo2With()); + } + + @Test + @Ignore + public void testKOMatcher() { + Pojo2 p = new Pojo2(); + assertThat(p).is(AllMatchers.DSL.pojo2With(AllMatchers.DSL.pojo1With().msg1("x"))); + } + + @Test + public void testOKMatcherForParent() { + Pojo2 p = new Pojo2(); + p.msg2 = "12"; + assertThat(p).is(AllMatchers.DSL.pojo2WithParent().msg2("12").end()); + } +} diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo3MatcherTest.java b/src/it/full-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo3MatcherTest.java similarity index 96% rename from src/test/java/ch/powerunit/extensions/matchers/samples/Pojo3MatcherTest.java rename to src/it/full-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo3MatcherTest.java index 40dcdd241..cc848c69c 100644 --- a/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo3MatcherTest.java +++ b/src/it/full-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo3MatcherTest.java @@ -1,39 +1,39 @@ -/** - * Powerunit - A JDK1.8 test framework - * Copyright (C) 2014 Mathieu Boretti. - * - * This file is part of Powerunit - * - * Powerunit is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Powerunit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Powerunit. If not, see . - */ -package ch.powerunit.extensions.matchers.samples; - -import ch.powerunit.Ignore; -import ch.powerunit.Test; -import ch.powerunit.TestSuite; - -public class Pojo3MatcherTest implements TestSuite { - @Test - public void testOKMatcher() { - Pojo3 p = new Pojo3<>(); - assertThat(p).is(Pojo3Matchers.pojo3With()); - } - - @Test - @Ignore - public void testKOMatcher() { - Pojo3 p = new Pojo3<>(); - assertThat(p).is(Pojo3Matchers. pojo3With().msg1("x")); - } -} +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import ch.powerunit.Ignore; +import ch.powerunit.Test; +import ch.powerunit.TestSuite; + +public class Pojo3MatcherTest implements TestSuite { + @Test + public void testOKMatcher() { + Pojo3 p = new Pojo3<>(); + assertThat(p).is(Pojo3Matchers.pojo3With()); + } + + @Test + @Ignore + public void testKOMatcher() { + Pojo3 p = new Pojo3<>(); + assertThat(p).is(Pojo3Matchers. pojo3With().msg1("x")); + } +} diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/PojoClassMatchersTest.java b/src/it/full-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/PojoClassMatchersTest.java similarity index 97% rename from src/test/java/ch/powerunit/extensions/matchers/samples/PojoClassMatchersTest.java rename to src/it/full-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/PojoClassMatchersTest.java index 644173b75..57c6039be 100644 --- a/src/test/java/ch/powerunit/extensions/matchers/samples/PojoClassMatchersTest.java +++ b/src/it/full-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/PojoClassMatchersTest.java @@ -1,36 +1,36 @@ -/** - * Powerunit - A JDK1.8 test framework - * Copyright (C) 2014 Mathieu Boretti. - * - * This file is part of Powerunit - * - * Powerunit is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Powerunit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Powerunit. If not, see . - */ -package ch.powerunit.extensions.matchers.samples; - -import ch.powerunit.Test; -import ch.powerunit.TestSuite; - -public class PojoClassMatchersTest implements TestSuite { - @Test - public void testClass() { - PojoClass ut = new PojoClass(); - ut.clazzNoGeneric = Object.class; - ut.clazzWildcard = String.class; - ut.clazzExtends = Integer.class; - ut.clazzSuper = Comparable.class; - assertThat(ut).is(PojoClassMatchers.pojoClassWith().clazzNoGeneric(Object.class).clazzWildcard(String.class) - .clazzExtends(Integer.class).clazzSuper(Comparable.class)); - } -} +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import ch.powerunit.Test; +import ch.powerunit.TestSuite; + +public class PojoClassMatchersTest implements TestSuite { + @Test + public void testClass() { + PojoClass ut = new PojoClass(); + ut.clazzNoGeneric = Object.class; + ut.clazzWildcard = String.class; + ut.clazzExtends = Integer.class; + ut.clazzSuper = Comparable.class; + assertThat(ut).is(PojoClassMatchers.pojoClassWith().clazzNoGeneric(Object.class).clazzWildcard(String.class) + .clazzExtends(Integer.class).clazzSuper(Comparable.class)); + } +} diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/SampleLocalDateTimeTest.java b/src/it/full-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/SampleLocalDateTimeTest.java similarity index 97% rename from src/test/java/ch/powerunit/extensions/matchers/samples/SampleLocalDateTimeTest.java rename to src/it/full-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/SampleLocalDateTimeTest.java index b13626b13..2a4c774ac 100644 --- a/src/test/java/ch/powerunit/extensions/matchers/samples/SampleLocalDateTimeTest.java +++ b/src/it/full-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/SampleLocalDateTimeTest.java @@ -1,35 +1,35 @@ -/** - * Powerunit - A JDK1.8 test framework - * Copyright (C) 2014 Mathieu Boretti. - * - * This file is part of Powerunit - * - * Powerunit is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Powerunit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Powerunit. If not, see . - */ -package ch.powerunit.extensions.matchers.samples; - -import java.time.LocalDateTime; - -import ch.powerunit.Test; -import ch.powerunit.TestSuite; - -public class SampleLocalDateTimeTest implements TestSuite { - @Test - public void testOKMatcherForComparable() { - SampleLocalDateTime p = new SampleLocalDateTime(); - p.setOpt(LocalDateTime.of(2012, 1, 1, 9, 5)); - assertThat(p).is( - SampleLocalDateTimeMatchers.sampleLocalDateTimeWith().optLessThan(LocalDateTime.of(2013, 1, 1, 9, 5))); - } -} +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import java.time.LocalDateTime; + +import ch.powerunit.Test; +import ch.powerunit.TestSuite; + +public class SampleLocalDateTimeTest implements TestSuite { + @Test + public void testOKMatcherForComparable() { + SampleLocalDateTime p = new SampleLocalDateTime(); + p.setOpt(LocalDateTime.of(2012, 1, 1, 9, 5)); + assertThat(p).is( + SampleLocalDateTimeMatchers.sampleLocalDateTimeWith().optLessThan(LocalDateTime.of(2013, 1, 1, 9, 5))); + } +} diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/SampleOptionalMatchersTest.java b/src/it/full-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/SampleOptionalMatchersTest.java similarity index 100% rename from src/test/java/ch/powerunit/extensions/matchers/samples/SampleOptionalMatchersTest.java rename to src/it/full-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/SampleOptionalMatchersTest.java diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/SampleOptionalTest.java b/src/it/full-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/SampleOptionalTest.java similarity index 100% rename from src/test/java/ch/powerunit/extensions/matchers/samples/SampleOptionalTest.java rename to src/it/full-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/SampleOptionalTest.java diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/SampleSupplierTest.java b/src/it/full-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/SampleSupplierTest.java similarity index 96% rename from src/test/java/ch/powerunit/extensions/matchers/samples/SampleSupplierTest.java rename to src/it/full-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/SampleSupplierTest.java index e2b8f5325..f57b21ca2 100644 --- a/src/test/java/ch/powerunit/extensions/matchers/samples/SampleSupplierTest.java +++ b/src/it/full-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/SampleSupplierTest.java @@ -1,36 +1,36 @@ -package ch.powerunit.extensions.matchers.samples; - -import java.util.Arrays; - -import ch.powerunit.Ignore; -import ch.powerunit.Test; -import ch.powerunit.TestSuite; - -public class SampleSupplierTest implements TestSuite { - @Test - public void testSupplierNull() { - SampleSupplier ss = new SampleSupplier(); - assertThat(ss).is(SampleSupplierMatchers.sampleSupplierWith().s1(nullValue())); - } - - @Test - @Ignore - public void testSupplierNullKO() { - SampleSupplier ss = new SampleSupplier(); - assertThat(ss).is(SampleSupplierMatchers.sampleSupplierWith().s1SupplierResult(is("x"))); - } - - @Test - public void testSupplierNotNull() { - SampleSupplier ss = new SampleSupplier(); - ss.s1 = () -> "x"; - assertThat(ss).is(SampleSupplierMatchers.sampleSupplierWith().s1SupplierResult(is("x"))); - } - - @Test - public void testSupplierNotNullList() { - SampleSupplier ss = new SampleSupplier(); - ss.s2 = () -> Arrays.asList("x"); - assertThat(ss).is(SampleSupplierMatchers.sampleSupplierWith().s2SupplierResult(contains("x"))); - } -} +package ch.powerunit.extensions.matchers.samples; + +import java.util.Arrays; + +import ch.powerunit.Ignore; +import ch.powerunit.Test; +import ch.powerunit.TestSuite; + +public class SampleSupplierTest implements TestSuite { + @Test + public void testSupplierNull() { + SampleSupplier ss = new SampleSupplier(); + assertThat(ss).is(SampleSupplierMatchers.sampleSupplierWith().s1(nullValue())); + } + + @Test + @Ignore + public void testSupplierNullKO() { + SampleSupplier ss = new SampleSupplier(); + assertThat(ss).is(SampleSupplierMatchers.sampleSupplierWith().s1SupplierResult(is("x"))); + } + + @Test + public void testSupplierNotNull() { + SampleSupplier ss = new SampleSupplier(); + ss.s1 = () -> "x"; + assertThat(ss).is(SampleSupplierMatchers.sampleSupplierWith().s1SupplierResult(is("x"))); + } + + @Test + public void testSupplierNotNullList() { + SampleSupplier ss = new SampleSupplier(); + ss.s2 = () -> Arrays.asList("x"); + assertThat(ss).is(SampleSupplierMatchers.sampleSupplierWith().s2SupplierResult(contains("x"))); + } +} diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithSameRoundListMatchersTest.java b/src/it/full-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithSameRoundListMatchersTest.java similarity index 97% rename from src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithSameRoundListMatchersTest.java rename to src/it/full-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithSameRoundListMatchersTest.java index a870dac0f..4ed538dda 100644 --- a/src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithSameRoundListMatchersTest.java +++ b/src/it/full-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithSameRoundListMatchersTest.java @@ -1,142 +1,142 @@ -/** - * Powerunit - A JDK1.8 test framework - * Copyright (C) 2014 Mathieu Boretti. - * - * This file is part of Powerunit - * - * Powerunit is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Powerunit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Powerunit. If not, see . - */ -package ch.powerunit.extensions.matchers.samples.iterable; - -import static ch.powerunit.matchers.MatcherTester.matcher; -import static ch.powerunit.matchers.MatcherTester.value; - -import java.util.Arrays; -import java.util.Collections; - -import ch.powerunit.TestDelegate; -import ch.powerunit.TestSuite; -import ch.powerunit.matchers.MatcherTester; - -/** - * @author borettim - * - */ -public class PojoWithSameRoundListMatchersTest implements TestSuite { - - private static final Object OTHER_TYPE = ""; - - private static final PojoWithSameRoundList NULL_LIST = new PojoWithSameRoundList(null); - - private static final PojoWithSameRoundList EMPTY_LIST = new PojoWithSameRoundList(Collections.emptyList()); - - private static final PojoWithSameRoundList SINGLE_LIST_WITH_A = new PojoWithSameRoundList( - Arrays.asList(new PojoWithStringList(Arrays.asList("A")))); - - private static final PojoWithSameRoundList SINGLE_LIST_WITH_B = new PojoWithSameRoundList( - Arrays.asList(new PojoWithStringList(Arrays.asList("B")))); - - private static final PojoWithSameRoundList SINGLE_LIST_WITH_A_B = new PojoWithSameRoundList( - Arrays.asList(new PojoWithStringList(Arrays.asList("A")), new PojoWithStringList(Arrays.asList("B")))); - - private static final PojoWithSameRoundList SINGLE_LIST_WITH_B_A = new PojoWithSameRoundList( - Arrays.asList(new PojoWithStringList(Arrays.asList("B")), new PojoWithStringList(Arrays.asList("A")))); - - @TestDelegate - public final MatcherTester testMatcher = testerOfMatcher(// - PojoWithSameRoundListMatchers.PojoWithSameRoundListMatcher.class)// - .with(// - matcher(// - (PojoWithSameRoundListMatchers.PojoWithSameRoundListMatcher) PojoWithSameRoundListMatchers - .pojoWithSameRoundListWithSameValue(NULL_LIST)) - .// - describedAs( - "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithSameRoundList with\n[field null]\n") - .// - nullRejected("was null").// - accepting(NULL_LIST).// - rejecting(// - value(OTHER_TYPE).// - withMessage("was \"\""), // - value(EMPTY_LIST).// - withMessage("[field was <[]>]\n"), // - value(SINGLE_LIST_WITH_A).// - withMessage( - "[field was <[PojoWithStringList [field=[A]]]>]\n")), // - matcher(// - (PojoWithSameRoundListMatchers.PojoWithSameRoundListMatcher) PojoWithSameRoundListMatchers - .pojoWithSameRoundListWithSameValue(EMPTY_LIST)) - .// - describedAs( - "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithSameRoundList with\n[field an empty iterable]\n") - .// - nullRejected("was null").// - accepting(EMPTY_LIST).// - rejecting(// - value(OTHER_TYPE).// - withMessage("was \"\""), // - value(NULL_LIST).// - withMessage("[field was null]\n"), // - value(SINGLE_LIST_WITH_A).// - withMessage( - "[field []]\n")), // - matcher(// - (PojoWithSameRoundListMatchers.PojoWithSameRoundListMatcher) PojoWithSameRoundListMatchers - .pojoWithSameRoundListWithSameValue(SINGLE_LIST_WITH_A)) - .// - describedAs( - "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithSameRoundList with\n[field iterable containing [an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringList with\n[field iterable containing [is \"A\"]]\n]]\n") - .// - nullRejected("was null").// - accepting(SINGLE_LIST_WITH_A).// - rejecting(// - value(EMPTY_LIST).// - withMessage( - "[field No item matched: an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringList with\n[field iterable containing [is \"A\"]]\n]\n"), - value(OTHER_TYPE).// - withMessage("was \"\""), // - value(NULL_LIST).// - withMessage("[field was null]\n"), // - value(SINGLE_LIST_WITH_A_B).// - withMessage( - "[field Not matched: ]\n")), // - matcher(// - (PojoWithSameRoundListMatchers.PojoWithSameRoundListMatcher) PojoWithSameRoundListMatchers - .pojoWithSameRoundListWithSameValue(SINGLE_LIST_WITH_A_B)) - .// - describedAs( - "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithSameRoundList with\n[field iterable containing [an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringList with\n[field iterable containing [is \"A\"]]\n, an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringList with\n[field iterable containing [is \"B\"]]\n]]\n") - .// - nullRejected("was null").// - accepting(SINGLE_LIST_WITH_A_B).// - rejecting(// - value(EMPTY_LIST).// - withMessage( - "[field No item matched: an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringList with\n[field iterable containing [is \"A\"]]\n]\n"), - value(OTHER_TYPE).// - withMessage("was \"\""), // - value(NULL_LIST).// - withMessage("[field was null]\n"), // - value(SINGLE_LIST_WITH_A).// - withMessage( - "[field No item matched: an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringList with\n[field iterable containing [is \"B\"]]\n]\n"), // - value(SINGLE_LIST_WITH_B).// - withMessage( - "[field item 0: [field item 0: was \"B\"]\n]\n"), // - value(SINGLE_LIST_WITH_B_A).// - withMessage( - "[field item 0: [field item 0: was \"B\"]\n]\n"))// - ); - +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples.iterable; + +import static ch.powerunit.matchers.MatcherTester.matcher; +import static ch.powerunit.matchers.MatcherTester.value; + +import java.util.Arrays; +import java.util.Collections; + +import ch.powerunit.TestDelegate; +import ch.powerunit.TestSuite; +import ch.powerunit.matchers.MatcherTester; + +/** + * @author borettim + * + */ +public class PojoWithSameRoundListMatchersTest implements TestSuite { + + private static final Object OTHER_TYPE = ""; + + private static final PojoWithSameRoundList NULL_LIST = new PojoWithSameRoundList(null); + + private static final PojoWithSameRoundList EMPTY_LIST = new PojoWithSameRoundList(Collections.emptyList()); + + private static final PojoWithSameRoundList SINGLE_LIST_WITH_A = new PojoWithSameRoundList( + Arrays.asList(new PojoWithStringList(Arrays.asList("A")))); + + private static final PojoWithSameRoundList SINGLE_LIST_WITH_B = new PojoWithSameRoundList( + Arrays.asList(new PojoWithStringList(Arrays.asList("B")))); + + private static final PojoWithSameRoundList SINGLE_LIST_WITH_A_B = new PojoWithSameRoundList( + Arrays.asList(new PojoWithStringList(Arrays.asList("A")), new PojoWithStringList(Arrays.asList("B")))); + + private static final PojoWithSameRoundList SINGLE_LIST_WITH_B_A = new PojoWithSameRoundList( + Arrays.asList(new PojoWithStringList(Arrays.asList("B")), new PojoWithStringList(Arrays.asList("A")))); + + @TestDelegate + public final MatcherTester testMatcher = testerOfMatcher(// + PojoWithSameRoundListMatchers.PojoWithSameRoundListMatcher.class)// + .with(// + matcher(// + (PojoWithSameRoundListMatchers.PojoWithSameRoundListMatcher) PojoWithSameRoundListMatchers + .pojoWithSameRoundListWithSameValue(NULL_LIST)) + .// + describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithSameRoundList with\n[field null]\n") + .// + nullRejected("was null").// + accepting(NULL_LIST).// + rejecting(// + value(OTHER_TYPE).// + withMessage("was \"\""), // + value(EMPTY_LIST).// + withMessage("[field was <[]>]\n"), // + value(SINGLE_LIST_WITH_A).// + withMessage( + "[field was <[PojoWithStringList [field=[A]]]>]\n")), // + matcher(// + (PojoWithSameRoundListMatchers.PojoWithSameRoundListMatcher) PojoWithSameRoundListMatchers + .pojoWithSameRoundListWithSameValue(EMPTY_LIST)) + .// + describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithSameRoundList with\n[field an empty iterable]\n") + .// + nullRejected("was null").// + accepting(EMPTY_LIST).// + rejecting(// + value(OTHER_TYPE).// + withMessage("was \"\""), // + value(NULL_LIST).// + withMessage("[field was null]\n"), // + value(SINGLE_LIST_WITH_A).// + withMessage( + "[field []]\n")), // + matcher(// + (PojoWithSameRoundListMatchers.PojoWithSameRoundListMatcher) PojoWithSameRoundListMatchers + .pojoWithSameRoundListWithSameValue(SINGLE_LIST_WITH_A)) + .// + describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithSameRoundList with\n[field iterable containing [an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringList with\n[field iterable containing [is \"A\"]]\n]]\n") + .// + nullRejected("was null").// + accepting(SINGLE_LIST_WITH_A).// + rejecting(// + value(EMPTY_LIST).// + withMessage( + "[field No item matched: an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringList with\n[field iterable containing [is \"A\"]]\n]\n"), + value(OTHER_TYPE).// + withMessage("was \"\""), // + value(NULL_LIST).// + withMessage("[field was null]\n"), // + value(SINGLE_LIST_WITH_A_B).// + withMessage( + "[field Not matched: ]\n")), // + matcher(// + (PojoWithSameRoundListMatchers.PojoWithSameRoundListMatcher) PojoWithSameRoundListMatchers + .pojoWithSameRoundListWithSameValue(SINGLE_LIST_WITH_A_B)) + .// + describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithSameRoundList with\n[field iterable containing [an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringList with\n[field iterable containing [is \"A\"]]\n, an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringList with\n[field iterable containing [is \"B\"]]\n]]\n") + .// + nullRejected("was null").// + accepting(SINGLE_LIST_WITH_A_B).// + rejecting(// + value(EMPTY_LIST).// + withMessage( + "[field No item matched: an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringList with\n[field iterable containing [is \"A\"]]\n]\n"), + value(OTHER_TYPE).// + withMessage("was \"\""), // + value(NULL_LIST).// + withMessage("[field was null]\n"), // + value(SINGLE_LIST_WITH_A).// + withMessage( + "[field No item matched: an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringList with\n[field iterable containing [is \"B\"]]\n]\n"), // + value(SINGLE_LIST_WITH_B).// + withMessage( + "[field item 0: [field item 0: was \"B\"]\n]\n"), // + value(SINGLE_LIST_WITH_B_A).// + withMessage( + "[field item 0: [field item 0: was \"B\"]\n]\n"))// + ); + } \ No newline at end of file diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringListMatchersTest.java b/src/it/full-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringListMatchersTest.java similarity index 97% rename from src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringListMatchersTest.java rename to src/it/full-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringListMatchersTest.java index 7581fecf6..db65eeb6f 100644 --- a/src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringListMatchersTest.java +++ b/src/it/full-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringListMatchersTest.java @@ -1,130 +1,130 @@ -/** - * Powerunit - A JDK1.8 test framework - * Copyright (C) 2014 Mathieu Boretti. - * - * This file is part of Powerunit - * - * Powerunit is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Powerunit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Powerunit. If not, see . - */ -package ch.powerunit.extensions.matchers.samples.iterable; - -import static ch.powerunit.matchers.MatcherTester.matcher; -import static ch.powerunit.matchers.MatcherTester.value; - -import java.util.Arrays; -import java.util.Collections; - -import ch.powerunit.TestDelegate; -import ch.powerunit.TestSuite; -import ch.powerunit.matchers.MatcherTester; - -/** - * @author borettim - * - */ -public class PojoWithStringListMatchersTest implements TestSuite { - - private static final Object OTHER_TYPE = ""; - - private static final PojoWithStringList NULL_LIST = new PojoWithStringList(null); - - private static final PojoWithStringList EMPTY_LIST = new PojoWithStringList(Collections.emptyList()); - - private static final PojoWithStringList SINGLE_LIST_WITH_A = new PojoWithStringList(Arrays.asList("A")); - - private static final PojoWithStringList SINGLE_LIST_WITH_B = new PojoWithStringList(Arrays.asList("B")); - - private static final PojoWithStringList SINGLE_LIST_WITH_A_B = new PojoWithStringList(Arrays.asList("A", "B")); - - private static final PojoWithStringList SINGLE_LIST_WITH_B_A = new PojoWithStringList(Arrays.asList("B", "A")); - - @TestDelegate - public final MatcherTester testMatcher = testerOfMatcher(// - PojoWithStringListMatchers.PojoWithStringListMatcher.class)// - .with(// - matcher(// - (PojoWithStringListMatchers.PojoWithStringListMatcher) PojoWithStringListMatchers - .pojoWithStringListWithSameValue(NULL_LIST)) - .// - describedAs( - "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringList with\n[field null]\n") - .// - nullRejected("was null").// - accepting(NULL_LIST).// - rejecting(// - value(OTHER_TYPE).// - withMessage("was \"\""), // - value(EMPTY_LIST).// - withMessage("[field was <[]>]\n"), // - value(SINGLE_LIST_WITH_A).// - withMessage("[field was <[A]>]\n")), // - matcher(// - (PojoWithStringListMatchers.PojoWithStringListMatcher) PojoWithStringListMatchers - .pojoWithStringListWithSameValue(EMPTY_LIST)) - .// - describedAs( - "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringList with\n[field an empty iterable]\n") - .// - nullRejected("was null").// - accepting(EMPTY_LIST).// - rejecting(// - value(OTHER_TYPE).// - withMessage("was \"\""), // - value(NULL_LIST).// - withMessage("[field was null]\n"), // - value(SINGLE_LIST_WITH_A).// - withMessage("[field [\"A\"]]\n")), // - matcher(// - (PojoWithStringListMatchers.PojoWithStringListMatcher) PojoWithStringListMatchers - .pojoWithStringListWithSameValue(SINGLE_LIST_WITH_A)) - .// - describedAs( - "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringList with\n[field iterable containing [is \"A\"]]\n") - .// - nullRejected("was null").// - accepting(SINGLE_LIST_WITH_A).// - rejecting(// - value(EMPTY_LIST).// - withMessage("[field No item matched: is \"A\"]\n"), - value(OTHER_TYPE).// - withMessage("was \"\""), // - value(NULL_LIST).// - withMessage("[field was null]\n"), // - value(SINGLE_LIST_WITH_A_B).// - withMessage("[field Not matched: \"B\"]\n")), // - matcher(// - (PojoWithStringListMatchers.PojoWithStringListMatcher) PojoWithStringListMatchers - .pojoWithStringListWithSameValue(SINGLE_LIST_WITH_A_B)) - .// - describedAs( - "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringList with\n[field iterable containing [is \"A\", is \"B\"]]\n") - .// - nullRejected("was null").// - accepting(SINGLE_LIST_WITH_A_B).// - rejecting(// - value(EMPTY_LIST).// - withMessage("[field No item matched: is \"A\"]\n"), - value(OTHER_TYPE).// - withMessage("was \"\""), // - value(NULL_LIST).// - withMessage("[field was null]\n"), // - value(SINGLE_LIST_WITH_A).// - withMessage("[field No item matched: is \"B\"]\n"), // - value(SINGLE_LIST_WITH_B).// - withMessage("[field item 0: was \"B\"]\n"), // - value(SINGLE_LIST_WITH_B_A).// - withMessage("[field item 0: was \"B\"]\n"))// - ); - +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples.iterable; + +import static ch.powerunit.matchers.MatcherTester.matcher; +import static ch.powerunit.matchers.MatcherTester.value; + +import java.util.Arrays; +import java.util.Collections; + +import ch.powerunit.TestDelegate; +import ch.powerunit.TestSuite; +import ch.powerunit.matchers.MatcherTester; + +/** + * @author borettim + * + */ +public class PojoWithStringListMatchersTest implements TestSuite { + + private static final Object OTHER_TYPE = ""; + + private static final PojoWithStringList NULL_LIST = new PojoWithStringList(null); + + private static final PojoWithStringList EMPTY_LIST = new PojoWithStringList(Collections.emptyList()); + + private static final PojoWithStringList SINGLE_LIST_WITH_A = new PojoWithStringList(Arrays.asList("A")); + + private static final PojoWithStringList SINGLE_LIST_WITH_B = new PojoWithStringList(Arrays.asList("B")); + + private static final PojoWithStringList SINGLE_LIST_WITH_A_B = new PojoWithStringList(Arrays.asList("A", "B")); + + private static final PojoWithStringList SINGLE_LIST_WITH_B_A = new PojoWithStringList(Arrays.asList("B", "A")); + + @TestDelegate + public final MatcherTester testMatcher = testerOfMatcher(// + PojoWithStringListMatchers.PojoWithStringListMatcher.class)// + .with(// + matcher(// + (PojoWithStringListMatchers.PojoWithStringListMatcher) PojoWithStringListMatchers + .pojoWithStringListWithSameValue(NULL_LIST)) + .// + describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringList with\n[field null]\n") + .// + nullRejected("was null").// + accepting(NULL_LIST).// + rejecting(// + value(OTHER_TYPE).// + withMessage("was \"\""), // + value(EMPTY_LIST).// + withMessage("[field was <[]>]\n"), // + value(SINGLE_LIST_WITH_A).// + withMessage("[field was <[A]>]\n")), // + matcher(// + (PojoWithStringListMatchers.PojoWithStringListMatcher) PojoWithStringListMatchers + .pojoWithStringListWithSameValue(EMPTY_LIST)) + .// + describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringList with\n[field an empty iterable]\n") + .// + nullRejected("was null").// + accepting(EMPTY_LIST).// + rejecting(// + value(OTHER_TYPE).// + withMessage("was \"\""), // + value(NULL_LIST).// + withMessage("[field was null]\n"), // + value(SINGLE_LIST_WITH_A).// + withMessage("[field [\"A\"]]\n")), // + matcher(// + (PojoWithStringListMatchers.PojoWithStringListMatcher) PojoWithStringListMatchers + .pojoWithStringListWithSameValue(SINGLE_LIST_WITH_A)) + .// + describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringList with\n[field iterable containing [is \"A\"]]\n") + .// + nullRejected("was null").// + accepting(SINGLE_LIST_WITH_A).// + rejecting(// + value(EMPTY_LIST).// + withMessage("[field No item matched: is \"A\"]\n"), + value(OTHER_TYPE).// + withMessage("was \"\""), // + value(NULL_LIST).// + withMessage("[field was null]\n"), // + value(SINGLE_LIST_WITH_A_B).// + withMessage("[field Not matched: \"B\"]\n")), // + matcher(// + (PojoWithStringListMatchers.PojoWithStringListMatcher) PojoWithStringListMatchers + .pojoWithStringListWithSameValue(SINGLE_LIST_WITH_A_B)) + .// + describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringList with\n[field iterable containing [is \"A\", is \"B\"]]\n") + .// + nullRejected("was null").// + accepting(SINGLE_LIST_WITH_A_B).// + rejecting(// + value(EMPTY_LIST).// + withMessage("[field No item matched: is \"A\"]\n"), + value(OTHER_TYPE).// + withMessage("was \"\""), // + value(NULL_LIST).// + withMessage("[field was null]\n"), // + value(SINGLE_LIST_WITH_A).// + withMessage("[field No item matched: is \"B\"]\n"), // + value(SINGLE_LIST_WITH_B).// + withMessage("[field item 0: was \"B\"]\n"), // + value(SINGLE_LIST_WITH_B_A).// + withMessage("[field item 0: was \"B\"]\n"))// + ); + } \ No newline at end of file diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringSetMatchersTest.java b/src/it/full-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringSetMatchersTest.java similarity index 97% rename from src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringSetMatchersTest.java rename to src/it/full-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringSetMatchersTest.java index 6404e46d5..b6f52fc6d 100644 --- a/src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringSetMatchersTest.java +++ b/src/it/full-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringSetMatchersTest.java @@ -1,130 +1,130 @@ -/** - * Powerunit - A JDK1.8 test framework - * Copyright (C) 2014 Mathieu Boretti. - * - * This file is part of Powerunit - * - * Powerunit is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Powerunit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Powerunit. If not, see . - */ -package ch.powerunit.extensions.matchers.samples.iterable; - -import static ch.powerunit.matchers.MatcherTester.matcher; -import static ch.powerunit.matchers.MatcherTester.value; - -import java.util.Arrays; -import java.util.Collections; -import java.util.HashSet; - -import ch.powerunit.TestDelegate; -import ch.powerunit.TestSuite; -import ch.powerunit.matchers.MatcherTester; - -/** - * @author borettim - * - */ -public class PojoWithStringSetMatchersTest implements TestSuite { - - private static final Object OTHER_TYPE = ""; - - private static final PojoWithStringSet NULL_LIST = new PojoWithStringSet(null); - - private static final PojoWithStringSet EMPTY_LIST = new PojoWithStringSet(Collections.emptySet()); - - private static final PojoWithStringSet SINGLE_LIST_WITH_A = new PojoWithStringSet(Collections.singleton("A")); - - private static final PojoWithStringSet SINGLE_LIST_WITH_B = new PojoWithStringSet(Collections.singleton("B")); - - private static final PojoWithStringSet SINGLE_LIST_WITH_A_B = new PojoWithStringSet( - new HashSet<>(Arrays.asList("A", "B"))); - - private static final PojoWithStringSet SINGLE_LIST_WITH_B_A = new PojoWithStringSet( - new HashSet<>(Arrays.asList("B", "A"))); - - @TestDelegate - public final MatcherTester testMatcher = testerOfMatcher(// - PojoWithStringSetMatchers.PojoWithStringSetMatcher.class)// - .with(// - matcher(// - (PojoWithStringSetMatchers.PojoWithStringSetMatcher) PojoWithStringSetMatchers - .pojoWithStringSetWithSameValue(NULL_LIST)) - .// - describedAs( - "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringSet with\n[field null]\n") - .// - nullRejected("was null").// - accepting(NULL_LIST).// - rejecting(// - value(OTHER_TYPE).// - withMessage("was \"\""), // - value(EMPTY_LIST).// - withMessage("[field was <[]>]\n"), // - value(SINGLE_LIST_WITH_A).// - withMessage("[field was <[A]>]\n")), // - matcher(// - (PojoWithStringSetMatchers.PojoWithStringSetMatcher) PojoWithStringSetMatchers - .pojoWithStringSetWithSameValue(EMPTY_LIST)) - .// - describedAs( - "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringSet with\n[field an empty iterable]\n") - .// - nullRejected("was null").// - accepting(EMPTY_LIST).// - rejecting(// - value(OTHER_TYPE).// - withMessage("was \"\""), // - value(NULL_LIST).// - withMessage("[field was null]\n"), // - value(SINGLE_LIST_WITH_A).// - withMessage("[field [\"A\"]]\n")), // - matcher(// - (PojoWithStringSetMatchers.PojoWithStringSetMatcher) PojoWithStringSetMatchers - .pojoWithStringSetWithSameValue(SINGLE_LIST_WITH_A)) - .// - describedAs( - "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringSet with\n[field iterable containing [is \"A\"]]\n") - .// - nullRejected("was null").// - accepting(SINGLE_LIST_WITH_A).// - rejecting(// - value(EMPTY_LIST).// - withMessage("[field No item matched: is \"A\"]\n"), - value(OTHER_TYPE).// - withMessage("was \"\""), // - value(NULL_LIST).// - withMessage("[field was null]\n"), // - value(SINGLE_LIST_WITH_A_B).// - withMessage("[field Not matched: \"B\"]\n")), // - matcher(// - (PojoWithStringSetMatchers.PojoWithStringSetMatcher) PojoWithStringSetMatchers - .pojoWithStringSetWithSameValue(SINGLE_LIST_WITH_A_B)) - .// - describedAs( - "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringSet with\n[field iterable containing [is \"A\", is \"B\"]]\n") - .// - nullRejected("was null").// - accepting(SINGLE_LIST_WITH_A_B).// - rejecting(// - value(EMPTY_LIST).// - withMessage("[field No item matched: is \"A\"]\n"), - value(OTHER_TYPE).// - withMessage("was \"\""), // - value(NULL_LIST).// - withMessage("[field was null]\n"), // - value(SINGLE_LIST_WITH_A).// - withMessage("[field No item matched: is \"B\"]\n"), // - value(SINGLE_LIST_WITH_B).// - withMessage("[field item 0: was \"B\"]\n"))); - +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples.iterable; + +import static ch.powerunit.matchers.MatcherTester.matcher; +import static ch.powerunit.matchers.MatcherTester.value; + +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; + +import ch.powerunit.TestDelegate; +import ch.powerunit.TestSuite; +import ch.powerunit.matchers.MatcherTester; + +/** + * @author borettim + * + */ +public class PojoWithStringSetMatchersTest implements TestSuite { + + private static final Object OTHER_TYPE = ""; + + private static final PojoWithStringSet NULL_LIST = new PojoWithStringSet(null); + + private static final PojoWithStringSet EMPTY_LIST = new PojoWithStringSet(Collections.emptySet()); + + private static final PojoWithStringSet SINGLE_LIST_WITH_A = new PojoWithStringSet(Collections.singleton("A")); + + private static final PojoWithStringSet SINGLE_LIST_WITH_B = new PojoWithStringSet(Collections.singleton("B")); + + private static final PojoWithStringSet SINGLE_LIST_WITH_A_B = new PojoWithStringSet( + new HashSet<>(Arrays.asList("A", "B"))); + + private static final PojoWithStringSet SINGLE_LIST_WITH_B_A = new PojoWithStringSet( + new HashSet<>(Arrays.asList("B", "A"))); + + @TestDelegate + public final MatcherTester testMatcher = testerOfMatcher(// + PojoWithStringSetMatchers.PojoWithStringSetMatcher.class)// + .with(// + matcher(// + (PojoWithStringSetMatchers.PojoWithStringSetMatcher) PojoWithStringSetMatchers + .pojoWithStringSetWithSameValue(NULL_LIST)) + .// + describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringSet with\n[field null]\n") + .// + nullRejected("was null").// + accepting(NULL_LIST).// + rejecting(// + value(OTHER_TYPE).// + withMessage("was \"\""), // + value(EMPTY_LIST).// + withMessage("[field was <[]>]\n"), // + value(SINGLE_LIST_WITH_A).// + withMessage("[field was <[A]>]\n")), // + matcher(// + (PojoWithStringSetMatchers.PojoWithStringSetMatcher) PojoWithStringSetMatchers + .pojoWithStringSetWithSameValue(EMPTY_LIST)) + .// + describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringSet with\n[field an empty iterable]\n") + .// + nullRejected("was null").// + accepting(EMPTY_LIST).// + rejecting(// + value(OTHER_TYPE).// + withMessage("was \"\""), // + value(NULL_LIST).// + withMessage("[field was null]\n"), // + value(SINGLE_LIST_WITH_A).// + withMessage("[field [\"A\"]]\n")), // + matcher(// + (PojoWithStringSetMatchers.PojoWithStringSetMatcher) PojoWithStringSetMatchers + .pojoWithStringSetWithSameValue(SINGLE_LIST_WITH_A)) + .// + describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringSet with\n[field iterable containing [is \"A\"]]\n") + .// + nullRejected("was null").// + accepting(SINGLE_LIST_WITH_A).// + rejecting(// + value(EMPTY_LIST).// + withMessage("[field No item matched: is \"A\"]\n"), + value(OTHER_TYPE).// + withMessage("was \"\""), // + value(NULL_LIST).// + withMessage("[field was null]\n"), // + value(SINGLE_LIST_WITH_A_B).// + withMessage("[field Not matched: \"B\"]\n")), // + matcher(// + (PojoWithStringSetMatchers.PojoWithStringSetMatcher) PojoWithStringSetMatchers + .pojoWithStringSetWithSameValue(SINGLE_LIST_WITH_A_B)) + .// + describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringSet with\n[field iterable containing [is \"A\", is \"B\"]]\n") + .// + nullRejected("was null").// + accepting(SINGLE_LIST_WITH_A_B).// + rejecting(// + value(EMPTY_LIST).// + withMessage("[field No item matched: is \"A\"]\n"), + value(OTHER_TYPE).// + withMessage("was \"\""), // + value(NULL_LIST).// + withMessage("[field was null]\n"), // + value(SINGLE_LIST_WITH_A).// + withMessage("[field No item matched: is \"B\"]\n"), // + value(SINGLE_LIST_WITH_B).// + withMessage("[field item 0: was \"B\"]\n"))); + } \ No newline at end of file diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/third/OneFunnyOneMatchersTest.java b/src/it/full-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/third/OneFunnyOneMatchersTest.java similarity index 100% rename from src/test/java/ch/powerunit/extensions/matchers/samples/third/OneFunnyOneMatchersTest.java rename to src/it/full-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/third/OneFunnyOneMatchersTest.java diff --git a/src/it/full-it-jdk8/verify.bsh b/src/it/full-it-jdk8/verify.bsh new file mode 100644 index 000000000..9adc23f13 --- /dev/null +++ b/src/it/full-it-jdk8/verify.bsh @@ -0,0 +1,7 @@ +import java.io.*; + +File file = new File( basedir, "build.log" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not build log: " + file ); +} diff --git a/src/it/full-it-jdk9+/params.properties b/src/it/full-it-jdk9+/params.properties new file mode 100644 index 000000000..714c1431d --- /dev/null +++ b/src/it/full-it-jdk9+/params.properties @@ -0,0 +1,2 @@ +invoker.java.version=!1.8,9,10,11+ +invoker.goals=clean install diff --git a/src/it/full-it-jdk9+/pom.xml b/src/it/full-it-jdk9+/pom.xml new file mode 100644 index 000000000..2825adb66 --- /dev/null +++ b/src/it/full-it-jdk9+/pom.xml @@ -0,0 +1,316 @@ + + 4.0.0 + ch.powerunit.extensions + powerunit-extensions-matchers-it32 + @project.version@ + + jar + + + 1.8 + 1.8 + UTF-8 + 1.3 + 2.22.2 + 0.5.0 + + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.11.2 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.5 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.13.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-archetype-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + + ch.powerunit + powerunit + ${powerunit.version} + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.9.0 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.version} + + + com.github.github + site-maven-plugin + 0.12 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + org.codehaus.mojo + jaxb2-maven-plugin + 2.5.0 + + + org.apache.maven.plugins + maven-changes-plugin + 2.12.1 + + + GitHub + + + + + org.codehaus.mojo + sonar-maven-plugin + 3.7.0.1746 + + + maven-invoker-plugin + 3.2.1 + + + maven-assembly-plugin + 3.3.0 + + + org.codehaus.mojo + xml-maven-plugin + 1.0.2 + + + maven-deploy-plugin + 2.8.2 + + + maven-install-plugin + 2.5.2 + + + + + + org.jacoco + jacoco-maven-plugin + + + + ${project.build.directory} + + *.exec + + + + + + + default-prepare-agent-1 + + prepare-agent + + + + default-prepare-agent-2 + initialize + + prepare-agent-integration + + + testcompileargs + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + jar + test-jar + + + + + true + false + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.source.version} + ${java.target.version} + true + + -J${testcompileargs} + + + + + default-compile + + compile + + + + -J${testcompileargs} + -Ach.powerunit.extensions.matchers.provideprocessor.ProvidesMatchersAnnotationsProcessor.factory=ch.powerunit.extensions.matchers.samples.AllMatchers + + + + + + + + + + + org.hamcrest + hamcrest-all + ${hamcrest.version} + + + ch.powerunit + powerunit + ${powerunit.version} + test + + + ch.powerunit.extensions + powerunit-extensions-matchers + @project.version@ + + + javax.annotation + javax.annotation-api + 1.3.2 + + + com.google.code.bean-matchers + bean-matchers + 0.12 + true + + + org.exparity + hamcrest-date + 2.0.7 + true + + + com.nitorcreations + matchers + 1.3 + true + + + com.spotify + hamcrest-jackson + 1.1.5 + true + + + \ No newline at end of file diff --git a/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/MapSample.java b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/MapSample.java new file mode 100644 index 000000000..8b83c827d --- /dev/null +++ b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/MapSample.java @@ -0,0 +1,22 @@ +package ch.powerunit.extensions.matchers.samples; + +import java.util.Map; + +import ch.powerunit.extensions.matchers.ProvideMatchers; +import ch.powerunit.extensions.matchers.samples.extension.MyTestWithoutGeneric; +import ch.powerunit.extensions.matchers.samples.extension.MyTestWithoutGeneric2; + +@ProvideMatchers +public class MapSample { + public Map map1; + + public Map map2; + + public Map map3; + + public Map map4; + + public Map map5; + + public Map map6; +} diff --git a/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java new file mode 100644 index 000000000..b74ebe416 --- /dev/null +++ b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java @@ -0,0 +1,97 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Set; + +import ch.powerunit.extensions.matchers.ComplementaryExpositionMethod; +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * + */ +@ProvideMatchers(moreMethod = { ComplementaryExpositionMethod.CONTAINS, ComplementaryExpositionMethod.ARRAYCONTAINING, + ComplementaryExpositionMethod.HAS_ITEMS, ComplementaryExpositionMethod.ANY_OF, + ComplementaryExpositionMethod.NONE_OF }) +public class Pojo1 { + private String msg1; + + public String msg2; + + public int msg3; + + public String[] msg4; + + public int[] msg5; + + public List msg6; + + public List msg7; + + public List[] msg8; + + public Collection msg9; + + public Set msg12; + + public String getMsg1() { + return msg1; + } + + public void setMsg1(String msg1) { + this.msg1 = msg1; + } + + public boolean myBoolean; + + private boolean oneBoolean; + + public boolean isOneBoolean() { + return oneBoolean; + } + + public void setOneBoolean(boolean oneBoolean) { + this.oneBoolean = oneBoolean; + } + + public Pojo1() { + } + + public Pojo1(String msg1) { + this.msg1 = msg1; + } + + public Pojo1(List msg6) { + this.msg6 = msg6; + } + + @Override + public String toString() { + return "Pojo1 [msg1=" + msg1 + ", msg2=" + msg2 + ", msg3=" + msg3 + ", msg4=" + Arrays.toString(msg4) + + ", msg5=" + Arrays.toString(msg5) + ", msg6=" + msg6 + ", msg7=" + msg7 + ", msg8=" + + Arrays.toString(msg8) + ", msg9=" + msg9 + ", msg12=" + msg12 + ", myBoolean=" + myBoolean + + ", oneBoolean=" + oneBoolean + "]"; + } + +} diff --git a/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo2.java b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo2.java new file mode 100644 index 000000000..5ff8953e8 --- /dev/null +++ b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo2.java @@ -0,0 +1,37 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +/** + * @author borettim + * + */ +public class Pojo2 extends Pojo1 { + private char msg10; + + public char getMsg10() { + return msg10; + } + + public void setMsg10(char msg10) { + this.msg10 = msg10; + } + +} diff --git a/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo3.java b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo3.java new file mode 100644 index 000000000..8fed294d8 --- /dev/null +++ b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo3.java @@ -0,0 +1,67 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import java.io.Serializable; +import java.util.List; + +import ch.powerunit.extensions.matchers.ComplementaryExpositionMethod; +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * @param + * This is T + * @param + * This is O + * + */ +@ProvideMatchers(comments = "this is a \"comment\"", moreMethod = { ComplementaryExpositionMethod.CONTAINS, + ComplementaryExpositionMethod.ARRAYCONTAINING, ComplementaryExpositionMethod.HAS_ITEMS, + ComplementaryExpositionMethod.ANY_OF }) +public class Pojo3 { + public String msg1; + + public T msg2; + + public O msg3; + + private T msg4; + + public T[] msg5; + + public List msg6; + + /** + * @return the msg4 + */ + public T getMsg4() { + return msg4; + } + + /** + * @param msg4 + * the msg4 to set + */ + public void setMsg4(T msg4) { + this.msg4 = msg4; + } + +} diff --git a/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo4.java b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo4.java new file mode 100644 index 000000000..a87f6fb23 --- /dev/null +++ b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo4.java @@ -0,0 +1,47 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import java.io.Serializable; + +/** + * @author borettim + * + * @param + * A... + * @param + * B... + * @see org.hamcrest.Matcher + * + */ +public class Pojo4> extends Pojo3 { + private char msg10; + + public char getMsg10() { + return msg10; + } + + public void setMsg10(char msg10) { + this.msg10 = msg10; + } + + public B test; + +} diff --git a/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/PojoClass.java b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/PojoClass.java new file mode 100644 index 000000000..f777d380e --- /dev/null +++ b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/PojoClass.java @@ -0,0 +1,37 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * + */ +@ProvideMatchers() +public class PojoClass { + public Class clazzNoGeneric; + + public Class clazzWildcard; + + public Class clazzExtends; + + public Class clazzSuper; +} diff --git a/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/PojoShort.java b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/PojoShort.java new file mode 100644 index 000000000..1c3bbce8f --- /dev/null +++ b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/PojoShort.java @@ -0,0 +1,32 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * + */ +@ProvideMatchers +public class PojoShort { + public String msg1; + +} diff --git a/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/Sample.java b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/Sample.java new file mode 100644 index 000000000..371add391 --- /dev/null +++ b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/Sample.java @@ -0,0 +1,17 @@ +package ch.powerunit.extensions.matchers.samples; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers +public class Sample { + private String field1; + + public String getField1() { + return field1; + } + + public void setField1(String field1) { + this.field1 = field1; + } + +} diff --git a/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/SampleLocalDateTime.java b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/SampleLocalDateTime.java new file mode 100644 index 000000000..5d912da1f --- /dev/null +++ b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/SampleLocalDateTime.java @@ -0,0 +1,18 @@ +package ch.powerunit.extensions.matchers.samples; + +import java.time.LocalDateTime; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers +public class SampleLocalDateTime { + private LocalDateTime opt; + + public LocalDateTime getOpt() { + return opt; + } + + public void setOpt(LocalDateTime opt) { + this.opt = opt; + } +} diff --git a/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/SampleOptional.java b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/SampleOptional.java new file mode 100644 index 000000000..2e15e9337 --- /dev/null +++ b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/SampleOptional.java @@ -0,0 +1,52 @@ +package ch.powerunit.extensions.matchers.samples; + +import java.util.Optional; + +import ch.powerunit.extensions.matchers.IgnoreInMatcher; +import ch.powerunit.extensions.matchers.ProvideMatchers; +import ch.powerunit.extensions.matchers.samples.extension.MyTestWithoutGeneric; +import ch.powerunit.extensions.matchers.samples.extension.MyTestWithoutGeneric2; + +@ProvideMatchers +public class SampleOptional { + public SampleOptional() { + } + + public SampleOptional(Optional opt, String ignoreMe, Optional opt2, + Optional opt3, Optional opt4) { + this.opt = opt; + this.ignoreMe = ignoreMe; + this.opt2 = opt2; + this.opt3 = opt3; + this.opt4 = opt4; + } + + // only once must be added + public Optional opt; + + public Optional getOpt() { + return opt; + } + + public void setOpt(Optional opt) { + this.opt = opt; + } + + @IgnoreInMatcher(comments = "Why not?") + public String ignoreMe; + + public String getIgnoreMe() { + return ignoreMe; + } + + public void setIgnoreMe(String ignoreMe) { + this.ignoreMe = ignoreMe; + } + + public Optional opt2; + + public Optional opt3; + + public Optional opt4; + +} diff --git a/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/SampleSupplier.java b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/SampleSupplier.java new file mode 100644 index 000000000..306d0eae6 --- /dev/null +++ b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/SampleSupplier.java @@ -0,0 +1,13 @@ +package ch.powerunit.extensions.matchers.samples; + +import java.util.List; +import java.util.function.Supplier; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers +public class SampleSupplier { + public Supplier s1; + + public Supplier> s2; +} diff --git a/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/SimplePojo.java b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/SimplePojo.java new file mode 100644 index 000000000..2f648de20 --- /dev/null +++ b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/SimplePojo.java @@ -0,0 +1,8 @@ +package ch.powerunit.extensions.matchers.samples; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers +public class SimplePojo { + public String oneField; +} diff --git a/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/TwoFieldsPojo.java b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/TwoFieldsPojo.java new file mode 100644 index 000000000..5cebbe139 --- /dev/null +++ b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/TwoFieldsPojo.java @@ -0,0 +1,10 @@ +package ch.powerunit.extensions.matchers.samples; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers +public class TwoFieldsPojo { + public String firstField; + + public String secondField; +} diff --git a/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/addmatcher/PojoWithOverrideField.java b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/addmatcher/PojoWithOverrideField.java new file mode 100644 index 000000000..7b52739a9 --- /dev/null +++ b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/addmatcher/PojoWithOverrideField.java @@ -0,0 +1,30 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples.addmatcher; + +import ch.powerunit.extensions.matchers.AddToMatcher; +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers +public class PojoWithOverrideField { + @AddToMatcher(suffix = "Suffix", argument = "", body = "// Does nothing, just for sample") + @AddToMatcher(suffix = "SuffixTest", argument = "java.lang.String test", body = "// Does nothing, just for sample") + public String field; +} diff --git a/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/extension/Includer.java b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/extension/Includer.java new file mode 100644 index 000000000..e011e3c1b --- /dev/null +++ b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/extension/Includer.java @@ -0,0 +1,10 @@ +package ch.powerunit.extensions.matchers.samples.extension; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers +public class Includer { + public MyTestWithoutGeneric p1; + + public MyTestWithoutGeneric2 p2; +} diff --git a/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/extension/MyPair.java b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/extension/MyPair.java new file mode 100644 index 000000000..3d3e95473 --- /dev/null +++ b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/extension/MyPair.java @@ -0,0 +1,27 @@ +package ch.powerunit.extensions.matchers.samples.extension; + +import org.apache.commons.lang3.tuple.Pair; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers +public class MyPair extends Pair { + + public String test; + + @Override + public R setValue(R arg0) { + return null; + } + + @Override + public L getLeft() { + return null; + } + + @Override + public R getRight() { + return null; + } + +} diff --git a/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/extension/MyPair2.java b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/extension/MyPair2.java new file mode 100644 index 000000000..82d125281 --- /dev/null +++ b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/extension/MyPair2.java @@ -0,0 +1,27 @@ +package ch.powerunit.extensions.matchers.samples.extension; + +import org.apache.commons.lang3.tuple.Pair; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers(allowWeakWithSameValue = true) +public class MyPair2 extends Pair { + + public String test; + + @Override + public R setValue(R arg0) { + return null; + } + + @Override + public L getLeft() { + return null; + } + + @Override + public R getRight() { + return null; + } + +} diff --git a/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/extension/MyTestWithoutGeneric.java b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/extension/MyTestWithoutGeneric.java new file mode 100644 index 000000000..29c91937e --- /dev/null +++ b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/extension/MyTestWithoutGeneric.java @@ -0,0 +1,15 @@ +package ch.powerunit.extensions.matchers.samples.extension; + +import org.apache.commons.lang3.text.StrBuilder; + +import ch.powerunit.extensions.matchers.ComplementaryExpositionMethod; +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers(moreMethod = { ComplementaryExpositionMethod.CONTAINS, ComplementaryExpositionMethod.ARRAYCONTAINING, + ComplementaryExpositionMethod.HAS_ITEMS, ComplementaryExpositionMethod.ANY_OF, + ComplementaryExpositionMethod.NONE_OF }) +public class MyTestWithoutGeneric extends StrBuilder { + + public String test; + +} diff --git a/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/extension/MyTestWithoutGeneric2.java b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/extension/MyTestWithoutGeneric2.java new file mode 100644 index 000000000..16ee91483 --- /dev/null +++ b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/extension/MyTestWithoutGeneric2.java @@ -0,0 +1,22 @@ +package ch.powerunit.extensions.matchers.samples.extension; + +import org.apache.commons.lang3.text.StrBuilder; + +import ch.powerunit.extensions.matchers.ComplementaryExpositionMethod; +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers(moreMethod = { ComplementaryExpositionMethod.CONTAINS, ComplementaryExpositionMethod.ARRAYCONTAINING, + ComplementaryExpositionMethod.HAS_ITEMS, ComplementaryExpositionMethod.ANY_OF, + ComplementaryExpositionMethod.NONE_OF }, allowWeakWithSameValue = true) +public class MyTestWithoutGeneric2 extends StrBuilder { + + public MyTestWithoutGeneric2() { + } + + public MyTestWithoutGeneric2(String test) { + this.test = test; + } + + public String test; + +} diff --git a/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithSameRoundList.java b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithSameRoundList.java new file mode 100644 index 000000000..50b78a464 --- /dev/null +++ b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithSameRoundList.java @@ -0,0 +1,44 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples.iterable; + +import java.util.List; +import java.util.Objects; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * + */ +@ProvideMatchers +public class PojoWithSameRoundList { + public List field; + + public PojoWithSameRoundList(List field) { + this.field = field; + } + + @Override + public String toString() { + return "PojoWithStringList [field=" + Objects.toString(field) + "]"; + } + +} diff --git a/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringList.java b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringList.java new file mode 100644 index 000000000..003359481 --- /dev/null +++ b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringList.java @@ -0,0 +1,44 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples.iterable; + +import java.util.List; +import java.util.Objects; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * + */ +@ProvideMatchers +public class PojoWithStringList { + public List field; + + public PojoWithStringList(List field) { + this.field = field; + } + + @Override + public String toString() { + return "PojoWithStringList [field=" + Objects.toString(field) + "]"; + } + +} diff --git a/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringSet.java b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringSet.java new file mode 100644 index 000000000..3fe25103e --- /dev/null +++ b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringSet.java @@ -0,0 +1,44 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples.iterable; + +import java.util.Objects; +import java.util.Set; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * + */ +@ProvideMatchers +public class PojoWithStringSet { + public Set field; + + public PojoWithStringSet(Set field) { + this.field = field; + } + + @Override + public String toString() { + return "PojoWithStringList [field=" + Objects.toString(field) + "]"; + } + +} diff --git a/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/others/Pojo42.java b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/others/Pojo42.java new file mode 100644 index 000000000..6924b1243 --- /dev/null +++ b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/others/Pojo42.java @@ -0,0 +1,85 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples.others; + +import java.util.Collection; +import java.util.List; +import java.util.Set; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * + */ +@ProvideMatchers +public class Pojo42 { + private String msg1; + + public String msg2; + + public int msg3; + + public String[] msg4; + + public int[] msg5; + + public List msg6; + + public List msg7; + + public List[] msg8; + + public Collection msg9; + + public Set msg12; + + public String getMsg1() { + return msg1; + } + + public void setMsg1(String msg1) { + this.msg1 = msg1; + } + + public boolean myBoolean; + + private boolean oneBoolean; + + public boolean isOneBoolean() { + return oneBoolean; + } + + public void setOneBoolean(boolean oneBoolean) { + this.oneBoolean = oneBoolean; + } + + public Pojo42() { + } + + public Pojo42(String msg1) { + this.msg1 = msg1; + } + + public Pojo42(List msg6) { + this.msg6 = msg6; + } + +} diff --git a/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/others/Pojo43.java b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/others/Pojo43.java new file mode 100644 index 000000000..f182fa89c --- /dev/null +++ b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/others/Pojo43.java @@ -0,0 +1,32 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples.others; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * + */ +@ProvideMatchers(matchersPackageName = "ch.powerunit.extensions.matchers.samples.others2") +public class Pojo43 { + public String nameMe; + +} diff --git a/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/others/PojoRenameMatcher.java b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/others/PojoRenameMatcher.java new file mode 100644 index 000000000..2b515432c --- /dev/null +++ b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/others/PojoRenameMatcher.java @@ -0,0 +1,32 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples.others; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * + */ +@ProvideMatchers(matchersClassName="PojoRenameMatchersToOtherName") +public class PojoRenameMatcher { + public String msg1; + +} diff --git a/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/others/PojoRenameParentMatcher.java b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/others/PojoRenameParentMatcher.java new file mode 100644 index 000000000..dc5e5bb00 --- /dev/null +++ b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/others/PojoRenameParentMatcher.java @@ -0,0 +1,15 @@ +/** + * + */ +package ch.powerunit.extensions.matchers.samples.others; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * + */ +@ProvideMatchers +public class PojoRenameParentMatcher extends PojoRenameMatcher { + public String testMe; +} diff --git a/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/third/ExtendedPojo43.java b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/third/ExtendedPojo43.java new file mode 100644 index 000000000..9a8a9901b --- /dev/null +++ b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/third/ExtendedPojo43.java @@ -0,0 +1,33 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples.third; + +import ch.powerunit.extensions.matchers.ProvideMatchers; +import ch.powerunit.extensions.matchers.samples.others.Pojo43; + +/** + * @author borettim + * + */ +@ProvideMatchers() +public class ExtendedPojo43 extends Pojo43{ + public String nameMe2; + +} diff --git a/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/third/OneFunnyOne.java b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/third/OneFunnyOne.java new file mode 100644 index 000000000..8bc2a8def --- /dev/null +++ b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/third/OneFunnyOne.java @@ -0,0 +1,46 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples.third; + +import ch.powerunit.extensions.matchers.ProvideMatchers; +import ch.powerunit.extensions.matchers.samples.Pojo1; +import ch.powerunit.extensions.matchers.samples.Pojo3; +import ch.powerunit.extensions.matchers.samples.others.PojoRenameMatcher; + +@ProvideMatchers +public class OneFunnyOne { + public Pojo1 onePojo1; + + public String secondOne; + + public Pojo3 secondPojo3; + + public PojoRenameMatcher thirdPojo; + + private Pojo1 onePojo1b; + + public void setOnePojo1b(Pojo1 onePojo1b) { + this.onePojo1b=onePojo1b; + } + + public Pojo1 getOnePojo1b() { + return onePojo1b; + } +} diff --git a/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/third/SimpleFullyOne.java b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/third/SimpleFullyOne.java new file mode 100644 index 000000000..29646d926 --- /dev/null +++ b/src/it/full-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/third/SimpleFullyOne.java @@ -0,0 +1,28 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples.third; + +import ch.powerunit.extensions.matchers.ProvideMatchers; +import ch.powerunit.extensions.matchers.samples.Pojo1; + +@ProvideMatchers +public class SimpleFullyOne { + public Pojo1 onePojo1; +} diff --git a/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/MapSampleTest.java b/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/MapSampleTest.java new file mode 100644 index 000000000..e96b75300 --- /dev/null +++ b/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/MapSampleTest.java @@ -0,0 +1,24 @@ +package ch.powerunit.extensions.matchers.samples; + +import java.util.Collections; + +import ch.powerunit.Test; +import ch.powerunit.TestSuite; +import ch.powerunit.extensions.matchers.samples.extension.MyTestWithoutGeneric2; + +public class MapSampleTest implements TestSuite { + @Test + public void testSameValue() { + MapSample ms = new MapSample<>(); + ms.map1 = Collections.singletonMap("x", 12); + ms.map2 = Collections.singletonMap("y", 12L); + ms.map3 = Collections.singletonMap("z", "a"); + ms.map4 = Collections.singletonMap("a", "b"); + assertThat(ms).is(MapSampleMatchers.mapSampleWith() + .map1HasSameValues(Collections.singletonMap("x", 12)).build()); + assertThat(ms).isNot( + MapSampleMatchers.mapSampleWith().map1HasSameValues(Collections.emptyMap()).build()); + assertThat(ms).isNot(MapSampleMatchers.mapSampleWith() + .map6HasSameValues(Collections.singletonMap("x", new MyTestWithoutGeneric2("z"))).build()); + } +} diff --git a/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java b/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java new file mode 100644 index 000000000..4686b1972 --- /dev/null +++ b/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java @@ -0,0 +1,229 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import static ch.powerunit.matchers.MatcherTester.matcher; +import static ch.powerunit.matchers.MatcherTester.value; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.hamcrest.Factory; +import org.hamcrest.Matcher; + +import ch.powerunit.Ignore; +import ch.powerunit.Test; +import ch.powerunit.TestDelegate; +import ch.powerunit.TestSuite; +import ch.powerunit.matchers.MatcherTester; + +public class Pojo1MatcherTest implements TestSuite { + + @TestDelegate + public final MatcherTester tester = testerOfMatcher(Pojo1Matchers.Pojo1MatcherImpl.class).with( + matcher((Pojo1Matchers.Pojo1MatcherImpl) Pojo1Matchers.pojo1With().msg1ContainsString("12")).describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.Pojo1 with\n[msg4 ANYTHING]\n[msg3 ANYTHING]\n[msg2 ANYTHING]\n[msg1 a string containing \"12\"]\n[msg8 ANYTHING]\n[msg7 ANYTHING]\n[msg6 ANYTHING]\n[msg12 ANYTHING]\n[msg5 ANYTHING]\n[oneBoolean ANYTHING]\n[myBoolean ANYTHING]\n[msg9 ANYTHING]\n") + .nullRejected("was null").accepting(new Pojo1("12"), new Pojo1("121")) + .rejecting(value("").withMessage("was \"\""), value(new Pojo1()).withMessage("[msg1 was null]\n"), + value(new Pojo1("11")).withMessage("[msg1 was \"11\"]\n")), + matcher((Pojo1Matchers.Pojo1MatcherImpl) Pojo1Matchers.pojo1With().msg6IsEmptyIterable()).describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.Pojo1 with\n[msg4 ANYTHING]\n[msg3 ANYTHING]\n[msg2 ANYTHING]\n[msg1 ANYTHING]\n[msg8 ANYTHING]\n[msg7 ANYTHING]\n[msg6 an empty iterable]\n[msg12 ANYTHING]\n[msg5 ANYTHING]\n[oneBoolean ANYTHING]\n[myBoolean ANYTHING]\n[msg9 ANYTHING]\n") + .nullRejected("was null").accepting(new Pojo1(Collections.emptyList())) + .rejecting(value(new Pojo1(Collections.singletonList("x"))).withMessage("[msg6 [\"x\"]]\n"))); + + @Test + public void testOKMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With()); + } + + @Test + public void testSameInstanceMatcher() { + Pojo1 p = new Pojo1(); + p.msg6 = new ArrayList<>(); + assertThat(p).is(Pojo1Matchers.pojo1With().msg6IsSameInstance(p.msg6)); + } + + @Test + public void testContainsMatcherOne() { + Pojo1 p1 = new Pojo1(); + p1.setMsg1("x"); + List lst = Arrays.asList(p1); + assertThat(lst).is(Pojo1Matchers.containsPojo1(p1)); + } + + @Test + public void testContainsMatcherTwo() { + Pojo1 p1 = new Pojo1(); + p1.setMsg1("x"); + Pojo1 p2 = new Pojo1(); + p2.setMsg1("y"); + List lst = Arrays.asList(p1, p2); + assertThat(lst).is(Pojo1Matchers.containsPojo1(p1, p2)); + } + + @Test + public void testContainsMatcherThird() { + Pojo1 p1 = new Pojo1(); + p1.setMsg1("x"); + Pojo1 p2 = new Pojo1(); + p2.setMsg1("y"); + Pojo1 p3 = new Pojo1(); + p3.setMsg1("z"); + List lst = Arrays.asList(p1, p2, p3); + assertThat(lst).is(Pojo1Matchers.containsPojo1(p1, p2, p3)); + } + + @Test + public void testContainsMatcherMore() { + Pojo1 p1 = new Pojo1(); + p1.setMsg1("x"); + Pojo1 p2 = new Pojo1(); + p2.setMsg1("y"); + Pojo1 p3 = new Pojo1(); + p3.setMsg1("z"); + Pojo1 p4 = new Pojo1(); + p4.setMsg1("a"); + List lst = Arrays.asList(p1, p2, p3, p4); + assertThat(lst).is(Pojo1Matchers.containsPojo1(p1, p2, p3, p4)); + } + + @Test + public void testOKMatcherWithConvert() { + Pojo1 p = new Pojo1(); + p.msg2 = "12"; + assertThat(p).is(Pojo1Matchers.pojo1With().msg2As(s -> Integer.valueOf(s) + 1l, is(13l))); + } + + @Test + public void testOKMatcherWithLinkedMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With().andWith(notNullValue()).andWith(hasToString(notNullValue())) + .buildWith(anything())); + } + + @Test + public void testOKMatcherWithComparable() { + Pojo1 p = new Pojo1(); + p.msg2 = "12"; + assertThat(p).is(Pojo1Matchers.pojo1With().msg2ComparesEqualTo("12").build()); + } + + @Test + public void testKOMatcherWithReference() { + Pojo1 p1 = new Pojo1(); + p1.msg2 = "12"; + Pojo1 p2 = new Pojo1(); + p2.msg2 = "12"; + assertThat(p1).is(Pojo1Matchers.pojo1WithSameValue(p2)); + } + + @Test + public void testKOMatcherWithEmptyArray() { + Pojo1 p1 = new Pojo1(); + p1.msg8 = new List[] {}; + assertThat(p1).is(Pojo1Matchers.pojo1With().msg8IsEmpty()); + } + + @Test + public void testKOMatcherWithExtensionUtility() { + Pojo1 p1 = new Pojo1(); + p1.msg6 = Arrays.asList("a", "b"); + assertThat(p1).is(Pojo1Matchers.pojo1With().msg6HasFirstItem(is("a"))); + } + + @Test + public void testAnyOf() { + Pojo1 p1 = new Pojo1(); + p1.msg2 = "x"; + Pojo1 p2 = new Pojo1(); + p2.msg2 = "y"; + Pojo1 p3 = new Pojo1(); + p3.msg2 = "z"; + assertThat(p1).is(Pojo1Matchers.anyOfPojo1(p1, p2, p3)); + } + + @Test + public void testNoneOf() { + Pojo1 p1 = new Pojo1(); + p1.msg2 = "x"; + Pojo1 p2 = new Pojo1(); + p2.msg2 = "y"; + Pojo1 p3 = new Pojo1(); + p3.msg2 = "z"; + assertThat(p1).is(Pojo1Matchers.noneOfPojo1(p2, p3)); + } + + @Test + @Ignore + public void testKOMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With().msg1("x")); + } + + @Factory + public static void test() { + } + + @Factory + public static void test(String name1) { + } + + @Factory + public static T test(T input) { + return input; + } + + @Factory + public static , K> void test1(T t1, K t2) { + } + + @Factory + public static & Serializable, K> void test2(T t1, K t2) { + } + + @Factory + public static & Serializable, K> void test3(T t1, K... t2) { + } + + @Factory + public static void test4(T t1) { + } + + @Factory + public static Matcher fromMatcher(Matcher input) { + return null; + } + + /** + * @param name1 + * @param name2 + */ + @Factory + public static void test(String name1, String name2) { + } + + @Factory + public static void test(int x) { + } +} diff --git a/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo2MatcherTest.java b/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo2MatcherTest.java new file mode 100644 index 000000000..91b927e21 --- /dev/null +++ b/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo2MatcherTest.java @@ -0,0 +1,46 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import ch.powerunit.Ignore; +import ch.powerunit.Test; +import ch.powerunit.TestSuite; + +public class Pojo2MatcherTest implements TestSuite { + @Test + public void testOKMatcher() { + Pojo2 p = new Pojo2(); + assertThat(p).is(AllMatchers.DSL.pojo2With()); + } + + @Test + @Ignore + public void testKOMatcher() { + Pojo2 p = new Pojo2(); + assertThat(p).is(AllMatchers.DSL.pojo2With(AllMatchers.DSL.pojo1With().msg1("x"))); + } + + @Test + public void testOKMatcherForParent() { + Pojo2 p = new Pojo2(); + p.msg2 = "12"; + assertThat(p).is(AllMatchers.DSL.pojo2WithParent().msg2("12").end()); + } +} diff --git a/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo3MatcherTest.java b/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo3MatcherTest.java new file mode 100644 index 000000000..cc848c69c --- /dev/null +++ b/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo3MatcherTest.java @@ -0,0 +1,39 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import ch.powerunit.Ignore; +import ch.powerunit.Test; +import ch.powerunit.TestSuite; + +public class Pojo3MatcherTest implements TestSuite { + @Test + public void testOKMatcher() { + Pojo3 p = new Pojo3<>(); + assertThat(p).is(Pojo3Matchers.pojo3With()); + } + + @Test + @Ignore + public void testKOMatcher() { + Pojo3 p = new Pojo3<>(); + assertThat(p).is(Pojo3Matchers. pojo3With().msg1("x")); + } +} diff --git a/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/PojoClassMatchersTest.java b/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/PojoClassMatchersTest.java new file mode 100644 index 000000000..57c6039be --- /dev/null +++ b/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/PojoClassMatchersTest.java @@ -0,0 +1,36 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import ch.powerunit.Test; +import ch.powerunit.TestSuite; + +public class PojoClassMatchersTest implements TestSuite { + @Test + public void testClass() { + PojoClass ut = new PojoClass(); + ut.clazzNoGeneric = Object.class; + ut.clazzWildcard = String.class; + ut.clazzExtends = Integer.class; + ut.clazzSuper = Comparable.class; + assertThat(ut).is(PojoClassMatchers.pojoClassWith().clazzNoGeneric(Object.class).clazzWildcard(String.class) + .clazzExtends(Integer.class).clazzSuper(Comparable.class)); + } +} diff --git a/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/SampleLocalDateTimeTest.java b/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/SampleLocalDateTimeTest.java new file mode 100644 index 000000000..2a4c774ac --- /dev/null +++ b/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/SampleLocalDateTimeTest.java @@ -0,0 +1,35 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import java.time.LocalDateTime; + +import ch.powerunit.Test; +import ch.powerunit.TestSuite; + +public class SampleLocalDateTimeTest implements TestSuite { + @Test + public void testOKMatcherForComparable() { + SampleLocalDateTime p = new SampleLocalDateTime(); + p.setOpt(LocalDateTime.of(2012, 1, 1, 9, 5)); + assertThat(p).is( + SampleLocalDateTimeMatchers.sampleLocalDateTimeWith().optLessThan(LocalDateTime.of(2013, 1, 1, 9, 5))); + } +} diff --git a/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/SampleOptionalMatchersTest.java b/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/SampleOptionalMatchersTest.java new file mode 100644 index 000000000..f741cd739 --- /dev/null +++ b/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/SampleOptionalMatchersTest.java @@ -0,0 +1,133 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import static ch.powerunit.matchers.MatcherTester.matcher; +import static ch.powerunit.matchers.MatcherTester.value; + +import java.util.Optional; + +import ch.powerunit.TestDelegate; +import ch.powerunit.TestSuite; +import ch.powerunit.extensions.matchers.samples.extension.MyTestWithoutGeneric; +import ch.powerunit.extensions.matchers.samples.extension.MyTestWithoutGeneric2; +import ch.powerunit.matchers.MatcherTester; + +/** + * @author borettim + * + */ +public class SampleOptionalMatchersTest implements TestSuite { + + private static final Object OTHER_TYPE = ""; + + private static final SampleOptional ALL_NULL = new SampleOptional(); + + private static final SampleOptional ALL_EMPTY = new SampleOptional(Optional.empty(), null, Optional.empty(), + Optional.empty(), Optional.empty()); + + private static final SampleOptional ALL_EMPTY_BUT_IGNORE = new SampleOptional(Optional.empty(), "", + Optional.empty(), Optional.empty(), Optional.empty()); + + private static final SampleOptional ALL_NOT_EMPTY = new SampleOptional(Optional.of("1"), "", + Optional.of(new Pojo1()), Optional.of(new MyTestWithoutGeneric()), + Optional.of(new MyTestWithoutGeneric2())); + + private static final SampleOptional ALL_NOT_EMPTY_V2 = new SampleOptional(Optional.of("2"), "", + Optional.of(new Pojo1()), Optional.of(new MyTestWithoutGeneric()), + Optional.of(new MyTestWithoutGeneric2("x"))); + + @TestDelegate + public final MatcherTester testMatcher = testerOfMatcher(// + SampleOptionalMatchers.SampleOptionalMatcher.class)// + .with(// + matcher(// + (SampleOptionalMatchers.SampleOptionalMatcher) SampleOptionalMatchers + .sampleOptionalWithSameValue(ALL_EMPTY)).// + describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.SampleOptional with\n[opt optional is not present]\n[opt3 optional is not present]\n[opt4 optional is not present]\n[ignoreMe This field is ignored Why not?]\n[opt2 optional is not present]\n") + .// + nullRejected("was null").// + accepting(ALL_EMPTY).// + accepting(ALL_EMPTY_BUT_IGNORE).// + rejecting(// + value(OTHER_TYPE).// + withMessage("was \"\""), // + value(ALL_NOT_EMPTY).// + withMessage( + "[opt was ]\n[opt3 was ]\n[opt4 was ]\n[opt2 was ]\n"), // + value(ALL_NULL).// + withMessage( + "[opt was null]\n[opt3 was null]\n[opt4 was null]\n[opt2 was null]\n")), // + matcher(// + (SampleOptionalMatchers.SampleOptionalMatcher) SampleOptionalMatchers + .sampleOptionalWithSameValue(ALL_NULL)).// + describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.SampleOptional with\n[opt null]\n[opt3 null]\n[opt4 null]\n[ignoreMe This field is ignored Why not?]\n[opt2 null]\n") + .// + nullRejected("was null").// + accepting(ALL_NULL).// + rejecting(// + value(OTHER_TYPE).// + withMessage("was \"\""), // + value(ALL_NOT_EMPTY).// + withMessage( + "[opt was ]\n[opt3 was ]\n[opt4 was ]\n[opt2 was ]\n"), // + value(ALL_EMPTY_BUT_IGNORE).// + withMessage( + "[opt was ]\n[opt3 was ]\n[opt4 was ]\n[opt2 was ]\n")), // + matcher(// + (SampleOptionalMatchers.SampleOptionalMatcher) SampleOptionalMatchers + .sampleOptionalWithSameValue(ALL_NOT_EMPTY)).// + describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.SampleOptional with\n" + + "[opt optional is present and [is \"1\"]]\n" + + "[opt3 optional is present and [is <>]]\n" + + "[opt4 optional is present and [an instance of ch.powerunit.extensions.matchers.samples.extension.MyTestWithoutGeneric2 with\n" + + "[parent ANYTHING]\n" + "[test is null]\n" + + "]]\n" + + "[ignoreMe This field is ignored Why not?]\n" + + "[opt2 optional is present and [an instance of ch.powerunit.extensions.matchers.samples.Pojo1 with\n" + + "[msg4 is null]\n" + "[msg3 is <0>]\n" + + "[msg2 is null]\n" + "[msg1 is null]\n" + + "[msg8 is null]\n" + "[msg7 null]\n" + + "[msg6 null]\n" + "[msg12 null]\n" + + "[msg5 is null]\n" + "[oneBoolean is ]\n" + + "[myBoolean is ]\n" + "[msg9 null]\n" + + "]]\n") + .// + nullRejected("was null").// + accepting(ALL_NOT_EMPTY).// + rejecting(// + value(OTHER_TYPE).// + withMessage("was \"\""), // + value(ALL_NULL).// + withMessage( + "[opt was null]\n[opt3 was null]\n[opt4 was null]\n[opt2 was null]\n"), // + value(ALL_EMPTY_BUT_IGNORE).// + withMessage( + "[opt was ]\n[opt3 was ]\n[opt4 was ]\n[opt2 was ]\n"), // + value(ALL_NOT_EMPTY_V2).// + withMessage( + "[opt was ]\n[opt4 was ]\n")) // + + ); + +} \ No newline at end of file diff --git a/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/SampleOptionalTest.java b/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/SampleOptionalTest.java new file mode 100644 index 000000000..7dba60734 --- /dev/null +++ b/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/SampleOptionalTest.java @@ -0,0 +1,71 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import java.util.Optional; + +import ch.powerunit.Test; +import ch.powerunit.TestSuite; + +public class SampleOptionalTest implements TestSuite { + @Test + public void testOKMatcherForOptional1() { + SampleOptional p = new SampleOptional(); + p.setOpt(Optional.empty()); + assertThat(p).is(SampleOptionalMatchers.sampleOptionalWith().optIsNotPresent()); + } + + @Test + public void testOKMatcherForOptional2() { + SampleOptional p = new SampleOptional(); + p.setOpt(Optional.of("x")); + assertThat(p).is(SampleOptionalMatchers.sampleOptionalWith().optIsPresent()); + } + + @Test + public void testOKMatcherForOptional3() { + SampleOptional p = new SampleOptional(); + p.setOpt(Optional.empty()); + assertThat(p).is(SampleOptionalMatchers.sampleOptionalWith().optIsAbsent()); + } + + @Test + public void testOKMatcherForOptional4() { + SampleOptional p = new SampleOptional(); + p.setOpt(Optional.of("x")); + assertThat(p).is(SampleOptionalMatchers.sampleOptionalWith().optIsPresentAndIs("x")); + } + + @Test + public void testOKMatcherForOptional5() { + SampleOptional p = new SampleOptional(); + p.setOpt(Optional.of("x")); + assertThat(p).is(SampleOptionalMatchers.sampleOptionalWith().optIsPresentAndIs(is("x"))); + } + + @Test + public void testOKMatcherForOptional6() { + SampleOptional p = new SampleOptional(); + p.setOpt(Optional.of("x")); + SampleOptional p2 = new SampleOptional(); + p2.setOpt(Optional.of("x")); + assertThat(p).is(SampleOptionalMatchers.sampleOptionalWithSameValue(p2)); + } +} diff --git a/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/SampleSupplierTest.java b/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/SampleSupplierTest.java new file mode 100644 index 000000000..f57b21ca2 --- /dev/null +++ b/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/SampleSupplierTest.java @@ -0,0 +1,36 @@ +package ch.powerunit.extensions.matchers.samples; + +import java.util.Arrays; + +import ch.powerunit.Ignore; +import ch.powerunit.Test; +import ch.powerunit.TestSuite; + +public class SampleSupplierTest implements TestSuite { + @Test + public void testSupplierNull() { + SampleSupplier ss = new SampleSupplier(); + assertThat(ss).is(SampleSupplierMatchers.sampleSupplierWith().s1(nullValue())); + } + + @Test + @Ignore + public void testSupplierNullKO() { + SampleSupplier ss = new SampleSupplier(); + assertThat(ss).is(SampleSupplierMatchers.sampleSupplierWith().s1SupplierResult(is("x"))); + } + + @Test + public void testSupplierNotNull() { + SampleSupplier ss = new SampleSupplier(); + ss.s1 = () -> "x"; + assertThat(ss).is(SampleSupplierMatchers.sampleSupplierWith().s1SupplierResult(is("x"))); + } + + @Test + public void testSupplierNotNullList() { + SampleSupplier ss = new SampleSupplier(); + ss.s2 = () -> Arrays.asList("x"); + assertThat(ss).is(SampleSupplierMatchers.sampleSupplierWith().s2SupplierResult(contains("x"))); + } +} diff --git a/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithSameRoundListMatchersTest.java b/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithSameRoundListMatchersTest.java new file mode 100644 index 000000000..4ed538dda --- /dev/null +++ b/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithSameRoundListMatchersTest.java @@ -0,0 +1,142 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples.iterable; + +import static ch.powerunit.matchers.MatcherTester.matcher; +import static ch.powerunit.matchers.MatcherTester.value; + +import java.util.Arrays; +import java.util.Collections; + +import ch.powerunit.TestDelegate; +import ch.powerunit.TestSuite; +import ch.powerunit.matchers.MatcherTester; + +/** + * @author borettim + * + */ +public class PojoWithSameRoundListMatchersTest implements TestSuite { + + private static final Object OTHER_TYPE = ""; + + private static final PojoWithSameRoundList NULL_LIST = new PojoWithSameRoundList(null); + + private static final PojoWithSameRoundList EMPTY_LIST = new PojoWithSameRoundList(Collections.emptyList()); + + private static final PojoWithSameRoundList SINGLE_LIST_WITH_A = new PojoWithSameRoundList( + Arrays.asList(new PojoWithStringList(Arrays.asList("A")))); + + private static final PojoWithSameRoundList SINGLE_LIST_WITH_B = new PojoWithSameRoundList( + Arrays.asList(new PojoWithStringList(Arrays.asList("B")))); + + private static final PojoWithSameRoundList SINGLE_LIST_WITH_A_B = new PojoWithSameRoundList( + Arrays.asList(new PojoWithStringList(Arrays.asList("A")), new PojoWithStringList(Arrays.asList("B")))); + + private static final PojoWithSameRoundList SINGLE_LIST_WITH_B_A = new PojoWithSameRoundList( + Arrays.asList(new PojoWithStringList(Arrays.asList("B")), new PojoWithStringList(Arrays.asList("A")))); + + @TestDelegate + public final MatcherTester testMatcher = testerOfMatcher(// + PojoWithSameRoundListMatchers.PojoWithSameRoundListMatcher.class)// + .with(// + matcher(// + (PojoWithSameRoundListMatchers.PojoWithSameRoundListMatcher) PojoWithSameRoundListMatchers + .pojoWithSameRoundListWithSameValue(NULL_LIST)) + .// + describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithSameRoundList with\n[field null]\n") + .// + nullRejected("was null").// + accepting(NULL_LIST).// + rejecting(// + value(OTHER_TYPE).// + withMessage("was \"\""), // + value(EMPTY_LIST).// + withMessage("[field was <[]>]\n"), // + value(SINGLE_LIST_WITH_A).// + withMessage( + "[field was <[PojoWithStringList [field=[A]]]>]\n")), // + matcher(// + (PojoWithSameRoundListMatchers.PojoWithSameRoundListMatcher) PojoWithSameRoundListMatchers + .pojoWithSameRoundListWithSameValue(EMPTY_LIST)) + .// + describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithSameRoundList with\n[field an empty iterable]\n") + .// + nullRejected("was null").// + accepting(EMPTY_LIST).// + rejecting(// + value(OTHER_TYPE).// + withMessage("was \"\""), // + value(NULL_LIST).// + withMessage("[field was null]\n"), // + value(SINGLE_LIST_WITH_A).// + withMessage( + "[field []]\n")), // + matcher(// + (PojoWithSameRoundListMatchers.PojoWithSameRoundListMatcher) PojoWithSameRoundListMatchers + .pojoWithSameRoundListWithSameValue(SINGLE_LIST_WITH_A)) + .// + describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithSameRoundList with\n[field iterable containing [an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringList with\n[field iterable containing [is \"A\"]]\n]]\n") + .// + nullRejected("was null").// + accepting(SINGLE_LIST_WITH_A).// + rejecting(// + value(EMPTY_LIST).// + withMessage( + "[field No item matched: an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringList with\n[field iterable containing [is \"A\"]]\n]\n"), + value(OTHER_TYPE).// + withMessage("was \"\""), // + value(NULL_LIST).// + withMessage("[field was null]\n"), // + value(SINGLE_LIST_WITH_A_B).// + withMessage( + "[field Not matched: ]\n")), // + matcher(// + (PojoWithSameRoundListMatchers.PojoWithSameRoundListMatcher) PojoWithSameRoundListMatchers + .pojoWithSameRoundListWithSameValue(SINGLE_LIST_WITH_A_B)) + .// + describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithSameRoundList with\n[field iterable containing [an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringList with\n[field iterable containing [is \"A\"]]\n, an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringList with\n[field iterable containing [is \"B\"]]\n]]\n") + .// + nullRejected("was null").// + accepting(SINGLE_LIST_WITH_A_B).// + rejecting(// + value(EMPTY_LIST).// + withMessage( + "[field No item matched: an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringList with\n[field iterable containing [is \"A\"]]\n]\n"), + value(OTHER_TYPE).// + withMessage("was \"\""), // + value(NULL_LIST).// + withMessage("[field was null]\n"), // + value(SINGLE_LIST_WITH_A).// + withMessage( + "[field No item matched: an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringList with\n[field iterable containing [is \"B\"]]\n]\n"), // + value(SINGLE_LIST_WITH_B).// + withMessage( + "[field item 0: [field item 0: was \"B\"]\n]\n"), // + value(SINGLE_LIST_WITH_B_A).// + withMessage( + "[field item 0: [field item 0: was \"B\"]\n]\n"))// + ); + +} \ No newline at end of file diff --git a/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringListMatchersTest.java b/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringListMatchersTest.java new file mode 100644 index 000000000..db65eeb6f --- /dev/null +++ b/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringListMatchersTest.java @@ -0,0 +1,130 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples.iterable; + +import static ch.powerunit.matchers.MatcherTester.matcher; +import static ch.powerunit.matchers.MatcherTester.value; + +import java.util.Arrays; +import java.util.Collections; + +import ch.powerunit.TestDelegate; +import ch.powerunit.TestSuite; +import ch.powerunit.matchers.MatcherTester; + +/** + * @author borettim + * + */ +public class PojoWithStringListMatchersTest implements TestSuite { + + private static final Object OTHER_TYPE = ""; + + private static final PojoWithStringList NULL_LIST = new PojoWithStringList(null); + + private static final PojoWithStringList EMPTY_LIST = new PojoWithStringList(Collections.emptyList()); + + private static final PojoWithStringList SINGLE_LIST_WITH_A = new PojoWithStringList(Arrays.asList("A")); + + private static final PojoWithStringList SINGLE_LIST_WITH_B = new PojoWithStringList(Arrays.asList("B")); + + private static final PojoWithStringList SINGLE_LIST_WITH_A_B = new PojoWithStringList(Arrays.asList("A", "B")); + + private static final PojoWithStringList SINGLE_LIST_WITH_B_A = new PojoWithStringList(Arrays.asList("B", "A")); + + @TestDelegate + public final MatcherTester testMatcher = testerOfMatcher(// + PojoWithStringListMatchers.PojoWithStringListMatcher.class)// + .with(// + matcher(// + (PojoWithStringListMatchers.PojoWithStringListMatcher) PojoWithStringListMatchers + .pojoWithStringListWithSameValue(NULL_LIST)) + .// + describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringList with\n[field null]\n") + .// + nullRejected("was null").// + accepting(NULL_LIST).// + rejecting(// + value(OTHER_TYPE).// + withMessage("was \"\""), // + value(EMPTY_LIST).// + withMessage("[field was <[]>]\n"), // + value(SINGLE_LIST_WITH_A).// + withMessage("[field was <[A]>]\n")), // + matcher(// + (PojoWithStringListMatchers.PojoWithStringListMatcher) PojoWithStringListMatchers + .pojoWithStringListWithSameValue(EMPTY_LIST)) + .// + describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringList with\n[field an empty iterable]\n") + .// + nullRejected("was null").// + accepting(EMPTY_LIST).// + rejecting(// + value(OTHER_TYPE).// + withMessage("was \"\""), // + value(NULL_LIST).// + withMessage("[field was null]\n"), // + value(SINGLE_LIST_WITH_A).// + withMessage("[field [\"A\"]]\n")), // + matcher(// + (PojoWithStringListMatchers.PojoWithStringListMatcher) PojoWithStringListMatchers + .pojoWithStringListWithSameValue(SINGLE_LIST_WITH_A)) + .// + describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringList with\n[field iterable containing [is \"A\"]]\n") + .// + nullRejected("was null").// + accepting(SINGLE_LIST_WITH_A).// + rejecting(// + value(EMPTY_LIST).// + withMessage("[field No item matched: is \"A\"]\n"), + value(OTHER_TYPE).// + withMessage("was \"\""), // + value(NULL_LIST).// + withMessage("[field was null]\n"), // + value(SINGLE_LIST_WITH_A_B).// + withMessage("[field Not matched: \"B\"]\n")), // + matcher(// + (PojoWithStringListMatchers.PojoWithStringListMatcher) PojoWithStringListMatchers + .pojoWithStringListWithSameValue(SINGLE_LIST_WITH_A_B)) + .// + describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringList with\n[field iterable containing [is \"A\", is \"B\"]]\n") + .// + nullRejected("was null").// + accepting(SINGLE_LIST_WITH_A_B).// + rejecting(// + value(EMPTY_LIST).// + withMessage("[field No item matched: is \"A\"]\n"), + value(OTHER_TYPE).// + withMessage("was \"\""), // + value(NULL_LIST).// + withMessage("[field was null]\n"), // + value(SINGLE_LIST_WITH_A).// + withMessage("[field No item matched: is \"B\"]\n"), // + value(SINGLE_LIST_WITH_B).// + withMessage("[field item 0: was \"B\"]\n"), // + value(SINGLE_LIST_WITH_B_A).// + withMessage("[field item 0: was \"B\"]\n"))// + ); + +} \ No newline at end of file diff --git a/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringSetMatchersTest.java b/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringSetMatchersTest.java new file mode 100644 index 000000000..b6f52fc6d --- /dev/null +++ b/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/iterable/PojoWithStringSetMatchersTest.java @@ -0,0 +1,130 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples.iterable; + +import static ch.powerunit.matchers.MatcherTester.matcher; +import static ch.powerunit.matchers.MatcherTester.value; + +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; + +import ch.powerunit.TestDelegate; +import ch.powerunit.TestSuite; +import ch.powerunit.matchers.MatcherTester; + +/** + * @author borettim + * + */ +public class PojoWithStringSetMatchersTest implements TestSuite { + + private static final Object OTHER_TYPE = ""; + + private static final PojoWithStringSet NULL_LIST = new PojoWithStringSet(null); + + private static final PojoWithStringSet EMPTY_LIST = new PojoWithStringSet(Collections.emptySet()); + + private static final PojoWithStringSet SINGLE_LIST_WITH_A = new PojoWithStringSet(Collections.singleton("A")); + + private static final PojoWithStringSet SINGLE_LIST_WITH_B = new PojoWithStringSet(Collections.singleton("B")); + + private static final PojoWithStringSet SINGLE_LIST_WITH_A_B = new PojoWithStringSet( + new HashSet<>(Arrays.asList("A", "B"))); + + private static final PojoWithStringSet SINGLE_LIST_WITH_B_A = new PojoWithStringSet( + new HashSet<>(Arrays.asList("B", "A"))); + + @TestDelegate + public final MatcherTester testMatcher = testerOfMatcher(// + PojoWithStringSetMatchers.PojoWithStringSetMatcher.class)// + .with(// + matcher(// + (PojoWithStringSetMatchers.PojoWithStringSetMatcher) PojoWithStringSetMatchers + .pojoWithStringSetWithSameValue(NULL_LIST)) + .// + describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringSet with\n[field null]\n") + .// + nullRejected("was null").// + accepting(NULL_LIST).// + rejecting(// + value(OTHER_TYPE).// + withMessage("was \"\""), // + value(EMPTY_LIST).// + withMessage("[field was <[]>]\n"), // + value(SINGLE_LIST_WITH_A).// + withMessage("[field was <[A]>]\n")), // + matcher(// + (PojoWithStringSetMatchers.PojoWithStringSetMatcher) PojoWithStringSetMatchers + .pojoWithStringSetWithSameValue(EMPTY_LIST)) + .// + describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringSet with\n[field an empty iterable]\n") + .// + nullRejected("was null").// + accepting(EMPTY_LIST).// + rejecting(// + value(OTHER_TYPE).// + withMessage("was \"\""), // + value(NULL_LIST).// + withMessage("[field was null]\n"), // + value(SINGLE_LIST_WITH_A).// + withMessage("[field [\"A\"]]\n")), // + matcher(// + (PojoWithStringSetMatchers.PojoWithStringSetMatcher) PojoWithStringSetMatchers + .pojoWithStringSetWithSameValue(SINGLE_LIST_WITH_A)) + .// + describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringSet with\n[field iterable containing [is \"A\"]]\n") + .// + nullRejected("was null").// + accepting(SINGLE_LIST_WITH_A).// + rejecting(// + value(EMPTY_LIST).// + withMessage("[field No item matched: is \"A\"]\n"), + value(OTHER_TYPE).// + withMessage("was \"\""), // + value(NULL_LIST).// + withMessage("[field was null]\n"), // + value(SINGLE_LIST_WITH_A_B).// + withMessage("[field Not matched: \"B\"]\n")), // + matcher(// + (PojoWithStringSetMatchers.PojoWithStringSetMatcher) PojoWithStringSetMatchers + .pojoWithStringSetWithSameValue(SINGLE_LIST_WITH_A_B)) + .// + describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.iterable.PojoWithStringSet with\n[field iterable containing [is \"A\", is \"B\"]]\n") + .// + nullRejected("was null").// + accepting(SINGLE_LIST_WITH_A_B).// + rejecting(// + value(EMPTY_LIST).// + withMessage("[field No item matched: is \"A\"]\n"), + value(OTHER_TYPE).// + withMessage("was \"\""), // + value(NULL_LIST).// + withMessage("[field was null]\n"), // + value(SINGLE_LIST_WITH_A).// + withMessage("[field No item matched: is \"B\"]\n"), // + value(SINGLE_LIST_WITH_B).// + withMessage("[field item 0: was \"B\"]\n"))); + +} \ No newline at end of file diff --git a/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/third/OneFunnyOneMatchersTest.java b/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/third/OneFunnyOneMatchersTest.java new file mode 100644 index 000000000..c5c1596bd --- /dev/null +++ b/src/it/full-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/third/OneFunnyOneMatchersTest.java @@ -0,0 +1,55 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples.third; + +import ch.powerunit.Test; +import ch.powerunit.TestSuite; +import ch.powerunit.extensions.matchers.samples.Pojo1; + +public class OneFunnyOneMatchersTest implements TestSuite { + + @Test + public void testMatcherWithSubMatcherDSL() { + OneFunnyOne obj = new OneFunnyOne(); + obj.onePojo1 = new Pojo1(); + obj.onePojo1.msg2 = "12"; + assertThat(obj).is(OneFunnyOneMatchers.oneFunnyOneWith().onePojo1With().msg2("12").end()); + + } + + @Test + public void testMatcherWithSubMatcherDSLEndWith() { + OneFunnyOne obj = new OneFunnyOne(); + obj.onePojo1 = new Pojo1(); + obj.onePojo1.msg2 = "12"; + assertThat(obj).is( + OneFunnyOneMatchers.oneFunnyOneWith().onePojo1With().msg2("12").endWith(hasToString(notNullValue()))); + + } + + @Test + public void testMatcherWithSubMatcherDSL2() { + OneFunnyOne obj = new OneFunnyOne(); + obj.setOnePojo1b(new Pojo1()); + obj.getOnePojo1b().msg2 = "12"; + assertThat(obj).is(OneFunnyOneMatchers.oneFunnyOneWith().onePojo1bWith().msg2("12").end()); + + } +} diff --git a/src/it/full-it-jdk9+/verify.bsh b/src/it/full-it-jdk9+/verify.bsh new file mode 100644 index 000000000..9adc23f13 --- /dev/null +++ b/src/it/full-it-jdk9+/verify.bsh @@ -0,0 +1,7 @@ +import java.io.*; + +File file = new File( basedir, "build.log" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not build log: " + file ); +} diff --git a/src/it/hamcrestdate-it-jdk8-existing/params.properties b/src/it/hamcrestdate-it-jdk8-existing/params.properties new file mode 100644 index 000000000..ab922d13c --- /dev/null +++ b/src/it/hamcrestdate-it-jdk8-existing/params.properties @@ -0,0 +1,2 @@ +invoker.java.version=1.8,!9,!10,!11 +invoker.goals=clean install diff --git a/src/it/hamcrestdate-it-jdk8-existing/pom.xml b/src/it/hamcrestdate-it-jdk8-existing/pom.xml new file mode 100644 index 000000000..8678896c1 --- /dev/null +++ b/src/it/hamcrestdate-it-jdk8-existing/pom.xml @@ -0,0 +1,278 @@ + + 4.0.0 + ch.powerunit.extensions + powerunit-extensions-matchers-it31 + @project.version@ + + jar + + + 1.8 + 1.8 + UTF-8 + 1.3 + 2.22.2 + 0.5.0 + + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.11.2 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.5 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.13.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-archetype-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + + ch.powerunit + powerunit + ${powerunit.version} + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.9.0 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.version} + + + com.github.github + site-maven-plugin + 0.12 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + org.codehaus.mojo + jaxb2-maven-plugin + 2.5.0 + + + org.apache.maven.plugins + maven-changes-plugin + 2.12.1 + + + GitHub + + + + + org.codehaus.mojo + sonar-maven-plugin + 3.7.0.1746 + + + maven-invoker-plugin + 3.2.1 + + + maven-assembly-plugin + 3.3.0 + + + org.codehaus.mojo + xml-maven-plugin + 1.0.2 + + + maven-deploy-plugin + 2.8.2 + + + maven-install-plugin + 2.5.2 + + + + + + org.jacoco + jacoco-maven-plugin + + + + ${project.build.directory} + + *.exec + + + + + + + default-prepare-agent-1 + + prepare-agent + + + + default-prepare-agent-2 + initialize + + prepare-agent-integration + + + testcompileargs + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + jar + test-jar + + + + + true + false + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.source.version} + ${java.target.version} + true + + -J${testcompileargs} + + + + + + + + + org.hamcrest + hamcrest-all + ${hamcrest.version} + + + ch.powerunit + powerunit + ${powerunit.version} + test + + + ch.powerunit.extensions + powerunit-extensions-matchers + @project.version@ + + + org.exparity + hamcrest-date + 2.0.7 + true + + + \ No newline at end of file diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDate.java b/src/it/hamcrestdate-it-jdk8-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDate.java similarity index 100% rename from src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDate.java rename to src/it/hamcrestdate-it-jdk8-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDate.java diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateTimeV2.java b/src/it/hamcrestdate-it-jdk8-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateTimeV2.java similarity index 100% rename from src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateTimeV2.java rename to src/it/hamcrestdate-it-jdk8-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateTimeV2.java diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalTime.java b/src/it/hamcrestdate-it-jdk8-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalTime.java similarity index 100% rename from src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalTime.java rename to src/it/hamcrestdate-it-jdk8-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalTime.java diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleZonedDateTime.java b/src/it/hamcrestdate-it-jdk8-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleZonedDateTime.java similarity index 100% rename from src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleZonedDateTime.java rename to src/it/hamcrestdate-it-jdk8-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleZonedDateTime.java diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateMatchersTest.java b/src/it/hamcrestdate-it-jdk8-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateMatchersTest.java similarity index 100% rename from src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateMatchersTest.java rename to src/it/hamcrestdate-it-jdk8-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateMatchersTest.java diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateTimeV2MatchersTest.java b/src/it/hamcrestdate-it-jdk8-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateTimeV2MatchersTest.java similarity index 100% rename from src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateTimeV2MatchersTest.java rename to src/it/hamcrestdate-it-jdk8-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateTimeV2MatchersTest.java diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalTimeMatchersTest.java b/src/it/hamcrestdate-it-jdk8-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalTimeMatchersTest.java similarity index 100% rename from src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalTimeMatchersTest.java rename to src/it/hamcrestdate-it-jdk8-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalTimeMatchersTest.java diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleZonedDateTimeMatchersTest.java b/src/it/hamcrestdate-it-jdk8-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleZonedDateTimeMatchersTest.java similarity index 100% rename from src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleZonedDateTimeMatchersTest.java rename to src/it/hamcrestdate-it-jdk8-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleZonedDateTimeMatchersTest.java diff --git a/src/it/hamcrestdate-it-jdk8-existing/verify.bsh b/src/it/hamcrestdate-it-jdk8-existing/verify.bsh new file mode 100644 index 000000000..27daa1af4 --- /dev/null +++ b/src/it/hamcrestdate-it-jdk8-existing/verify.bsh @@ -0,0 +1,26 @@ +import java.io.*; + +File file = new File( basedir, "build.log" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not build log: " + file ); +} + + +file = new File( basedir, "target/generated-sources/annotations/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateMatchers.java" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find generated Matcher: " + file ); +} + +file = new File( basedir, "target/classes/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateMatchers.class" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find compiled Matcher: " + file ); +} + +file = new File( basedir, "target/test-classes/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateMatchersTest.class" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find compiled Test of the matcher: " + file ); +} diff --git a/src/it/hamcrestdate-it-jdk8-missing/params.properties b/src/it/hamcrestdate-it-jdk8-missing/params.properties new file mode 100644 index 000000000..1a20829cb --- /dev/null +++ b/src/it/hamcrestdate-it-jdk8-missing/params.properties @@ -0,0 +1,3 @@ +invoker.java.version=1.8,!9,!10,!11 +invoker.goals=clean install +invoker.buildResult = failure \ No newline at end of file diff --git a/src/it/hamcrestdate-it-jdk8-missing/pom.xml b/src/it/hamcrestdate-it-jdk8-missing/pom.xml new file mode 100644 index 000000000..2d66ad0d5 --- /dev/null +++ b/src/it/hamcrestdate-it-jdk8-missing/pom.xml @@ -0,0 +1,272 @@ + + 4.0.0 + ch.powerunit.extensions + powerunit-extensions-matchers-it30 + @project.version@ + + jar + + + 1.8 + 1.8 + UTF-8 + 1.3 + 2.22.2 + 0.5.0 + + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.11.2 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.5 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.13.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-archetype-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + + ch.powerunit + powerunit + ${powerunit.version} + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.9.0 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.version} + + + com.github.github + site-maven-plugin + 0.12 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + org.codehaus.mojo + jaxb2-maven-plugin + 2.5.0 + + + org.apache.maven.plugins + maven-changes-plugin + 2.12.1 + + + GitHub + + + + + org.codehaus.mojo + sonar-maven-plugin + 3.7.0.1746 + + + maven-invoker-plugin + 3.2.1 + + + maven-assembly-plugin + 3.3.0 + + + org.codehaus.mojo + xml-maven-plugin + 1.0.2 + + + maven-deploy-plugin + 2.8.2 + + + maven-install-plugin + 2.5.2 + + + + + + org.jacoco + jacoco-maven-plugin + + + + ${project.build.directory} + + *.exec + + + + + + + default-prepare-agent-1 + + prepare-agent + + + + default-prepare-agent-2 + initialize + + prepare-agent-integration + + + testcompileargs + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + jar + test-jar + + + + + true + false + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.source.version} + ${java.target.version} + true + + -J${testcompileargs} + + + + + + + + + org.hamcrest + hamcrest-all + ${hamcrest.version} + + + ch.powerunit + powerunit + ${powerunit.version} + test + + + ch.powerunit.extensions + powerunit-extensions-matchers + @project.version@ + + + \ No newline at end of file diff --git a/src/it/hamcrestdate-it-jdk8-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDate.java b/src/it/hamcrestdate-it-jdk8-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDate.java new file mode 100644 index 000000000..51235ae26 --- /dev/null +++ b/src/it/hamcrestdate-it-jdk8-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDate.java @@ -0,0 +1,18 @@ +package ch.powerunit.extensions.matchers.samples.extensions.hamcrestdate; + +import java.time.LocalDate; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers +public class SampleLocalDate { + private LocalDate opt; + + public LocalDate getOpt() { + return opt; + } + + public void setOpt(LocalDate opt) { + this.opt = opt; + } +} diff --git a/src/it/hamcrestdate-it-jdk8-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateTimeV2.java b/src/it/hamcrestdate-it-jdk8-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateTimeV2.java new file mode 100644 index 000000000..5ff74fb4d --- /dev/null +++ b/src/it/hamcrestdate-it-jdk8-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateTimeV2.java @@ -0,0 +1,18 @@ +package ch.powerunit.extensions.matchers.samples.extensions.hamcrestdate; + +import java.time.LocalDateTime; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers +public class SampleLocalDateTimeV2 { + private LocalDateTime opt; + + public LocalDateTime getOpt() { + return opt; + } + + public void setOpt(LocalDateTime opt) { + this.opt = opt; + } +} diff --git a/src/it/hamcrestdate-it-jdk8-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalTime.java b/src/it/hamcrestdate-it-jdk8-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalTime.java new file mode 100644 index 000000000..87649839c --- /dev/null +++ b/src/it/hamcrestdate-it-jdk8-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalTime.java @@ -0,0 +1,18 @@ +package ch.powerunit.extensions.matchers.samples.extensions.hamcrestdate; + +import java.time.LocalTime; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers +public class SampleLocalTime { + private LocalTime opt; + + public LocalTime getOpt() { + return opt; + } + + public void setOpt(LocalTime opt) { + this.opt = opt; + } +} diff --git a/src/it/hamcrestdate-it-jdk8-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleZonedDateTime.java b/src/it/hamcrestdate-it-jdk8-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleZonedDateTime.java new file mode 100644 index 000000000..38b89aa0c --- /dev/null +++ b/src/it/hamcrestdate-it-jdk8-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleZonedDateTime.java @@ -0,0 +1,18 @@ +package ch.powerunit.extensions.matchers.samples.extensions.hamcrestdate; + +import java.time.ZonedDateTime; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers +public class SampleZonedDateTime { + private ZonedDateTime opt; + + public ZonedDateTime getOpt() { + return opt; + } + + public void setOpt(ZonedDateTime opt) { + this.opt = opt; + } +} diff --git a/src/it/hamcrestdate-it-jdk8-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateMatchersTest.java b/src/it/hamcrestdate-it-jdk8-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateMatchersTest.java new file mode 100644 index 000000000..896d39c9c --- /dev/null +++ b/src/it/hamcrestdate-it-jdk8-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateMatchersTest.java @@ -0,0 +1,15 @@ +package ch.powerunit.extensions.matchers.samples.extensions.hamcrestdate; + +import java.time.LocalDate; + +import ch.powerunit.Test; +import ch.powerunit.TestSuite; + +public class SampleLocalDateMatchersTest implements TestSuite { + @Test + public void testAfter() { + SampleLocalDate sld = new SampleLocalDate(); + sld.setOpt(LocalDate.of(2003, 10, 1)); + assertThat(sld).is(SampleLocalDateMatchers.sampleLocalDateWith().optAfter(LocalDate.of(1987, 12, 11))); + } +} diff --git a/src/it/hamcrestdate-it-jdk8-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateTimeV2MatchersTest.java b/src/it/hamcrestdate-it-jdk8-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateTimeV2MatchersTest.java new file mode 100644 index 000000000..a88fc7036 --- /dev/null +++ b/src/it/hamcrestdate-it-jdk8-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateTimeV2MatchersTest.java @@ -0,0 +1,16 @@ +package ch.powerunit.extensions.matchers.samples.extensions.hamcrestdate; + +import java.time.LocalDateTime; + +import ch.powerunit.Test; +import ch.powerunit.TestSuite; + +public class SampleLocalDateTimeV2MatchersTest implements TestSuite { + @Test + public void testAfter() { + SampleLocalDateTimeV2 sld = new SampleLocalDateTimeV2(); + sld.setOpt(LocalDateTime.of(2003, 10, 1, 12, 34)); + assertThat(sld).is(SampleLocalDateTimeV2Matchers.sampleLocalDateTimeV2With() + .optAfter(LocalDateTime.of(1987, 12, 11, 11, 23))); + } +} diff --git a/src/it/hamcrestdate-it-jdk8-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalTimeMatchersTest.java b/src/it/hamcrestdate-it-jdk8-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalTimeMatchersTest.java new file mode 100644 index 000000000..415f1254c --- /dev/null +++ b/src/it/hamcrestdate-it-jdk8-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalTimeMatchersTest.java @@ -0,0 +1,15 @@ +package ch.powerunit.extensions.matchers.samples.extensions.hamcrestdate; + +import java.time.LocalTime; + +import ch.powerunit.Test; +import ch.powerunit.TestSuite; + +public class SampleLocalTimeMatchersTest implements TestSuite { + @Test + public void testAfter() { + SampleLocalTime sld = new SampleLocalTime(); + sld.setOpt(LocalTime.of(8, 1)); + assertThat(sld).is(SampleLocalTimeMatchers.sampleLocalTimeWith().optAfter(LocalTime.of(7, 1))); + } +} diff --git a/src/it/hamcrestdate-it-jdk8-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleZonedDateTimeMatchersTest.java b/src/it/hamcrestdate-it-jdk8-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleZonedDateTimeMatchersTest.java new file mode 100644 index 000000000..02b19c173 --- /dev/null +++ b/src/it/hamcrestdate-it-jdk8-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleZonedDateTimeMatchersTest.java @@ -0,0 +1,18 @@ +package ch.powerunit.extensions.matchers.samples.extensions.hamcrestdate; + +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.ZonedDateTime; + +import ch.powerunit.Test; +import ch.powerunit.TestSuite; + +public class SampleZonedDateTimeMatchersTest implements TestSuite { + @Test + public void testAfter() { + SampleZonedDateTime sld = new SampleZonedDateTime(); + sld.setOpt(ZonedDateTime.of(LocalDateTime.of(1987, 12, 11, 11, 23), ZoneId.systemDefault())); + assertThat(sld).is(SampleZonedDateTimeMatchers.sampleZonedDateTimeWith() + .optAfter(ZonedDateTime.of(LocalDateTime.of(1930, 12, 11, 11, 23), ZoneId.systemDefault()))); + } +} diff --git a/src/it/hamcrestdate-it-jdk8-missing/verify.bsh b/src/it/hamcrestdate-it-jdk8-missing/verify.bsh new file mode 100644 index 000000000..9458584e7 --- /dev/null +++ b/src/it/hamcrestdate-it-jdk8-missing/verify.bsh @@ -0,0 +1,26 @@ +import java.io.*; + +File file = new File( basedir, "build.log" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not build log: " + file ); +} + + +file = new File( basedir, "target/generated-sources/annotations/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateMatchers.java" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find generated Matcher: " + file ); +} + +file = new File( basedir, "target/classes/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateMatchers.class" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find compiled Matcher: " + file ); +} + +file = new File( basedir, "target/test-classes/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateMatchersTest.class" ); +if ( file.isFile() ) +{ + throw new FileNotFoundException( "Find compiled tester of the matcher, but should not: " + file ); +} diff --git a/src/it/hamcrestdate-it-jdk9+-existing/params.properties b/src/it/hamcrestdate-it-jdk9+-existing/params.properties new file mode 100644 index 000000000..714c1431d --- /dev/null +++ b/src/it/hamcrestdate-it-jdk9+-existing/params.properties @@ -0,0 +1,2 @@ +invoker.java.version=!1.8,9,10,11+ +invoker.goals=clean install diff --git a/src/it/hamcrestdate-it-jdk9+-existing/pom.xml b/src/it/hamcrestdate-it-jdk9+-existing/pom.xml new file mode 100644 index 000000000..819c9842f --- /dev/null +++ b/src/it/hamcrestdate-it-jdk9+-existing/pom.xml @@ -0,0 +1,283 @@ + + 4.0.0 + ch.powerunit.extensions + powerunit-extensions-matchers-it22 + @project.version@ + + jar + + + 1.8 + 1.8 + UTF-8 + 1.3 + 2.22.2 + 0.5.0 + + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.11.2 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.5 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.13.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-archetype-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + + ch.powerunit + powerunit + ${powerunit.version} + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.9.0 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.version} + + + com.github.github + site-maven-plugin + 0.12 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + org.codehaus.mojo + jaxb2-maven-plugin + 2.5.0 + + + org.apache.maven.plugins + maven-changes-plugin + 2.12.1 + + + GitHub + + + + + org.codehaus.mojo + sonar-maven-plugin + 3.7.0.1746 + + + maven-invoker-plugin + 3.2.1 + + + maven-assembly-plugin + 3.3.0 + + + org.codehaus.mojo + xml-maven-plugin + 1.0.2 + + + maven-deploy-plugin + 2.8.2 + + + maven-install-plugin + 2.5.2 + + + + + + org.jacoco + jacoco-maven-plugin + + + + ${project.build.directory} + + *.exec + + + + + + + default-prepare-agent-1 + + prepare-agent + + + + default-prepare-agent-2 + initialize + + prepare-agent-integration + + + testcompileargs + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + jar + test-jar + + + + + true + false + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.source.version} + ${java.target.version} + true + + -J${testcompileargs} + + + + + + + + + org.hamcrest + hamcrest-all + ${hamcrest.version} + + + ch.powerunit + powerunit + ${powerunit.version} + test + + + ch.powerunit.extensions + powerunit-extensions-matchers + @project.version@ + + + org.exparity + hamcrest-date + 2.0.7 + true + + + javax.annotation + javax.annotation-api + 1.3.2 + + + \ No newline at end of file diff --git a/src/it/hamcrestdate-it-jdk9+-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDate.java b/src/it/hamcrestdate-it-jdk9+-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDate.java new file mode 100644 index 000000000..51235ae26 --- /dev/null +++ b/src/it/hamcrestdate-it-jdk9+-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDate.java @@ -0,0 +1,18 @@ +package ch.powerunit.extensions.matchers.samples.extensions.hamcrestdate; + +import java.time.LocalDate; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers +public class SampleLocalDate { + private LocalDate opt; + + public LocalDate getOpt() { + return opt; + } + + public void setOpt(LocalDate opt) { + this.opt = opt; + } +} diff --git a/src/it/hamcrestdate-it-jdk9+-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateTimeV2.java b/src/it/hamcrestdate-it-jdk9+-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateTimeV2.java new file mode 100644 index 000000000..5ff74fb4d --- /dev/null +++ b/src/it/hamcrestdate-it-jdk9+-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateTimeV2.java @@ -0,0 +1,18 @@ +package ch.powerunit.extensions.matchers.samples.extensions.hamcrestdate; + +import java.time.LocalDateTime; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers +public class SampleLocalDateTimeV2 { + private LocalDateTime opt; + + public LocalDateTime getOpt() { + return opt; + } + + public void setOpt(LocalDateTime opt) { + this.opt = opt; + } +} diff --git a/src/it/hamcrestdate-it-jdk9+-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalTime.java b/src/it/hamcrestdate-it-jdk9+-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalTime.java new file mode 100644 index 000000000..87649839c --- /dev/null +++ b/src/it/hamcrestdate-it-jdk9+-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalTime.java @@ -0,0 +1,18 @@ +package ch.powerunit.extensions.matchers.samples.extensions.hamcrestdate; + +import java.time.LocalTime; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers +public class SampleLocalTime { + private LocalTime opt; + + public LocalTime getOpt() { + return opt; + } + + public void setOpt(LocalTime opt) { + this.opt = opt; + } +} diff --git a/src/it/hamcrestdate-it-jdk9+-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleZonedDateTime.java b/src/it/hamcrestdate-it-jdk9+-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleZonedDateTime.java new file mode 100644 index 000000000..38b89aa0c --- /dev/null +++ b/src/it/hamcrestdate-it-jdk9+-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleZonedDateTime.java @@ -0,0 +1,18 @@ +package ch.powerunit.extensions.matchers.samples.extensions.hamcrestdate; + +import java.time.ZonedDateTime; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers +public class SampleZonedDateTime { + private ZonedDateTime opt; + + public ZonedDateTime getOpt() { + return opt; + } + + public void setOpt(ZonedDateTime opt) { + this.opt = opt; + } +} diff --git a/src/it/hamcrestdate-it-jdk9+-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateMatchersTest.java b/src/it/hamcrestdate-it-jdk9+-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateMatchersTest.java new file mode 100644 index 000000000..896d39c9c --- /dev/null +++ b/src/it/hamcrestdate-it-jdk9+-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateMatchersTest.java @@ -0,0 +1,15 @@ +package ch.powerunit.extensions.matchers.samples.extensions.hamcrestdate; + +import java.time.LocalDate; + +import ch.powerunit.Test; +import ch.powerunit.TestSuite; + +public class SampleLocalDateMatchersTest implements TestSuite { + @Test + public void testAfter() { + SampleLocalDate sld = new SampleLocalDate(); + sld.setOpt(LocalDate.of(2003, 10, 1)); + assertThat(sld).is(SampleLocalDateMatchers.sampleLocalDateWith().optAfter(LocalDate.of(1987, 12, 11))); + } +} diff --git a/src/it/hamcrestdate-it-jdk9+-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateTimeV2MatchersTest.java b/src/it/hamcrestdate-it-jdk9+-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateTimeV2MatchersTest.java new file mode 100644 index 000000000..a88fc7036 --- /dev/null +++ b/src/it/hamcrestdate-it-jdk9+-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateTimeV2MatchersTest.java @@ -0,0 +1,16 @@ +package ch.powerunit.extensions.matchers.samples.extensions.hamcrestdate; + +import java.time.LocalDateTime; + +import ch.powerunit.Test; +import ch.powerunit.TestSuite; + +public class SampleLocalDateTimeV2MatchersTest implements TestSuite { + @Test + public void testAfter() { + SampleLocalDateTimeV2 sld = new SampleLocalDateTimeV2(); + sld.setOpt(LocalDateTime.of(2003, 10, 1, 12, 34)); + assertThat(sld).is(SampleLocalDateTimeV2Matchers.sampleLocalDateTimeV2With() + .optAfter(LocalDateTime.of(1987, 12, 11, 11, 23))); + } +} diff --git a/src/it/hamcrestdate-it-jdk9+-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalTimeMatchersTest.java b/src/it/hamcrestdate-it-jdk9+-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalTimeMatchersTest.java new file mode 100644 index 000000000..415f1254c --- /dev/null +++ b/src/it/hamcrestdate-it-jdk9+-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalTimeMatchersTest.java @@ -0,0 +1,15 @@ +package ch.powerunit.extensions.matchers.samples.extensions.hamcrestdate; + +import java.time.LocalTime; + +import ch.powerunit.Test; +import ch.powerunit.TestSuite; + +public class SampleLocalTimeMatchersTest implements TestSuite { + @Test + public void testAfter() { + SampleLocalTime sld = new SampleLocalTime(); + sld.setOpt(LocalTime.of(8, 1)); + assertThat(sld).is(SampleLocalTimeMatchers.sampleLocalTimeWith().optAfter(LocalTime.of(7, 1))); + } +} diff --git a/src/it/hamcrestdate-it-jdk9+-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleZonedDateTimeMatchersTest.java b/src/it/hamcrestdate-it-jdk9+-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleZonedDateTimeMatchersTest.java new file mode 100644 index 000000000..02b19c173 --- /dev/null +++ b/src/it/hamcrestdate-it-jdk9+-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleZonedDateTimeMatchersTest.java @@ -0,0 +1,18 @@ +package ch.powerunit.extensions.matchers.samples.extensions.hamcrestdate; + +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.ZonedDateTime; + +import ch.powerunit.Test; +import ch.powerunit.TestSuite; + +public class SampleZonedDateTimeMatchersTest implements TestSuite { + @Test + public void testAfter() { + SampleZonedDateTime sld = new SampleZonedDateTime(); + sld.setOpt(ZonedDateTime.of(LocalDateTime.of(1987, 12, 11, 11, 23), ZoneId.systemDefault())); + assertThat(sld).is(SampleZonedDateTimeMatchers.sampleZonedDateTimeWith() + .optAfter(ZonedDateTime.of(LocalDateTime.of(1930, 12, 11, 11, 23), ZoneId.systemDefault()))); + } +} diff --git a/src/it/hamcrestdate-it-jdk9+-existing/verify.bsh b/src/it/hamcrestdate-it-jdk9+-existing/verify.bsh new file mode 100644 index 000000000..27daa1af4 --- /dev/null +++ b/src/it/hamcrestdate-it-jdk9+-existing/verify.bsh @@ -0,0 +1,26 @@ +import java.io.*; + +File file = new File( basedir, "build.log" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not build log: " + file ); +} + + +file = new File( basedir, "target/generated-sources/annotations/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateMatchers.java" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find generated Matcher: " + file ); +} + +file = new File( basedir, "target/classes/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateMatchers.class" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find compiled Matcher: " + file ); +} + +file = new File( basedir, "target/test-classes/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateMatchersTest.class" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find compiled Test of the matcher: " + file ); +} diff --git a/src/it/hamcrestdate-it-jdk9+-missing/params.properties b/src/it/hamcrestdate-it-jdk9+-missing/params.properties new file mode 100644 index 000000000..973dfe1d2 --- /dev/null +++ b/src/it/hamcrestdate-it-jdk9+-missing/params.properties @@ -0,0 +1,3 @@ +invoker.java.version=!1.8,9,10,11+ +invoker.goals=clean install +invoker.buildResult = failure \ No newline at end of file diff --git a/src/it/hamcrestdate-it-jdk9+-missing/pom.xml b/src/it/hamcrestdate-it-jdk9+-missing/pom.xml new file mode 100644 index 000000000..d78fe3988 --- /dev/null +++ b/src/it/hamcrestdate-it-jdk9+-missing/pom.xml @@ -0,0 +1,277 @@ + + 4.0.0 + ch.powerunit.extensions + powerunit-extensions-matchers-it21 + @project.version@ + + jar + + + 1.8 + 1.8 + UTF-8 + 1.3 + 2.22.2 + 0.5.0 + + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.11.2 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.5 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.13.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-archetype-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + + ch.powerunit + powerunit + ${powerunit.version} + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.9.0 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.version} + + + com.github.github + site-maven-plugin + 0.12 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + org.codehaus.mojo + jaxb2-maven-plugin + 2.5.0 + + + org.apache.maven.plugins + maven-changes-plugin + 2.12.1 + + + GitHub + + + + + org.codehaus.mojo + sonar-maven-plugin + 3.7.0.1746 + + + maven-invoker-plugin + 3.2.1 + + + maven-assembly-plugin + 3.3.0 + + + org.codehaus.mojo + xml-maven-plugin + 1.0.2 + + + maven-deploy-plugin + 2.8.2 + + + maven-install-plugin + 2.5.2 + + + + + + org.jacoco + jacoco-maven-plugin + + + + ${project.build.directory} + + *.exec + + + + + + + default-prepare-agent-1 + + prepare-agent + + + + default-prepare-agent-2 + initialize + + prepare-agent-integration + + + testcompileargs + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + jar + test-jar + + + + + true + false + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.source.version} + ${java.target.version} + true + + -J${testcompileargs} + + + + + + + + + org.hamcrest + hamcrest-all + ${hamcrest.version} + + + ch.powerunit + powerunit + ${powerunit.version} + test + + + ch.powerunit.extensions + powerunit-extensions-matchers + @project.version@ + + + javax.annotation + javax.annotation-api + 1.3.2 + + + \ No newline at end of file diff --git a/src/it/hamcrestdate-it-jdk9+-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDate.java b/src/it/hamcrestdate-it-jdk9+-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDate.java new file mode 100644 index 000000000..51235ae26 --- /dev/null +++ b/src/it/hamcrestdate-it-jdk9+-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDate.java @@ -0,0 +1,18 @@ +package ch.powerunit.extensions.matchers.samples.extensions.hamcrestdate; + +import java.time.LocalDate; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers +public class SampleLocalDate { + private LocalDate opt; + + public LocalDate getOpt() { + return opt; + } + + public void setOpt(LocalDate opt) { + this.opt = opt; + } +} diff --git a/src/it/hamcrestdate-it-jdk9+-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateTimeV2.java b/src/it/hamcrestdate-it-jdk9+-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateTimeV2.java new file mode 100644 index 000000000..5ff74fb4d --- /dev/null +++ b/src/it/hamcrestdate-it-jdk9+-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateTimeV2.java @@ -0,0 +1,18 @@ +package ch.powerunit.extensions.matchers.samples.extensions.hamcrestdate; + +import java.time.LocalDateTime; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers +public class SampleLocalDateTimeV2 { + private LocalDateTime opt; + + public LocalDateTime getOpt() { + return opt; + } + + public void setOpt(LocalDateTime opt) { + this.opt = opt; + } +} diff --git a/src/it/hamcrestdate-it-jdk9+-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalTime.java b/src/it/hamcrestdate-it-jdk9+-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalTime.java new file mode 100644 index 000000000..87649839c --- /dev/null +++ b/src/it/hamcrestdate-it-jdk9+-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalTime.java @@ -0,0 +1,18 @@ +package ch.powerunit.extensions.matchers.samples.extensions.hamcrestdate; + +import java.time.LocalTime; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers +public class SampleLocalTime { + private LocalTime opt; + + public LocalTime getOpt() { + return opt; + } + + public void setOpt(LocalTime opt) { + this.opt = opt; + } +} diff --git a/src/it/hamcrestdate-it-jdk9+-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleZonedDateTime.java b/src/it/hamcrestdate-it-jdk9+-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleZonedDateTime.java new file mode 100644 index 000000000..38b89aa0c --- /dev/null +++ b/src/it/hamcrestdate-it-jdk9+-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleZonedDateTime.java @@ -0,0 +1,18 @@ +package ch.powerunit.extensions.matchers.samples.extensions.hamcrestdate; + +import java.time.ZonedDateTime; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers +public class SampleZonedDateTime { + private ZonedDateTime opt; + + public ZonedDateTime getOpt() { + return opt; + } + + public void setOpt(ZonedDateTime opt) { + this.opt = opt; + } +} diff --git a/src/it/hamcrestdate-it-jdk9+-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateMatchersTest.java b/src/it/hamcrestdate-it-jdk9+-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateMatchersTest.java new file mode 100644 index 000000000..896d39c9c --- /dev/null +++ b/src/it/hamcrestdate-it-jdk9+-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateMatchersTest.java @@ -0,0 +1,15 @@ +package ch.powerunit.extensions.matchers.samples.extensions.hamcrestdate; + +import java.time.LocalDate; + +import ch.powerunit.Test; +import ch.powerunit.TestSuite; + +public class SampleLocalDateMatchersTest implements TestSuite { + @Test + public void testAfter() { + SampleLocalDate sld = new SampleLocalDate(); + sld.setOpt(LocalDate.of(2003, 10, 1)); + assertThat(sld).is(SampleLocalDateMatchers.sampleLocalDateWith().optAfter(LocalDate.of(1987, 12, 11))); + } +} diff --git a/src/it/hamcrestdate-it-jdk9+-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateTimeV2MatchersTest.java b/src/it/hamcrestdate-it-jdk9+-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateTimeV2MatchersTest.java new file mode 100644 index 000000000..a88fc7036 --- /dev/null +++ b/src/it/hamcrestdate-it-jdk9+-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateTimeV2MatchersTest.java @@ -0,0 +1,16 @@ +package ch.powerunit.extensions.matchers.samples.extensions.hamcrestdate; + +import java.time.LocalDateTime; + +import ch.powerunit.Test; +import ch.powerunit.TestSuite; + +public class SampleLocalDateTimeV2MatchersTest implements TestSuite { + @Test + public void testAfter() { + SampleLocalDateTimeV2 sld = new SampleLocalDateTimeV2(); + sld.setOpt(LocalDateTime.of(2003, 10, 1, 12, 34)); + assertThat(sld).is(SampleLocalDateTimeV2Matchers.sampleLocalDateTimeV2With() + .optAfter(LocalDateTime.of(1987, 12, 11, 11, 23))); + } +} diff --git a/src/it/hamcrestdate-it-jdk9+-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalTimeMatchersTest.java b/src/it/hamcrestdate-it-jdk9+-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalTimeMatchersTest.java new file mode 100644 index 000000000..415f1254c --- /dev/null +++ b/src/it/hamcrestdate-it-jdk9+-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalTimeMatchersTest.java @@ -0,0 +1,15 @@ +package ch.powerunit.extensions.matchers.samples.extensions.hamcrestdate; + +import java.time.LocalTime; + +import ch.powerunit.Test; +import ch.powerunit.TestSuite; + +public class SampleLocalTimeMatchersTest implements TestSuite { + @Test + public void testAfter() { + SampleLocalTime sld = new SampleLocalTime(); + sld.setOpt(LocalTime.of(8, 1)); + assertThat(sld).is(SampleLocalTimeMatchers.sampleLocalTimeWith().optAfter(LocalTime.of(7, 1))); + } +} diff --git a/src/it/hamcrestdate-it-jdk9+-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleZonedDateTimeMatchersTest.java b/src/it/hamcrestdate-it-jdk9+-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleZonedDateTimeMatchersTest.java new file mode 100644 index 000000000..02b19c173 --- /dev/null +++ b/src/it/hamcrestdate-it-jdk9+-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleZonedDateTimeMatchersTest.java @@ -0,0 +1,18 @@ +package ch.powerunit.extensions.matchers.samples.extensions.hamcrestdate; + +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.ZonedDateTime; + +import ch.powerunit.Test; +import ch.powerunit.TestSuite; + +public class SampleZonedDateTimeMatchersTest implements TestSuite { + @Test + public void testAfter() { + SampleZonedDateTime sld = new SampleZonedDateTime(); + sld.setOpt(ZonedDateTime.of(LocalDateTime.of(1987, 12, 11, 11, 23), ZoneId.systemDefault())); + assertThat(sld).is(SampleZonedDateTimeMatchers.sampleZonedDateTimeWith() + .optAfter(ZonedDateTime.of(LocalDateTime.of(1930, 12, 11, 11, 23), ZoneId.systemDefault()))); + } +} diff --git a/src/it/hamcrestdate-it-jdk9+-missing/verify.bsh b/src/it/hamcrestdate-it-jdk9+-missing/verify.bsh new file mode 100644 index 000000000..9458584e7 --- /dev/null +++ b/src/it/hamcrestdate-it-jdk9+-missing/verify.bsh @@ -0,0 +1,26 @@ +import java.io.*; + +File file = new File( basedir, "build.log" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not build log: " + file ); +} + + +file = new File( basedir, "target/generated-sources/annotations/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateMatchers.java" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find generated Matcher: " + file ); +} + +file = new File( basedir, "target/classes/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateMatchers.class" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find compiled Matcher: " + file ); +} + +file = new File( basedir, "target/test-classes/ch/powerunit/extensions/matchers/samples/extensions/hamcrestdate/SampleLocalDateMatchersTest.class" ); +if ( file.isFile() ) +{ + throw new FileNotFoundException( "Find compiled tester of the matcher, but should not: " + file ); +} diff --git a/src/it/hamcrestutility-it-jdk8-existing/params.properties b/src/it/hamcrestutility-it-jdk8-existing/params.properties new file mode 100644 index 000000000..ab922d13c --- /dev/null +++ b/src/it/hamcrestutility-it-jdk8-existing/params.properties @@ -0,0 +1,2 @@ +invoker.java.version=1.8,!9,!10,!11 +invoker.goals=clean install diff --git a/src/it/hamcrestutility-it-jdk8-existing/pom.xml b/src/it/hamcrestutility-it-jdk8-existing/pom.xml new file mode 100644 index 000000000..016e3e2eb --- /dev/null +++ b/src/it/hamcrestutility-it-jdk8-existing/pom.xml @@ -0,0 +1,278 @@ + + 4.0.0 + ch.powerunit.extensions + powerunit-extensions-matchers-it20 + @project.version@ + + jar + + + 1.8 + 1.8 + UTF-8 + 1.3 + 2.22.2 + 0.5.0 + + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.11.2 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.5 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.13.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-archetype-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + + ch.powerunit + powerunit + ${powerunit.version} + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.9.0 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.version} + + + com.github.github + site-maven-plugin + 0.12 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + org.codehaus.mojo + jaxb2-maven-plugin + 2.5.0 + + + org.apache.maven.plugins + maven-changes-plugin + 2.12.1 + + + GitHub + + + + + org.codehaus.mojo + sonar-maven-plugin + 3.7.0.1746 + + + maven-invoker-plugin + 3.2.1 + + + maven-assembly-plugin + 3.3.0 + + + org.codehaus.mojo + xml-maven-plugin + 1.0.2 + + + maven-deploy-plugin + 2.8.2 + + + maven-install-plugin + 2.5.2 + + + + + + org.jacoco + jacoco-maven-plugin + + + + ${project.build.directory} + + *.exec + + + + + + + default-prepare-agent-1 + + prepare-agent + + + + default-prepare-agent-2 + initialize + + prepare-agent-integration + + + testcompileargs + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + jar + test-jar + + + + + true + false + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.source.version} + ${java.target.version} + true + + -J${testcompileargs} + + + + + + + + + org.hamcrest + hamcrest-all + ${hamcrest.version} + + + ch.powerunit + powerunit + ${powerunit.version} + test + + + ch.powerunit.extensions + powerunit-extensions-matchers + @project.version@ + + + com.nitorcreations + matchers + 1.3 + true + + + \ No newline at end of file diff --git a/src/it/hamcrestutility-it-jdk8-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojo.java b/src/it/hamcrestutility-it-jdk8-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojo.java new file mode 100644 index 000000000..2a0cd194f --- /dev/null +++ b/src/it/hamcrestutility-it-jdk8-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojo.java @@ -0,0 +1,12 @@ +package ch.powerunit.extensions.matchers.samples.extensions.hamcrestutility; + +import java.util.List; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers +public class HamcrestUtililtyPojo { + + public List myList; + +} diff --git a/src/it/hamcrestutility-it-jdk8-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojoMatchersTest.java b/src/it/hamcrestutility-it-jdk8-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojoMatchersTest.java new file mode 100644 index 000000000..a5342a01a --- /dev/null +++ b/src/it/hamcrestutility-it-jdk8-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojoMatchersTest.java @@ -0,0 +1,17 @@ +package ch.powerunit.extensions.matchers.samples.extensions.hamcrestutility; + +import java.util.ArrayList; + +import ch.powerunit.Test; +import ch.powerunit.TestSuite; + +public class HamcrestUtililtyPojoMatchersTest implements TestSuite { + + @Test + public void testHamcrestUtility() { + HamcrestUtililtyPojo pojo = new HamcrestUtililtyPojo(); + pojo.myList = new ArrayList<>(); + assertThat(pojo).is(HamcrestUtililtyPojoMatchers.hamcrestUtililtyPojoWith().myListHasNoDuplicates()); + } + +} diff --git a/src/it/hamcrestutility-it-jdk8-existing/verify.bsh b/src/it/hamcrestutility-it-jdk8-existing/verify.bsh new file mode 100644 index 000000000..eea5acd40 --- /dev/null +++ b/src/it/hamcrestutility-it-jdk8-existing/verify.bsh @@ -0,0 +1,26 @@ +import java.io.*; + +File file = new File( basedir, "build.log" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not build log: " + file ); +} + + +file = new File( basedir, "target/generated-sources/annotations/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojoMatchers.java" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find generated Matcher: " + file ); +} + +file = new File( basedir, "target/classes/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojoMatchers.class" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find compiled Matcher: " + file ); +} + +file = new File( basedir, "target/test-classes/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojoMatchersTest.class" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find compiled Test of the matcher: " + file ); +} diff --git a/src/it/hamcrestutility-it-jdk8-missing/params.properties b/src/it/hamcrestutility-it-jdk8-missing/params.properties new file mode 100644 index 000000000..1a20829cb --- /dev/null +++ b/src/it/hamcrestutility-it-jdk8-missing/params.properties @@ -0,0 +1,3 @@ +invoker.java.version=1.8,!9,!10,!11 +invoker.goals=clean install +invoker.buildResult = failure \ No newline at end of file diff --git a/src/it/hamcrestutility-it-jdk8-missing/pom.xml b/src/it/hamcrestutility-it-jdk8-missing/pom.xml new file mode 100644 index 000000000..b9109d36f --- /dev/null +++ b/src/it/hamcrestutility-it-jdk8-missing/pom.xml @@ -0,0 +1,272 @@ + + 4.0.0 + ch.powerunit.extensions + powerunit-extensions-matchers-it16 + @project.version@ + + jar + + + 1.8 + 1.8 + UTF-8 + 1.3 + 2.22.2 + 0.5.0 + + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.11.2 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.5 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.13.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-archetype-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + + ch.powerunit + powerunit + ${powerunit.version} + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.9.0 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.version} + + + com.github.github + site-maven-plugin + 0.12 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + org.codehaus.mojo + jaxb2-maven-plugin + 2.5.0 + + + org.apache.maven.plugins + maven-changes-plugin + 2.12.1 + + + GitHub + + + + + org.codehaus.mojo + sonar-maven-plugin + 3.7.0.1746 + + + maven-invoker-plugin + 3.2.1 + + + maven-assembly-plugin + 3.3.0 + + + org.codehaus.mojo + xml-maven-plugin + 1.0.2 + + + maven-deploy-plugin + 2.8.2 + + + maven-install-plugin + 2.5.2 + + + + + + org.jacoco + jacoco-maven-plugin + + + + ${project.build.directory} + + *.exec + + + + + + + default-prepare-agent-1 + + prepare-agent + + + + default-prepare-agent-2 + initialize + + prepare-agent-integration + + + testcompileargs + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + jar + test-jar + + + + + true + false + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.source.version} + ${java.target.version} + true + + -J${testcompileargs} + + + + + + + + + org.hamcrest + hamcrest-all + ${hamcrest.version} + + + ch.powerunit + powerunit + ${powerunit.version} + test + + + ch.powerunit.extensions + powerunit-extensions-matchers + @project.version@ + + + \ No newline at end of file diff --git a/src/it/hamcrestutility-it-jdk8-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojo.java b/src/it/hamcrestutility-it-jdk8-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojo.java new file mode 100644 index 000000000..aeb9c7061 --- /dev/null +++ b/src/it/hamcrestutility-it-jdk8-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojo.java @@ -0,0 +1,13 @@ +package ch.powerunit.extensions.matchers.samples.extensions.hamcrestutility; + + +import java.util.List; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers +public class HamcrestUtililtyPojo { + + public List myList; + +} diff --git a/src/it/hamcrestutility-it-jdk8-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojoMatchersTest.java b/src/it/hamcrestutility-it-jdk8-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojoMatchersTest.java new file mode 100644 index 000000000..a5342a01a --- /dev/null +++ b/src/it/hamcrestutility-it-jdk8-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojoMatchersTest.java @@ -0,0 +1,17 @@ +package ch.powerunit.extensions.matchers.samples.extensions.hamcrestutility; + +import java.util.ArrayList; + +import ch.powerunit.Test; +import ch.powerunit.TestSuite; + +public class HamcrestUtililtyPojoMatchersTest implements TestSuite { + + @Test + public void testHamcrestUtility() { + HamcrestUtililtyPojo pojo = new HamcrestUtililtyPojo(); + pojo.myList = new ArrayList<>(); + assertThat(pojo).is(HamcrestUtililtyPojoMatchers.hamcrestUtililtyPojoWith().myListHasNoDuplicates()); + } + +} diff --git a/src/it/hamcrestutility-it-jdk8-missing/verify.bsh b/src/it/hamcrestutility-it-jdk8-missing/verify.bsh new file mode 100644 index 000000000..e0bb1aae1 --- /dev/null +++ b/src/it/hamcrestutility-it-jdk8-missing/verify.bsh @@ -0,0 +1,26 @@ +import java.io.*; + +File file = new File( basedir, "build.log" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not build log: " + file ); +} + + +file = new File( basedir, "target/generated-sources/annotations/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojoMatchers.java" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find generated Matcher: " + file ); +} + +file = new File( basedir, "target/classes/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojoMatchers.class" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find compiled Matcher: " + file ); +} + +file = new File( basedir, "target/test-classes/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojoMatchersTest.class" ); +if ( file.isFile() ) +{ + throw new FileNotFoundException( "Find compiled tester of the matcher, but should not: " + file ); +} diff --git a/src/it/hamcrestutility-it-jdk9+-existing/params.properties b/src/it/hamcrestutility-it-jdk9+-existing/params.properties new file mode 100644 index 000000000..714c1431d --- /dev/null +++ b/src/it/hamcrestutility-it-jdk9+-existing/params.properties @@ -0,0 +1,2 @@ +invoker.java.version=!1.8,9,10,11+ +invoker.goals=clean install diff --git a/src/it/hamcrestutility-it-jdk9+-existing/pom.xml b/src/it/hamcrestutility-it-jdk9+-existing/pom.xml new file mode 100644 index 000000000..7f907ec7a --- /dev/null +++ b/src/it/hamcrestutility-it-jdk9+-existing/pom.xml @@ -0,0 +1,283 @@ + + 4.0.0 + ch.powerunit.extensions + powerunit-extensions-matchers-it15 + @project.version@ + + jar + + + 1.8 + 1.8 + UTF-8 + 1.3 + 2.22.2 + 0.5.0 + + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.11.2 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.5 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.13.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-archetype-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + + ch.powerunit + powerunit + ${powerunit.version} + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.9.0 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.version} + + + com.github.github + site-maven-plugin + 0.12 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + org.codehaus.mojo + jaxb2-maven-plugin + 2.5.0 + + + org.apache.maven.plugins + maven-changes-plugin + 2.12.1 + + + GitHub + + + + + org.codehaus.mojo + sonar-maven-plugin + 3.7.0.1746 + + + maven-invoker-plugin + 3.2.1 + + + maven-assembly-plugin + 3.3.0 + + + org.codehaus.mojo + xml-maven-plugin + 1.0.2 + + + maven-deploy-plugin + 2.8.2 + + + maven-install-plugin + 2.5.2 + + + + + + org.jacoco + jacoco-maven-plugin + + + + ${project.build.directory} + + *.exec + + + + + + + default-prepare-agent-1 + + prepare-agent + + + + default-prepare-agent-2 + initialize + + prepare-agent-integration + + + testcompileargs + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + jar + test-jar + + + + + true + false + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.source.version} + ${java.target.version} + true + + -J${testcompileargs} + + + + + + + + + org.hamcrest + hamcrest-all + ${hamcrest.version} + + + ch.powerunit + powerunit + ${powerunit.version} + test + + + ch.powerunit.extensions + powerunit-extensions-matchers + @project.version@ + + + com.nitorcreations + matchers + 1.3 + true + + + javax.annotation + javax.annotation-api + 1.3.2 + + + \ No newline at end of file diff --git a/src/it/hamcrestutility-it-jdk9+-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojo.java b/src/it/hamcrestutility-it-jdk9+-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojo.java new file mode 100644 index 000000000..2a0cd194f --- /dev/null +++ b/src/it/hamcrestutility-it-jdk9+-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojo.java @@ -0,0 +1,12 @@ +package ch.powerunit.extensions.matchers.samples.extensions.hamcrestutility; + +import java.util.List; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers +public class HamcrestUtililtyPojo { + + public List myList; + +} diff --git a/src/it/hamcrestutility-it-jdk9+-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojoMatchersTest.java b/src/it/hamcrestutility-it-jdk9+-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojoMatchersTest.java new file mode 100644 index 000000000..a5342a01a --- /dev/null +++ b/src/it/hamcrestutility-it-jdk9+-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojoMatchersTest.java @@ -0,0 +1,17 @@ +package ch.powerunit.extensions.matchers.samples.extensions.hamcrestutility; + +import java.util.ArrayList; + +import ch.powerunit.Test; +import ch.powerunit.TestSuite; + +public class HamcrestUtililtyPojoMatchersTest implements TestSuite { + + @Test + public void testHamcrestUtility() { + HamcrestUtililtyPojo pojo = new HamcrestUtililtyPojo(); + pojo.myList = new ArrayList<>(); + assertThat(pojo).is(HamcrestUtililtyPojoMatchers.hamcrestUtililtyPojoWith().myListHasNoDuplicates()); + } + +} diff --git a/src/it/hamcrestutility-it-jdk9+-existing/verify.bsh b/src/it/hamcrestutility-it-jdk9+-existing/verify.bsh new file mode 100644 index 000000000..eea5acd40 --- /dev/null +++ b/src/it/hamcrestutility-it-jdk9+-existing/verify.bsh @@ -0,0 +1,26 @@ +import java.io.*; + +File file = new File( basedir, "build.log" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not build log: " + file ); +} + + +file = new File( basedir, "target/generated-sources/annotations/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojoMatchers.java" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find generated Matcher: " + file ); +} + +file = new File( basedir, "target/classes/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojoMatchers.class" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find compiled Matcher: " + file ); +} + +file = new File( basedir, "target/test-classes/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojoMatchersTest.class" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find compiled Test of the matcher: " + file ); +} diff --git a/src/it/hamcrestutility-it-jdk9+-missing/params.properties b/src/it/hamcrestutility-it-jdk9+-missing/params.properties new file mode 100644 index 000000000..973dfe1d2 --- /dev/null +++ b/src/it/hamcrestutility-it-jdk9+-missing/params.properties @@ -0,0 +1,3 @@ +invoker.java.version=!1.8,9,10,11+ +invoker.goals=clean install +invoker.buildResult = failure \ No newline at end of file diff --git a/src/it/hamcrestutility-it-jdk9+-missing/pom.xml b/src/it/hamcrestutility-it-jdk9+-missing/pom.xml new file mode 100644 index 000000000..59e87b2d7 --- /dev/null +++ b/src/it/hamcrestutility-it-jdk9+-missing/pom.xml @@ -0,0 +1,277 @@ + + 4.0.0 + ch.powerunit.extensions + powerunit-extensions-matchers-it14 + @project.version@ + + jar + + + 1.8 + 1.8 + UTF-8 + 1.3 + 2.22.2 + 0.5.0 + + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.11.2 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.5 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.13.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-archetype-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + + ch.powerunit + powerunit + ${powerunit.version} + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.9.0 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.version} + + + com.github.github + site-maven-plugin + 0.12 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + org.codehaus.mojo + jaxb2-maven-plugin + 2.5.0 + + + org.apache.maven.plugins + maven-changes-plugin + 2.12.1 + + + GitHub + + + + + org.codehaus.mojo + sonar-maven-plugin + 3.7.0.1746 + + + maven-invoker-plugin + 3.2.1 + + + maven-assembly-plugin + 3.3.0 + + + org.codehaus.mojo + xml-maven-plugin + 1.0.2 + + + maven-deploy-plugin + 2.8.2 + + + maven-install-plugin + 2.5.2 + + + + + + org.jacoco + jacoco-maven-plugin + + + + ${project.build.directory} + + *.exec + + + + + + + default-prepare-agent-1 + + prepare-agent + + + + default-prepare-agent-2 + initialize + + prepare-agent-integration + + + testcompileargs + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + jar + test-jar + + + + + true + false + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.source.version} + ${java.target.version} + true + + -J${testcompileargs} + + + + + + + + + org.hamcrest + hamcrest-all + ${hamcrest.version} + + + ch.powerunit + powerunit + ${powerunit.version} + test + + + ch.powerunit.extensions + powerunit-extensions-matchers + @project.version@ + + + javax.annotation + javax.annotation-api + 1.3.2 + + + \ No newline at end of file diff --git a/src/it/hamcrestutility-it-jdk9+-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojo.java b/src/it/hamcrestutility-it-jdk9+-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojo.java new file mode 100644 index 000000000..2a0cd194f --- /dev/null +++ b/src/it/hamcrestutility-it-jdk9+-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojo.java @@ -0,0 +1,12 @@ +package ch.powerunit.extensions.matchers.samples.extensions.hamcrestutility; + +import java.util.List; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers +public class HamcrestUtililtyPojo { + + public List myList; + +} diff --git a/src/it/hamcrestutility-it-jdk9+-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojoMatchersTest.java b/src/it/hamcrestutility-it-jdk9+-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojoMatchersTest.java new file mode 100644 index 000000000..a5342a01a --- /dev/null +++ b/src/it/hamcrestutility-it-jdk9+-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojoMatchersTest.java @@ -0,0 +1,17 @@ +package ch.powerunit.extensions.matchers.samples.extensions.hamcrestutility; + +import java.util.ArrayList; + +import ch.powerunit.Test; +import ch.powerunit.TestSuite; + +public class HamcrestUtililtyPojoMatchersTest implements TestSuite { + + @Test + public void testHamcrestUtility() { + HamcrestUtililtyPojo pojo = new HamcrestUtililtyPojo(); + pojo.myList = new ArrayList<>(); + assertThat(pojo).is(HamcrestUtililtyPojoMatchers.hamcrestUtililtyPojoWith().myListHasNoDuplicates()); + } + +} diff --git a/src/it/hamcrestutility-it-jdk9+-missing/verify.bsh b/src/it/hamcrestutility-it-jdk9+-missing/verify.bsh new file mode 100644 index 000000000..e0bb1aae1 --- /dev/null +++ b/src/it/hamcrestutility-it-jdk9+-missing/verify.bsh @@ -0,0 +1,26 @@ +import java.io.*; + +File file = new File( basedir, "build.log" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not build log: " + file ); +} + + +file = new File( basedir, "target/generated-sources/annotations/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojoMatchers.java" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find generated Matcher: " + file ); +} + +file = new File( basedir, "target/classes/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojoMatchers.class" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find compiled Matcher: " + file ); +} + +file = new File( basedir, "target/test-classes/ch/powerunit/extensions/matchers/samples/extensions/hamcrestutility/HamcrestUtililtyPojoMatchersTest.class" ); +if ( file.isFile() ) +{ + throw new FileNotFoundException( "Find compiled tester of the matcher, but should not: " + file ); +} diff --git a/src/it/provider-factory-disabled-it-jdk/params.properties b/src/it/provider-factory-disabled-it-jdk/params.properties new file mode 100644 index 000000000..ab922d13c --- /dev/null +++ b/src/it/provider-factory-disabled-it-jdk/params.properties @@ -0,0 +1,2 @@ +invoker.java.version=1.8,!9,!10,!11 +invoker.goals=clean install diff --git a/src/it/provider-factory-disabled-it-jdk/pom.xml b/src/it/provider-factory-disabled-it-jdk/pom.xml new file mode 100644 index 000000000..fb0dd49c3 --- /dev/null +++ b/src/it/provider-factory-disabled-it-jdk/pom.xml @@ -0,0 +1,273 @@ + + 4.0.0 + ch.powerunit.extensions + powerunit-extensions-matchers-it13 + @project.version@ + + jar + + + 1.8 + 1.8 + UTF-8 + 1.3 + 2.22.2 + 0.5.0 + + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.11.2 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.5 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.13.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-archetype-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + + ch.powerunit + powerunit + ${powerunit.version} + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.9.0 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.version} + + + com.github.github + site-maven-plugin + 0.12 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + org.codehaus.mojo + jaxb2-maven-plugin + 2.5.0 + + + org.apache.maven.plugins + maven-changes-plugin + 2.12.1 + + + GitHub + + + + + org.codehaus.mojo + sonar-maven-plugin + 3.7.0.1746 + + + maven-invoker-plugin + 3.2.1 + + + maven-assembly-plugin + 3.3.0 + + + org.codehaus.mojo + xml-maven-plugin + 1.0.2 + + + maven-deploy-plugin + 2.8.2 + + + maven-install-plugin + 2.5.2 + + + + + + org.jacoco + jacoco-maven-plugin + + + + ${project.build.directory} + + *.exec + + + + + + + default-prepare-agent-1 + + prepare-agent + + + + default-prepare-agent-2 + initialize + + prepare-agent-integration + + + testcompileargs + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + jar + test-jar + + + + + true + false + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.source.version} + ${java.target.version} + true + + -J${testcompileargs} + + + + + + + + + + org.hamcrest + hamcrest-all + ${hamcrest.version} + + + ch.powerunit + powerunit + ${powerunit.version} + test + + + ch.powerunit.extensions + powerunit-extensions-matchers + @project.version@ + + + \ No newline at end of file diff --git a/src/it/provider-factory-disabled-it-jdk/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java b/src/it/provider-factory-disabled-it-jdk/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java new file mode 100644 index 000000000..6ace664ae --- /dev/null +++ b/src/it/provider-factory-disabled-it-jdk/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java @@ -0,0 +1,94 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Set; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * + */ +@ProvideMatchers +public class Pojo1 { + private String msg1; + + public String msg2; + + public int msg3; + + public String[] msg4; + + public int[] msg5; + + public List msg6; + + public List msg7; + + public List[] msg8; + + public Collection msg9; + + public Set msg12; + + public String getMsg1() { + return msg1; + } + + public void setMsg1(String msg1) { + this.msg1 = msg1; + } + + public boolean myBoolean; + + private boolean oneBoolean; + + public boolean isOneBoolean() { + return oneBoolean; + } + + public void setOneBoolean(boolean oneBoolean) { + this.oneBoolean = oneBoolean; + } + + public Pojo1() { + } + + public Pojo1(String msg1) { + this.msg1 = msg1; + } + + public Pojo1(List msg6) { + this.msg6 = msg6; + } + + @Override + public String toString() { + return "Pojo1 [msg1=" + msg1 + ", msg2=" + msg2 + ", msg3=" + msg3 + ", msg4=" + Arrays.toString(msg4) + + ", msg5=" + Arrays.toString(msg5) + ", msg6=" + msg6 + ", msg7=" + msg7 + ", msg8=" + + Arrays.toString(msg8) + ", msg9=" + msg9 + ", msg12=" + msg12 + ", myBoolean=" + myBoolean + + ", oneBoolean=" + oneBoolean + "]"; + } + +} diff --git a/src/it/provider-factory-disabled-it-jdk/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java b/src/it/provider-factory-disabled-it-jdk/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java new file mode 100644 index 000000000..27b042423 --- /dev/null +++ b/src/it/provider-factory-disabled-it-jdk/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java @@ -0,0 +1,156 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import static ch.powerunit.matchers.MatcherTester.matcher; +import static ch.powerunit.matchers.MatcherTester.value; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.hamcrest.Factory; +import org.hamcrest.Matcher; + +import ch.powerunit.Ignore; +import ch.powerunit.Test; +import ch.powerunit.TestDelegate; +import ch.powerunit.TestSuite; +import ch.powerunit.matchers.MatcherTester; + +public class Pojo1MatcherTest implements TestSuite { + + @TestDelegate + public final MatcherTester tester = testerOfMatcher(Pojo1Matchers.Pojo1MatcherImpl.class).with( + matcher((Pojo1Matchers.Pojo1MatcherImpl) Pojo1Matchers.pojo1With().msg1ContainsString("12")).describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.Pojo1 with\n[msg4 ANYTHING]\n[msg3 ANYTHING]\n[msg2 ANYTHING]\n[msg1 a string containing \"12\"]\n[msg8 ANYTHING]\n[msg7 ANYTHING]\n[msg6 ANYTHING]\n[msg12 ANYTHING]\n[msg5 ANYTHING]\n[oneBoolean ANYTHING]\n[myBoolean ANYTHING]\n[msg9 ANYTHING]\n") + .nullRejected("was null").accepting(new Pojo1("12"), new Pojo1("121")) + .rejecting(value("").withMessage("was \"\""), value(new Pojo1()).withMessage("[msg1 was null]\n"), + value(new Pojo1("11")).withMessage("[msg1 was \"11\"]\n")), + matcher((Pojo1Matchers.Pojo1MatcherImpl) Pojo1Matchers.pojo1With().msg6IsEmptyIterable()).describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.Pojo1 with\n[msg4 ANYTHING]\n[msg3 ANYTHING]\n[msg2 ANYTHING]\n[msg1 ANYTHING]\n[msg8 ANYTHING]\n[msg7 ANYTHING]\n[msg6 an empty iterable]\n[msg12 ANYTHING]\n[msg5 ANYTHING]\n[oneBoolean ANYTHING]\n[myBoolean ANYTHING]\n[msg9 ANYTHING]\n") + .nullRejected("was null").accepting(new Pojo1(Collections.emptyList())) + .rejecting(value(new Pojo1(Collections.singletonList("x"))).withMessage("[msg6 [\"x\"]]\n"))); + + @Test + public void testOKMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With()); + } + + @Test + public void testSameInstanceMatcher() { + Pojo1 p = new Pojo1(); + p.msg6 = new ArrayList<>(); + assertThat(p).is(Pojo1Matchers.pojo1With().msg6IsSameInstance(p.msg6)); + } + + @Test + public void testOKMatcherWithConvert() { + Pojo1 p = new Pojo1(); + p.msg2 = "12"; + assertThat(p).is(Pojo1Matchers.pojo1With().msg2As(s -> Integer.valueOf(s) + 1l, is(13l))); + } + + @Test + public void testOKMatcherWithLinkedMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With().andWith(notNullValue()).andWith(hasToString(notNullValue())) + .buildWith(anything())); + } + + @Test + public void testOKMatcherWithComparable() { + Pojo1 p = new Pojo1(); + p.msg2 = "12"; + assertThat(p).is(Pojo1Matchers.pojo1With().msg2ComparesEqualTo("12").build()); + } + + @Test + public void testKOMatcherWithReference() { + Pojo1 p1 = new Pojo1(); + p1.msg2 = "12"; + Pojo1 p2 = new Pojo1(); + p2.msg2 = "12"; + assertThat(p1).is(Pojo1Matchers.pojo1WithSameValue(p2)); + } + + @Test + public void testKOMatcherWithEmptyArray() { + Pojo1 p1 = new Pojo1(); + p1.msg8 = new List[] {}; + assertThat(p1).is(Pojo1Matchers.pojo1With().msg8IsEmpty()); + } + + @Test + @Ignore + public void testKOMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With().msg1("x")); + } + + @Factory + public static void test() { + } + + @Factory + public static void test(String name1) { + } + + @Factory + public static T test(T input) { + return input; + } + + @Factory + public static , K> void test1(T t1, K t2) { + } + + @Factory + public static & Serializable, K> void test2(T t1, K t2) { + } + + @Factory + public static & Serializable, K> void test3(T t1, K... t2) { + } + + @Factory + public static void test4(T t1) { + } + + @Factory + public static Matcher fromMatcher(Matcher input) { + return null; + } + + /** + * @param name1 + * @param name2 + */ + @Factory + public static void test(String name1, String name2) { + } + + @Factory + public static void test(int x) { + } +} diff --git a/src/it/provider-factory-disabled-it-jdk/verify.bsh b/src/it/provider-factory-disabled-it-jdk/verify.bsh new file mode 100644 index 000000000..3cc0bce36 --- /dev/null +++ b/src/it/provider-factory-disabled-it-jdk/verify.bsh @@ -0,0 +1,13 @@ +import java.io.*; + +File file = new File( basedir, "build.log" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not build log: " + file ); +} + +file = new File( basedir, "target/generated-sources/annotations/ch/powerunit/extensions/matchers/samples/AllMatchers.java" ); +if ( file.isFile() ) +{ + throw new FileNotFoundException( "Could find file produced by Factory processor: " + file ); +} diff --git a/src/it/provider-factory-disabled-it-jdk9+/params.properties b/src/it/provider-factory-disabled-it-jdk9+/params.properties new file mode 100644 index 000000000..714c1431d --- /dev/null +++ b/src/it/provider-factory-disabled-it-jdk9+/params.properties @@ -0,0 +1,2 @@ +invoker.java.version=!1.8,9,10,11+ +invoker.goals=clean install diff --git a/src/it/provider-factory-disabled-it-jdk9+/pom.xml b/src/it/provider-factory-disabled-it-jdk9+/pom.xml new file mode 100644 index 000000000..edb35e69c --- /dev/null +++ b/src/it/provider-factory-disabled-it-jdk9+/pom.xml @@ -0,0 +1,279 @@ + + 4.0.0 + ch.powerunit.extensions + powerunit-extensions-matchers-it12 + @project.version@ + + jar + + + 1.8 + 1.8 + UTF-8 + 1.3 + 2.22.2 + 0.5.0 + + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.11.2 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.5 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.13.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-archetype-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + + ch.powerunit + powerunit + ${powerunit.version} + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.9.0 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.version} + + + com.github.github + site-maven-plugin + 0.12 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + org.codehaus.mojo + jaxb2-maven-plugin + 2.5.0 + + + org.apache.maven.plugins + maven-changes-plugin + 2.12.1 + + + GitHub + + + + + org.codehaus.mojo + sonar-maven-plugin + 3.7.0.1746 + + + maven-invoker-plugin + 3.2.1 + + + maven-assembly-plugin + 3.3.0 + + + org.codehaus.mojo + xml-maven-plugin + 1.0.2 + + + maven-deploy-plugin + 2.8.2 + + + maven-install-plugin + 2.5.2 + + + + + + org.jacoco + jacoco-maven-plugin + + + + ${project.build.directory} + + *.exec + + + + + + + default-prepare-agent-1 + + prepare-agent + + + + default-prepare-agent-2 + initialize + + prepare-agent-integration + + + testcompileargs + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + jar + test-jar + + + + + true + false + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.source.version} + ${java.target.version} + true + + -J${testcompileargs} + + + + + + + + + + org.hamcrest + hamcrest-all + ${hamcrest.version} + + + ch.powerunit + powerunit + ${powerunit.version} + test + + + ch.powerunit.extensions + powerunit-extensions-matchers + @project.version@ + + + javax.annotation + javax.annotation-api + 1.3.2 + + + \ No newline at end of file diff --git a/src/it/provider-factory-disabled-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java b/src/it/provider-factory-disabled-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java new file mode 100644 index 000000000..6ace664ae --- /dev/null +++ b/src/it/provider-factory-disabled-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java @@ -0,0 +1,94 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Set; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * + */ +@ProvideMatchers +public class Pojo1 { + private String msg1; + + public String msg2; + + public int msg3; + + public String[] msg4; + + public int[] msg5; + + public List msg6; + + public List msg7; + + public List[] msg8; + + public Collection msg9; + + public Set msg12; + + public String getMsg1() { + return msg1; + } + + public void setMsg1(String msg1) { + this.msg1 = msg1; + } + + public boolean myBoolean; + + private boolean oneBoolean; + + public boolean isOneBoolean() { + return oneBoolean; + } + + public void setOneBoolean(boolean oneBoolean) { + this.oneBoolean = oneBoolean; + } + + public Pojo1() { + } + + public Pojo1(String msg1) { + this.msg1 = msg1; + } + + public Pojo1(List msg6) { + this.msg6 = msg6; + } + + @Override + public String toString() { + return "Pojo1 [msg1=" + msg1 + ", msg2=" + msg2 + ", msg3=" + msg3 + ", msg4=" + Arrays.toString(msg4) + + ", msg5=" + Arrays.toString(msg5) + ", msg6=" + msg6 + ", msg7=" + msg7 + ", msg8=" + + Arrays.toString(msg8) + ", msg9=" + msg9 + ", msg12=" + msg12 + ", myBoolean=" + myBoolean + + ", oneBoolean=" + oneBoolean + "]"; + } + +} diff --git a/src/it/provider-factory-disabled-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java b/src/it/provider-factory-disabled-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java new file mode 100644 index 000000000..27b042423 --- /dev/null +++ b/src/it/provider-factory-disabled-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java @@ -0,0 +1,156 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import static ch.powerunit.matchers.MatcherTester.matcher; +import static ch.powerunit.matchers.MatcherTester.value; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.hamcrest.Factory; +import org.hamcrest.Matcher; + +import ch.powerunit.Ignore; +import ch.powerunit.Test; +import ch.powerunit.TestDelegate; +import ch.powerunit.TestSuite; +import ch.powerunit.matchers.MatcherTester; + +public class Pojo1MatcherTest implements TestSuite { + + @TestDelegate + public final MatcherTester tester = testerOfMatcher(Pojo1Matchers.Pojo1MatcherImpl.class).with( + matcher((Pojo1Matchers.Pojo1MatcherImpl) Pojo1Matchers.pojo1With().msg1ContainsString("12")).describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.Pojo1 with\n[msg4 ANYTHING]\n[msg3 ANYTHING]\n[msg2 ANYTHING]\n[msg1 a string containing \"12\"]\n[msg8 ANYTHING]\n[msg7 ANYTHING]\n[msg6 ANYTHING]\n[msg12 ANYTHING]\n[msg5 ANYTHING]\n[oneBoolean ANYTHING]\n[myBoolean ANYTHING]\n[msg9 ANYTHING]\n") + .nullRejected("was null").accepting(new Pojo1("12"), new Pojo1("121")) + .rejecting(value("").withMessage("was \"\""), value(new Pojo1()).withMessage("[msg1 was null]\n"), + value(new Pojo1("11")).withMessage("[msg1 was \"11\"]\n")), + matcher((Pojo1Matchers.Pojo1MatcherImpl) Pojo1Matchers.pojo1With().msg6IsEmptyIterable()).describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.Pojo1 with\n[msg4 ANYTHING]\n[msg3 ANYTHING]\n[msg2 ANYTHING]\n[msg1 ANYTHING]\n[msg8 ANYTHING]\n[msg7 ANYTHING]\n[msg6 an empty iterable]\n[msg12 ANYTHING]\n[msg5 ANYTHING]\n[oneBoolean ANYTHING]\n[myBoolean ANYTHING]\n[msg9 ANYTHING]\n") + .nullRejected("was null").accepting(new Pojo1(Collections.emptyList())) + .rejecting(value(new Pojo1(Collections.singletonList("x"))).withMessage("[msg6 [\"x\"]]\n"))); + + @Test + public void testOKMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With()); + } + + @Test + public void testSameInstanceMatcher() { + Pojo1 p = new Pojo1(); + p.msg6 = new ArrayList<>(); + assertThat(p).is(Pojo1Matchers.pojo1With().msg6IsSameInstance(p.msg6)); + } + + @Test + public void testOKMatcherWithConvert() { + Pojo1 p = new Pojo1(); + p.msg2 = "12"; + assertThat(p).is(Pojo1Matchers.pojo1With().msg2As(s -> Integer.valueOf(s) + 1l, is(13l))); + } + + @Test + public void testOKMatcherWithLinkedMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With().andWith(notNullValue()).andWith(hasToString(notNullValue())) + .buildWith(anything())); + } + + @Test + public void testOKMatcherWithComparable() { + Pojo1 p = new Pojo1(); + p.msg2 = "12"; + assertThat(p).is(Pojo1Matchers.pojo1With().msg2ComparesEqualTo("12").build()); + } + + @Test + public void testKOMatcherWithReference() { + Pojo1 p1 = new Pojo1(); + p1.msg2 = "12"; + Pojo1 p2 = new Pojo1(); + p2.msg2 = "12"; + assertThat(p1).is(Pojo1Matchers.pojo1WithSameValue(p2)); + } + + @Test + public void testKOMatcherWithEmptyArray() { + Pojo1 p1 = new Pojo1(); + p1.msg8 = new List[] {}; + assertThat(p1).is(Pojo1Matchers.pojo1With().msg8IsEmpty()); + } + + @Test + @Ignore + public void testKOMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With().msg1("x")); + } + + @Factory + public static void test() { + } + + @Factory + public static void test(String name1) { + } + + @Factory + public static T test(T input) { + return input; + } + + @Factory + public static , K> void test1(T t1, K t2) { + } + + @Factory + public static & Serializable, K> void test2(T t1, K t2) { + } + + @Factory + public static & Serializable, K> void test3(T t1, K... t2) { + } + + @Factory + public static void test4(T t1) { + } + + @Factory + public static Matcher fromMatcher(Matcher input) { + return null; + } + + /** + * @param name1 + * @param name2 + */ + @Factory + public static void test(String name1, String name2) { + } + + @Factory + public static void test(int x) { + } +} diff --git a/src/it/provider-factory-disabled-it-jdk9+/verify.bsh b/src/it/provider-factory-disabled-it-jdk9+/verify.bsh new file mode 100644 index 000000000..3cc0bce36 --- /dev/null +++ b/src/it/provider-factory-disabled-it-jdk9+/verify.bsh @@ -0,0 +1,13 @@ +import java.io.*; + +File file = new File( basedir, "build.log" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not build log: " + file ); +} + +file = new File( basedir, "target/generated-sources/annotations/ch/powerunit/extensions/matchers/samples/AllMatchers.java" ); +if ( file.isFile() ) +{ + throw new FileNotFoundException( "Could find file produced by Factory processor: " + file ); +} diff --git a/src/it/provider-factory-enabled-it-jdk/params.properties b/src/it/provider-factory-enabled-it-jdk/params.properties new file mode 100644 index 000000000..ab922d13c --- /dev/null +++ b/src/it/provider-factory-enabled-it-jdk/params.properties @@ -0,0 +1,2 @@ +invoker.java.version=1.8,!9,!10,!11 +invoker.goals=clean install diff --git a/src/it/provider-factory-enabled-it-jdk/pom.xml b/src/it/provider-factory-enabled-it-jdk/pom.xml new file mode 100644 index 000000000..b6d993aeb --- /dev/null +++ b/src/it/provider-factory-enabled-it-jdk/pom.xml @@ -0,0 +1,273 @@ + + 4.0.0 + ch.powerunit.extensions + powerunit-extensions-matchers-it11 + @project.version@ + + jar + + + 1.8 + 1.8 + UTF-8 + 1.3 + 2.22.2 + 0.5.0 + + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.11.2 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.5 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.13.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-archetype-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + + ch.powerunit + powerunit + ${powerunit.version} + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.9.0 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.version} + + + com.github.github + site-maven-plugin + 0.12 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + org.codehaus.mojo + jaxb2-maven-plugin + 2.5.0 + + + org.apache.maven.plugins + maven-changes-plugin + 2.12.1 + + + GitHub + + + + + org.codehaus.mojo + sonar-maven-plugin + 3.7.0.1746 + + + maven-invoker-plugin + 3.2.1 + + + maven-assembly-plugin + 3.3.0 + + + org.codehaus.mojo + xml-maven-plugin + 1.0.2 + + + maven-deploy-plugin + 2.8.2 + + + maven-install-plugin + 2.5.2 + + + + + + org.jacoco + jacoco-maven-plugin + + + + ${project.build.directory} + + *.exec + + + + + + + default-prepare-agent-1 + + prepare-agent + + + + default-prepare-agent-2 + initialize + + prepare-agent-integration + + + testcompileargs + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + jar + test-jar + + + + + true + false + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.source.version} + ${java.target.version} + true + + -J${testcompileargs} + -Ach.powerunit.extensions.matchers.provideprocessor.ProvidesMatchersAnnotationsProcessor.factory=ch.powerunit.extensions.matchers.samples.AllMatchers + + + + + + + + + org.hamcrest + hamcrest-all + ${hamcrest.version} + + + ch.powerunit + powerunit + ${powerunit.version} + test + + + ch.powerunit.extensions + powerunit-extensions-matchers + @project.version@ + + + \ No newline at end of file diff --git a/src/it/provider-factory-enabled-it-jdk/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java b/src/it/provider-factory-enabled-it-jdk/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java new file mode 100644 index 000000000..6ace664ae --- /dev/null +++ b/src/it/provider-factory-enabled-it-jdk/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java @@ -0,0 +1,94 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Set; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * + */ +@ProvideMatchers +public class Pojo1 { + private String msg1; + + public String msg2; + + public int msg3; + + public String[] msg4; + + public int[] msg5; + + public List msg6; + + public List msg7; + + public List[] msg8; + + public Collection msg9; + + public Set msg12; + + public String getMsg1() { + return msg1; + } + + public void setMsg1(String msg1) { + this.msg1 = msg1; + } + + public boolean myBoolean; + + private boolean oneBoolean; + + public boolean isOneBoolean() { + return oneBoolean; + } + + public void setOneBoolean(boolean oneBoolean) { + this.oneBoolean = oneBoolean; + } + + public Pojo1() { + } + + public Pojo1(String msg1) { + this.msg1 = msg1; + } + + public Pojo1(List msg6) { + this.msg6 = msg6; + } + + @Override + public String toString() { + return "Pojo1 [msg1=" + msg1 + ", msg2=" + msg2 + ", msg3=" + msg3 + ", msg4=" + Arrays.toString(msg4) + + ", msg5=" + Arrays.toString(msg5) + ", msg6=" + msg6 + ", msg7=" + msg7 + ", msg8=" + + Arrays.toString(msg8) + ", msg9=" + msg9 + ", msg12=" + msg12 + ", myBoolean=" + myBoolean + + ", oneBoolean=" + oneBoolean + "]"; + } + +} diff --git a/src/it/provider-factory-enabled-it-jdk/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java b/src/it/provider-factory-enabled-it-jdk/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java new file mode 100644 index 000000000..27b042423 --- /dev/null +++ b/src/it/provider-factory-enabled-it-jdk/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java @@ -0,0 +1,156 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import static ch.powerunit.matchers.MatcherTester.matcher; +import static ch.powerunit.matchers.MatcherTester.value; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.hamcrest.Factory; +import org.hamcrest.Matcher; + +import ch.powerunit.Ignore; +import ch.powerunit.Test; +import ch.powerunit.TestDelegate; +import ch.powerunit.TestSuite; +import ch.powerunit.matchers.MatcherTester; + +public class Pojo1MatcherTest implements TestSuite { + + @TestDelegate + public final MatcherTester tester = testerOfMatcher(Pojo1Matchers.Pojo1MatcherImpl.class).with( + matcher((Pojo1Matchers.Pojo1MatcherImpl) Pojo1Matchers.pojo1With().msg1ContainsString("12")).describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.Pojo1 with\n[msg4 ANYTHING]\n[msg3 ANYTHING]\n[msg2 ANYTHING]\n[msg1 a string containing \"12\"]\n[msg8 ANYTHING]\n[msg7 ANYTHING]\n[msg6 ANYTHING]\n[msg12 ANYTHING]\n[msg5 ANYTHING]\n[oneBoolean ANYTHING]\n[myBoolean ANYTHING]\n[msg9 ANYTHING]\n") + .nullRejected("was null").accepting(new Pojo1("12"), new Pojo1("121")) + .rejecting(value("").withMessage("was \"\""), value(new Pojo1()).withMessage("[msg1 was null]\n"), + value(new Pojo1("11")).withMessage("[msg1 was \"11\"]\n")), + matcher((Pojo1Matchers.Pojo1MatcherImpl) Pojo1Matchers.pojo1With().msg6IsEmptyIterable()).describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.Pojo1 with\n[msg4 ANYTHING]\n[msg3 ANYTHING]\n[msg2 ANYTHING]\n[msg1 ANYTHING]\n[msg8 ANYTHING]\n[msg7 ANYTHING]\n[msg6 an empty iterable]\n[msg12 ANYTHING]\n[msg5 ANYTHING]\n[oneBoolean ANYTHING]\n[myBoolean ANYTHING]\n[msg9 ANYTHING]\n") + .nullRejected("was null").accepting(new Pojo1(Collections.emptyList())) + .rejecting(value(new Pojo1(Collections.singletonList("x"))).withMessage("[msg6 [\"x\"]]\n"))); + + @Test + public void testOKMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With()); + } + + @Test + public void testSameInstanceMatcher() { + Pojo1 p = new Pojo1(); + p.msg6 = new ArrayList<>(); + assertThat(p).is(Pojo1Matchers.pojo1With().msg6IsSameInstance(p.msg6)); + } + + @Test + public void testOKMatcherWithConvert() { + Pojo1 p = new Pojo1(); + p.msg2 = "12"; + assertThat(p).is(Pojo1Matchers.pojo1With().msg2As(s -> Integer.valueOf(s) + 1l, is(13l))); + } + + @Test + public void testOKMatcherWithLinkedMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With().andWith(notNullValue()).andWith(hasToString(notNullValue())) + .buildWith(anything())); + } + + @Test + public void testOKMatcherWithComparable() { + Pojo1 p = new Pojo1(); + p.msg2 = "12"; + assertThat(p).is(Pojo1Matchers.pojo1With().msg2ComparesEqualTo("12").build()); + } + + @Test + public void testKOMatcherWithReference() { + Pojo1 p1 = new Pojo1(); + p1.msg2 = "12"; + Pojo1 p2 = new Pojo1(); + p2.msg2 = "12"; + assertThat(p1).is(Pojo1Matchers.pojo1WithSameValue(p2)); + } + + @Test + public void testKOMatcherWithEmptyArray() { + Pojo1 p1 = new Pojo1(); + p1.msg8 = new List[] {}; + assertThat(p1).is(Pojo1Matchers.pojo1With().msg8IsEmpty()); + } + + @Test + @Ignore + public void testKOMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With().msg1("x")); + } + + @Factory + public static void test() { + } + + @Factory + public static void test(String name1) { + } + + @Factory + public static T test(T input) { + return input; + } + + @Factory + public static , K> void test1(T t1, K t2) { + } + + @Factory + public static & Serializable, K> void test2(T t1, K t2) { + } + + @Factory + public static & Serializable, K> void test3(T t1, K... t2) { + } + + @Factory + public static void test4(T t1) { + } + + @Factory + public static Matcher fromMatcher(Matcher input) { + return null; + } + + /** + * @param name1 + * @param name2 + */ + @Factory + public static void test(String name1, String name2) { + } + + @Factory + public static void test(int x) { + } +} diff --git a/src/it/provider-factory-enabled-it-jdk/verify.bsh b/src/it/provider-factory-enabled-it-jdk/verify.bsh new file mode 100644 index 000000000..fdcbd5b02 --- /dev/null +++ b/src/it/provider-factory-enabled-it-jdk/verify.bsh @@ -0,0 +1,13 @@ +import java.io.*; + +File file = new File( basedir, "build.log" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not build log: " + file ); +} + +file = new File( basedir, "target/generated-sources/annotations/ch/powerunit/extensions/matchers/samples/AllMatchers.java" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find file produced by Factory processor: " + file ); +} diff --git a/src/it/provider-factory-enabled-it-jdk9+/params.properties b/src/it/provider-factory-enabled-it-jdk9+/params.properties new file mode 100644 index 000000000..714c1431d --- /dev/null +++ b/src/it/provider-factory-enabled-it-jdk9+/params.properties @@ -0,0 +1,2 @@ +invoker.java.version=!1.8,9,10,11+ +invoker.goals=clean install diff --git a/src/it/provider-factory-enabled-it-jdk9+/pom.xml b/src/it/provider-factory-enabled-it-jdk9+/pom.xml new file mode 100644 index 000000000..88ccc6414 --- /dev/null +++ b/src/it/provider-factory-enabled-it-jdk9+/pom.xml @@ -0,0 +1,279 @@ + + 4.0.0 + ch.powerunit.extensions + powerunit-extensions-matchers-it10 + @project.version@ + + jar + + + 1.8 + 1.8 + UTF-8 + 1.3 + 2.22.2 + 0.5.0 + + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.11.2 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.5 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.13.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-archetype-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + + ch.powerunit + powerunit + ${powerunit.version} + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.9.0 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.version} + + + com.github.github + site-maven-plugin + 0.12 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + org.codehaus.mojo + jaxb2-maven-plugin + 2.5.0 + + + org.apache.maven.plugins + maven-changes-plugin + 2.12.1 + + + GitHub + + + + + org.codehaus.mojo + sonar-maven-plugin + 3.7.0.1746 + + + maven-invoker-plugin + 3.2.1 + + + maven-assembly-plugin + 3.3.0 + + + org.codehaus.mojo + xml-maven-plugin + 1.0.2 + + + maven-deploy-plugin + 2.8.2 + + + maven-install-plugin + 2.5.2 + + + + + + org.jacoco + jacoco-maven-plugin + + + + ${project.build.directory} + + *.exec + + + + + + + default-prepare-agent-1 + + prepare-agent + + + + default-prepare-agent-2 + initialize + + prepare-agent-integration + + + testcompileargs + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + jar + test-jar + + + + + true + false + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.source.version} + ${java.target.version} + true + + -J${testcompileargs} + -Ach.powerunit.extensions.matchers.provideprocessor.ProvidesMatchersAnnotationsProcessor.factory=ch.powerunit.extensions.matchers.samples.AllMatchers + + + + + + + + + org.hamcrest + hamcrest-all + ${hamcrest.version} + + + ch.powerunit + powerunit + ${powerunit.version} + test + + + ch.powerunit.extensions + powerunit-extensions-matchers + @project.version@ + + + javax.annotation + javax.annotation-api + 1.3.2 + + + \ No newline at end of file diff --git a/src/it/provider-factory-enabled-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java b/src/it/provider-factory-enabled-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java new file mode 100644 index 000000000..6ace664ae --- /dev/null +++ b/src/it/provider-factory-enabled-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java @@ -0,0 +1,94 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Set; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * + */ +@ProvideMatchers +public class Pojo1 { + private String msg1; + + public String msg2; + + public int msg3; + + public String[] msg4; + + public int[] msg5; + + public List msg6; + + public List msg7; + + public List[] msg8; + + public Collection msg9; + + public Set msg12; + + public String getMsg1() { + return msg1; + } + + public void setMsg1(String msg1) { + this.msg1 = msg1; + } + + public boolean myBoolean; + + private boolean oneBoolean; + + public boolean isOneBoolean() { + return oneBoolean; + } + + public void setOneBoolean(boolean oneBoolean) { + this.oneBoolean = oneBoolean; + } + + public Pojo1() { + } + + public Pojo1(String msg1) { + this.msg1 = msg1; + } + + public Pojo1(List msg6) { + this.msg6 = msg6; + } + + @Override + public String toString() { + return "Pojo1 [msg1=" + msg1 + ", msg2=" + msg2 + ", msg3=" + msg3 + ", msg4=" + Arrays.toString(msg4) + + ", msg5=" + Arrays.toString(msg5) + ", msg6=" + msg6 + ", msg7=" + msg7 + ", msg8=" + + Arrays.toString(msg8) + ", msg9=" + msg9 + ", msg12=" + msg12 + ", myBoolean=" + myBoolean + + ", oneBoolean=" + oneBoolean + "]"; + } + +} diff --git a/src/it/provider-factory-enabled-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java b/src/it/provider-factory-enabled-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java new file mode 100644 index 000000000..27b042423 --- /dev/null +++ b/src/it/provider-factory-enabled-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java @@ -0,0 +1,156 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import static ch.powerunit.matchers.MatcherTester.matcher; +import static ch.powerunit.matchers.MatcherTester.value; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.hamcrest.Factory; +import org.hamcrest.Matcher; + +import ch.powerunit.Ignore; +import ch.powerunit.Test; +import ch.powerunit.TestDelegate; +import ch.powerunit.TestSuite; +import ch.powerunit.matchers.MatcherTester; + +public class Pojo1MatcherTest implements TestSuite { + + @TestDelegate + public final MatcherTester tester = testerOfMatcher(Pojo1Matchers.Pojo1MatcherImpl.class).with( + matcher((Pojo1Matchers.Pojo1MatcherImpl) Pojo1Matchers.pojo1With().msg1ContainsString("12")).describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.Pojo1 with\n[msg4 ANYTHING]\n[msg3 ANYTHING]\n[msg2 ANYTHING]\n[msg1 a string containing \"12\"]\n[msg8 ANYTHING]\n[msg7 ANYTHING]\n[msg6 ANYTHING]\n[msg12 ANYTHING]\n[msg5 ANYTHING]\n[oneBoolean ANYTHING]\n[myBoolean ANYTHING]\n[msg9 ANYTHING]\n") + .nullRejected("was null").accepting(new Pojo1("12"), new Pojo1("121")) + .rejecting(value("").withMessage("was \"\""), value(new Pojo1()).withMessage("[msg1 was null]\n"), + value(new Pojo1("11")).withMessage("[msg1 was \"11\"]\n")), + matcher((Pojo1Matchers.Pojo1MatcherImpl) Pojo1Matchers.pojo1With().msg6IsEmptyIterable()).describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.Pojo1 with\n[msg4 ANYTHING]\n[msg3 ANYTHING]\n[msg2 ANYTHING]\n[msg1 ANYTHING]\n[msg8 ANYTHING]\n[msg7 ANYTHING]\n[msg6 an empty iterable]\n[msg12 ANYTHING]\n[msg5 ANYTHING]\n[oneBoolean ANYTHING]\n[myBoolean ANYTHING]\n[msg9 ANYTHING]\n") + .nullRejected("was null").accepting(new Pojo1(Collections.emptyList())) + .rejecting(value(new Pojo1(Collections.singletonList("x"))).withMessage("[msg6 [\"x\"]]\n"))); + + @Test + public void testOKMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With()); + } + + @Test + public void testSameInstanceMatcher() { + Pojo1 p = new Pojo1(); + p.msg6 = new ArrayList<>(); + assertThat(p).is(Pojo1Matchers.pojo1With().msg6IsSameInstance(p.msg6)); + } + + @Test + public void testOKMatcherWithConvert() { + Pojo1 p = new Pojo1(); + p.msg2 = "12"; + assertThat(p).is(Pojo1Matchers.pojo1With().msg2As(s -> Integer.valueOf(s) + 1l, is(13l))); + } + + @Test + public void testOKMatcherWithLinkedMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With().andWith(notNullValue()).andWith(hasToString(notNullValue())) + .buildWith(anything())); + } + + @Test + public void testOKMatcherWithComparable() { + Pojo1 p = new Pojo1(); + p.msg2 = "12"; + assertThat(p).is(Pojo1Matchers.pojo1With().msg2ComparesEqualTo("12").build()); + } + + @Test + public void testKOMatcherWithReference() { + Pojo1 p1 = new Pojo1(); + p1.msg2 = "12"; + Pojo1 p2 = new Pojo1(); + p2.msg2 = "12"; + assertThat(p1).is(Pojo1Matchers.pojo1WithSameValue(p2)); + } + + @Test + public void testKOMatcherWithEmptyArray() { + Pojo1 p1 = new Pojo1(); + p1.msg8 = new List[] {}; + assertThat(p1).is(Pojo1Matchers.pojo1With().msg8IsEmpty()); + } + + @Test + @Ignore + public void testKOMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With().msg1("x")); + } + + @Factory + public static void test() { + } + + @Factory + public static void test(String name1) { + } + + @Factory + public static T test(T input) { + return input; + } + + @Factory + public static , K> void test1(T t1, K t2) { + } + + @Factory + public static & Serializable, K> void test2(T t1, K t2) { + } + + @Factory + public static & Serializable, K> void test3(T t1, K... t2) { + } + + @Factory + public static void test4(T t1) { + } + + @Factory + public static Matcher fromMatcher(Matcher input) { + return null; + } + + /** + * @param name1 + * @param name2 + */ + @Factory + public static void test(String name1, String name2) { + } + + @Factory + public static void test(int x) { + } +} diff --git a/src/it/provider-factory-enabled-it-jdk9+/verify.bsh b/src/it/provider-factory-enabled-it-jdk9+/verify.bsh new file mode 100644 index 000000000..fdcbd5b02 --- /dev/null +++ b/src/it/provider-factory-enabled-it-jdk9+/verify.bsh @@ -0,0 +1,13 @@ +import java.io.*; + +File file = new File( basedir, "build.log" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not build log: " + file ); +} + +file = new File( basedir, "target/generated-sources/annotations/ch/powerunit/extensions/matchers/samples/AllMatchers.java" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find file produced by Factory processor: " + file ); +} diff --git a/src/it/settings.xml b/src/it/settings.xml new file mode 100644 index 000000000..98a0b0f4a --- /dev/null +++ b/src/it/settings.xml @@ -0,0 +1,35 @@ + + + + + it-repo + + true + + + + local.central + @localRepositoryUrl@ + + true + + + true + + + + + + local.central + @localRepositoryUrl@ + + true + + + true + + + + + + \ No newline at end of file diff --git a/src/it/setup/params.properties b/src/it/setup/params.properties new file mode 100644 index 000000000..4b8953274 --- /dev/null +++ b/src/it/setup/params.properties @@ -0,0 +1 @@ +invoker.goals=clean install diff --git a/src/it/setup/pom.xml b/src/it/setup/pom.xml new file mode 100644 index 000000000..0e2dab3f2 --- /dev/null +++ b/src/it/setup/pom.xml @@ -0,0 +1,285 @@ + + 4.0.0 + ch.powerunit.extensions + powerunit-extensions-matchers-it0000 + @project.version@ + + jar + + + 1.8 + 1.8 + UTF-8 + 1.3 + 2.22.2 + 0.5.0 + + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.11.2 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.5 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.13.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-archetype-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + + ch.powerunit + powerunit + ${powerunit.version} + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.9.0 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.version} + + + com.github.github + site-maven-plugin + 0.12 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + org.codehaus.mojo + jaxb2-maven-plugin + 2.5.0 + + + org.apache.maven.plugins + maven-changes-plugin + 2.12.1 + + + GitHub + + + + + org.codehaus.mojo + sonar-maven-plugin + 3.7.0.1746 + + + maven-invoker-plugin + 3.2.1 + + + maven-assembly-plugin + 3.3.0 + + + org.codehaus.mojo + xml-maven-plugin + 1.0.2 + + + maven-deploy-plugin + 2.8.2 + + + maven-install-plugin + 2.5.2 + + + + + + org.jacoco + jacoco-maven-plugin + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + jar + test-jar + + + + + true + false + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.source.version} + ${java.target.version} + + + + + + + + org.hamcrest + hamcrest-all + ${hamcrest.version} + + + ch.powerunit + powerunit + ${powerunit.version} + test + + + com.google.code.bean-matchers + bean-matchers + 0.12 + test + true + + + org.exparity + hamcrest-date + 2.0.7 + test + true + + + com.nitorcreations + matchers + 1.3 + test + true + + + com.spotify + hamcrest-jackson + 1.1.5 + test + true + + + javax.annotation + javax.annotation-api + 1.3.2 + provided + true + + + javax.xml.bind + jaxb-api + 2.3.1 + + + com.sun.xml.bind + jaxb-impl + 2.3.3 + + + com.sun.xml.bind + jaxb-core + 2.3.0.1 + + + \ No newline at end of file diff --git a/src/it/setup/verify.bsh b/src/it/setup/verify.bsh new file mode 100644 index 000000000..9adc23f13 --- /dev/null +++ b/src/it/setup/verify.bsh @@ -0,0 +1,7 @@ +import java.io.*; + +File file = new File( basedir, "build.log" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not build log: " + file ); +} diff --git a/src/it/simple-it-jdk8-hamcrest21/params.properties b/src/it/simple-it-jdk8-hamcrest21/params.properties new file mode 100644 index 000000000..ab922d13c --- /dev/null +++ b/src/it/simple-it-jdk8-hamcrest21/params.properties @@ -0,0 +1,2 @@ +invoker.java.version=1.8,!9,!10,!11 +invoker.goals=clean install diff --git a/src/it/simple-it-jdk8-hamcrest21/pom.xml b/src/it/simple-it-jdk8-hamcrest21/pom.xml new file mode 100644 index 000000000..d7bbfbaa3 --- /dev/null +++ b/src/it/simple-it-jdk8-hamcrest21/pom.xml @@ -0,0 +1,278 @@ + + 4.0.0 + ch.powerunit.extensions + powerunit-extensions-matchers-it108 + @project.version@ + + jar + + + 1.8 + 1.8 + UTF-8 + 2.22.2 + 0.5.0 + + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.11.2 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.5 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.13.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-archetype-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + + ch.powerunit + powerunit + ${powerunit.version} + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.9.0 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.version} + + + com.github.github + site-maven-plugin + 0.12 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + org.codehaus.mojo + jaxb2-maven-plugin + 2.5.0 + + + org.apache.maven.plugins + maven-changes-plugin + 2.12.1 + + + GitHub + + + + + org.codehaus.mojo + sonar-maven-plugin + 3.7.0.1746 + + + maven-invoker-plugin + 3.2.1 + + + maven-assembly-plugin + 3.3.0 + + + org.codehaus.mojo + xml-maven-plugin + 1.0.2 + + + maven-deploy-plugin + 2.8.2 + + + maven-install-plugin + 2.5.2 + + + + + + org.jacoco + jacoco-maven-plugin + + + + ${project.build.directory} + + *.exec + + + + + + + default-prepare-agent-1 + + prepare-agent + + + + default-prepare-agent-2 + initialize + + prepare-agent-integration + + + testcompileargs + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + jar + test-jar + + + + + true + false + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.source.version} + ${java.target.version} + true + + -J${testcompileargs} + + + + + + + + + org.hamcrest + hamcrest + 2.1 + + + ch.powerunit + powerunit + ${powerunit.version} + test + + + org.hamcrest + hamcrest-all + + + + + ch.powerunit.extensions + powerunit-extensions-matchers + @project.version@ + + + \ No newline at end of file diff --git a/src/it/simple-it-jdk8-hamcrest21/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java b/src/it/simple-it-jdk8-hamcrest21/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java new file mode 100644 index 000000000..6ace664ae --- /dev/null +++ b/src/it/simple-it-jdk8-hamcrest21/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java @@ -0,0 +1,94 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Set; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * + */ +@ProvideMatchers +public class Pojo1 { + private String msg1; + + public String msg2; + + public int msg3; + + public String[] msg4; + + public int[] msg5; + + public List msg6; + + public List msg7; + + public List[] msg8; + + public Collection msg9; + + public Set msg12; + + public String getMsg1() { + return msg1; + } + + public void setMsg1(String msg1) { + this.msg1 = msg1; + } + + public boolean myBoolean; + + private boolean oneBoolean; + + public boolean isOneBoolean() { + return oneBoolean; + } + + public void setOneBoolean(boolean oneBoolean) { + this.oneBoolean = oneBoolean; + } + + public Pojo1() { + } + + public Pojo1(String msg1) { + this.msg1 = msg1; + } + + public Pojo1(List msg6) { + this.msg6 = msg6; + } + + @Override + public String toString() { + return "Pojo1 [msg1=" + msg1 + ", msg2=" + msg2 + ", msg3=" + msg3 + ", msg4=" + Arrays.toString(msg4) + + ", msg5=" + Arrays.toString(msg5) + ", msg6=" + msg6 + ", msg7=" + msg7 + ", msg8=" + + Arrays.toString(msg8) + ", msg9=" + msg9 + ", msg12=" + msg12 + ", myBoolean=" + myBoolean + + ", oneBoolean=" + oneBoolean + "]"; + } + +} diff --git a/src/it/simple-it-jdk8-hamcrest21/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java b/src/it/simple-it-jdk8-hamcrest21/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java new file mode 100644 index 000000000..567df64f2 --- /dev/null +++ b/src/it/simple-it-jdk8-hamcrest21/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java @@ -0,0 +1,156 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import static ch.powerunit.matchers.MatcherTester.matcher; +import static ch.powerunit.matchers.MatcherTester.value; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.hamcrest.Factory; +import org.hamcrest.Matcher; + +import ch.powerunit.Ignore; +import ch.powerunit.Test; +import ch.powerunit.TestDelegate; +import ch.powerunit.TestSuite; +import ch.powerunit.matchers.MatcherTester; + +public class Pojo1MatcherTest implements TestSuite { + + @TestDelegate + public final MatcherTester tester = testerOfMatcher(Pojo1Matchers.Pojo1MatcherImpl.class).with( + matcher((Pojo1Matchers.Pojo1MatcherImpl) Pojo1Matchers.pojo1With().msg1ContainsString("12")).describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.Pojo1 with\n[msg4 ANYTHING]\n[msg3 ANYTHING]\n[msg2 ANYTHING]\n[msg1 a string containing \"12\"]\n[msg8 ANYTHING]\n[msg7 ANYTHING]\n[msg6 ANYTHING]\n[msg12 ANYTHING]\n[msg5 ANYTHING]\n[oneBoolean ANYTHING]\n[myBoolean ANYTHING]\n[msg9 ANYTHING]\n") + .nullRejected("was null").accepting(new Pojo1("12"), new Pojo1("121")) + .rejecting(value("").withMessage("was String \"\""), value(new Pojo1()).withMessage("[msg1 was null]\n"), + value(new Pojo1("11")).withMessage("[msg1 was \"11\"]\n")), + matcher((Pojo1Matchers.Pojo1MatcherImpl) Pojo1Matchers.pojo1With().msg6IsEmptyIterable()).describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.Pojo1 with\n[msg4 ANYTHING]\n[msg3 ANYTHING]\n[msg2 ANYTHING]\n[msg1 ANYTHING]\n[msg8 ANYTHING]\n[msg7 ANYTHING]\n[msg6 an empty iterable]\n[msg12 ANYTHING]\n[msg5 ANYTHING]\n[oneBoolean ANYTHING]\n[myBoolean ANYTHING]\n[msg9 ANYTHING]\n") + .nullRejected("was null").accepting(new Pojo1(Collections.emptyList())) + .rejecting(value(new Pojo1(Collections.singletonList("x"))).withMessage("[msg6 [\"x\"]]\n"))); + + @Test + public void testOKMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With()); + } + + @Test + public void testSameInstanceMatcher() { + Pojo1 p = new Pojo1(); + p.msg6 = new ArrayList<>(); + assertThat(p).is(Pojo1Matchers.pojo1With().msg6IsSameInstance(p.msg6)); + } + + @Test + public void testOKMatcherWithConvert() { + Pojo1 p = new Pojo1(); + p.msg2 = "12"; + assertThat(p).is(Pojo1Matchers.pojo1With().msg2As(s -> Integer.valueOf(s) + 1l, is(13l))); + } + + @Test + public void testOKMatcherWithLinkedMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With().andWith(notNullValue()).andWith(hasToString(notNullValue())) + .buildWith(anything())); + } + + @Test + public void testOKMatcherWithComparable() { + Pojo1 p = new Pojo1(); + p.msg2 = "12"; + assertThat(p).is(Pojo1Matchers.pojo1With().msg2ComparesEqualTo("12").build()); + } + + @Test + public void testKOMatcherWithReference() { + Pojo1 p1 = new Pojo1(); + p1.msg2 = "12"; + Pojo1 p2 = new Pojo1(); + p2.msg2 = "12"; + assertThat(p1).is(Pojo1Matchers.pojo1WithSameValue(p2)); + } + + @Test + public void testKOMatcherWithEmptyArray() { + Pojo1 p1 = new Pojo1(); + p1.msg8 = new List[] {}; + assertThat(p1).is(Pojo1Matchers.pojo1With().msg8IsEmpty()); + } + + @Test + @Ignore + public void testKOMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With().msg1("x")); + } + + @Factory + public static void test() { + } + + @Factory + public static void test(String name1) { + } + + @Factory + public static T test(T input) { + return input; + } + + @Factory + public static , K> void test1(T t1, K t2) { + } + + @Factory + public static & Serializable, K> void test2(T t1, K t2) { + } + + @Factory + public static & Serializable, K> void test3(T t1, K... t2) { + } + + @Factory + public static void test4(T t1) { + } + + @Factory + public static Matcher fromMatcher(Matcher input) { + return null; + } + + /** + * @param name1 + * @param name2 + */ + @Factory + public static void test(String name1, String name2) { + } + + @Factory + public static void test(int x) { + } +} diff --git a/src/it/simple-it-jdk8-hamcrest21/verify.bsh b/src/it/simple-it-jdk8-hamcrest21/verify.bsh new file mode 100644 index 000000000..9adc23f13 --- /dev/null +++ b/src/it/simple-it-jdk8-hamcrest21/verify.bsh @@ -0,0 +1,7 @@ +import java.io.*; + +File file = new File( basedir, "build.log" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not build log: " + file ); +} diff --git a/src/it/simple-it-jdk8-hamcrest22/params.properties b/src/it/simple-it-jdk8-hamcrest22/params.properties new file mode 100644 index 000000000..ab922d13c --- /dev/null +++ b/src/it/simple-it-jdk8-hamcrest22/params.properties @@ -0,0 +1,2 @@ +invoker.java.version=1.8,!9,!10,!11 +invoker.goals=clean install diff --git a/src/it/simple-it-jdk8-hamcrest22/pom.xml b/src/it/simple-it-jdk8-hamcrest22/pom.xml new file mode 100644 index 000000000..1b73e2ff0 --- /dev/null +++ b/src/it/simple-it-jdk8-hamcrest22/pom.xml @@ -0,0 +1,278 @@ + + 4.0.0 + ch.powerunit.extensions + powerunit-extensions-matchers-it208 + @project.version@ + + jar + + + 1.8 + 1.8 + UTF-8 + 2.22.2 + 0.5.0 + + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.11.2 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.5 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.13.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-archetype-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + + ch.powerunit + powerunit + ${powerunit.version} + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.9.0 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.version} + + + com.github.github + site-maven-plugin + 0.12 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + org.codehaus.mojo + jaxb2-maven-plugin + 2.5.0 + + + org.apache.maven.plugins + maven-changes-plugin + 2.12.1 + + + GitHub + + + + + org.codehaus.mojo + sonar-maven-plugin + 3.7.0.1746 + + + maven-invoker-plugin + 3.2.1 + + + maven-assembly-plugin + 3.3.0 + + + org.codehaus.mojo + xml-maven-plugin + 1.0.2 + + + maven-deploy-plugin + 2.8.2 + + + maven-install-plugin + 2.5.2 + + + + + + org.jacoco + jacoco-maven-plugin + + + + ${project.build.directory} + + *.exec + + + + + + + default-prepare-agent-1 + + prepare-agent + + + + default-prepare-agent-2 + initialize + + prepare-agent-integration + + + testcompileargs + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + jar + test-jar + + + + + true + false + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.source.version} + ${java.target.version} + true + + -J${testcompileargs} + + + + + + + + + org.hamcrest + hamcrest + 2.2 + + + ch.powerunit + powerunit + ${powerunit.version} + test + + + org.hamcrest + hamcrest-all + + + + + ch.powerunit.extensions + powerunit-extensions-matchers + @project.version@ + + + \ No newline at end of file diff --git a/src/it/simple-it-jdk8-hamcrest22/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java b/src/it/simple-it-jdk8-hamcrest22/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java new file mode 100644 index 000000000..6ace664ae --- /dev/null +++ b/src/it/simple-it-jdk8-hamcrest22/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java @@ -0,0 +1,94 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Set; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * + */ +@ProvideMatchers +public class Pojo1 { + private String msg1; + + public String msg2; + + public int msg3; + + public String[] msg4; + + public int[] msg5; + + public List msg6; + + public List msg7; + + public List[] msg8; + + public Collection msg9; + + public Set msg12; + + public String getMsg1() { + return msg1; + } + + public void setMsg1(String msg1) { + this.msg1 = msg1; + } + + public boolean myBoolean; + + private boolean oneBoolean; + + public boolean isOneBoolean() { + return oneBoolean; + } + + public void setOneBoolean(boolean oneBoolean) { + this.oneBoolean = oneBoolean; + } + + public Pojo1() { + } + + public Pojo1(String msg1) { + this.msg1 = msg1; + } + + public Pojo1(List msg6) { + this.msg6 = msg6; + } + + @Override + public String toString() { + return "Pojo1 [msg1=" + msg1 + ", msg2=" + msg2 + ", msg3=" + msg3 + ", msg4=" + Arrays.toString(msg4) + + ", msg5=" + Arrays.toString(msg5) + ", msg6=" + msg6 + ", msg7=" + msg7 + ", msg8=" + + Arrays.toString(msg8) + ", msg9=" + msg9 + ", msg12=" + msg12 + ", myBoolean=" + myBoolean + + ", oneBoolean=" + oneBoolean + "]"; + } + +} diff --git a/src/it/simple-it-jdk8-hamcrest22/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java b/src/it/simple-it-jdk8-hamcrest22/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java new file mode 100644 index 000000000..567df64f2 --- /dev/null +++ b/src/it/simple-it-jdk8-hamcrest22/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java @@ -0,0 +1,156 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import static ch.powerunit.matchers.MatcherTester.matcher; +import static ch.powerunit.matchers.MatcherTester.value; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.hamcrest.Factory; +import org.hamcrest.Matcher; + +import ch.powerunit.Ignore; +import ch.powerunit.Test; +import ch.powerunit.TestDelegate; +import ch.powerunit.TestSuite; +import ch.powerunit.matchers.MatcherTester; + +public class Pojo1MatcherTest implements TestSuite { + + @TestDelegate + public final MatcherTester tester = testerOfMatcher(Pojo1Matchers.Pojo1MatcherImpl.class).with( + matcher((Pojo1Matchers.Pojo1MatcherImpl) Pojo1Matchers.pojo1With().msg1ContainsString("12")).describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.Pojo1 with\n[msg4 ANYTHING]\n[msg3 ANYTHING]\n[msg2 ANYTHING]\n[msg1 a string containing \"12\"]\n[msg8 ANYTHING]\n[msg7 ANYTHING]\n[msg6 ANYTHING]\n[msg12 ANYTHING]\n[msg5 ANYTHING]\n[oneBoolean ANYTHING]\n[myBoolean ANYTHING]\n[msg9 ANYTHING]\n") + .nullRejected("was null").accepting(new Pojo1("12"), new Pojo1("121")) + .rejecting(value("").withMessage("was String \"\""), value(new Pojo1()).withMessage("[msg1 was null]\n"), + value(new Pojo1("11")).withMessage("[msg1 was \"11\"]\n")), + matcher((Pojo1Matchers.Pojo1MatcherImpl) Pojo1Matchers.pojo1With().msg6IsEmptyIterable()).describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.Pojo1 with\n[msg4 ANYTHING]\n[msg3 ANYTHING]\n[msg2 ANYTHING]\n[msg1 ANYTHING]\n[msg8 ANYTHING]\n[msg7 ANYTHING]\n[msg6 an empty iterable]\n[msg12 ANYTHING]\n[msg5 ANYTHING]\n[oneBoolean ANYTHING]\n[myBoolean ANYTHING]\n[msg9 ANYTHING]\n") + .nullRejected("was null").accepting(new Pojo1(Collections.emptyList())) + .rejecting(value(new Pojo1(Collections.singletonList("x"))).withMessage("[msg6 [\"x\"]]\n"))); + + @Test + public void testOKMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With()); + } + + @Test + public void testSameInstanceMatcher() { + Pojo1 p = new Pojo1(); + p.msg6 = new ArrayList<>(); + assertThat(p).is(Pojo1Matchers.pojo1With().msg6IsSameInstance(p.msg6)); + } + + @Test + public void testOKMatcherWithConvert() { + Pojo1 p = new Pojo1(); + p.msg2 = "12"; + assertThat(p).is(Pojo1Matchers.pojo1With().msg2As(s -> Integer.valueOf(s) + 1l, is(13l))); + } + + @Test + public void testOKMatcherWithLinkedMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With().andWith(notNullValue()).andWith(hasToString(notNullValue())) + .buildWith(anything())); + } + + @Test + public void testOKMatcherWithComparable() { + Pojo1 p = new Pojo1(); + p.msg2 = "12"; + assertThat(p).is(Pojo1Matchers.pojo1With().msg2ComparesEqualTo("12").build()); + } + + @Test + public void testKOMatcherWithReference() { + Pojo1 p1 = new Pojo1(); + p1.msg2 = "12"; + Pojo1 p2 = new Pojo1(); + p2.msg2 = "12"; + assertThat(p1).is(Pojo1Matchers.pojo1WithSameValue(p2)); + } + + @Test + public void testKOMatcherWithEmptyArray() { + Pojo1 p1 = new Pojo1(); + p1.msg8 = new List[] {}; + assertThat(p1).is(Pojo1Matchers.pojo1With().msg8IsEmpty()); + } + + @Test + @Ignore + public void testKOMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With().msg1("x")); + } + + @Factory + public static void test() { + } + + @Factory + public static void test(String name1) { + } + + @Factory + public static T test(T input) { + return input; + } + + @Factory + public static , K> void test1(T t1, K t2) { + } + + @Factory + public static & Serializable, K> void test2(T t1, K t2) { + } + + @Factory + public static & Serializable, K> void test3(T t1, K... t2) { + } + + @Factory + public static void test4(T t1) { + } + + @Factory + public static Matcher fromMatcher(Matcher input) { + return null; + } + + /** + * @param name1 + * @param name2 + */ + @Factory + public static void test(String name1, String name2) { + } + + @Factory + public static void test(int x) { + } +} diff --git a/src/it/simple-it-jdk8-hamcrest22/verify.bsh b/src/it/simple-it-jdk8-hamcrest22/verify.bsh new file mode 100644 index 000000000..9adc23f13 --- /dev/null +++ b/src/it/simple-it-jdk8-hamcrest22/verify.bsh @@ -0,0 +1,7 @@ +import java.io.*; + +File file = new File( basedir, "build.log" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not build log: " + file ); +} diff --git a/src/it/simple-it-jdk8-missinghamcrest/params.properties b/src/it/simple-it-jdk8-missinghamcrest/params.properties new file mode 100644 index 000000000..1a20829cb --- /dev/null +++ b/src/it/simple-it-jdk8-missinghamcrest/params.properties @@ -0,0 +1,3 @@ +invoker.java.version=1.8,!9,!10,!11 +invoker.goals=clean install +invoker.buildResult = failure \ No newline at end of file diff --git a/src/it/simple-it-jdk8-missinghamcrest/pom.xml b/src/it/simple-it-jdk8-missinghamcrest/pom.xml new file mode 100644 index 000000000..f9926625b --- /dev/null +++ b/src/it/simple-it-jdk8-missinghamcrest/pom.xml @@ -0,0 +1,267 @@ + + 4.0.0 + ch.powerunit.extensions + powerunit-extensions-matchers-it108 + @project.version@ + + jar + + + 1.8 + 1.8 + UTF-8 + 1.3 + 2.22.2 + 0.5.0 + + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.11.2 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.5 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.13.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-archetype-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + + ch.powerunit + powerunit + ${powerunit.version} + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.9.0 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.version} + + + com.github.github + site-maven-plugin + 0.12 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + org.codehaus.mojo + jaxb2-maven-plugin + 2.5.0 + + + org.apache.maven.plugins + maven-changes-plugin + 2.12.1 + + + GitHub + + + + + org.codehaus.mojo + sonar-maven-plugin + 3.7.0.1746 + + + maven-invoker-plugin + 3.2.1 + + + maven-assembly-plugin + 3.3.0 + + + org.codehaus.mojo + xml-maven-plugin + 1.0.2 + + + maven-deploy-plugin + 2.8.2 + + + maven-install-plugin + 2.5.2 + + + + + + org.jacoco + jacoco-maven-plugin + + + + ${project.build.directory} + + *.exec + + + + + + + default-prepare-agent-1 + + prepare-agent + + + + default-prepare-agent-2 + initialize + + prepare-agent-integration + + + testcompileargs + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + jar + test-jar + + + + + true + false + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.source.version} + ${java.target.version} + true + + -J${testcompileargs} + + + + + + + + + ch.powerunit + powerunit + ${powerunit.version} + test + + + ch.powerunit.extensions + powerunit-extensions-matchers + @project.version@ + + + \ No newline at end of file diff --git a/src/it/simple-it-jdk8-missinghamcrest/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java b/src/it/simple-it-jdk8-missinghamcrest/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java new file mode 100644 index 000000000..6ace664ae --- /dev/null +++ b/src/it/simple-it-jdk8-missinghamcrest/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java @@ -0,0 +1,94 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Set; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * + */ +@ProvideMatchers +public class Pojo1 { + private String msg1; + + public String msg2; + + public int msg3; + + public String[] msg4; + + public int[] msg5; + + public List msg6; + + public List msg7; + + public List[] msg8; + + public Collection msg9; + + public Set msg12; + + public String getMsg1() { + return msg1; + } + + public void setMsg1(String msg1) { + this.msg1 = msg1; + } + + public boolean myBoolean; + + private boolean oneBoolean; + + public boolean isOneBoolean() { + return oneBoolean; + } + + public void setOneBoolean(boolean oneBoolean) { + this.oneBoolean = oneBoolean; + } + + public Pojo1() { + } + + public Pojo1(String msg1) { + this.msg1 = msg1; + } + + public Pojo1(List msg6) { + this.msg6 = msg6; + } + + @Override + public String toString() { + return "Pojo1 [msg1=" + msg1 + ", msg2=" + msg2 + ", msg3=" + msg3 + ", msg4=" + Arrays.toString(msg4) + + ", msg5=" + Arrays.toString(msg5) + ", msg6=" + msg6 + ", msg7=" + msg7 + ", msg8=" + + Arrays.toString(msg8) + ", msg9=" + msg9 + ", msg12=" + msg12 + ", myBoolean=" + myBoolean + + ", oneBoolean=" + oneBoolean + "]"; + } + +} diff --git a/src/it/simple-it-jdk8-missinghamcrest/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java b/src/it/simple-it-jdk8-missinghamcrest/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java new file mode 100644 index 000000000..27b042423 --- /dev/null +++ b/src/it/simple-it-jdk8-missinghamcrest/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java @@ -0,0 +1,156 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import static ch.powerunit.matchers.MatcherTester.matcher; +import static ch.powerunit.matchers.MatcherTester.value; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.hamcrest.Factory; +import org.hamcrest.Matcher; + +import ch.powerunit.Ignore; +import ch.powerunit.Test; +import ch.powerunit.TestDelegate; +import ch.powerunit.TestSuite; +import ch.powerunit.matchers.MatcherTester; + +public class Pojo1MatcherTest implements TestSuite { + + @TestDelegate + public final MatcherTester tester = testerOfMatcher(Pojo1Matchers.Pojo1MatcherImpl.class).with( + matcher((Pojo1Matchers.Pojo1MatcherImpl) Pojo1Matchers.pojo1With().msg1ContainsString("12")).describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.Pojo1 with\n[msg4 ANYTHING]\n[msg3 ANYTHING]\n[msg2 ANYTHING]\n[msg1 a string containing \"12\"]\n[msg8 ANYTHING]\n[msg7 ANYTHING]\n[msg6 ANYTHING]\n[msg12 ANYTHING]\n[msg5 ANYTHING]\n[oneBoolean ANYTHING]\n[myBoolean ANYTHING]\n[msg9 ANYTHING]\n") + .nullRejected("was null").accepting(new Pojo1("12"), new Pojo1("121")) + .rejecting(value("").withMessage("was \"\""), value(new Pojo1()).withMessage("[msg1 was null]\n"), + value(new Pojo1("11")).withMessage("[msg1 was \"11\"]\n")), + matcher((Pojo1Matchers.Pojo1MatcherImpl) Pojo1Matchers.pojo1With().msg6IsEmptyIterable()).describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.Pojo1 with\n[msg4 ANYTHING]\n[msg3 ANYTHING]\n[msg2 ANYTHING]\n[msg1 ANYTHING]\n[msg8 ANYTHING]\n[msg7 ANYTHING]\n[msg6 an empty iterable]\n[msg12 ANYTHING]\n[msg5 ANYTHING]\n[oneBoolean ANYTHING]\n[myBoolean ANYTHING]\n[msg9 ANYTHING]\n") + .nullRejected("was null").accepting(new Pojo1(Collections.emptyList())) + .rejecting(value(new Pojo1(Collections.singletonList("x"))).withMessage("[msg6 [\"x\"]]\n"))); + + @Test + public void testOKMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With()); + } + + @Test + public void testSameInstanceMatcher() { + Pojo1 p = new Pojo1(); + p.msg6 = new ArrayList<>(); + assertThat(p).is(Pojo1Matchers.pojo1With().msg6IsSameInstance(p.msg6)); + } + + @Test + public void testOKMatcherWithConvert() { + Pojo1 p = new Pojo1(); + p.msg2 = "12"; + assertThat(p).is(Pojo1Matchers.pojo1With().msg2As(s -> Integer.valueOf(s) + 1l, is(13l))); + } + + @Test + public void testOKMatcherWithLinkedMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With().andWith(notNullValue()).andWith(hasToString(notNullValue())) + .buildWith(anything())); + } + + @Test + public void testOKMatcherWithComparable() { + Pojo1 p = new Pojo1(); + p.msg2 = "12"; + assertThat(p).is(Pojo1Matchers.pojo1With().msg2ComparesEqualTo("12").build()); + } + + @Test + public void testKOMatcherWithReference() { + Pojo1 p1 = new Pojo1(); + p1.msg2 = "12"; + Pojo1 p2 = new Pojo1(); + p2.msg2 = "12"; + assertThat(p1).is(Pojo1Matchers.pojo1WithSameValue(p2)); + } + + @Test + public void testKOMatcherWithEmptyArray() { + Pojo1 p1 = new Pojo1(); + p1.msg8 = new List[] {}; + assertThat(p1).is(Pojo1Matchers.pojo1With().msg8IsEmpty()); + } + + @Test + @Ignore + public void testKOMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With().msg1("x")); + } + + @Factory + public static void test() { + } + + @Factory + public static void test(String name1) { + } + + @Factory + public static T test(T input) { + return input; + } + + @Factory + public static , K> void test1(T t1, K t2) { + } + + @Factory + public static & Serializable, K> void test2(T t1, K t2) { + } + + @Factory + public static & Serializable, K> void test3(T t1, K... t2) { + } + + @Factory + public static void test4(T t1) { + } + + @Factory + public static Matcher fromMatcher(Matcher input) { + return null; + } + + /** + * @param name1 + * @param name2 + */ + @Factory + public static void test(String name1, String name2) { + } + + @Factory + public static void test(int x) { + } +} diff --git a/src/it/simple-it-jdk8-missinghamcrest/verify.bsh b/src/it/simple-it-jdk8-missinghamcrest/verify.bsh new file mode 100644 index 000000000..9adc23f13 --- /dev/null +++ b/src/it/simple-it-jdk8-missinghamcrest/verify.bsh @@ -0,0 +1,7 @@ +import java.io.*; + +File file = new File( basedir, "build.log" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not build log: " + file ); +} diff --git a/src/it/simple-it-jdk8/params.properties b/src/it/simple-it-jdk8/params.properties new file mode 100644 index 000000000..ab922d13c --- /dev/null +++ b/src/it/simple-it-jdk8/params.properties @@ -0,0 +1,2 @@ +invoker.java.version=1.8,!9,!10,!11 +invoker.goals=clean install diff --git a/src/it/simple-it-jdk8/pom.xml b/src/it/simple-it-jdk8/pom.xml new file mode 100644 index 000000000..9a7113366 --- /dev/null +++ b/src/it/simple-it-jdk8/pom.xml @@ -0,0 +1,272 @@ + + 4.0.0 + ch.powerunit.extensions + powerunit-extensions-matchers-it8 + @project.version@ + + jar + + + 1.8 + 1.8 + UTF-8 + 1.3 + 2.22.2 + 0.5.0 + + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.11.2 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.5 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.13.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-archetype-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + + ch.powerunit + powerunit + ${powerunit.version} + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.9.0 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.version} + + + com.github.github + site-maven-plugin + 0.12 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + org.codehaus.mojo + jaxb2-maven-plugin + 2.5.0 + + + org.apache.maven.plugins + maven-changes-plugin + 2.12.1 + + + GitHub + + + + + org.codehaus.mojo + sonar-maven-plugin + 3.7.0.1746 + + + maven-invoker-plugin + 3.2.1 + + + maven-assembly-plugin + 3.3.0 + + + org.codehaus.mojo + xml-maven-plugin + 1.0.2 + + + maven-deploy-plugin + 2.8.2 + + + maven-install-plugin + 2.5.2 + + + + + + org.jacoco + jacoco-maven-plugin + + + + ${project.build.directory} + + *.exec + + + + + + + default-prepare-agent-1 + + prepare-agent + + + + default-prepare-agent-2 + initialize + + prepare-agent-integration + + + testcompileargs + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + jar + test-jar + + + + + true + false + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.source.version} + ${java.target.version} + true + + -J${testcompileargs} + + + + + + + + + org.hamcrest + hamcrest-all + ${hamcrest.version} + + + ch.powerunit + powerunit + ${powerunit.version} + test + + + ch.powerunit.extensions + powerunit-extensions-matchers + @project.version@ + + + \ No newline at end of file diff --git a/src/it/simple-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java b/src/it/simple-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java new file mode 100644 index 000000000..6ace664ae --- /dev/null +++ b/src/it/simple-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java @@ -0,0 +1,94 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Set; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * + */ +@ProvideMatchers +public class Pojo1 { + private String msg1; + + public String msg2; + + public int msg3; + + public String[] msg4; + + public int[] msg5; + + public List msg6; + + public List msg7; + + public List[] msg8; + + public Collection msg9; + + public Set msg12; + + public String getMsg1() { + return msg1; + } + + public void setMsg1(String msg1) { + this.msg1 = msg1; + } + + public boolean myBoolean; + + private boolean oneBoolean; + + public boolean isOneBoolean() { + return oneBoolean; + } + + public void setOneBoolean(boolean oneBoolean) { + this.oneBoolean = oneBoolean; + } + + public Pojo1() { + } + + public Pojo1(String msg1) { + this.msg1 = msg1; + } + + public Pojo1(List msg6) { + this.msg6 = msg6; + } + + @Override + public String toString() { + return "Pojo1 [msg1=" + msg1 + ", msg2=" + msg2 + ", msg3=" + msg3 + ", msg4=" + Arrays.toString(msg4) + + ", msg5=" + Arrays.toString(msg5) + ", msg6=" + msg6 + ", msg7=" + msg7 + ", msg8=" + + Arrays.toString(msg8) + ", msg9=" + msg9 + ", msg12=" + msg12 + ", myBoolean=" + myBoolean + + ", oneBoolean=" + oneBoolean + "]"; + } + +} diff --git a/src/it/simple-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java b/src/it/simple-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java new file mode 100644 index 000000000..27b042423 --- /dev/null +++ b/src/it/simple-it-jdk8/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java @@ -0,0 +1,156 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import static ch.powerunit.matchers.MatcherTester.matcher; +import static ch.powerunit.matchers.MatcherTester.value; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.hamcrest.Factory; +import org.hamcrest.Matcher; + +import ch.powerunit.Ignore; +import ch.powerunit.Test; +import ch.powerunit.TestDelegate; +import ch.powerunit.TestSuite; +import ch.powerunit.matchers.MatcherTester; + +public class Pojo1MatcherTest implements TestSuite { + + @TestDelegate + public final MatcherTester tester = testerOfMatcher(Pojo1Matchers.Pojo1MatcherImpl.class).with( + matcher((Pojo1Matchers.Pojo1MatcherImpl) Pojo1Matchers.pojo1With().msg1ContainsString("12")).describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.Pojo1 with\n[msg4 ANYTHING]\n[msg3 ANYTHING]\n[msg2 ANYTHING]\n[msg1 a string containing \"12\"]\n[msg8 ANYTHING]\n[msg7 ANYTHING]\n[msg6 ANYTHING]\n[msg12 ANYTHING]\n[msg5 ANYTHING]\n[oneBoolean ANYTHING]\n[myBoolean ANYTHING]\n[msg9 ANYTHING]\n") + .nullRejected("was null").accepting(new Pojo1("12"), new Pojo1("121")) + .rejecting(value("").withMessage("was \"\""), value(new Pojo1()).withMessage("[msg1 was null]\n"), + value(new Pojo1("11")).withMessage("[msg1 was \"11\"]\n")), + matcher((Pojo1Matchers.Pojo1MatcherImpl) Pojo1Matchers.pojo1With().msg6IsEmptyIterable()).describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.Pojo1 with\n[msg4 ANYTHING]\n[msg3 ANYTHING]\n[msg2 ANYTHING]\n[msg1 ANYTHING]\n[msg8 ANYTHING]\n[msg7 ANYTHING]\n[msg6 an empty iterable]\n[msg12 ANYTHING]\n[msg5 ANYTHING]\n[oneBoolean ANYTHING]\n[myBoolean ANYTHING]\n[msg9 ANYTHING]\n") + .nullRejected("was null").accepting(new Pojo1(Collections.emptyList())) + .rejecting(value(new Pojo1(Collections.singletonList("x"))).withMessage("[msg6 [\"x\"]]\n"))); + + @Test + public void testOKMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With()); + } + + @Test + public void testSameInstanceMatcher() { + Pojo1 p = new Pojo1(); + p.msg6 = new ArrayList<>(); + assertThat(p).is(Pojo1Matchers.pojo1With().msg6IsSameInstance(p.msg6)); + } + + @Test + public void testOKMatcherWithConvert() { + Pojo1 p = new Pojo1(); + p.msg2 = "12"; + assertThat(p).is(Pojo1Matchers.pojo1With().msg2As(s -> Integer.valueOf(s) + 1l, is(13l))); + } + + @Test + public void testOKMatcherWithLinkedMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With().andWith(notNullValue()).andWith(hasToString(notNullValue())) + .buildWith(anything())); + } + + @Test + public void testOKMatcherWithComparable() { + Pojo1 p = new Pojo1(); + p.msg2 = "12"; + assertThat(p).is(Pojo1Matchers.pojo1With().msg2ComparesEqualTo("12").build()); + } + + @Test + public void testKOMatcherWithReference() { + Pojo1 p1 = new Pojo1(); + p1.msg2 = "12"; + Pojo1 p2 = new Pojo1(); + p2.msg2 = "12"; + assertThat(p1).is(Pojo1Matchers.pojo1WithSameValue(p2)); + } + + @Test + public void testKOMatcherWithEmptyArray() { + Pojo1 p1 = new Pojo1(); + p1.msg8 = new List[] {}; + assertThat(p1).is(Pojo1Matchers.pojo1With().msg8IsEmpty()); + } + + @Test + @Ignore + public void testKOMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With().msg1("x")); + } + + @Factory + public static void test() { + } + + @Factory + public static void test(String name1) { + } + + @Factory + public static T test(T input) { + return input; + } + + @Factory + public static , K> void test1(T t1, K t2) { + } + + @Factory + public static & Serializable, K> void test2(T t1, K t2) { + } + + @Factory + public static & Serializable, K> void test3(T t1, K... t2) { + } + + @Factory + public static void test4(T t1) { + } + + @Factory + public static Matcher fromMatcher(Matcher input) { + return null; + } + + /** + * @param name1 + * @param name2 + */ + @Factory + public static void test(String name1, String name2) { + } + + @Factory + public static void test(int x) { + } +} diff --git a/src/it/simple-it-jdk8/verify.bsh b/src/it/simple-it-jdk8/verify.bsh new file mode 100644 index 000000000..9adc23f13 --- /dev/null +++ b/src/it/simple-it-jdk8/verify.bsh @@ -0,0 +1,7 @@ +import java.io.*; + +File file = new File( basedir, "build.log" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not build log: " + file ); +} diff --git a/src/it/simple-it-jdk9+-hamcrest21/params.properties b/src/it/simple-it-jdk9+-hamcrest21/params.properties new file mode 100644 index 000000000..714c1431d --- /dev/null +++ b/src/it/simple-it-jdk9+-hamcrest21/params.properties @@ -0,0 +1,2 @@ +invoker.java.version=!1.8,9,10,11+ +invoker.goals=clean install diff --git a/src/it/simple-it-jdk9+-hamcrest21/pom.xml b/src/it/simple-it-jdk9+-hamcrest21/pom.xml new file mode 100644 index 000000000..fa8c07ca2 --- /dev/null +++ b/src/it/simple-it-jdk9+-hamcrest21/pom.xml @@ -0,0 +1,283 @@ + + 4.0.0 + ch.powerunit.extensions + powerunit-extensions-matchers-it107 + @project.version@ + + jar + + + 1.8 + 1.8 + UTF-8 + 2.22.2 + 0.5.0 + + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.11.2 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.5 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.13.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-archetype-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + + ch.powerunit + powerunit + ${powerunit.version} + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.9.0 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.version} + + + com.github.github + site-maven-plugin + 0.12 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + org.codehaus.mojo + jaxb2-maven-plugin + 2.5.0 + + + org.apache.maven.plugins + maven-changes-plugin + 2.12.1 + + + GitHub + + + + + org.codehaus.mojo + sonar-maven-plugin + 3.7.0.1746 + + + maven-invoker-plugin + 3.2.1 + + + maven-assembly-plugin + 3.3.0 + + + org.codehaus.mojo + xml-maven-plugin + 1.0.2 + + + maven-deploy-plugin + 2.8.2 + + + maven-install-plugin + 2.5.2 + + + + + + org.jacoco + jacoco-maven-plugin + + + + ${project.build.directory} + + *.exec + + + + + + + default-prepare-agent-1 + + prepare-agent + + + + default-prepare-agent-2 + initialize + + prepare-agent-integration + + + testcompileargs + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + jar + test-jar + + + + + true + false + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.source.version} + ${java.target.version} + true + + -J${testcompileargs} + + + + + + + + + org.hamcrest + hamcrest + 2.1 + + + ch.powerunit + powerunit + ${powerunit.version} + test + + + org.hamcrest + hamcrest-all + + + + + ch.powerunit.extensions + powerunit-extensions-matchers + @project.version@ + + + javax.annotation + javax.annotation-api + 1.3.2 + + + \ No newline at end of file diff --git a/src/it/simple-it-jdk9+-hamcrest21/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java b/src/it/simple-it-jdk9+-hamcrest21/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java new file mode 100644 index 000000000..6ace664ae --- /dev/null +++ b/src/it/simple-it-jdk9+-hamcrest21/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java @@ -0,0 +1,94 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Set; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * + */ +@ProvideMatchers +public class Pojo1 { + private String msg1; + + public String msg2; + + public int msg3; + + public String[] msg4; + + public int[] msg5; + + public List msg6; + + public List msg7; + + public List[] msg8; + + public Collection msg9; + + public Set msg12; + + public String getMsg1() { + return msg1; + } + + public void setMsg1(String msg1) { + this.msg1 = msg1; + } + + public boolean myBoolean; + + private boolean oneBoolean; + + public boolean isOneBoolean() { + return oneBoolean; + } + + public void setOneBoolean(boolean oneBoolean) { + this.oneBoolean = oneBoolean; + } + + public Pojo1() { + } + + public Pojo1(String msg1) { + this.msg1 = msg1; + } + + public Pojo1(List msg6) { + this.msg6 = msg6; + } + + @Override + public String toString() { + return "Pojo1 [msg1=" + msg1 + ", msg2=" + msg2 + ", msg3=" + msg3 + ", msg4=" + Arrays.toString(msg4) + + ", msg5=" + Arrays.toString(msg5) + ", msg6=" + msg6 + ", msg7=" + msg7 + ", msg8=" + + Arrays.toString(msg8) + ", msg9=" + msg9 + ", msg12=" + msg12 + ", myBoolean=" + myBoolean + + ", oneBoolean=" + oneBoolean + "]"; + } + +} diff --git a/src/it/simple-it-jdk9+-hamcrest21/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java b/src/it/simple-it-jdk9+-hamcrest21/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java new file mode 100644 index 000000000..567df64f2 --- /dev/null +++ b/src/it/simple-it-jdk9+-hamcrest21/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java @@ -0,0 +1,156 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import static ch.powerunit.matchers.MatcherTester.matcher; +import static ch.powerunit.matchers.MatcherTester.value; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.hamcrest.Factory; +import org.hamcrest.Matcher; + +import ch.powerunit.Ignore; +import ch.powerunit.Test; +import ch.powerunit.TestDelegate; +import ch.powerunit.TestSuite; +import ch.powerunit.matchers.MatcherTester; + +public class Pojo1MatcherTest implements TestSuite { + + @TestDelegate + public final MatcherTester tester = testerOfMatcher(Pojo1Matchers.Pojo1MatcherImpl.class).with( + matcher((Pojo1Matchers.Pojo1MatcherImpl) Pojo1Matchers.pojo1With().msg1ContainsString("12")).describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.Pojo1 with\n[msg4 ANYTHING]\n[msg3 ANYTHING]\n[msg2 ANYTHING]\n[msg1 a string containing \"12\"]\n[msg8 ANYTHING]\n[msg7 ANYTHING]\n[msg6 ANYTHING]\n[msg12 ANYTHING]\n[msg5 ANYTHING]\n[oneBoolean ANYTHING]\n[myBoolean ANYTHING]\n[msg9 ANYTHING]\n") + .nullRejected("was null").accepting(new Pojo1("12"), new Pojo1("121")) + .rejecting(value("").withMessage("was String \"\""), value(new Pojo1()).withMessage("[msg1 was null]\n"), + value(new Pojo1("11")).withMessage("[msg1 was \"11\"]\n")), + matcher((Pojo1Matchers.Pojo1MatcherImpl) Pojo1Matchers.pojo1With().msg6IsEmptyIterable()).describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.Pojo1 with\n[msg4 ANYTHING]\n[msg3 ANYTHING]\n[msg2 ANYTHING]\n[msg1 ANYTHING]\n[msg8 ANYTHING]\n[msg7 ANYTHING]\n[msg6 an empty iterable]\n[msg12 ANYTHING]\n[msg5 ANYTHING]\n[oneBoolean ANYTHING]\n[myBoolean ANYTHING]\n[msg9 ANYTHING]\n") + .nullRejected("was null").accepting(new Pojo1(Collections.emptyList())) + .rejecting(value(new Pojo1(Collections.singletonList("x"))).withMessage("[msg6 [\"x\"]]\n"))); + + @Test + public void testOKMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With()); + } + + @Test + public void testSameInstanceMatcher() { + Pojo1 p = new Pojo1(); + p.msg6 = new ArrayList<>(); + assertThat(p).is(Pojo1Matchers.pojo1With().msg6IsSameInstance(p.msg6)); + } + + @Test + public void testOKMatcherWithConvert() { + Pojo1 p = new Pojo1(); + p.msg2 = "12"; + assertThat(p).is(Pojo1Matchers.pojo1With().msg2As(s -> Integer.valueOf(s) + 1l, is(13l))); + } + + @Test + public void testOKMatcherWithLinkedMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With().andWith(notNullValue()).andWith(hasToString(notNullValue())) + .buildWith(anything())); + } + + @Test + public void testOKMatcherWithComparable() { + Pojo1 p = new Pojo1(); + p.msg2 = "12"; + assertThat(p).is(Pojo1Matchers.pojo1With().msg2ComparesEqualTo("12").build()); + } + + @Test + public void testKOMatcherWithReference() { + Pojo1 p1 = new Pojo1(); + p1.msg2 = "12"; + Pojo1 p2 = new Pojo1(); + p2.msg2 = "12"; + assertThat(p1).is(Pojo1Matchers.pojo1WithSameValue(p2)); + } + + @Test + public void testKOMatcherWithEmptyArray() { + Pojo1 p1 = new Pojo1(); + p1.msg8 = new List[] {}; + assertThat(p1).is(Pojo1Matchers.pojo1With().msg8IsEmpty()); + } + + @Test + @Ignore + public void testKOMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With().msg1("x")); + } + + @Factory + public static void test() { + } + + @Factory + public static void test(String name1) { + } + + @Factory + public static T test(T input) { + return input; + } + + @Factory + public static , K> void test1(T t1, K t2) { + } + + @Factory + public static & Serializable, K> void test2(T t1, K t2) { + } + + @Factory + public static & Serializable, K> void test3(T t1, K... t2) { + } + + @Factory + public static void test4(T t1) { + } + + @Factory + public static Matcher fromMatcher(Matcher input) { + return null; + } + + /** + * @param name1 + * @param name2 + */ + @Factory + public static void test(String name1, String name2) { + } + + @Factory + public static void test(int x) { + } +} diff --git a/src/it/simple-it-jdk9+-hamcrest21/verify.bsh b/src/it/simple-it-jdk9+-hamcrest21/verify.bsh new file mode 100644 index 000000000..9adc23f13 --- /dev/null +++ b/src/it/simple-it-jdk9+-hamcrest21/verify.bsh @@ -0,0 +1,7 @@ +import java.io.*; + +File file = new File( basedir, "build.log" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not build log: " + file ); +} diff --git a/src/it/simple-it-jdk9+-hamcrest22/params.properties b/src/it/simple-it-jdk9+-hamcrest22/params.properties new file mode 100644 index 000000000..714c1431d --- /dev/null +++ b/src/it/simple-it-jdk9+-hamcrest22/params.properties @@ -0,0 +1,2 @@ +invoker.java.version=!1.8,9,10,11+ +invoker.goals=clean install diff --git a/src/it/simple-it-jdk9+-hamcrest22/pom.xml b/src/it/simple-it-jdk9+-hamcrest22/pom.xml new file mode 100644 index 000000000..90fff711c --- /dev/null +++ b/src/it/simple-it-jdk9+-hamcrest22/pom.xml @@ -0,0 +1,283 @@ + + 4.0.0 + ch.powerunit.extensions + powerunit-extensions-matchers-it207 + @project.version@ + + jar + + + 1.8 + 1.8 + UTF-8 + 2.22.2 + 0.5.0 + + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.11.2 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.5 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.13.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-archetype-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + + ch.powerunit + powerunit + ${powerunit.version} + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.9.0 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.version} + + + com.github.github + site-maven-plugin + 0.12 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + org.codehaus.mojo + jaxb2-maven-plugin + 2.5.0 + + + org.apache.maven.plugins + maven-changes-plugin + 2.12.1 + + + GitHub + + + + + org.codehaus.mojo + sonar-maven-plugin + 3.7.0.1746 + + + maven-invoker-plugin + 3.2.1 + + + maven-assembly-plugin + 3.3.0 + + + org.codehaus.mojo + xml-maven-plugin + 1.0.2 + + + maven-deploy-plugin + 2.8.2 + + + maven-install-plugin + 2.5.2 + + + + + + org.jacoco + jacoco-maven-plugin + + + + ${project.build.directory} + + *.exec + + + + + + + default-prepare-agent-1 + + prepare-agent + + + + default-prepare-agent-2 + initialize + + prepare-agent-integration + + + testcompileargs + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + jar + test-jar + + + + + true + false + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.source.version} + ${java.target.version} + true + + -J${testcompileargs} + + + + + + + + + org.hamcrest + hamcrest + 2.2 + + + ch.powerunit + powerunit + ${powerunit.version} + test + + + org.hamcrest + hamcrest-all + + + + + ch.powerunit.extensions + powerunit-extensions-matchers + @project.version@ + + + javax.annotation + javax.annotation-api + 1.3.2 + + + \ No newline at end of file diff --git a/src/it/simple-it-jdk9+-hamcrest22/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java b/src/it/simple-it-jdk9+-hamcrest22/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java new file mode 100644 index 000000000..6ace664ae --- /dev/null +++ b/src/it/simple-it-jdk9+-hamcrest22/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java @@ -0,0 +1,94 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Set; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * + */ +@ProvideMatchers +public class Pojo1 { + private String msg1; + + public String msg2; + + public int msg3; + + public String[] msg4; + + public int[] msg5; + + public List msg6; + + public List msg7; + + public List[] msg8; + + public Collection msg9; + + public Set msg12; + + public String getMsg1() { + return msg1; + } + + public void setMsg1(String msg1) { + this.msg1 = msg1; + } + + public boolean myBoolean; + + private boolean oneBoolean; + + public boolean isOneBoolean() { + return oneBoolean; + } + + public void setOneBoolean(boolean oneBoolean) { + this.oneBoolean = oneBoolean; + } + + public Pojo1() { + } + + public Pojo1(String msg1) { + this.msg1 = msg1; + } + + public Pojo1(List msg6) { + this.msg6 = msg6; + } + + @Override + public String toString() { + return "Pojo1 [msg1=" + msg1 + ", msg2=" + msg2 + ", msg3=" + msg3 + ", msg4=" + Arrays.toString(msg4) + + ", msg5=" + Arrays.toString(msg5) + ", msg6=" + msg6 + ", msg7=" + msg7 + ", msg8=" + + Arrays.toString(msg8) + ", msg9=" + msg9 + ", msg12=" + msg12 + ", myBoolean=" + myBoolean + + ", oneBoolean=" + oneBoolean + "]"; + } + +} diff --git a/src/it/simple-it-jdk9+-hamcrest22/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java b/src/it/simple-it-jdk9+-hamcrest22/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java new file mode 100644 index 000000000..567df64f2 --- /dev/null +++ b/src/it/simple-it-jdk9+-hamcrest22/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java @@ -0,0 +1,156 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import static ch.powerunit.matchers.MatcherTester.matcher; +import static ch.powerunit.matchers.MatcherTester.value; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.hamcrest.Factory; +import org.hamcrest.Matcher; + +import ch.powerunit.Ignore; +import ch.powerunit.Test; +import ch.powerunit.TestDelegate; +import ch.powerunit.TestSuite; +import ch.powerunit.matchers.MatcherTester; + +public class Pojo1MatcherTest implements TestSuite { + + @TestDelegate + public final MatcherTester tester = testerOfMatcher(Pojo1Matchers.Pojo1MatcherImpl.class).with( + matcher((Pojo1Matchers.Pojo1MatcherImpl) Pojo1Matchers.pojo1With().msg1ContainsString("12")).describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.Pojo1 with\n[msg4 ANYTHING]\n[msg3 ANYTHING]\n[msg2 ANYTHING]\n[msg1 a string containing \"12\"]\n[msg8 ANYTHING]\n[msg7 ANYTHING]\n[msg6 ANYTHING]\n[msg12 ANYTHING]\n[msg5 ANYTHING]\n[oneBoolean ANYTHING]\n[myBoolean ANYTHING]\n[msg9 ANYTHING]\n") + .nullRejected("was null").accepting(new Pojo1("12"), new Pojo1("121")) + .rejecting(value("").withMessage("was String \"\""), value(new Pojo1()).withMessage("[msg1 was null]\n"), + value(new Pojo1("11")).withMessage("[msg1 was \"11\"]\n")), + matcher((Pojo1Matchers.Pojo1MatcherImpl) Pojo1Matchers.pojo1With().msg6IsEmptyIterable()).describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.Pojo1 with\n[msg4 ANYTHING]\n[msg3 ANYTHING]\n[msg2 ANYTHING]\n[msg1 ANYTHING]\n[msg8 ANYTHING]\n[msg7 ANYTHING]\n[msg6 an empty iterable]\n[msg12 ANYTHING]\n[msg5 ANYTHING]\n[oneBoolean ANYTHING]\n[myBoolean ANYTHING]\n[msg9 ANYTHING]\n") + .nullRejected("was null").accepting(new Pojo1(Collections.emptyList())) + .rejecting(value(new Pojo1(Collections.singletonList("x"))).withMessage("[msg6 [\"x\"]]\n"))); + + @Test + public void testOKMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With()); + } + + @Test + public void testSameInstanceMatcher() { + Pojo1 p = new Pojo1(); + p.msg6 = new ArrayList<>(); + assertThat(p).is(Pojo1Matchers.pojo1With().msg6IsSameInstance(p.msg6)); + } + + @Test + public void testOKMatcherWithConvert() { + Pojo1 p = new Pojo1(); + p.msg2 = "12"; + assertThat(p).is(Pojo1Matchers.pojo1With().msg2As(s -> Integer.valueOf(s) + 1l, is(13l))); + } + + @Test + public void testOKMatcherWithLinkedMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With().andWith(notNullValue()).andWith(hasToString(notNullValue())) + .buildWith(anything())); + } + + @Test + public void testOKMatcherWithComparable() { + Pojo1 p = new Pojo1(); + p.msg2 = "12"; + assertThat(p).is(Pojo1Matchers.pojo1With().msg2ComparesEqualTo("12").build()); + } + + @Test + public void testKOMatcherWithReference() { + Pojo1 p1 = new Pojo1(); + p1.msg2 = "12"; + Pojo1 p2 = new Pojo1(); + p2.msg2 = "12"; + assertThat(p1).is(Pojo1Matchers.pojo1WithSameValue(p2)); + } + + @Test + public void testKOMatcherWithEmptyArray() { + Pojo1 p1 = new Pojo1(); + p1.msg8 = new List[] {}; + assertThat(p1).is(Pojo1Matchers.pojo1With().msg8IsEmpty()); + } + + @Test + @Ignore + public void testKOMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With().msg1("x")); + } + + @Factory + public static void test() { + } + + @Factory + public static void test(String name1) { + } + + @Factory + public static T test(T input) { + return input; + } + + @Factory + public static , K> void test1(T t1, K t2) { + } + + @Factory + public static & Serializable, K> void test2(T t1, K t2) { + } + + @Factory + public static & Serializable, K> void test3(T t1, K... t2) { + } + + @Factory + public static void test4(T t1) { + } + + @Factory + public static Matcher fromMatcher(Matcher input) { + return null; + } + + /** + * @param name1 + * @param name2 + */ + @Factory + public static void test(String name1, String name2) { + } + + @Factory + public static void test(int x) { + } +} diff --git a/src/it/simple-it-jdk9+-hamcrest22/verify.bsh b/src/it/simple-it-jdk9+-hamcrest22/verify.bsh new file mode 100644 index 000000000..9adc23f13 --- /dev/null +++ b/src/it/simple-it-jdk9+-hamcrest22/verify.bsh @@ -0,0 +1,7 @@ +import java.io.*; + +File file = new File( basedir, "build.log" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not build log: " + file ); +} diff --git a/src/it/simple-it-jdk9+-missinghamcrest/params.properties b/src/it/simple-it-jdk9+-missinghamcrest/params.properties new file mode 100644 index 000000000..973dfe1d2 --- /dev/null +++ b/src/it/simple-it-jdk9+-missinghamcrest/params.properties @@ -0,0 +1,3 @@ +invoker.java.version=!1.8,9,10,11+ +invoker.goals=clean install +invoker.buildResult = failure \ No newline at end of file diff --git a/src/it/simple-it-jdk9+-missinghamcrest/pom.xml b/src/it/simple-it-jdk9+-missinghamcrest/pom.xml new file mode 100644 index 000000000..58a2f11f0 --- /dev/null +++ b/src/it/simple-it-jdk9+-missinghamcrest/pom.xml @@ -0,0 +1,273 @@ + + 4.0.0 + ch.powerunit.extensions + powerunit-extensions-matchers-it107 + @project.version@ + + jar + + + 1.8 + 1.8 + UTF-8 + 1.3 + 2.22.2 + 0.5.0 + + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.11.2 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.5 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.13.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-archetype-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + + ch.powerunit + powerunit + ${powerunit.version} + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.9.0 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.version} + + + com.github.github + site-maven-plugin + 0.12 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + org.codehaus.mojo + jaxb2-maven-plugin + 2.5.0 + + + org.apache.maven.plugins + maven-changes-plugin + 2.12.1 + + + GitHub + + + + + org.codehaus.mojo + sonar-maven-plugin + 3.7.0.1746 + + + maven-invoker-plugin + 3.2.1 + + + maven-assembly-plugin + 3.3.0 + + + org.codehaus.mojo + xml-maven-plugin + 1.0.2 + + + maven-deploy-plugin + 2.8.2 + + + maven-install-plugin + 2.5.2 + + + + + + org.jacoco + jacoco-maven-plugin + + + + ${project.build.directory} + + *.exec + + + + + + + default-prepare-agent-1 + + prepare-agent + + + + default-prepare-agent-2 + initialize + + prepare-agent-integration + + + testcompileargs + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + jar + test-jar + + + + + true + false + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.source.version} + ${java.target.version} + true + + -J${testcompileargs} + + + + + + + + + ch.powerunit + powerunit + ${powerunit.version} + test + + + ch.powerunit.extensions + powerunit-extensions-matchers + @project.version@ + + + javax.annotation + javax.annotation-api + 1.3.2 + + + \ No newline at end of file diff --git a/src/it/simple-it-jdk9+-missinghamcrest/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java b/src/it/simple-it-jdk9+-missinghamcrest/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java new file mode 100644 index 000000000..6ace664ae --- /dev/null +++ b/src/it/simple-it-jdk9+-missinghamcrest/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java @@ -0,0 +1,94 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Set; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * + */ +@ProvideMatchers +public class Pojo1 { + private String msg1; + + public String msg2; + + public int msg3; + + public String[] msg4; + + public int[] msg5; + + public List msg6; + + public List msg7; + + public List[] msg8; + + public Collection msg9; + + public Set msg12; + + public String getMsg1() { + return msg1; + } + + public void setMsg1(String msg1) { + this.msg1 = msg1; + } + + public boolean myBoolean; + + private boolean oneBoolean; + + public boolean isOneBoolean() { + return oneBoolean; + } + + public void setOneBoolean(boolean oneBoolean) { + this.oneBoolean = oneBoolean; + } + + public Pojo1() { + } + + public Pojo1(String msg1) { + this.msg1 = msg1; + } + + public Pojo1(List msg6) { + this.msg6 = msg6; + } + + @Override + public String toString() { + return "Pojo1 [msg1=" + msg1 + ", msg2=" + msg2 + ", msg3=" + msg3 + ", msg4=" + Arrays.toString(msg4) + + ", msg5=" + Arrays.toString(msg5) + ", msg6=" + msg6 + ", msg7=" + msg7 + ", msg8=" + + Arrays.toString(msg8) + ", msg9=" + msg9 + ", msg12=" + msg12 + ", myBoolean=" + myBoolean + + ", oneBoolean=" + oneBoolean + "]"; + } + +} diff --git a/src/it/simple-it-jdk9+-missinghamcrest/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java b/src/it/simple-it-jdk9+-missinghamcrest/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java new file mode 100644 index 000000000..27b042423 --- /dev/null +++ b/src/it/simple-it-jdk9+-missinghamcrest/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java @@ -0,0 +1,156 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import static ch.powerunit.matchers.MatcherTester.matcher; +import static ch.powerunit.matchers.MatcherTester.value; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.hamcrest.Factory; +import org.hamcrest.Matcher; + +import ch.powerunit.Ignore; +import ch.powerunit.Test; +import ch.powerunit.TestDelegate; +import ch.powerunit.TestSuite; +import ch.powerunit.matchers.MatcherTester; + +public class Pojo1MatcherTest implements TestSuite { + + @TestDelegate + public final MatcherTester tester = testerOfMatcher(Pojo1Matchers.Pojo1MatcherImpl.class).with( + matcher((Pojo1Matchers.Pojo1MatcherImpl) Pojo1Matchers.pojo1With().msg1ContainsString("12")).describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.Pojo1 with\n[msg4 ANYTHING]\n[msg3 ANYTHING]\n[msg2 ANYTHING]\n[msg1 a string containing \"12\"]\n[msg8 ANYTHING]\n[msg7 ANYTHING]\n[msg6 ANYTHING]\n[msg12 ANYTHING]\n[msg5 ANYTHING]\n[oneBoolean ANYTHING]\n[myBoolean ANYTHING]\n[msg9 ANYTHING]\n") + .nullRejected("was null").accepting(new Pojo1("12"), new Pojo1("121")) + .rejecting(value("").withMessage("was \"\""), value(new Pojo1()).withMessage("[msg1 was null]\n"), + value(new Pojo1("11")).withMessage("[msg1 was \"11\"]\n")), + matcher((Pojo1Matchers.Pojo1MatcherImpl) Pojo1Matchers.pojo1With().msg6IsEmptyIterable()).describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.Pojo1 with\n[msg4 ANYTHING]\n[msg3 ANYTHING]\n[msg2 ANYTHING]\n[msg1 ANYTHING]\n[msg8 ANYTHING]\n[msg7 ANYTHING]\n[msg6 an empty iterable]\n[msg12 ANYTHING]\n[msg5 ANYTHING]\n[oneBoolean ANYTHING]\n[myBoolean ANYTHING]\n[msg9 ANYTHING]\n") + .nullRejected("was null").accepting(new Pojo1(Collections.emptyList())) + .rejecting(value(new Pojo1(Collections.singletonList("x"))).withMessage("[msg6 [\"x\"]]\n"))); + + @Test + public void testOKMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With()); + } + + @Test + public void testSameInstanceMatcher() { + Pojo1 p = new Pojo1(); + p.msg6 = new ArrayList<>(); + assertThat(p).is(Pojo1Matchers.pojo1With().msg6IsSameInstance(p.msg6)); + } + + @Test + public void testOKMatcherWithConvert() { + Pojo1 p = new Pojo1(); + p.msg2 = "12"; + assertThat(p).is(Pojo1Matchers.pojo1With().msg2As(s -> Integer.valueOf(s) + 1l, is(13l))); + } + + @Test + public void testOKMatcherWithLinkedMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With().andWith(notNullValue()).andWith(hasToString(notNullValue())) + .buildWith(anything())); + } + + @Test + public void testOKMatcherWithComparable() { + Pojo1 p = new Pojo1(); + p.msg2 = "12"; + assertThat(p).is(Pojo1Matchers.pojo1With().msg2ComparesEqualTo("12").build()); + } + + @Test + public void testKOMatcherWithReference() { + Pojo1 p1 = new Pojo1(); + p1.msg2 = "12"; + Pojo1 p2 = new Pojo1(); + p2.msg2 = "12"; + assertThat(p1).is(Pojo1Matchers.pojo1WithSameValue(p2)); + } + + @Test + public void testKOMatcherWithEmptyArray() { + Pojo1 p1 = new Pojo1(); + p1.msg8 = new List[] {}; + assertThat(p1).is(Pojo1Matchers.pojo1With().msg8IsEmpty()); + } + + @Test + @Ignore + public void testKOMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With().msg1("x")); + } + + @Factory + public static void test() { + } + + @Factory + public static void test(String name1) { + } + + @Factory + public static T test(T input) { + return input; + } + + @Factory + public static , K> void test1(T t1, K t2) { + } + + @Factory + public static & Serializable, K> void test2(T t1, K t2) { + } + + @Factory + public static & Serializable, K> void test3(T t1, K... t2) { + } + + @Factory + public static void test4(T t1) { + } + + @Factory + public static Matcher fromMatcher(Matcher input) { + return null; + } + + /** + * @param name1 + * @param name2 + */ + @Factory + public static void test(String name1, String name2) { + } + + @Factory + public static void test(int x) { + } +} diff --git a/src/it/simple-it-jdk9+-missinghamcrest/verify.bsh b/src/it/simple-it-jdk9+-missinghamcrest/verify.bsh new file mode 100644 index 000000000..9adc23f13 --- /dev/null +++ b/src/it/simple-it-jdk9+-missinghamcrest/verify.bsh @@ -0,0 +1,7 @@ +import java.io.*; + +File file = new File( basedir, "build.log" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not build log: " + file ); +} diff --git a/src/it/simple-it-jdk9+/params.properties b/src/it/simple-it-jdk9+/params.properties new file mode 100644 index 000000000..714c1431d --- /dev/null +++ b/src/it/simple-it-jdk9+/params.properties @@ -0,0 +1,2 @@ +invoker.java.version=!1.8,9,10,11+ +invoker.goals=clean install diff --git a/src/it/simple-it-jdk9+/pom.xml b/src/it/simple-it-jdk9+/pom.xml new file mode 100644 index 000000000..4a6e3d7b7 --- /dev/null +++ b/src/it/simple-it-jdk9+/pom.xml @@ -0,0 +1,278 @@ + + 4.0.0 + ch.powerunit.extensions + powerunit-extensions-matchers-it7 + @project.version@ + + jar + + + 1.8 + 1.8 + UTF-8 + 1.3 + 2.22.2 + 0.5.0 + + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.11.2 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.5 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.13.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-archetype-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + + ch.powerunit + powerunit + ${powerunit.version} + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.9.0 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.version} + + + com.github.github + site-maven-plugin + 0.12 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + org.codehaus.mojo + jaxb2-maven-plugin + 2.5.0 + + + org.apache.maven.plugins + maven-changes-plugin + 2.12.1 + + + GitHub + + + + + org.codehaus.mojo + sonar-maven-plugin + 3.7.0.1746 + + + maven-invoker-plugin + 3.2.1 + + + maven-assembly-plugin + 3.3.0 + + + org.codehaus.mojo + xml-maven-plugin + 1.0.2 + + + maven-deploy-plugin + 2.8.2 + + + maven-install-plugin + 2.5.2 + + + + + + org.jacoco + jacoco-maven-plugin + + + + ${project.build.directory} + + *.exec + + + + + + + default-prepare-agent-1 + + prepare-agent + + + + default-prepare-agent-2 + initialize + + prepare-agent-integration + + + testcompileargs + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + jar + test-jar + + + + + true + false + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.source.version} + ${java.target.version} + true + + -J${testcompileargs} + + + + + + + + + org.hamcrest + hamcrest-all + ${hamcrest.version} + + + ch.powerunit + powerunit + ${powerunit.version} + test + + + ch.powerunit.extensions + powerunit-extensions-matchers + @project.version@ + + + javax.annotation + javax.annotation-api + 1.3.2 + + + \ No newline at end of file diff --git a/src/it/simple-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java b/src/it/simple-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java new file mode 100644 index 000000000..6ace664ae --- /dev/null +++ b/src/it/simple-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/Pojo1.java @@ -0,0 +1,94 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Set; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * + */ +@ProvideMatchers +public class Pojo1 { + private String msg1; + + public String msg2; + + public int msg3; + + public String[] msg4; + + public int[] msg5; + + public List msg6; + + public List msg7; + + public List[] msg8; + + public Collection msg9; + + public Set msg12; + + public String getMsg1() { + return msg1; + } + + public void setMsg1(String msg1) { + this.msg1 = msg1; + } + + public boolean myBoolean; + + private boolean oneBoolean; + + public boolean isOneBoolean() { + return oneBoolean; + } + + public void setOneBoolean(boolean oneBoolean) { + this.oneBoolean = oneBoolean; + } + + public Pojo1() { + } + + public Pojo1(String msg1) { + this.msg1 = msg1; + } + + public Pojo1(List msg6) { + this.msg6 = msg6; + } + + @Override + public String toString() { + return "Pojo1 [msg1=" + msg1 + ", msg2=" + msg2 + ", msg3=" + msg3 + ", msg4=" + Arrays.toString(msg4) + + ", msg5=" + Arrays.toString(msg5) + ", msg6=" + msg6 + ", msg7=" + msg7 + ", msg8=" + + Arrays.toString(msg8) + ", msg9=" + msg9 + ", msg12=" + msg12 + ", myBoolean=" + myBoolean + + ", oneBoolean=" + oneBoolean + "]"; + } + +} diff --git a/src/it/simple-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java b/src/it/simple-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java new file mode 100644 index 000000000..27b042423 --- /dev/null +++ b/src/it/simple-it-jdk9+/src/test/java/ch/powerunit/extensions/matchers/samples/Pojo1MatcherTest.java @@ -0,0 +1,156 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import static ch.powerunit.matchers.MatcherTester.matcher; +import static ch.powerunit.matchers.MatcherTester.value; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.hamcrest.Factory; +import org.hamcrest.Matcher; + +import ch.powerunit.Ignore; +import ch.powerunit.Test; +import ch.powerunit.TestDelegate; +import ch.powerunit.TestSuite; +import ch.powerunit.matchers.MatcherTester; + +public class Pojo1MatcherTest implements TestSuite { + + @TestDelegate + public final MatcherTester tester = testerOfMatcher(Pojo1Matchers.Pojo1MatcherImpl.class).with( + matcher((Pojo1Matchers.Pojo1MatcherImpl) Pojo1Matchers.pojo1With().msg1ContainsString("12")).describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.Pojo1 with\n[msg4 ANYTHING]\n[msg3 ANYTHING]\n[msg2 ANYTHING]\n[msg1 a string containing \"12\"]\n[msg8 ANYTHING]\n[msg7 ANYTHING]\n[msg6 ANYTHING]\n[msg12 ANYTHING]\n[msg5 ANYTHING]\n[oneBoolean ANYTHING]\n[myBoolean ANYTHING]\n[msg9 ANYTHING]\n") + .nullRejected("was null").accepting(new Pojo1("12"), new Pojo1("121")) + .rejecting(value("").withMessage("was \"\""), value(new Pojo1()).withMessage("[msg1 was null]\n"), + value(new Pojo1("11")).withMessage("[msg1 was \"11\"]\n")), + matcher((Pojo1Matchers.Pojo1MatcherImpl) Pojo1Matchers.pojo1With().msg6IsEmptyIterable()).describedAs( + "an instance of ch.powerunit.extensions.matchers.samples.Pojo1 with\n[msg4 ANYTHING]\n[msg3 ANYTHING]\n[msg2 ANYTHING]\n[msg1 ANYTHING]\n[msg8 ANYTHING]\n[msg7 ANYTHING]\n[msg6 an empty iterable]\n[msg12 ANYTHING]\n[msg5 ANYTHING]\n[oneBoolean ANYTHING]\n[myBoolean ANYTHING]\n[msg9 ANYTHING]\n") + .nullRejected("was null").accepting(new Pojo1(Collections.emptyList())) + .rejecting(value(new Pojo1(Collections.singletonList("x"))).withMessage("[msg6 [\"x\"]]\n"))); + + @Test + public void testOKMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With()); + } + + @Test + public void testSameInstanceMatcher() { + Pojo1 p = new Pojo1(); + p.msg6 = new ArrayList<>(); + assertThat(p).is(Pojo1Matchers.pojo1With().msg6IsSameInstance(p.msg6)); + } + + @Test + public void testOKMatcherWithConvert() { + Pojo1 p = new Pojo1(); + p.msg2 = "12"; + assertThat(p).is(Pojo1Matchers.pojo1With().msg2As(s -> Integer.valueOf(s) + 1l, is(13l))); + } + + @Test + public void testOKMatcherWithLinkedMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With().andWith(notNullValue()).andWith(hasToString(notNullValue())) + .buildWith(anything())); + } + + @Test + public void testOKMatcherWithComparable() { + Pojo1 p = new Pojo1(); + p.msg2 = "12"; + assertThat(p).is(Pojo1Matchers.pojo1With().msg2ComparesEqualTo("12").build()); + } + + @Test + public void testKOMatcherWithReference() { + Pojo1 p1 = new Pojo1(); + p1.msg2 = "12"; + Pojo1 p2 = new Pojo1(); + p2.msg2 = "12"; + assertThat(p1).is(Pojo1Matchers.pojo1WithSameValue(p2)); + } + + @Test + public void testKOMatcherWithEmptyArray() { + Pojo1 p1 = new Pojo1(); + p1.msg8 = new List[] {}; + assertThat(p1).is(Pojo1Matchers.pojo1With().msg8IsEmpty()); + } + + @Test + @Ignore + public void testKOMatcher() { + Pojo1 p = new Pojo1(); + assertThat(p).is(Pojo1Matchers.pojo1With().msg1("x")); + } + + @Factory + public static void test() { + } + + @Factory + public static void test(String name1) { + } + + @Factory + public static T test(T input) { + return input; + } + + @Factory + public static , K> void test1(T t1, K t2) { + } + + @Factory + public static & Serializable, K> void test2(T t1, K t2) { + } + + @Factory + public static & Serializable, K> void test3(T t1, K... t2) { + } + + @Factory + public static void test4(T t1) { + } + + @Factory + public static Matcher fromMatcher(Matcher input) { + return null; + } + + /** + * @param name1 + * @param name2 + */ + @Factory + public static void test(String name1, String name2) { + } + + @Factory + public static void test(int x) { + } +} diff --git a/src/it/simple-it-jdk9+/verify.bsh b/src/it/simple-it-jdk9+/verify.bsh new file mode 100644 index 000000000..9adc23f13 --- /dev/null +++ b/src/it/simple-it-jdk9+/verify.bsh @@ -0,0 +1,7 @@ +import java.io.*; + +File file = new File( basedir, "build.log" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not build log: " + file ); +} diff --git a/src/it/spotify-it-jdk8-existing/params.properties b/src/it/spotify-it-jdk8-existing/params.properties new file mode 100644 index 000000000..ab922d13c --- /dev/null +++ b/src/it/spotify-it-jdk8-existing/params.properties @@ -0,0 +1,2 @@ +invoker.java.version=1.8,!9,!10,!11 +invoker.goals=clean install diff --git a/src/it/spotify-it-jdk8-existing/pom.xml b/src/it/spotify-it-jdk8-existing/pom.xml new file mode 100644 index 000000000..7d0ba9c17 --- /dev/null +++ b/src/it/spotify-it-jdk8-existing/pom.xml @@ -0,0 +1,278 @@ + + 4.0.0 + ch.powerunit.extensions + powerunit-extensions-matchers-it6 + @project.version@ + + jar + + + 1.8 + 1.8 + UTF-8 + 1.3 + 2.22.2 + 0.5.0 + + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.11.2 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.5 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.13.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-archetype-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + + ch.powerunit + powerunit + ${powerunit.version} + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.9.0 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.version} + + + com.github.github + site-maven-plugin + 0.12 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + org.codehaus.mojo + jaxb2-maven-plugin + 2.5.0 + + + org.apache.maven.plugins + maven-changes-plugin + 2.12.1 + + + GitHub + + + + + org.codehaus.mojo + sonar-maven-plugin + 3.7.0.1746 + + + maven-invoker-plugin + 3.2.1 + + + maven-assembly-plugin + 3.3.0 + + + org.codehaus.mojo + xml-maven-plugin + 1.0.2 + + + maven-deploy-plugin + 2.8.2 + + + maven-install-plugin + 2.5.2 + + + + + + org.jacoco + jacoco-maven-plugin + + + + ${project.build.directory} + + *.exec + + + + + + + default-prepare-agent-1 + + prepare-agent + + + + default-prepare-agent-2 + initialize + + prepare-agent-integration + + + testcompileargs + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + jar + test-jar + + + + + true + false + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.source.version} + ${java.target.version} + true + + -J${testcompileargs} + + + + + + + + + org.hamcrest + hamcrest-all + ${hamcrest.version} + + + ch.powerunit + powerunit + ${powerunit.version} + test + + + ch.powerunit.extensions + powerunit-extensions-matchers + @project.version@ + + + com.spotify + hamcrest-jackson + 1.1.5 + true + + + \ No newline at end of file diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySample.java b/src/it/spotify-it-jdk8-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySample.java similarity index 100% rename from src/test/java/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySample.java rename to src/it/spotify-it-jdk8-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySample.java diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySampleMatchersTest.java b/src/it/spotify-it-jdk8-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySampleMatchersTest.java similarity index 100% rename from src/test/java/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySampleMatchersTest.java rename to src/it/spotify-it-jdk8-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySampleMatchersTest.java diff --git a/src/it/spotify-it-jdk8-existing/verify.bsh b/src/it/spotify-it-jdk8-existing/verify.bsh new file mode 100644 index 000000000..9a6c031f2 --- /dev/null +++ b/src/it/spotify-it-jdk8-existing/verify.bsh @@ -0,0 +1,26 @@ +import java.io.*; + +File file = new File( basedir, "build.log" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not build log: " + file ); +} + + +file = new File( basedir, "target/generated-sources/annotations/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySampleMatchers.java" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find generated Matcher: " + file ); +} + +file = new File( basedir, "target/classes/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySampleMatchers.class" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find compiled Matcher: " + file ); +} + +file = new File( basedir, "target/test-classes/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySampleMatchersTest.class" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find compiled Test of the matcher: " + file ); +} diff --git a/src/it/spotify-it-jdk8-missing/params.properties b/src/it/spotify-it-jdk8-missing/params.properties new file mode 100644 index 000000000..1a20829cb --- /dev/null +++ b/src/it/spotify-it-jdk8-missing/params.properties @@ -0,0 +1,3 @@ +invoker.java.version=1.8,!9,!10,!11 +invoker.goals=clean install +invoker.buildResult = failure \ No newline at end of file diff --git a/src/it/spotify-it-jdk8-missing/pom.xml b/src/it/spotify-it-jdk8-missing/pom.xml new file mode 100644 index 000000000..d47b4587d --- /dev/null +++ b/src/it/spotify-it-jdk8-missing/pom.xml @@ -0,0 +1,272 @@ + + 4.0.0 + ch.powerunit.extensions + powerunit-extensions-matchers-it5 + @project.version@ + + jar + + + 1.8 + 1.8 + UTF-8 + 1.3 + 2.22.2 + 0.5.0 + + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.11.2 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.5 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.13.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-archetype-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + + ch.powerunit + powerunit + ${powerunit.version} + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.9.0 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.version} + + + com.github.github + site-maven-plugin + 0.12 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + org.codehaus.mojo + jaxb2-maven-plugin + 2.5.0 + + + org.apache.maven.plugins + maven-changes-plugin + 2.12.1 + + + GitHub + + + + + org.codehaus.mojo + sonar-maven-plugin + 3.7.0.1746 + + + maven-invoker-plugin + 3.2.1 + + + maven-assembly-plugin + 3.3.0 + + + org.codehaus.mojo + xml-maven-plugin + 1.0.2 + + + maven-deploy-plugin + 2.8.2 + + + maven-install-plugin + 2.5.2 + + + + + + org.jacoco + jacoco-maven-plugin + + + + ${project.build.directory} + + *.exec + + + + + + + default-prepare-agent-1 + + prepare-agent + + + + default-prepare-agent-2 + initialize + + prepare-agent-integration + + + testcompileargs + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + jar + test-jar + + + + + true + false + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.source.version} + ${java.target.version} + true + + -J${testcompileargs} + + + + + + + + + org.hamcrest + hamcrest-all + ${hamcrest.version} + + + ch.powerunit + powerunit + ${powerunit.version} + test + + + ch.powerunit.extensions + powerunit-extensions-matchers + @project.version@ + + + \ No newline at end of file diff --git a/src/it/spotify-it-jdk8-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySample.java b/src/it/spotify-it-jdk8-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySample.java new file mode 100644 index 000000000..ee8006cfd --- /dev/null +++ b/src/it/spotify-it-jdk8-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySample.java @@ -0,0 +1,16 @@ +package ch.powerunit.extensions.matchers.samples.extensions.spotify; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers(extensions=ProvideMatchers.JSON_EXTENSION) +public class SpotifySample { + private String tmp; + + public String getTmp() { + return tmp; + } + + public void setTmp(String tmp) { + this.tmp = tmp; + } +} diff --git a/src/it/spotify-it-jdk8-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySampleMatchersTest.java b/src/it/spotify-it-jdk8-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySampleMatchersTest.java new file mode 100644 index 000000000..de63c0df4 --- /dev/null +++ b/src/it/spotify-it-jdk8-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySampleMatchersTest.java @@ -0,0 +1,16 @@ +package ch.powerunit.extensions.matchers.samples.extensions.spotify; + +import com.spotify.hamcrest.jackson.JsonMatchers; + +import ch.powerunit.Test; +import ch.powerunit.TestSuite; + +public class SpotifySampleMatchersTest implements TestSuite { + @Test + public void testAfter() { + SpotifySample ss = new SpotifySample(); + ss.setTmp("{\"a\":\"x\"}"); + assertThat(ss) + .is(SpotifySampleMatchers.spotifySampleWith().tmpAsJson(JsonMatchers.jsonObject().where("a", JsonMatchers.jsonText("x")))); + } +} diff --git a/src/it/spotify-it-jdk8-missing/verify.bsh b/src/it/spotify-it-jdk8-missing/verify.bsh new file mode 100644 index 000000000..e8da8b9df --- /dev/null +++ b/src/it/spotify-it-jdk8-missing/verify.bsh @@ -0,0 +1,26 @@ +import java.io.*; + +File file = new File( basedir, "build.log" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not build log: " + file ); +} + + +file = new File( basedir, "target/generated-sources/annotations/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySampleMatchers.java" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find generated Matcher: " + file ); +} + +file = new File( basedir, "target/classes/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySampleMatchers.class" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find compiled Matcher: " + file ); +} + +file = new File( basedir, "target/test-classes/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySampleMatchersTest.class" ); +if ( file.isFile() ) +{ + throw new FileNotFoundException( "Find compiled tester of the matcher, but should not: " + file ); +} diff --git a/src/it/spotify-it-jdk9+-existing/params.properties b/src/it/spotify-it-jdk9+-existing/params.properties new file mode 100644 index 000000000..714c1431d --- /dev/null +++ b/src/it/spotify-it-jdk9+-existing/params.properties @@ -0,0 +1,2 @@ +invoker.java.version=!1.8,9,10,11+ +invoker.goals=clean install diff --git a/src/it/spotify-it-jdk9+-existing/pom.xml b/src/it/spotify-it-jdk9+-existing/pom.xml new file mode 100644 index 000000000..a8b3647c5 --- /dev/null +++ b/src/it/spotify-it-jdk9+-existing/pom.xml @@ -0,0 +1,283 @@ + + 4.0.0 + ch.powerunit.extensions + powerunit-extensions-matchers-it4 + @project.version@ + + jar + + + 1.8 + 1.8 + UTF-8 + 1.3 + 2.22.2 + 0.5.0 + + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.11.2 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.5 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.13.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-archetype-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + + ch.powerunit + powerunit + ${powerunit.version} + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.9.0 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.version} + + + com.github.github + site-maven-plugin + 0.12 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + org.codehaus.mojo + jaxb2-maven-plugin + 2.5.0 + + + org.apache.maven.plugins + maven-changes-plugin + 2.12.1 + + + GitHub + + + + + org.codehaus.mojo + sonar-maven-plugin + 3.7.0.1746 + + + maven-invoker-plugin + 3.2.1 + + + maven-assembly-plugin + 3.3.0 + + + org.codehaus.mojo + xml-maven-plugin + 1.0.2 + + + maven-deploy-plugin + 2.8.2 + + + maven-install-plugin + 2.5.2 + + + + + + org.jacoco + jacoco-maven-plugin + + + + ${project.build.directory} + + *.exec + + + + + + + default-prepare-agent-1 + + prepare-agent + + + + default-prepare-agent-2 + initialize + + prepare-agent-integration + + + testcompileargs + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + jar + test-jar + + + + + true + false + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.source.version} + ${java.target.version} + true + + -J${testcompileargs} + + + + + + + + + org.hamcrest + hamcrest-all + ${hamcrest.version} + + + ch.powerunit + powerunit + ${powerunit.version} + test + + + ch.powerunit.extensions + powerunit-extensions-matchers + @project.version@ + + + com.spotify + hamcrest-jackson + 1.1.5 + true + + + javax.annotation + javax.annotation-api + 1.3.2 + + + \ No newline at end of file diff --git a/src/it/spotify-it-jdk9+-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySample.java b/src/it/spotify-it-jdk9+-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySample.java new file mode 100644 index 000000000..ee8006cfd --- /dev/null +++ b/src/it/spotify-it-jdk9+-existing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySample.java @@ -0,0 +1,16 @@ +package ch.powerunit.extensions.matchers.samples.extensions.spotify; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers(extensions=ProvideMatchers.JSON_EXTENSION) +public class SpotifySample { + private String tmp; + + public String getTmp() { + return tmp; + } + + public void setTmp(String tmp) { + this.tmp = tmp; + } +} diff --git a/src/it/spotify-it-jdk9+-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySampleMatchersTest.java b/src/it/spotify-it-jdk9+-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySampleMatchersTest.java new file mode 100644 index 000000000..de63c0df4 --- /dev/null +++ b/src/it/spotify-it-jdk9+-existing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySampleMatchersTest.java @@ -0,0 +1,16 @@ +package ch.powerunit.extensions.matchers.samples.extensions.spotify; + +import com.spotify.hamcrest.jackson.JsonMatchers; + +import ch.powerunit.Test; +import ch.powerunit.TestSuite; + +public class SpotifySampleMatchersTest implements TestSuite { + @Test + public void testAfter() { + SpotifySample ss = new SpotifySample(); + ss.setTmp("{\"a\":\"x\"}"); + assertThat(ss) + .is(SpotifySampleMatchers.spotifySampleWith().tmpAsJson(JsonMatchers.jsonObject().where("a", JsonMatchers.jsonText("x")))); + } +} diff --git a/src/it/spotify-it-jdk9+-existing/verify.bsh b/src/it/spotify-it-jdk9+-existing/verify.bsh new file mode 100644 index 000000000..9a6c031f2 --- /dev/null +++ b/src/it/spotify-it-jdk9+-existing/verify.bsh @@ -0,0 +1,26 @@ +import java.io.*; + +File file = new File( basedir, "build.log" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not build log: " + file ); +} + + +file = new File( basedir, "target/generated-sources/annotations/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySampleMatchers.java" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find generated Matcher: " + file ); +} + +file = new File( basedir, "target/classes/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySampleMatchers.class" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find compiled Matcher: " + file ); +} + +file = new File( basedir, "target/test-classes/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySampleMatchersTest.class" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find compiled Test of the matcher: " + file ); +} diff --git a/src/it/spotify-it-jdk9+-missing/params.properties b/src/it/spotify-it-jdk9+-missing/params.properties new file mode 100644 index 000000000..973dfe1d2 --- /dev/null +++ b/src/it/spotify-it-jdk9+-missing/params.properties @@ -0,0 +1,3 @@ +invoker.java.version=!1.8,9,10,11+ +invoker.goals=clean install +invoker.buildResult = failure \ No newline at end of file diff --git a/src/it/spotify-it-jdk9+-missing/pom.xml b/src/it/spotify-it-jdk9+-missing/pom.xml new file mode 100644 index 000000000..15e71e835 --- /dev/null +++ b/src/it/spotify-it-jdk9+-missing/pom.xml @@ -0,0 +1,277 @@ + + 4.0.0 + ch.powerunit.extensions + powerunit-extensions-matchers-it3 + @project.version@ + + jar + + + 1.8 + 1.8 + UTF-8 + 1.3 + 2.22.2 + 0.5.0 + + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.11.2 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.5 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.13.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-archetype-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + + ch.powerunit + powerunit + ${powerunit.version} + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.9.0 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.version} + + + com.github.github + site-maven-plugin + 0.12 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + org.codehaus.mojo + jaxb2-maven-plugin + 2.5.0 + + + org.apache.maven.plugins + maven-changes-plugin + 2.12.1 + + + GitHub + + + + + org.codehaus.mojo + sonar-maven-plugin + 3.7.0.1746 + + + maven-invoker-plugin + 3.2.1 + + + maven-assembly-plugin + 3.3.0 + + + org.codehaus.mojo + xml-maven-plugin + 1.0.2 + + + maven-deploy-plugin + 2.8.2 + + + maven-install-plugin + 2.5.2 + + + + + + org.jacoco + jacoco-maven-plugin + + + + ${project.build.directory} + + *.exec + + + + + + + default-prepare-agent-1 + + prepare-agent + + + + default-prepare-agent-2 + initialize + + prepare-agent-integration + + + testcompileargs + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + jar + test-jar + + + + + true + false + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.source.version} + ${java.target.version} + true + + -J${testcompileargs} + + + + + + + + + org.hamcrest + hamcrest-all + ${hamcrest.version} + + + ch.powerunit + powerunit + ${powerunit.version} + test + + + ch.powerunit.extensions + powerunit-extensions-matchers + @project.version@ + + + javax.annotation + javax.annotation-api + 1.3.2 + + + \ No newline at end of file diff --git a/src/it/spotify-it-jdk9+-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySample.java b/src/it/spotify-it-jdk9+-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySample.java new file mode 100644 index 000000000..ee8006cfd --- /dev/null +++ b/src/it/spotify-it-jdk9+-missing/src/main/java/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySample.java @@ -0,0 +1,16 @@ +package ch.powerunit.extensions.matchers.samples.extensions.spotify; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers(extensions=ProvideMatchers.JSON_EXTENSION) +public class SpotifySample { + private String tmp; + + public String getTmp() { + return tmp; + } + + public void setTmp(String tmp) { + this.tmp = tmp; + } +} diff --git a/src/it/spotify-it-jdk9+-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySampleMatchersTest.java b/src/it/spotify-it-jdk9+-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySampleMatchersTest.java new file mode 100644 index 000000000..de63c0df4 --- /dev/null +++ b/src/it/spotify-it-jdk9+-missing/src/test/java/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySampleMatchersTest.java @@ -0,0 +1,16 @@ +package ch.powerunit.extensions.matchers.samples.extensions.spotify; + +import com.spotify.hamcrest.jackson.JsonMatchers; + +import ch.powerunit.Test; +import ch.powerunit.TestSuite; + +public class SpotifySampleMatchersTest implements TestSuite { + @Test + public void testAfter() { + SpotifySample ss = new SpotifySample(); + ss.setTmp("{\"a\":\"x\"}"); + assertThat(ss) + .is(SpotifySampleMatchers.spotifySampleWith().tmpAsJson(JsonMatchers.jsonObject().where("a", JsonMatchers.jsonText("x")))); + } +} diff --git a/src/it/spotify-it-jdk9+-missing/verify.bsh b/src/it/spotify-it-jdk9+-missing/verify.bsh new file mode 100644 index 000000000..e8da8b9df --- /dev/null +++ b/src/it/spotify-it-jdk9+-missing/verify.bsh @@ -0,0 +1,26 @@ +import java.io.*; + +File file = new File( basedir, "build.log" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not build log: " + file ); +} + + +file = new File( basedir, "target/generated-sources/annotations/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySampleMatchers.java" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find generated Matcher: " + file ); +} + +file = new File( basedir, "target/classes/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySampleMatchers.class" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not find compiled Matcher: " + file ); +} + +file = new File( basedir, "target/test-classes/ch/powerunit/extensions/matchers/samples/extensions/spotify/SpotifySampleMatchersTest.class" ); +if ( file.isFile() ) +{ + throw new FileNotFoundException( "Find compiled tester of the matcher, but should not: " + file ); +} diff --git a/src/it/wrongannotation-it-jdk8/params.properties b/src/it/wrongannotation-it-jdk8/params.properties new file mode 100644 index 000000000..ab922d13c --- /dev/null +++ b/src/it/wrongannotation-it-jdk8/params.properties @@ -0,0 +1,2 @@ +invoker.java.version=1.8,!9,!10,!11 +invoker.goals=clean install diff --git a/src/it/wrongannotation-it-jdk8/pom.xml b/src/it/wrongannotation-it-jdk8/pom.xml new file mode 100644 index 000000000..8e69a10be --- /dev/null +++ b/src/it/wrongannotation-it-jdk8/pom.xml @@ -0,0 +1,272 @@ + + 4.0.0 + ch.powerunit.extensions + powerunit-extensions-matchers-it2 + @project.version@ + + jar + + + 1.8 + 1.8 + UTF-8 + 1.3 + 2.22.2 + 0.5.0 + + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.11.2 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.5 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.13.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-archetype-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + + ch.powerunit + powerunit + ${powerunit.version} + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.9.0 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.version} + + + com.github.github + site-maven-plugin + 0.12 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + org.codehaus.mojo + jaxb2-maven-plugin + 2.5.0 + + + org.apache.maven.plugins + maven-changes-plugin + 2.12.1 + + + GitHub + + + + + org.codehaus.mojo + sonar-maven-plugin + 3.7.0.1746 + + + maven-invoker-plugin + 3.2.1 + + + maven-assembly-plugin + 3.3.0 + + + org.codehaus.mojo + xml-maven-plugin + 1.0.2 + + + maven-deploy-plugin + 2.8.2 + + + maven-install-plugin + 2.5.2 + + + + + + org.jacoco + jacoco-maven-plugin + + + + ${project.build.directory} + + *.exec + + + + + + + default-prepare-agent-1 + + prepare-agent + + + + default-prepare-agent-2 + initialize + + prepare-agent-integration + + + testcompileargs + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + jar + test-jar + + + + + true + false + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.source.version} + ${java.target.version} + true + + -J${testcompileargs} + + + + + + + + + org.hamcrest + hamcrest-all + ${hamcrest.version} + + + ch.powerunit + powerunit + ${powerunit.version} + test + + + ch.powerunit.extensions + powerunit-extensions-matchers + @project.version@ + + + \ No newline at end of file diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/WrongAnnotatedEnum.java b/src/it/wrongannotation-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/WrongAnnotatedEnum.java similarity index 100% rename from src/test/java/ch/powerunit/extensions/matchers/samples/WrongAnnotatedEnum.java rename to src/it/wrongannotation-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/WrongAnnotatedEnum.java diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/WrongAnnotatedInterface.java b/src/it/wrongannotation-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/WrongAnnotatedInterface.java similarity index 100% rename from src/test/java/ch/powerunit/extensions/matchers/samples/WrongAnnotatedInterface.java rename to src/it/wrongannotation-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/WrongAnnotatedInterface.java diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/WrongIgnoreCase1.java b/src/it/wrongannotation-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/WrongIgnoreCase1.java similarity index 100% rename from src/test/java/ch/powerunit/extensions/matchers/samples/WrongIgnoreCase1.java rename to src/it/wrongannotation-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/WrongIgnoreCase1.java diff --git a/src/test/java/ch/powerunit/extensions/matchers/samples/WrongIgnoreCase2.java b/src/it/wrongannotation-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/WrongIgnoreCase2.java similarity index 100% rename from src/test/java/ch/powerunit/extensions/matchers/samples/WrongIgnoreCase2.java rename to src/it/wrongannotation-it-jdk8/src/main/java/ch/powerunit/extensions/matchers/samples/WrongIgnoreCase2.java diff --git a/src/it/wrongannotation-it-jdk8/verify.bsh b/src/it/wrongannotation-it-jdk8/verify.bsh new file mode 100644 index 000000000..e2033b1a3 --- /dev/null +++ b/src/it/wrongannotation-it-jdk8/verify.bsh @@ -0,0 +1,22 @@ +import java.io.*; +import java.util.Scanner; + +File file = new File( basedir, "build.log" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not build log: " + file ); +} + +int countError = 0; +Scanner scanner = new Scanner(file); +while (scanner.hasNextLine()) { + String line = scanner.nextLine(); + if (line.startsWith("[WARNING]") && ( + line.contains("WrongIgnoreCase1") || line.contains("WrongIgnoreCase2") || line.contains("WrongAnnotatedInterface") || line.contains("WrongAnnotatedEnum"))) { + countError++; + } +} + +if (countError!=10) { + throw new RuntimeException("Must contains 10 WARNING related to powerunit, but it is not the case ; "+countError); +} \ No newline at end of file diff --git a/src/it/wrongannotation-it-jdk9+/params.properties b/src/it/wrongannotation-it-jdk9+/params.properties new file mode 100644 index 000000000..714c1431d --- /dev/null +++ b/src/it/wrongannotation-it-jdk9+/params.properties @@ -0,0 +1,2 @@ +invoker.java.version=!1.8,9,10,11+ +invoker.goals=clean install diff --git a/src/it/wrongannotation-it-jdk9+/pom.xml b/src/it/wrongannotation-it-jdk9+/pom.xml new file mode 100644 index 000000000..ad0482934 --- /dev/null +++ b/src/it/wrongannotation-it-jdk9+/pom.xml @@ -0,0 +1,278 @@ + + 4.0.0 + ch.powerunit.extensions + powerunit-extensions-matchers-it1 + @project.version@ + + jar + + + 1.8 + 1.8 + UTF-8 + 1.3 + 2.22.2 + 0.5.0 + + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.11.2 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.5 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.13.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-archetype-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + + ch.powerunit + powerunit + ${powerunit.version} + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.9.0 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.version} + + + com.github.github + site-maven-plugin + 0.12 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + org.codehaus.mojo + jaxb2-maven-plugin + 2.5.0 + + + org.apache.maven.plugins + maven-changes-plugin + 2.12.1 + + + GitHub + + + + + org.codehaus.mojo + sonar-maven-plugin + 3.7.0.1746 + + + maven-invoker-plugin + 3.2.1 + + + maven-assembly-plugin + 3.3.0 + + + org.codehaus.mojo + xml-maven-plugin + 1.0.2 + + + maven-deploy-plugin + 2.8.2 + + + maven-install-plugin + 2.5.2 + + + + + + org.jacoco + jacoco-maven-plugin + + + + ${project.build.directory} + + *.exec + + + + + + + default-prepare-agent-1 + + prepare-agent + + + + default-prepare-agent-2 + initialize + + prepare-agent-integration + + + testcompileargs + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + jar + test-jar + + + + + true + false + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.source.version} + ${java.target.version} + true + + -J${testcompileargs} + + + + + + + + + org.hamcrest + hamcrest-all + ${hamcrest.version} + + + ch.powerunit + powerunit + ${powerunit.version} + test + + + ch.powerunit.extensions + powerunit-extensions-matchers + @project.version@ + + + javax.annotation + javax.annotation-api + 1.3.2 + + + \ No newline at end of file diff --git a/src/main/java/ch/powerunit/extensions/matchers/factoryprocessor/package-info.java b/src/it/wrongannotation-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/WrongAnnotatedEnum.java similarity index 83% rename from src/main/java/ch/powerunit/extensions/matchers/factoryprocessor/package-info.java rename to src/it/wrongannotation-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/WrongAnnotatedEnum.java index f9534d6c7..27a872f6e 100644 --- a/src/main/java/ch/powerunit/extensions/matchers/factoryprocessor/package-info.java +++ b/src/it/wrongannotation-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/WrongAnnotatedEnum.java @@ -17,8 +17,15 @@ * You should have received a copy of the GNU General Public License * along with Powerunit. If not, see . */ +package ch.powerunit.extensions.matchers.samples; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + /** * @author borettim * */ -package ch.powerunit.extensions.matchers.factoryprocessor; \ No newline at end of file +@ProvideMatchers +public enum WrongAnnotatedEnum { + +} diff --git a/src/it/wrongannotation-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/WrongAnnotatedInterface.java b/src/it/wrongannotation-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/WrongAnnotatedInterface.java new file mode 100644 index 000000000..5107e9ed0 --- /dev/null +++ b/src/it/wrongannotation-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/WrongAnnotatedInterface.java @@ -0,0 +1,31 @@ +/** + * Powerunit - A JDK1.8 test framework + * Copyright (C) 2014 Mathieu Boretti. + * + * This file is part of Powerunit + * + * Powerunit is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Powerunit is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Powerunit. If not, see . + */ +package ch.powerunit.extensions.matchers.samples; + +import ch.powerunit.extensions.matchers.ProvideMatchers; + +/** + * @author borettim + * + */ +@ProvideMatchers +public interface WrongAnnotatedInterface { + +} diff --git a/src/it/wrongannotation-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/WrongIgnoreCase1.java b/src/it/wrongannotation-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/WrongIgnoreCase1.java new file mode 100644 index 000000000..d0527d983 --- /dev/null +++ b/src/it/wrongannotation-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/WrongIgnoreCase1.java @@ -0,0 +1,19 @@ +package ch.powerunit.extensions.matchers.samples; + +import ch.powerunit.extensions.matchers.AddToMatcher; +import ch.powerunit.extensions.matchers.AddToMatchers; +import ch.powerunit.extensions.matchers.IgnoreInMatcher; + +public class WrongIgnoreCase1 { + @IgnoreInMatcher + public String msg1; + + @IgnoreInMatcher + public static String msg2; + + @AddToMatcher(argument = "", body = {}, suffix = "") + public String msg3; + + @AddToMatchers({ @AddToMatcher(argument = "", body = {}, suffix = "") }) + public String msg4; +} diff --git a/src/it/wrongannotation-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/WrongIgnoreCase2.java b/src/it/wrongannotation-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/WrongIgnoreCase2.java new file mode 100644 index 000000000..c3353bf17 --- /dev/null +++ b/src/it/wrongannotation-it-jdk9+/src/main/java/ch/powerunit/extensions/matchers/samples/WrongIgnoreCase2.java @@ -0,0 +1,21 @@ +package ch.powerunit.extensions.matchers.samples; + +import ch.powerunit.extensions.matchers.AddToMatcher; +import ch.powerunit.extensions.matchers.AddToMatchers; +import ch.powerunit.extensions.matchers.IgnoreInMatcher; +import ch.powerunit.extensions.matchers.ProvideMatchers; + +@ProvideMatchers +public class WrongIgnoreCase2 { + @IgnoreInMatcher + public static String msg1; + + @IgnoreInMatcher + private static String msg2; + + @AddToMatcher(argument = "", body = {}, suffix = "") + public static String msg3; + + @AddToMatchers({ @AddToMatcher(argument = "", body = {}, suffix = "") }) + public static String msg4; +} diff --git a/src/it/wrongannotation-it-jdk9+/verify.bsh b/src/it/wrongannotation-it-jdk9+/verify.bsh new file mode 100644 index 000000000..e2033b1a3 --- /dev/null +++ b/src/it/wrongannotation-it-jdk9+/verify.bsh @@ -0,0 +1,22 @@ +import java.io.*; +import java.util.Scanner; + +File file = new File( basedir, "build.log" ); +if ( !file.isFile() ) +{ + throw new FileNotFoundException( "Could not build log: " + file ); +} + +int countError = 0; +Scanner scanner = new Scanner(file); +while (scanner.hasNextLine()) { + String line = scanner.nextLine(); + if (line.startsWith("[WARNING]") && ( + line.contains("WrongIgnoreCase1") || line.contains("WrongIgnoreCase2") || line.contains("WrongAnnotatedInterface") || line.contains("WrongAnnotatedEnum"))) { + countError++; + } +} + +if (countError!=10) { + throw new RuntimeException("Must contains 10 WARNING related to powerunit, but it is not the case ; "+countError); +} \ No newline at end of file diff --git a/src/main/archetype/archetype-resources/pom.xml b/src/main/archetype/archetype-resources/pom.xml index c4c02d546..96f1416a9 100644 --- a/src/main/archetype/archetype-resources/pom.xml +++ b/src/main/archetype/archetype-resources/pom.xml @@ -1,4 +1,5 @@ - 4.0.0 @@ -11,10 +12,12 @@ 1.8 1.8 + ${version} ${powerunit.version} ${surefire.version} + @@ -33,6 +36,7 @@ + @@ -44,7 +48,8 @@ ${java.target.version} - -Ach.powerunit.extensions.matchers.factoryprocessor.FactoryAnnotationsProcessor.targets=.*:\${package}.AllMatchers + + -Ach.powerunit.extensions.matchers.provideprocessor.ProvidesMatchersAnnotationsProcessor.factory=\${package}.AllMatchers @@ -58,6 +63,12 @@ ${artifactId} \${powerunit.extension.matcher.version} + + + org.hamcrest + hamcrest-all + 1.3 + ch.powerunit @@ -65,5 +76,6 @@ \${powerunit.version} test + \ No newline at end of file diff --git a/src/main/dedicated-jar/factory/META-INF/services/javax.annotation.processing.Processor b/src/main/dedicated-jar/factory/META-INF/services/javax.annotation.processing.Processor deleted file mode 100644 index d135682a6..000000000 --- a/src/main/dedicated-jar/factory/META-INF/services/javax.annotation.processing.Processor +++ /dev/null @@ -1 +0,0 @@ -ch.powerunit.extensions.matchers.factoryprocessor.FactoryAnnotationsProcessor diff --git a/src/main/dedicated-jar/providematchers/META-INF/services/javax.annotation.processing.Processor b/src/main/dedicated-jar/providematchers/META-INF/services/javax.annotation.processing.Processor deleted file mode 100644 index 8f7546b96..000000000 --- a/src/main/dedicated-jar/providematchers/META-INF/services/javax.annotation.processing.Processor +++ /dev/null @@ -1 +0,0 @@ -ch.powerunit.extensions.matchers.provideprocessor.ProvidesMatchersAnnotationsProcessor diff --git a/src/main/java/ch/powerunit/extensions/matchers/ProvideMatchers.java b/src/main/java/ch/powerunit/extensions/matchers/ProvideMatchers.java index 1627dd20f..25d616fae 100644 --- a/src/main/java/ch/powerunit/extensions/matchers/ProvideMatchers.java +++ b/src/main/java/ch/powerunit/extensions/matchers/ProvideMatchers.java @@ -65,7 +65,7 @@ *