r1040 - lutinjaxx/trunk/maven-jaxx-plugin/src/test/java/org/codelutin/jaxx
Author: chemit Date: 2008-11-30 21:12:00 +0000 (Sun, 30 Nov 2008) New Revision: 1040 Removed: lutinjaxx/trunk/maven-jaxx-plugin/src/test/java/org/codelutin/jaxx/BuildExamples.java Log: no more used Deleted: lutinjaxx/trunk/maven-jaxx-plugin/src/test/java/org/codelutin/jaxx/BuildExamples.java =================================================================== --- lutinjaxx/trunk/maven-jaxx-plugin/src/test/java/org/codelutin/jaxx/BuildExamples.java 2008-11-30 21:10:13 UTC (rev 1039) +++ lutinjaxx/trunk/maven-jaxx-plugin/src/test/java/org/codelutin/jaxx/BuildExamples.java 2008-11-30 21:12:00 UTC (rev 1040) @@ -1,106 +0,0 @@ -package org.codelutin.jaxx; - -import junit.framework.TestCase; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.maven.it.VerificationException; -import org.apache.maven.it.Verifier; -import org.codehaus.plexus.util.FileUtils; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -/** - * @author chemit - * @deprecated This goal is not ny longer used : we have specific maven modules to build examples... - */ -public abstract class BuildExamples extends TestCase { - - protected static final Log log = LogFactory.getLog(BuildExamples.class); - - protected File srcDir; - - protected File destDir; - - protected File siteDir; - protected File siteDestDir; - - protected Verifier verifier; - - protected File getBasedir() { - String b = System.getenv("basedir"); - if (b == null) { - b = new File("").getAbsolutePath(); - } - return new File(b); - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - log.info("start " + getName()); - String dirname = getName().substring(4); - - srcDir = new File(getBasedir(), "src" + File.separator + "examples" + File.separator + dirname); - destDir = new File(getBasedir(), "target" + File.separator + "examples" + File.separator + dirname); - siteDestDir = new File(getBasedir(), "target" + File.separator + "generated-site" + File.separator + "resources" + File.separator + "examples"); - siteDir = new File(destDir, "target" + File.separator + "jnlp"); - - destDir.mkdirs(); - - FileUtils.copyDirectoryStructure(srcDir, destDir); - - verifier = new Verifier(destDir.getAbsolutePath(), true); - - List<String> cliOptions = new ArrayList<String>(); - cliOptions.add("-Dmaven.verbose=true"); - verifier.setCliOptions(cliOptions); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - srcDir = destDir = null; - if (verifier != null) { - verifier.resetStreams(); - verifier = null; - } - } - - /** - * fixme : make this test works again. - * - * @throws Exception if any - */ - public void estComponents() throws Exception { - buildExample(); - } - - public void testCalculator() throws Exception { - buildExample(); - } - - public void testCounter() throws Exception { - buildExample(); - } - - public void testLabelStyle() throws Exception { - buildExample(); - } - - public void testValidation() throws Exception { - buildExample(); - } - - protected void buildExample() throws VerificationException, IOException { - verifier.executeGoals(Arrays.asList("jaxx:generate", "package")); - verifier.verifyErrorFreeLog(); - FileUtils.copyDirectory(new File(siteDir, "lib"), new File(siteDestDir, "lib")); - FileUtils.copyDirectory(siteDir, siteDestDir, "*.jnlp", ""); - } - - -}
participants (1)
-
chemit@users.labs.libre-entreprise.org