Skip to content

Commit

Permalink
Merge db26f05 into 1fef4d4
Browse files Browse the repository at this point in the history
  • Loading branch information
boretti committed May 31, 2020
2 parents 1fef4d4 + db26f05 commit 9ed74fe
Show file tree
Hide file tree
Showing 58 changed files with 1,616 additions and 601 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -18,7 +18,7 @@ before_install:
- mkdir -p $HOME/.script
- curl https://report.ci/annotate.py -o $HOME/.script/annotate.py --retry 5
- curl https://report.ci/upload.py -o $HOME/.script/upload.py --retry 5
- curl https://codecov.io/bash -o $HOME/.script/codecov.bash --retry 5
- curl https://codecov.io/bash -o $HOME/.script/codecov.bash --retry 5 -k
- chmod +x $HOME/.script/codecov.bash
- chmod +x .travisci/*.sh
install:
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Expand Up @@ -327,6 +327,7 @@
<extraArtifacts>
<extraArtifact>org.hamcrest:hamcrest:2.2:jar</extraArtifact>
<extraArtifact>org.hamcrest:hamcrest:2.1:jar</extraArtifact>
<extraArtifact>ch.powerunit.extensions:powerunit-extensions-matchers:0.2.0:jar</extraArtifact>
</extraArtifacts>
<writeJunitReport>true</writeJunitReport>
<junitPackageName>ch.powerunit.extensions.matchers</junitPackageName>
Expand Down
5 changes: 5 additions & 0 deletions src/it/multimodule-nogeneric-it-jdk8/children/pom.xml
Expand Up @@ -69,5 +69,10 @@
<artifactId>powerunit-extensions-matchers-multimodule-parent-it1000</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>ch.powerunit.extensions</groupId>
<artifactId>powerunit-extensions-matchers-multimodule-parent-old-it1000</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
@@ -0,0 +1,51 @@
/**
* 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 <http://www.gnu.org/licenses/>.
*/
package ch.powerunit.extensions.matchers.multi.children;

import ch.powerunit.extensions.matchers.ProvideMatchers;
import ch.powerunit.extensions.matchers.multi.parentold.Pojo1;

/**
* @author borettim
*
*/
@ProvideMatchers
public class Pojo24 extends Pojo1 {

public String msg2;

public Pojo24() {
}

public Pojo24(String msg2) {
this.msg2 = msg2;
}

public Pojo24(String msg1, String msg2) {
super(msg1);
this.msg2 = msg2;
}

@Override
public String toString() {
return "Pojo24 [msg2=" + msg2 + ", msg1=" + msg1 + "]";
}

}
@@ -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 <http://www.gnu.org/licenses/>.
*/
package ch.powerunit.extensions.matchers.multi.children;

import ch.powerunit.extensions.matchers.ProvideMatchers;
import ch.powerunit.extensions.matchers.multi.parentold.Pojo1;

/**
* @author borettim
*
*/
@ProvideMatchers
public class Pojo26 {

public Pojo1 field1;

public Pojo26() {
}

public Pojo26(Pojo1 field1) {
super();
this.field1 = field1;
}

@Override
public String toString() {
return "Pojo26 [field1=" + field1 + "]";
}

}
@@ -0,0 +1,96 @@
/**
* 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 <http://www.gnu.org/licenses/>.
*/
package ch.powerunit.extensions.matchers.multi.children;

import ch.powerunit.TestDelegate;
import ch.powerunit.TestSuite;
import ch.powerunit.extensions.matchers.multi.parentold.Pojo1Matchers;
import ch.powerunit.matchers.MatcherTester;
import static ch.powerunit.matchers.MatcherTester.matcher;
import static ch.powerunit.matchers.MatcherTester.value;

