I have a very trivial example I am using o check the setup of PitClipse on my machine using Eclipse Kepler. (I have tried 3 different machines, running 64 bit and 32 bit Java, and I have checked against testNG and JUnit 4)
I have installed PitClipse on all machines, and my project has used PitClipse before. When I select the test cases by right clicking and select run as PitTYest, the tool is starting up, but I am getting the following log:
Connected
Received request: PitRequest [options=PitOptions [reportDir=D:\Dropbox\ClassPreps\Spring20132014\se2832\Labs\.metadata\.plugins\org.pitest.pitclipse.core\html_results, classUnderTest=CalculatorTest, classesToMutate=[.*], sourceDirs=[D:\Dropbox\ClassPreps\Spring20132014\se2832\Labs\Lab8MutationTesting2014\src], packages=[], threads=4, historyLocation=null, excludedClasses=[], excludedMethods=[], avoidCallsTo=[java.util.logging, org.apache.log4j, org.slf4j, org.apache.commons.logging]], projects=[Lab8MutationTesting2014]]
5:28:08 PM PIT >> FINE : Running report with ReportOptions [config=org.pitest.mutationtest.config.CompoundConfiguration@2376170d, targetClasses=[^\..*$], excludedMethods=[], excludedClasses=[], codePaths=[], reportDir=D:\Dropbox\ClassPreps\Spring20132014\se2832\Labs\.metadata\.plugins\org.pitest.pitclipse.core\html_results, historyInputLocation=null, historyOutputLocation=null, sourceDirs=[D:\Dropbox\ClassPreps\Spring20132014\se2832\Labs\Lab8MutationTesting2014\src], classPathElements=[D:\Dropbox\ClassPreps\Spring20132014\se2832\Labs\Lab8MutationTesting2014\bin, C:\eclipse64\plugins\org.junit_4.11.0.v201303080030\junit.jar, C:\eclipse64\plugins\org.hamcrest.core_1.3.0.v201303031735.jar, C:\eclipse64\plugins\org.pitest.command-line-osgi_0.33.0.jar, C:\eclipse64\plugins\org.pitest.osgi_0.33.0.jar, C:\eclipse64\plugins\org.pitest.pitclipse-pitrunner_0.33.2.201404202230.jar, C:\eclipse64\plugins\org.pitest.guava-shade-osgi_16.0.1.jar, C:\eclipse64\configuration\org.eclipse.osgi\bundles\474\1\.cp\lib\jsr305-2.0.0.jar], mutators=[], dependencyAnalysisMaxDistance=-1, mutateStaticInitializers=false, jvmArgs=[], numberOfThreads=4, timeoutFactor=1.25, timeoutConstant=4000, targetTests=[^CalculatorTest$], loggingClasses=[java.util.logging, org.apache.log4j, org.slf4j, org.apache.commons.logging], maxMutationsPerClass=0, verbose=true, failWhenNoMutations=false, outputs=[HTML, PITCLIPSE_MUTATIONS], groupConfig=TestGroupConfig [excludedGroups=[], includedGroups=[]], mutationUnitSize=0, shouldCreateTimestampedReports=true, detectInlinedCode=false, exportLineCoverage=false, mutationThreshold=0, coverageThreshold=0, mutationEngine=gregor, javaExecutable=null]
5:28:08 PM PIT >> FINE : System class path is D:\Dropbox\ClassPreps\Spring20132014\se2832\Labs\Lab8MutationTesting2014\bin;C:\eclipse64\plugins\org.junit_4.11.0.v201303080030\junit.jar;C:\eclipse64\plugins\org.hamcrest.core_1.3.0.v201303031735.jar;C:\eclipse64\plugins\org.pitest.command-line-osgi_0.33.0.jar;C:\eclipse64\plugins\org.pitest.osgi_0.33.0.jar;C:\eclipse64\plugins\org.pitest.pitclipse-pitrunner_0.33.2.201404202230.jar;C:\eclipse64\plugins\org.pitest.guava-shade-osgi_16.0.1.jar;C:\eclipse64\configuration\org.eclipse.osgi\bundles\474\1\.cp\lib\jsr305-2.0.0.jar
5:28:08 PM PIT >> FINE : Maximum available memory is 1806 mb
5:28:08 PM PIT >> FINE : using port 8092
5:28:08 PM PIT >> FINE : SLAVE : Installing PIT agent
5:28:08 PM PIT >> INFO : Sending 1 test classes to slave
5:28:08 PM PIT >> INFO : Sent tests to slave
5:28:09 PM PIT >> INFO : SLAVE : 5:28:08 PM PIT >> FINE : Expecting 1 tests classes from parent
5:28:08 PM PIT >> FINE : Tests classes received
5:28:09 PM PIT >> INFO : SLAVE : 5:28:09 PM PIT >> INFO : Found 3 tests
5:28:09 PM PIT >> INFO : SLAVE : 5:28:09 PM PIT >> INFO : Dependency analysis reduced number of potential tests by 0
5:28:09 PM PIT >> INFO : SLAVE : 5:28:09 PM PIT >> INFO : 3 tests received
5:28:09 PM PIT >> INFO : SLAVE : 5:28:09 PM PIT >> FINE : Running 3 units
5:28:09 PM PIT >> INFO : SLAVE : 5:28:09 PM PIT >> FINE : Gathering coverage for test Description [testClass=CalculatorTest, name=testMultiply(CalculatorTest)]
5:28:09 PM PIT >> INFO : SLAVE : 5:28:09 PM PIT >> FINE : Gathering coverage for test Description [testClass=CalculatorTest, name=testSimpleAdd(CalculatorTest)]
5:28:09 PM PIT >> INFO : SLAVE : 5:28:09 PM PIT >> FINE : Gathering coverage for test Description [testClass=CalculatorTest, name=testSubtract(CalculatorTest)]
5:28:09 PM PIT >> INFO : SLAVE : 5:28:09 PM PIT >> FINE : Finished
5:28:09 PM PIT >> INFO : Calculated coverage in 0 seconds.
5:28:09 PM PIT >> FINE : Used memory after coverage calculation 15 mb
5:28:09 PM PIT >> FINE : Free Memory after coverage calculation 105 mb
5:28:09 PM PIT >> INFO : Created 0 mutation test units
5:28:09 PM PIT >> WARNING : No mutations found. This probably means there is an issue with either the supplied classpath or filters.
5:28:09 PM PIT >> FINE : Used memory before analysis start 17 mb
5:28:09 PM PIT >> FINE : Free Memory before analysis start 103 mb
5:28:09 PM PIT >> FINE : Running 0 units
5:28:09 PM PIT >> FINE : Finished
5:28:09 PM PIT >> INFO : Completed in 0 seconds
================================================================================
However, in the past, this exact code has mutated very well with PitClipse on different computers. What aspect of configuration might be wrong that would prevent this eclipse plugin from working? I'm attached the code and test cases below as well:
/**
* The following class holds calculator operations.
* @author schilling
*
*/
public class CalculatorExample {
/**
* This method will add two integers and provide the result as a return value.
* @param a This is the first addend.
* @param b This is the second addend.
* @return The return value is the sum of the two numbers.
*/
public int add(int a, int b) {
return a + b;
}
/**
* This method will add two integers and provide the result as a return value.
* @param a This is the first parameter.
* @param b This is the second parameter.
* @return The return value is the difference of the two numbers.
*/
public int subtract(int a, int b) {
return a - b;
}
public int multiply(int a, int b) {
return a * b;
}
public int divide(int a, int b) {
return a / b;
}
}
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
/**
* This class will verify the operation of the simple calculator class.
* @author schilling
*
*/
public class CalculatorTest {
private CalculatorExample c;
/**
* This method will simply instantiate a new instance of the Calculator class so that it is clean each time a test case executes.
*/
@Before
public void setup()
{
c=new CalculatorExample();
}
@Test
/**
* This method ensures that the addition operation works properly.
*/
public void testSimpleAdd() {
assertEquals(c.add(1, 1), 2);
}
@Test
/**
* This method will test that simple subtraction works.
*/
public void testSubtract() {
assertEquals(c.subtract(0, 0), 0);
assertEquals(c.subtract(5, 4), 1);
}
@Test
/**
* The following is a basic test of multiplication, making certain two multiplies work properly.
*/
public void testMultiply()
{
assertEquals(c.multiply(0, 0),0);
//assertEquals(c.multiply(1, 1),1);
}
}