diff --git a/enterprise-update/pom.xml b/enterprise-update/pom.xml
index a17bc0af8c..ab415ae715 100644
--- a/enterprise-update/pom.xml
+++ b/enterprise-update/pom.xml
@@ -154,8 +154,8 @@
* To run these tests in Eclipse, add the following to the "VM arguments" for the junit Run Configuration: *
- * -Dalfresco.update.package=target/alfresco-enterprise-update-package-2015-1-EA-SNAPSHOT.zip - * -Dalfresco.contents.package=target/update-contents-2015-1-EA-SNAPSHOT.zip + * -Dalfresco.update.package.zip=target/alfresco-enterprise-update-package-2015-1-EA-SNAPSHOT.zip ** * ...or similar, depending on current version etc. There probably is a better way. @@ -37,12 +36,11 @@ import org.junit.Test; public class PackagingIntegrationTest { private File updatePackage; - private File contentsPackage; @Before public void setUp() throws Exception { - String pkgName = System.getProperty("alfresco.update.package"); + String pkgName = System.getProperty("alfresco.update.package.zip"); assertNotNull("Could not determine package name.", pkgName); updatePackage = new File(pkgName); } diff --git a/enterprise-update/src/test/java/org/alfresco/update/pkg/test/AbstractIntegrationTest.java b/enterprise-update/src/test/java/org/alfresco/update/pkg/test/AbstractIntegrationTest.java index 90d5071b6b..b0ff8da80f 100644 --- a/enterprise-update/src/test/java/org/alfresco/update/pkg/test/AbstractIntegrationTest.java +++ b/enterprise-update/src/test/java/org/alfresco/update/pkg/test/AbstractIntegrationTest.java @@ -15,13 +15,11 @@ import org.junit.Before; public abstract class AbstractIntegrationTest { protected File targetDir; - protected String version; @Before public void setUp() throws Exception { initTargetDir(); - initVersion(); } private void initTargetDir() @@ -35,15 +33,6 @@ public abstract class AbstractIntegrationTest assertTrue("target dir does not exist :" + targetDir, this.targetDir.exists()); } - private void initVersion() - { - // This is set by maven, see pom.xml - System.out.println("MER"); - version = System.getProperty("version"); - System.out.println("SSS"); - assertNotNull("'version' system property not set. If using an IDE, then add an appropriate VM argument to " - + "your run configuration, e.g. -Dversion=5.0.3-SNAPSHOT", version); - } protected boolean runningOnWindows() { diff --git a/enterprise-update/src/test/java/org/alfresco/update/pkg/test/TgzFormatIntegrationTest.java b/enterprise-update/src/test/java/org/alfresco/update/pkg/test/TgzFormatIntegrationTest.java index 5fa84434b3..152bb6e0ac 100644 --- a/enterprise-update/src/test/java/org/alfresco/update/pkg/test/TgzFormatIntegrationTest.java +++ b/enterprise-update/src/test/java/org/alfresco/update/pkg/test/TgzFormatIntegrationTest.java @@ -8,6 +8,7 @@ package org.alfresco.update.pkg.test; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import java.io.BufferedInputStream; @@ -30,16 +31,26 @@ import org.junit.Test; /** * Tests for the tgz format packaging. * + * To run these tests in Eclipse, add the following to the "VM arguments" for the junit Run Configuration: + *
+ * -Dalfresco.update.package.tgz=target/alfresco-enterprise-update-package-2015-1-EA-SNAPSHOT.zip + *+ * * @author Matt Ward */ public class TgzFormatIntegrationTest extends AbstractIntegrationTest { private boolean found; + File updatePackage; + @Before public void setUp() throws Exception { super.setUp(); + String pkgName = System.getProperty("alfresco.update.package.tgz"); + assertNotNull("Could not determine package name.", pkgName); + updatePackage = new File(pkgName); } public final String ARTIFACT_NAME="alfresco-enterprise-update-package-"; @@ -54,12 +65,11 @@ public class TgzFormatIntegrationTest extends AbstractIntegrationTest return; } - File archive = new File(targetDir, ARTIFACT_NAME+version+".tgz"); - assertTrue("File does not exist: "+archive, archive.exists()); + assertTrue("File does not exist: "+ updatePackage, updatePackage.exists()); FileInputStream fis = null; try { - fis = new FileInputStream(archive); + fis = new FileInputStream(updatePackage); handleArchiveEntries(fis, new ArchiveEntryHandler() {