public class Pojo24MatcherTest implements TestSuite {

//@formatter:off
@TestDelegate
public final MatcherTester<?> tester = testerOfMatcher(Pojo24Matchers.Pojo24MatcherImpl.class)
.with(
matcher((Pojo24Matchers.Pojo24MatcherImpl) Pojo24Matchers.pojo24With().msg2ContainsString("12"))
.describedAs("an instance of ch.powerunit.extensions.matchers.multi.children.Pojo24 with\n[parent ANYTHING]\n[msg2 a string containing \"12\"]\n")
.nullRejected("was null")
.accepting(
new Pojo24("12"),
new Pojo24("121"))
.rejecting(
value("").withMessage("was \"\""),
value(new Pojo24()).withMessage("[msg2 was null]\n"),
value(new Pojo24("11")).withMessage("[msg2 was \"11\"]\n")),
matcher((Pojo24Matchers.Pojo24MatcherImpl) Pojo24Matchers.pojo24With(Pojo1Matchers.pojo1With().msg1("x")).msg2ContainsString("12"))
.describedAs("an instance of ch.powerunit.extensions.matchers.multi.children.Pojo24 with\n[parent an instance of ch.powerunit.extensions.matchers.multi.parentold.Pojo1 with\n[msg1 is \"x\"]\n]\n[msg2 a string containing \"12\"]\n")
.nullRejected("was null")
.accepting(
new Pojo24("x","12"),
new Pojo24("x","121"))
.rejecting(
value("").withMessage("was \"\""),
value(new Pojo24()).withMessage("[parent [msg1 was null]\n]\n[msg2 was null]\n"),
value(new Pojo24("11")).withMessage("[parent [msg1 was null]\n]\n[msg2 was \"11\"]\n"),
value(new Pojo24("z","11")).withMessage("[parent [msg1 was \"z\"]\n]\n[msg2 was \"11\"]\n")),
matcher((Pojo24Matchers.Pojo24MatcherImpl) Pojo24Matchers.pojo24WithSameValue(new Pojo24("x")))
.describedAs("an instance of ch.powerunit.extensions.matchers.multi.children.Pojo24 with\n[parent an instance of ch.powerunit.extensions.matchers.multi.parentold.Pojo1 with\n[msg1 is null]\n]\n[msg2 is \"x\"]\n")
.nullRejected("was null")
.accepting(
new Pojo24("x"))
.rejecting(
value("").withMessage("was \"\""),
value(new Pojo24()).withMessage("[msg2 was null]\n"),
value(new Pojo24("11")).withMessage("[msg2 was \"11\"]\n")),
matcher((Pojo24Matchers.Pojo24MatcherImpl) Pojo24Matchers.pojo24WithSameValue(new Pojo24("y","x")))
.describedAs("an instance of ch.powerunit.extensions.matchers.multi.children.Pojo24 with\n[parent an instance of ch.powerunit.extensions.matchers.multi.parentold.Pojo1 with\n[msg1 is \"y\"]\n]\n[msg2 is \"x\"]\n")
.nullRejected("was null")
.accepting(
new Pojo24("y","x"))
.rejecting(
value("").withMessage("was \"\""),
value(new Pojo24()).withMessage("[parent [msg1 was null]\n]\n[msg2 was null]\n"),
value(new Pojo24("11")).withMessage("[parent [msg1 was null]\n]\n[msg2 was \"11\"]\n"),
value(new Pojo24("z","x")).withMessage("[parent [msg1 was \"z\"]\n]\n")),
matcher((Pojo24Matchers.Pojo24MatcherImpl) Pojo24Matchers.pojo24WithSameValue(new Pojo24("y","x"),"msg2"))
.describedAs("an instance of ch.powerunit.extensions.matchers.multi.children.Pojo24 with\n[parent an instance of ch.powerunit.extensions.matchers.multi.parentold.Pojo1 with\n[msg1 is \"y\"]\n]\n[msg2 ANYTHING]\n")
.nullRejected("was null")
.accepting(
new Pojo24("y","x"),
new Pojo24("y","x2"))
.rejecting(
value("").withMessage("was \"\""),
value(new Pojo24()).withMessage("[parent [msg1 was null]\n]\n"),
value(new Pojo24("11")).withMessage("[parent [msg1 was null]\n]\n"),
value(new Pojo24("z","x")).withMessage("[parent [msg1 was \"z\"]\n]\n")),
matcher((Pojo24Matchers.Pojo24MatcherImpl) Pojo24Matchers.pojo24WithSameValue(new Pojo24("y","x"),"msg1"))
.describedAs("an instance of ch.powerunit.extensions.matchers.multi.children.Pojo24 with\n[parent an instance of ch.powerunit.extensions.matchers.multi.parentold.Pojo1 with\n[msg1 is \"y\"]\n]\n[msg2 is \"x\"]\n")
.nullRejected("was null")
.accepting(
new Pojo24("y","x"))
.rejecting(
value("").withMessage("was \"\""),
value(new Pojo24()).withMessage("[parent [msg1 was null]\n]\n[msg2 was null]\n"),
value(new Pojo24("11")).withMessage("[parent [msg1 was null]\n]\n[msg2 was \"11\"]\n")));
//@formatter:on
}
Expand Up @@ -71,6 +71,27 @@ public class Pojo4MatcherTest implements TestSuite {
value("").withMessage("was \"\""),
value(new Pojo4()).withMessage("[parent [msg1 was null]\n]\n[msg2 was null]\n"),
value(new Pojo4("11")).withMessage("[parent [msg1 was null]\n]\n[msg2 was \"11\"]\n"),
value(new Pojo4("z","x")).withMessage("[parent [msg1 was \"z\"]\n]\n")));
value(new Pojo4("z","x")).withMessage("[parent [msg1 was \"z\"]\n]\n")),
matcher((Pojo4Matchers.Pojo4MatcherImpl) Pojo4Matchers.pojo4WithSameValue(new Pojo4("y","x"),"msg2"))
.describedAs("an instance of ch.powerunit.extensions.matchers.multi.children.Pojo4 with\n[parent an instance of ch.powerunit.extensions.matchers.multi.parent.Pojo1 with\n[msg1 is \"y\"]\n]\n[msg2 ANYTHING]\n")
.nullRejected("was null")
.accepting(
new Pojo4("y","x"),
new Pojo4("y","x2"))
.rejecting(
value("").withMessage("was \"\""),
value(new Pojo4()).withMessage("[parent [msg1 was null]\n]\n"),
value(new Pojo4("11")).withMessage("[parent [msg1 was null]\n]\n"),
value(new Pojo4("z","x")).withMessage("[parent [msg1 was \"z\"]\n]\n")),
matcher((Pojo4Matchers.Pojo4MatcherImpl) Pojo4Matchers.pojo4WithSameValue(new Pojo4("y","x"),"msg1"))
.describedAs("an instance of ch.powerunit.extensions.matchers.multi.children.Pojo4 with\n[parent an instance of ch.powerunit.extensions.matchers.multi.parent.Pojo1 with\n[msg1 ANYTHING]\n]\n[msg2 is \"x\"]\n")
.nullRejected("was null")
.accepting(
new Pojo4("y","x"),
new Pojo4("y2","x"))
.rejecting(
value("").withMessage("was \"\""),
value(new Pojo4()).withMessage("[msg2 was null]\n"),
value(new Pojo4("11")).withMessage("[msg2 was \"11\"]\n")));
//@formatter:on
}
Expand Up @@ -70,6 +70,15 @@ public class Pojo6MatcherTest implements TestSuite {
value("").withMessage("was \"\""),
value(new Pojo6()).withMessage("[field1 was null]\n"),
value(new Pojo6(new Pojo1())).withMessage("[field1 [msg1 was null]\n]\n"),
value(new Pojo6(new Pojo1("t"))).withMessage("[field1 [msg1 was \"t\"]\n]\n")));
value(new Pojo6(new Pojo1("t"))).withMessage("[field1 [msg1 was \"t\"]\n]\n")),
matcher((Pojo6Matchers.Pojo6MatcherImpl) Pojo6Matchers.pojo6WithSameValue(new Pojo6(new Pojo1("a")),"field1.msg1"))
.describedAs("an instance of ch.powerunit.extensions.matchers.multi.children.Pojo6 with\n[field1 an instance of ch.powerunit.extensions.matchers.multi.parent.Pojo1 with\n[msg1 ANYTHING]\n]\n")
.nullRejected("was null")
.accepting(
new Pojo6(new Pojo1("a")),
new Pojo6(new Pojo1("b")))
.rejecting(
value("").withMessage("was \"\""),
value(new Pojo6()).withMessage("[field1 was null]\n")));
//@formatter:on
}
68 changes: 68 additions & 0 deletions src/it/multimodule-nogeneric-it-jdk8/parent-old/pom.xml
@@ -0,0 +1,68 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ch.powerunit.extensions</groupId>
<artifactId>powerunit-extensions-matchers-multimodule-parent-old-it1000</artifactId>

