Skip to content

Commit 98afa9f

Browse files
Merge remote-tracking branch 'upstream/master'
2 parents 7bcfe24 + 2b7f03e commit 98afa9f

70 files changed

Lines changed: 3136 additions & 379 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎mutation-testing/pom.xml‎

Lines changed: 75 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,77 @@
11
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
22
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3-
<modelVersion>4.0.0</modelVersion>
4-
<groupId>com.baeldung</groupId>
5-
<artifactId>mutation-testing</artifactId>
6-
<version>0.1-SNAPSHOT</version>
7-
<name>mutation-testing</name>
8-
<dependencies>
9-
<dependency>
10-
<groupId>org.pitest</groupId>
11-
<artifactId>pitest-parent</artifactId>
12-
<version>1.1.10</version>
13-
<type>pom</type>
14-
</dependency>
15-
<dependency>
16-
<groupId>junit</groupId>
17-
<artifactId>junit</artifactId>
18-
<version>4.9</version>
19-
</dependency>
20-
</dependencies>
21-
<build>
22-
<plugins>
23-
<plugin>
24-
<groupId>org.pitest</groupId>
25-
<artifactId>pitest-maven</artifactId>
26-
<version>1.1.10</version>
27-
<configuration>
28-
<targetClasses>
29-
<param>com.baeldung.testing.mutation.*</param>
30-
</targetClasses>
31-
<targetTests>
32-
<param>com.baeldung.mutation.test.*</param>
33-
</targetTests>
34-
</configuration>
35-
</plugin>
36-
</plugins>
37-
</build>
38-
</project>
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>com.baeldung</groupId>
5+
<artifactId>mutation-testing</artifactId>
6+
<version>0.1-SNAPSHOT</version>
7+
<name>mutation-testing</name>
8+
<dependencies>
9+
<dependency>
10+
<groupId>org.pitest</groupId>
11+
<artifactId>pitest-parent</artifactId>
12+
<version>1.1.10</version>
13+
<type>pom</type>
14+
</dependency>
15+
<dependency>
16+
<groupId>junit</groupId>
17+
<artifactId>junit</artifactId>
18+
<version>4.9</version>
19+
</dependency>
20+
</dependencies>
21+
<build>
22+
<plugins>
23+
<plugin>
24+
<groupId>org.pitest</groupId>
25+
<artifactId>pitest-maven</artifactId>
26+
<version>1.1.10</version>
27+
<configuration>
28+
<targetClasses>
29+
<param>com.baeldung.testing.mutation.*</param>
30+
</targetClasses>
31+
<targetTests>
32+
<param>com.baeldung.mutation.test.*</param>
33+
</targetTests>
34+
</configuration>
35+
</plugin>
36+
<plugin>
37+
<groupId>org.jacoco</groupId>
38+
<artifactId>jacoco-maven-plugin</artifactId>
39+
<version>0.7.7.201606060606</version>
40+
<executions>
41+
<execution>
42+
<goals>
43+
<goal>prepare-agent</goal>
44+
</goals>
45+
</execution>
46+
<execution>
47+
<id>report</id>
48+
<phase>prepare-package</phase>
49+
<goals>
50+
<goal>report</goal>
51+
</goals>
52+
</execution>
53+
<execution>
54+
<id>jacoco-check</id>
55+
<goals>
56+
<goal>check</goal>
57+
</goals>
58+
<configuration>
59+
<rules>
60+
<rule>
61+
<element>PACKAGE</element>
62+
<limits>
63+
<limit>
64+
<counter>LINE</counter>
65+
<value>COVEREDRATIO</value>
66+
<minimum>0.50</minimum>
67+
</limit>
68+
</limits>
69+
</rule>
70+
</rules>
71+
</configuration>
72+
</execution>
73+
</executions>
74+
</plugin>
75+
</plugins>
76+
</build>
77+
</project>

‎mutation-testing/src/test/java/com/baeldung/mutation/test/TestPalindrome.java‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,26 @@
88
import com.baeldung.testing.mutation.Palindrome;
99

