Skip to content

Commit

Permalink
Issue #331 - Add a way to ignore fields in hasSameValue
Browse files Browse the repository at this point in the history
  • Loading branch information
boretti committed May 30, 2020
1 parent 1fef4d4 commit bd0aaed
Show file tree
Hide file tree
Showing 34 changed files with 726 additions and 108 deletions.
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 + "]";
}

}
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,0 +1,42 @@
/**
* 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;

/**
* @author borettim
*
*/
public class Pojo2 {

public String msg1;

public Pojo2() {
}

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

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

}
1 change: 1 addition & 0 deletions src/it/multimodule-nogeneric-it-jdk8/pom.xml
Expand Up @@ -162,6 +162,7 @@

<modules>
<module>parent</module>
<module>parent-old</module>
<module>children</module>
</modules>

Expand Down
5 changes: 5 additions & 0 deletions src/it/multimodule-nogeneric-it-jdk9+/children/pom.xml
Expand Up @@ -69,6 +69,11 @@
<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>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
Expand Down
@@ -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 comments on commit bd0aaed

Please sign in to comment.