<parent>
<groupId>ch.powerunit.extensions</groupId>
<artifactId>powerunit-extensions-matchers-multimodule-master-it1000</artifactId>
<version>@project.version@</version>
<relativePath>../pom.xml</relativePath>
</parent>

<packaging>jar</packaging>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<docfilessubdirs>true</docfilessubdirs>
<linksource>false</linksource>
<detectLinks />
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.source.version}</source>
<target>${java.target.version}</target>
<fork>true</fork>
<compilerArgs>
<compilerArg>-J@testcompileargs@</compilerArg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>${hamcrest.version}</version>
</dependency>
<dependency>
<groupId>ch.powerunit</groupId>
<artifactId>powerunit</artifactId>
<version>${powerunit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.powerunit.extensions</groupId>
<artifactId>powerunit-extensions-matchers</artifactId>
<version>0.2.0</version><!-- Forcer sur ancienne version -->
</dependency>
</dependencies>
</project>
@@ -0,0 +1,45 @@
/**
* 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 <http://www.gnu.org/licenses/>.
*/
package ch.powerunit.extensions.matchers.multi.parentold;

import ch.powerunit.extensions.matchers.ProvideMatchers;

/**
* @author borettim
*
*/
@ProvideMatchers
public class Pojo1 {

public String msg1;

public Pojo1() {
}

public Pojo1(String msg1) {
this.msg1 = msg1;
}

@Override
public String toString() {
return "Pojo1 [msg1=" + msg1 + "]";
}

}

0 comments on commit 9ed74fe

Please sign in to comment.