Rename mutation-testing -> testing

This commit is contained in:
Grzegorz Piwowarek 2016-10-25 17:16:10 +02:00
parent 93b4917672
commit 54572b9c9d
5 changed files with 127 additions and 127 deletions

View File

@ -58,7 +58,7 @@
<module>mockito</module> <module>mockito</module>
<module>mocks</module> <module>mocks</module>
<module>mutation-testing</module> <module>testing</module>
<module>orika</module> <module>orika</module>

View File

@ -1,77 +1,77 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <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"> 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> <modelVersion>4.0.0</modelVersion>
<groupId>com.baeldung</groupId> <groupId>com.baeldung</groupId>
<artifactId>mutation-testing</artifactId> <artifactId>mutation-testing</artifactId>
<version>0.1-SNAPSHOT</version> <version>0.1-SNAPSHOT</version>
<name>mutation-testing</name> <name>mutation-testing</name>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.pitest</groupId> <groupId>org.pitest</groupId>
<artifactId>pitest-parent</artifactId> <artifactId>pitest-parent</artifactId>
<version>1.1.10</version> <version>1.1.10</version>
<type>pom</type> <type>pom</type>
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.9</version> <version>4.9</version>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.pitest</groupId> <groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId> <artifactId>pitest-maven</artifactId>
<version>1.1.10</version> <version>1.1.10</version>
<configuration> <configuration>
<targetClasses> <targetClasses>
<param>com.baeldung.testing.mutation.*</param> <param>com.baeldung.testing.mutation.*</param>
</targetClasses> </targetClasses>
<targetTests> <targetTests>
<param>com.baeldung.mutation.test.*</param> <param>com.baeldung.mutation.test.*</param>
</targetTests> </targetTests>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.jacoco</groupId> <groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId> <artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.7.201606060606</version> <version>0.7.7.201606060606</version>
<executions> <executions>
<execution> <execution>
<goals> <goals>
<goal>prepare-agent</goal> <goal>prepare-agent</goal>
</goals> </goals>
</execution> </execution>
<execution> <execution>
<id>report</id> <id>report</id>
<phase>prepare-package</phase> <phase>prepare-package</phase>
<goals> <goals>
<goal>report</goal> <goal>report</goal>
</goals> </goals>
</execution> </execution>
<execution> <execution>
<id>jacoco-check</id> <id>jacoco-check</id>
<goals> <goals>
<goal>check</goal> <goal>check</goal>
</goals> </goals>
<configuration> <configuration>
<rules> <rules>
<rule> <rule>
<element>PACKAGE</element> <element>PACKAGE</element>
<limits> <limits>
<limit> <limit>
<counter>LINE</counter> <counter>LINE</counter>
<value>COVEREDRATIO</value> <value>COVEREDRATIO</value>
<minimum>0.50</minimum> <minimum>0.50</minimum>
</limit> </limit>
</limits> </limits>
</rule> </rule>
</rules> </rules>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
</project> </project>

View File

@ -1,15 +1,15 @@
package com.baeldung.testing.mutation; package com.baeldung.testing.mutation;
public class Palindrome { public class Palindrome {
public boolean isPalindrome(String inputString) { public boolean isPalindrome(String inputString) {
if (inputString.length() == 0) { if (inputString.length() == 0) {
return true; return true;
} else { } else {
char firstChar = inputString.charAt(0); char firstChar = inputString.charAt(0);
char lastChar = inputString.charAt(inputString.length() - 1); char lastChar = inputString.charAt(inputString.length() - 1);
String mid = inputString.substring(1, inputString.length() - 1); String mid = inputString.substring(1, inputString.length() - 1);
return (firstChar == lastChar) && isPalindrome(mid); return (firstChar == lastChar) && isPalindrome(mid);
} }
} }
} }

View File

@ -1,34 +1,34 @@
package com.baeldung.mutation.test; package com.baeldung.mutation.test;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import org.junit.Test; import org.junit.Test;
import com.baeldung.testing.mutation.Palindrome; import com.baeldung.testing.mutation.Palindrome;
public class TestPalindrome { public class TestPalindrome {
@Test @Test
public void whenEmptyString_thanAccept() { public void whenEmptyString_thanAccept() {
Palindrome palindromeTester = new Palindrome(); Palindrome palindromeTester = new Palindrome();
assertTrue(palindromeTester.isPalindrome("noon")); assertTrue(palindromeTester.isPalindrome("noon"));
} }
@Test @Test
public void whenPalindrom_thanAccept() { public void whenPalindrom_thanAccept() {
Palindrome palindromeTester = new Palindrome(); Palindrome palindromeTester = new Palindrome();
assertTrue(palindromeTester.isPalindrome("noon")); assertTrue(palindromeTester.isPalindrome("noon"));
} }
@Test @Test
public void whenNotPalindrom_thanReject(){ public void whenNotPalindrom_thanReject(){
Palindrome palindromeTester = new Palindrome(); Palindrome palindromeTester = new Palindrome();
assertFalse(palindromeTester.isPalindrome("box")); assertFalse(palindromeTester.isPalindrome("box"));
} }
@Test @Test
public void whenNearPalindrom_thanReject(){ public void whenNearPalindrom_thanReject(){
Palindrome palindromeTester = new Palindrome(); Palindrome palindromeTester = new Palindrome();
assertFalse(palindromeTester.isPalindrome("neon")); assertFalse(palindromeTester.isPalindrome("neon"));
} }
} }