mirror of
https://github.com/Alfresco/alfresco-sdk.git
synced 2025-06-02 17:35:25 +00:00
Archetypes - Remove unnecessary test files
Remove archetype test files not required with the new integration tests approach we're following for the archetype tests.
This commit is contained in:
parent
646899610d
commit
00839a8170
@ -1,5 +0,0 @@
|
||||
version=0.1-SNAPSHOT
|
||||
groupId=archetype.it
|
||||
artifactId=repoJarTest
|
||||
package=it.pkg
|
||||
|
@ -1 +0,0 @@
|
||||
verify -DskipTests=true
|
@ -1,4 +0,0 @@
|
||||
version=0.1-SNAPSHOT
|
||||
groupId=archetype.it
|
||||
artifactId=repoJarTestRun
|
||||
package=it.pkg
|
@ -1 +0,0 @@
|
||||
install
|
@ -1,4 +0,0 @@
|
||||
version=0.1-SNAPSHOT
|
||||
groupId=archetype.it
|
||||
artifactId=repoJarTestRunEnterpriseSixZero
|
||||
package=it.pkg
|
@ -1 +0,0 @@
|
||||
install -DskipTests -Dalfresco.bomDependencyArtifactId="acs-packaging" -Dalfresco.platform.version="6.0.0.2" -Dalfresco.share.version="6.0" -Dalfresco.platform.docker.image="alfresco/alfresco-content-repository" -Dalfresco.share.docker.image="alfresco/alfresco-share"
|
@ -1,4 +0,0 @@
|
||||
version=0.1-SNAPSHOT
|
||||
groupId=archetype.it
|
||||
artifactId=shareJarTest
|
||||
package=it.pkg
|
@ -1 +0,0 @@
|
||||
verify -DskipTests=true
|
@ -1,4 +0,0 @@
|
||||
version=0.1-SNAPSHOT
|
||||
groupId=archetype.it
|
||||
artifactId=shareJarTestRun
|
||||
package=it.pkg
|
@ -1 +0,0 @@
|
||||
install
|
@ -1,4 +0,0 @@
|
||||
version=0.1-SNAPSHOT
|
||||
groupId=archetype.it
|
||||
artifactId=shareJarTestRunEnterpriseSixZero
|
||||
package=it.pkg
|
@ -1 +0,0 @@
|
||||
install -DskipTests -Dalfresco.bomDependencyArtifactId="acs-packaging" -Dalfresco.platform.version="6.0.0.2" -Dalfresco.share.version="6.0" -Dalfresco.platform.docker.image="alfresco/alfresco-content-repository" -Dalfresco.share.docker.image="alfresco/alfresco-share"
|
@ -0,0 +1,55 @@
|
||||
package org.alfresco.maven.archetype.allinone;
|
||||
|
||||
import org.apache.maven.it.VerificationException;
|
||||
import org.apache.maven.it.Verifier;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
public abstract class AbstractArchetypeIT {
|
||||
|
||||
protected static final File ROOT = new File("target/test-classes/");
|
||||
protected static final String LOG_FILENAME = "log.txt";
|
||||
protected static final String ERROR_FILENAME = "error.txt";
|
||||
protected static final String LINUX_EXEC = "run.sh";
|
||||
protected static final String WINDOWS_EXEC = "run.bat";
|
||||
|
||||
protected ArchetypeProperties archetypeProperties;
|
||||
protected String projectPath;
|
||||
|
||||
@Before
|
||||
public void setUp() throws VerificationException, IOException {
|
||||
archetypeProperties = createArchetypeProperties();
|
||||
projectPath = ROOT.getAbsolutePath() + File.separator + archetypeProperties.getProjectArtifactId();
|
||||
|
||||
Verifier verifier = new Verifier(ROOT.getAbsolutePath());
|
||||
// Deleting a former created artifact from the archetype to be tested
|
||||
verifier.deleteArtifact(archetypeProperties.getProjectGroupId(), archetypeProperties.getProjectArtifactId(), archetypeProperties.getProjectVersion(), null);
|
||||
// Delete the created maven project
|
||||
verifier.deleteDirectory(archetypeProperties.getProjectArtifactId());
|
||||
}
|
||||
|
||||
protected abstract ArchetypeProperties createArchetypeProperties();
|
||||
|
||||
protected void generateProject() throws Exception {
|
||||
Verifier verifier = new Verifier(ROOT.getAbsolutePath());
|
||||
verifier.setSystemProperties(archetypeProperties.getSystemProperties());
|
||||
verifier.setAutoclean(false);
|
||||
verifier.executeGoal("archetype:generate");
|
||||
verifier.verifyErrorFreeLog();
|
||||
}
|
||||
|
||||
protected ProcessBuilder getProcessBuilder() {
|
||||
ProcessBuilder pb = new ProcessBuilder(getCommand(),"build_test");
|
||||
pb.directory(new File(projectPath));
|
||||
pb.redirectOutput(new File(projectPath + File.separator + LOG_FILENAME));
|
||||
pb.redirectError(new File(projectPath + File.separator + ERROR_FILENAME));
|
||||
return pb;
|
||||
}
|
||||
|
||||
private String getCommand() {
|
||||
return projectPath + File.separator + (System.getProperty( "os.name" ).startsWith( "Windows" ) ? WINDOWS_EXEC : LINUX_EXEC);
|
||||
}
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
package org.alfresco.maven.archetype.allinone;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
public class Constants {// GAV for the archetype
|
||||
|
||||
public static final String ARCHETYPE_GROUP_ID = "org.alfresco.maven.archetype";
|
||||
public static final String ARCHETYPE_ARTEFACT_ID = "alfresco-allinone-archetype";
|
||||
public static final String ARCHETYPE_VERSION = "4.0.0-SNAPSHOT";
|
||||
|
||||
|
||||
// GAV for the created artefact from the archetype which we want to test
|
||||
public static final String TEST_GROUP_ID = "archetype.it";
|
||||
|
||||
public static final String TEST_ARTIFACT_ID = "allinone-test-run";
|
||||
|
||||
public static final String TEST_VERSION = "0.1-SNAPSHOT";
|
||||
|
||||
|
||||
public static Properties getSystemProperties() {
|
||||
Properties props = new Properties(System.getProperties());
|
||||
props.put("archetypeGroupId", Constants.ARCHETYPE_GROUP_ID);
|
||||
props.put("archetypeArtifactId", Constants.ARCHETYPE_ARTEFACT_ID);
|
||||
props.put("archetypeVersion", Constants.ARCHETYPE_VERSION);
|
||||
props.put("groupId", Constants.TEST_GROUP_ID);
|
||||
props.put("artifactId", Constants.TEST_ARTIFACT_ID);
|
||||
props.put("version", Constants.TEST_VERSION);
|
||||
props.put("interactiveMode", "false");
|
||||
|
||||
return props;
|
||||
}
|
||||
|
||||
}
|
@ -1,68 +0,0 @@
|
||||
package org.alfresco.maven.archetype.allinone;
|
||||
|
||||
import org.apache.maven.it.VerificationException;
|
||||
import org.apache.maven.it.Verifier;
|
||||
import org.apache.maven.it.util.cli.CommandLineUtils;
|
||||
import org.apache.maven.it.util.cli.Commandline;
|
||||
import org.apache.maven.it.util.cli.StreamConsumer;
|
||||
import org.apache.maven.it.util.cli.WriterStreamConsumer;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.Writer;
|
||||
|
||||
public class CreateArchetypeTest {
|
||||
|
||||
public static final File ROOT = new File("target/test-classes/");
|
||||
|
||||
@Before
|
||||
public void setUp() throws VerificationException, IOException {
|
||||
Verifier verifier;
|
||||
|
||||
/*
|
||||
* We must first make sure that any artifact created
|
||||
* by this test has been removed from the local
|
||||
* repository. Failing to do this could cause
|
||||
* unstable test results. Fortunately, the verifier
|
||||
* makes it easy to do this.
|
||||
*/
|
||||
verifier = new Verifier(ROOT.getAbsolutePath());
|
||||
// Deleting a former created artefact from the archetype to be tested
|
||||
verifier.deleteArtifact(Constants.TEST_GROUP_ID, Constants.TEST_ARTIFACT_ID, Constants.TEST_VERSION, null);
|
||||
|
||||
// Delete the created maven project
|
||||
verifier.deleteDirectory(Constants.TEST_ARTIFACT_ID);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGenerateArchetype() throws Exception {
|
||||
Verifier verifier = new Verifier(ROOT.getAbsolutePath());
|
||||
verifier.setSystemProperties(Constants.getSystemProperties());
|
||||
verifier.setAutoclean(false);
|
||||
|
||||
/*
|
||||
* The Command Line Options (CLI) are passed to the
|
||||
* verifier as a list.
|
||||
*/
|
||||
verifier.executeGoal("archetype:generate");
|
||||
|
||||
verifier.verifyErrorFreeLog();
|
||||
|
||||
// Since creating the archetype was successful, we now want to actually build the generated project
|
||||
ProcessBuilder pb = new ProcessBuilder(ROOT.getAbsolutePath() + "/" + Constants.TEST_ARTIFACT_ID + "/" + "run.sh","test");
|
||||
pb.directory(new File(ROOT.getAbsolutePath() + "/" + Constants.TEST_ARTIFACT_ID));
|
||||
pb.redirectOutput(new File(ROOT.getAbsolutePath() + "/" + Constants.TEST_ARTIFACT_ID + "/" + "log.txt"));
|
||||
int exitvalue = pb.start().exitValue();
|
||||
System.out.println(exitvalue);
|
||||
|
||||
verifier = new Verifier(ROOT.getAbsolutePath() + "/" + Constants.TEST_ARTIFACT_ID);
|
||||
|
||||
verifier.setAutoclean(false);
|
||||
verifier.setLogFileName("log.txt");
|
||||
|
||||
verifier.verifyErrorFreeLog();
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
run.sh test
|
Loading…
x
Reference in New Issue
Block a user