Skip to content

Commit

Permalink
Remove a lot of old println detritus (#246)
Browse files Browse the repository at this point in the history
* Remove a lot of old println detritus
  • Loading branch information
elharo authored Nov 28, 2024
1 parent 7b4c29c commit e3e970b
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,6 @@ public void setIncludes(String includes) {
* <code>null</code>, doesn't exist, or isn't a directory).
*/
public List<String> scan(List<String> files) throws IllegalStateException {
// System.err.println("Scanning \nbasedir="+basedir +
// " \nincludes=" + java.util.Arrays.toString(includes) +
// " \nexcludes=" + java.util.Arrays.toString(excludes) +
// " \non files="+files);
if (basedir == null) {
throw new IllegalStateException("No basedir set");
}
Expand All @@ -410,16 +406,15 @@ public List<String> scan(List<String> files) throws IllegalStateException {
result.add(fileName);
}
}
// System.err.println("Result "+result+"\n\n\n");
return result;
}

/**
* Tests whether or not a name matches against at least one exclude pattern.
* Tests whether a name matches at least one exclude pattern.
*
* @param name The name to match. Must not be <code>null</code>.
* @param name The name to match. Must not be <code>null</code>
* @return <code>true</code> when the name matches against at least one exclude pattern, or
* <code>false</code> otherwise.
* <code>false</code> otherwise
*/
protected boolean isExcluded(String name) {
return matchesPatterns(name, excludes);
Expand Down Expand Up @@ -455,7 +450,6 @@ protected boolean matchesPatterns(String name, String[] patterns) {

for (int i = 0; i < patterns.length; i++) {
path = PathUtils.convertPathForOS(baseDir + patterns[i]);
// System.err.println("path="+path);
if (matchPath(path, name, isCaseSensitive)) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,10 @@ public void testResourceFiltering() throws Exception {
archetypeResources.add("src/test/mdo/AppTest.mdo");
archetypeResources.add("src/test/resources/AppTest.properties");

System.out.println("FileSet:" + fileSet);
System.out.println("Resources:" + archetypeResources);

ArchetypeFilesResolver resolver = new DefaultArchetypeFilesResolver();

List<String> fileSetResources = resolver.filterFiles("", fileSet, archetypeResources);

System.out.println("Result:" + fileSetResources);

assertEquals(2, fileSetResources.size());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ public void testOutput_Document_ShouldParseAndOutputCDATASection_NoMods() throws
StringWriter sw = new StringWriter();
new XMLOutputter().output(doc, sw);

System.out.println("Resulting content is:\n\n\'" + sw + "\'\n\n");

assertTrue(sw.toString().indexOf(content) > -1);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ private ArchetypeGenerationResult generateProjectFromArchetypeWithFailure(Archet
}

public void testArchetypeNotDefined() throws Exception {
System.out.println("testArchetypeNotDefined");

Archetype archetype = new Archetype("archetypes", null, "1.0");

ArchetypeGenerationRequest request = createArchetypeGenerationRequest("generate-2", archetype);
Expand All @@ -117,8 +115,6 @@ public void testArchetypeNotDefined() throws Exception {
}

public void testGenerateArchetypeCompleteWithoutParent() throws Exception {
System.out.println("testGenerateArchetypeCompleteWithoutParent");

ArchetypeGenerationRequest request = createArchetypeGenerationRequest("generate-4", ARCHETYPE_BASIC);

FileUtils.forceDelete(projectDirectory);
Expand All @@ -144,8 +140,6 @@ public void testGenerateArchetypeCompleteWithoutParent() throws Exception {
}

public void testGenerateArchetypeCompleteWithParent() throws Exception {
System.out.println("testGenerateArchetypeCompleteWithParent");

ArchetypeGenerationRequest request = createArchetypeGenerationRequest("generate-5", ARCHETYPE_BASIC);

File projectFile = getProjectFile();
Expand All @@ -169,8 +163,6 @@ public void testGenerateArchetypeCompleteWithParent() throws Exception {
}

public void testGenerateArchetypePartialOnChild() throws Exception {
System.out.println("testGenerateArchetypePartialOnChild");

ArchetypeGenerationRequest request = createArchetypeGenerationRequest("generate-8", ARCHETYPE_PARTIAL);

File parentProjectFile = getProjectFile();
Expand All @@ -197,8 +189,6 @@ public void testGenerateArchetypePartialOnChild() throws Exception {
}

public void testGenerateArchetypePartialOnChildDontOverride() throws Exception {
System.out.println("testGenerateArchetypePartialOnChildDontOverride");

ArchetypeGenerationRequest request = createArchetypeGenerationRequest("generate-9", ARCHETYPE_PARTIAL);

File projectFile = new File(projectDirectory, "pom.xml");
Expand All @@ -224,8 +214,6 @@ public void testGenerateArchetypePartialOnChildDontOverride() throws Exception {
}

public void testGenerateArchetypePartialOnParent() throws Exception {
System.out.println("testGenerateArchetypePartialOnParent");

ArchetypeGenerationRequest request = createArchetypeGenerationRequest("generate-7", ARCHETYPE_PARTIAL);

File projectFile = new File(outputDirectory, "pom.xml");
Expand All @@ -246,8 +234,6 @@ public void testGenerateArchetypePartialOnParent() throws Exception {
}

public void testGenerateArchetypePartialWithoutPoms() throws Exception {
System.out.println("testGenerateArchetypePartialWithoutPoms");

ArchetypeGenerationRequest request = createArchetypeGenerationRequest("generate-6", ARCHETYPE_PARTIAL);

File projectFile = new File(projectDirectory, "pom.xml");
Expand All @@ -264,8 +250,6 @@ public void testGenerateArchetypePartialWithoutPoms() throws Exception {
}

public void testGenerateArchetypeSite() throws Exception {
System.out.println("testGenerateArchetypeSite");

ArchetypeGenerationRequest request = createArchetypeGenerationRequest("generate-10", ARCHETYPE_SITE);

File projectFile = new File(projectDirectory, "pom.xml");
Expand All @@ -285,8 +269,6 @@ public void testGenerateArchetypeSite() throws Exception {
}

public void testGenerateFileSetArchetype() throws Exception {
System.out.println("testGenerateFileSetArchetype");

ArchetypeGenerationRequest request = createArchetypeGenerationRequest("generate-12", ARCHETYPE_FILESET);

File projectFile = new File(projectDirectory, "pom.xml");
Expand Down Expand Up @@ -369,8 +351,6 @@ public void testGenerateFileSetArchetype() throws Exception {
}

public void testGenerateOldArchetype() throws Exception {
System.out.println("testGenerateOldArchetype");

ArchetypeGenerationRequest request = createArchetypeGenerationRequest("generate-11", ARCHETYPE_OLD);

File projectFile = new File(projectDirectory, "pom.xml");
Expand All @@ -391,8 +371,6 @@ public void testGenerateOldArchetype() throws Exception {
}

public void testPropertiesNotDefined() throws Exception {
System.out.println("testPropertiesNotDefined");

ArchetypeGenerationRequest request = createArchetypeGenerationRequest("generate-3", ARCHETYPE_BASIC);

request.setProperties(new Properties());
Expand All @@ -406,8 +384,6 @@ public void testPropertiesNotDefined() throws Exception {
}

public void testGenerateArchetypeWithPostScriptIncluded() throws Exception {
System.out.println("testGenerateArchetypeWithPostScriptIncluded");

ArchetypeGenerationRequest request =
createArchetypeGenerationRequest("generate-13", ARCHETYPE_FILESET_WITH_POSTCREATE_SCRIPT);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ public class DefaultRepositoryCrawlerTest extends AbstractMojoTestCase {
* Test of crawl method, of class DefaultRepositoryCrawler.
*/
public void testCrawl() throws Exception {
System.out.println("crawl");

File repository = getTestFile("target/test-classes/repositories/central");
RepositoryCrawler instance = (RepositoryCrawler) lookup(RepositoryCrawler.class.getName());

Expand All @@ -45,22 +43,4 @@ public void testCrawl() throws Exception {
// TODO: should write to another directory
// instance.writeCatalog(result, new File(repository, "archetype-catalog.xml"));
}

// public void testCrawl2 ()
// throws Exception
// {
// System.out.println ( "\n\n\n\n\n\ncrawl2" );
//
// File repository = new File("/home/rafale/.m2/repository");
// //getTestFile ( "target/test-classes/repositories/central" );
// RepositoryCrawler instance =
// (RepositoryCrawler) lookup ( RepositoryCrawler.class.getName () );
//
// ArchetypeCatalog expResult = null;
// ArchetypeCatalog result = instance.crawl ( repository );
// System.err.println("result = "+result);
// assertEquals ( expResult, result );
// // TODO review the generated test code and remove the default call to fail.
//// fail ( "The test case is a prototype." );
// }
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,12 @@ public void testProjectGenerationFromAnArchetype() throws Exception {

ArchetypeCatalog catalog = archetype.getLocalCatalog(repositorySession);

System.err.println("archetypes => " + catalog.getArchetypes());
// Here I am just grabbing a OldArchetype but in a UI you would take the OldArchetype objects and present
// them to the user.

Archetype selection =
catalog.getArchetypes().get(catalog.getArchetypes().size() - 1);

System.err.println("Selected OldArchetype = " + selection);
// Now you will present a dialog, or whatever, and grab the following values.

String groupId = "com.mycompany";
Expand Down

0 comments on commit e3e970b

Please sign in to comment.