use of net.sourceforge.pmd.cpd.SimpleRenderer in project pmd-eclipse-plugin by pmd.
the class DetectCutAndPasteCmdTest method testDetectCutAndPasteCmdNullArg1.
/**
* Test robustness #1
*
* @throws CommandException
*/
@Test
public void testDetectCutAndPasteCmdNullArg1() throws CommandException {
try {
final DetectCutAndPasteCmd cmd = new DetectCutAndPasteCmd();
cmd.setProject(null);
cmd.setRenderer(new SimpleRenderer());
cmd.setReportName(PMDRuntimeConstants.SIMPLE_CPDREPORT_NAME);
cmd.performExecute();
Assert.fail();
} catch (final UnsetInputPropertiesException e) {
// yes cool
}
}
use of net.sourceforge.pmd.cpd.SimpleRenderer in project pmd-eclipse-plugin by pmd.
the class DetectCutAndPasteCmdTest method testDetectCutAndPasteCmdBasic1.
/**
* Test the basic usage of the cpd command
*/
@Test
public void testDetectCutAndPasteCmdBasic1() throws CommandException, CoreException {
final DetectCutAndPasteCmd cmd = new DetectCutAndPasteCmd();
cmd.setProject(this.testProject);
cmd.setRenderer(new SimpleRenderer());
cmd.setReportName(PMDRuntimeConstants.SIMPLE_CPDREPORT_NAME);
cmd.setCreateReport(true);
cmd.setLanguage("java");
cmd.setMinTileSize(10);
cmd.performExecute();
cmd.join();
final IFolder reportFolder = this.testProject.getFolder(PMDRuntimeConstants.REPORT_FOLDER);
Assert.assertTrue("The report folder doesn't exist: " + reportFolder, reportFolder.exists());
final IFile reportFile = reportFolder.getFile(PMDRuntimeConstants.SIMPLE_CPDREPORT_NAME);
Assert.assertTrue("The report file doesn't exist: " + reportFile, reportFile.exists());
if (reportFile.exists()) {
reportFile.delete(true, false, null);
}
if (reportFolder.exists()) {
reportFolder.delete(true, false, null);
}
}
use of net.sourceforge.pmd.cpd.SimpleRenderer in project pmd-eclipse-plugin by pmd.
the class DetectCutAndPasteCmdTest method testDetectCutAndPasteCmdNullArg5.
/**
* Test robustness #5
*
* @throws CommandException
*/
@Test
public void testDetectCutAndPasteCmdNullArg5() throws CommandException {
try {
final DetectCutAndPasteCmd cmd = new DetectCutAndPasteCmd();
cmd.setProject(null);
cmd.setRenderer(new SimpleRenderer());
cmd.setReportName(null);
cmd.performExecute();
Assert.fail();
} catch (final UnsetInputPropertiesException e) {
// yes cool
}
}
use of net.sourceforge.pmd.cpd.SimpleRenderer in project pmd-eclipse-plugin by pmd.
the class DetectCutAndPasteCmdTest method testDetectCutAndPasteCmdNullArg3.
/**
* Test robustness #3
*
* @throws CommandException
*/
@Test
public void testDetectCutAndPasteCmdNullArg3() throws CommandException {
try {
final DetectCutAndPasteCmd cmd = new DetectCutAndPasteCmd();
cmd.setProject(this.testProject);
cmd.setRenderer(new SimpleRenderer());
cmd.setReportName(null);
cmd.performExecute();
Assert.fail();
} catch (final UnsetInputPropertiesException e) {
// yes cool
}
}
Aggregations