1010
public class TestPalindrome {
11+
@Test
12+
public void whenEmptyString_thanAccept() {
13+
Palindrome palindromeTester = new Palindrome();
14+
assertTrue(palindromeTester.isPalindrome("noon"));
15+
}
1116

1217
@Test
13-
public void acceptsPalindrome() {
18+
public void whenPalindrom_thanAccept() {
1419
Palindrome palindromeTester = new Palindrome();
1520
assertTrue(palindromeTester.isPalindrome("noon"));
1621
}
1722

1823
@Test
19-
public void rejectsNonPalindrome(){
24+
public void whenNotPalindrom_thanReject(){
2025
Palindrome palindromeTester = new Palindrome();
2126
assertFalse(palindromeTester.isPalindrome("box"));
2227
}
2328

2429
@Test
25-
public void rejectsNearPalindrome(){
30+
public void whenNearPalindrom_thanReject(){
2631
Palindrome palindromeTester = new Palindrome();
2732
assertFalse(palindromeTester.isPalindrome("neon"));
2833
}

‎orika/pom.xml‎

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>com.baeldung</groupId>
5+
<artifactId>orika</artifactId>
6+
<version>1.0</version>
7+
8+
<properties>
9+
<slf4j-api.version>1.7.5</slf4j-api.version>
10+
<jcl-over-slf4j.version>1.7.5</jcl-over-slf4j.version>
11+
<orika-core.version>1.4.6</orika-core.version>
12+
<junit.version>4.3</junit.version>
13+
</properties>
14+
15+
<name>Orika</name>
16+
17+
<dependencies>
18+
19+
<dependency>
20+
<groupId>org.slf4j</groupId>
21+
<artifactId>slf4j-api</artifactId>
22+
<version>${slf4j-api.version}</version>
23+
</dependency>
24+
25+
<dependency>
26+
<groupId>org.slf4j</groupId>
27+
<artifactId>jcl-over-slf4j</artifactId>
28+
<version>${jcl-over-slf4j.version}</version>
29+
</dependency>
30+
31+
<dependency>
32+
<groupId>ma.glasnost.orika</groupId>
33+
<artifactId>orika-core</artifactId>
34+
<version>${orika-core.version}</version>
35+
</dependency>
36+
37+
<dependency>
38+
<groupId>junit</groupId>
39+
<artifactId>junit</artifactId>
40+
<version>${junit.version}</version>
41+
<scope>test</scope>
42+
</dependency>
43+
44+
</dependencies>
45+
46+
<build>
47+
<plugins>
48+
<plugin>
49+
<groupId>org.apache.maven.plugins</groupId>
50+
<artifactId>maven-compiler-plugin</artifactId>
51+
<version>3.3</version>
52+
<configuration>
53+
<source>7</source>
54+
<target>7</target>
55+
</configuration>
56+
</plugin>
57+
</plugins>
58+
</build>
59+
60+
</project>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package com.baeldung.orika;
2+
3+
public class Dest {
4+
@Override
5+
public String toString() {
6+
return "Dest [name=" + name + ", age=" + age + "]";
7+
}
8+
9+
private String name;
10+
private int age;
11+
12+
public Dest() {
13+
14+
}
15+
16+
public Dest(String name, int age) {
17+
this.name = name;
18+
this.age = age;
19+
}
20+
21+
public String getName() {
22+
return name;
23+
}
24+
25+
public void setName(String name) {
26+
this.name = name;
27+
}
28+
29+
public int getAge() {
30+
return age;
31+
}
32+
33+
public void setAge(int age) {
34+
this.age = age;
35+
}
36+
37+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.baeldung.orika;
2+
3+
public class Name {
4+
private String firstName;
5+
private String lastName;
6+
7+
public Name(String firstName, String lastName) {
8+
this.firstName = firstName;
9+
this.lastName = lastName;
10+
}
11+
12+
public String getFirstName() {
13+
return firstName;
14+
}
15+
16+
public void setFirstName(String firstName) {
17+
this.firstName = firstName;
18+
}
19+
20+
public String getLastName() {
21+
return lastName;
22+
}
23+
24+
public void setLastName(String lastName) {
25+
this.lastName = lastName;
26+
}
27+
28+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package com.baeldung.orika;
2+
3+
public class Person {
4+
@Override
5+
public String toString() {
6+
return "Person [name=" + name + ", nickname=" + nickname + ", age="
7+
+ age + "]";
8+
}
9+
10+
private String name;
11+
private String nickname;
12+
private int age;
13+
14+
public Person() {
15+
16+
}
17+
18+
public Person(String name, String nickname, int age) {
19+
this.name = name;
20+
this.nickname = nickname;
21+
this.age = age;
22+
}
23+
24+
public String getName() {
25+
return name;
26+
}
27+
28+
public void setName(String name) {
29+
this.name = name;
30+
}
31+
32+
public String getNickname() {
33+
return nickname;
34+
}
35+
36+
public void setNickname(String nickname) {
37+
this.nickname = nickname;
38+
}
39+
40+
public int getAge() {
41+
return age;
42+
}
43+
44+
public void setAge(int age) {
45+
this.age = age;
46+
}
47+
48+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package com.baeldung.orika;
2+
3+
public class Person3 {
4+
private String name;
5+
private String dtob;
6+
7+
public Person3() {
8+
9+
}
10+
11+
public Person3(String name, String dtob) {
12+
this.name = name;
13+
this.dtob = dtob;
14+
}
15+
16+
public String getName() {
17+
return name;
18+
}
19+
20+
public void setName(String name) {
21+
this.name = name;
22+
}
23+
24+
public String getDtob() {
25+
return dtob;
26+
}
27+
28+
public void setDtob(String dtob) {
29+
this.dtob = dtob;
30+
}
31+
32+
@Override
33+
public String toString() {
34+
return "Person3 [name=" + name + ", dtob=" + dtob + "]";
35+
}
36+
37+
38+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.baeldung.orika;
2+
3+
public class PersonContainer {
4+
private Name name;
5+
6+
public PersonContainer(Name name) {
7+
this.name = name;
8+
}
9+
10+
public Name getName() {
11+
return name;
12+
}
13+
14+
public void setName(Name name) {
15+
this.name = name;
16+
}
17+
18+
}

0 commit comments

Comments
 (0)