Merged WOLF-6 (WOLF.0.0) to 5.1.1 (5.1.1)

112275 mrogers: Please work!


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/services/full-installer/branches/5.1.1@123929 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mark Rogers
2016-03-15 10:59:23 +00:00
parent fe3c489edd
commit e4bcc6f2ff
4 changed files with 17 additions and 20 deletions

View File

@@ -154,8 +154,8 @@
<include>**/*IntegrationTest.java</include> <include>**/*IntegrationTest.java</include>
</includes> </includes>
<systemPropertyVariables> <systemPropertyVariables>
<alfresco.update.package>${project.artifactId}-${installer.version.name}.zip</alfresco.update.package> <alfresco.update.package.zip>${project.artifactId}-${installer.version.name}.zip</alfresco.update.package.zip>
<version>${version}</version> <alfresco.update.package.tgz>${project.artifactId}-${installer.version.name}.tgz</alfresco.update.package.tgz>
<alfresco.target.dir>${project.build.directory}</alfresco.target.dir> <alfresco.target.dir>${project.build.directory}</alfresco.target.dir>
</systemPropertyVariables> </systemPropertyVariables>
</configuration> </configuration>

View File

@@ -26,8 +26,7 @@ import org.junit.Test;
* <p> * <p>
* To run these tests in Eclipse, add the following to the "VM arguments" for the junit Run Configuration: * To run these tests in Eclipse, add the following to the "VM arguments" for the junit Run Configuration:
* <pre> * <pre>
* -Dalfresco.update.package=target/alfresco-enterprise-update-package-2015-1-EA-SNAPSHOT.zip * -Dalfresco.update.package.zip=target/alfresco-enterprise-update-package-2015-1-EA-SNAPSHOT.zip
* -Dalfresco.contents.package=target/update-contents-2015-1-EA-SNAPSHOT.zip
* </pre> * </pre>
* *
* ...or similar, depending on current version etc. There probably is a better way. * ...or similar, depending on current version etc. There probably is a better way.
@@ -37,12 +36,11 @@ import org.junit.Test;
public class PackagingIntegrationTest public class PackagingIntegrationTest
{ {
private File updatePackage; private File updatePackage;
private File contentsPackage;
@Before @Before
public void setUp() throws Exception 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); assertNotNull("Could not determine package name.", pkgName);
updatePackage = new File(pkgName); updatePackage = new File(pkgName);
} }

View File

@@ -15,13 +15,11 @@ import org.junit.Before;
public abstract class AbstractIntegrationTest public abstract class AbstractIntegrationTest
{ {
protected File targetDir; protected File targetDir;
protected String version;
@Before @Before
public void setUp() throws Exception public void setUp() throws Exception
{ {
initTargetDir(); initTargetDir();
initVersion();
} }
private void initTargetDir() private void initTargetDir()
@@ -35,15 +33,6 @@ public abstract class AbstractIntegrationTest
assertTrue("target dir does not exist :" + targetDir, this.targetDir.exists()); 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() protected boolean runningOnWindows()
{ {

View File

@@ -8,6 +8,7 @@
package org.alfresco.update.pkg.test; package org.alfresco.update.pkg.test;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import java.io.BufferedInputStream; import java.io.BufferedInputStream;
@@ -30,16 +31,26 @@ import org.junit.Test;
/** /**
* Tests for the tgz format packaging. * Tests for the tgz format packaging.
* *
* To run these tests in Eclipse, add the following to the "VM arguments" for the junit Run Configuration:
* <pre>
* -Dalfresco.update.package.tgz=target/alfresco-enterprise-update-package-2015-1-EA-SNAPSHOT.zip
* </pre>
*
* @author Matt Ward * @author Matt Ward
*/ */
public class TgzFormatIntegrationTest extends AbstractIntegrationTest public class TgzFormatIntegrationTest extends AbstractIntegrationTest
{ {
private boolean found; private boolean found;
File updatePackage;
@Before @Before
public void setUp() throws Exception public void setUp() throws Exception
{ {
super.setUp(); 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-"; public final String ARTIFACT_NAME="alfresco-enterprise-update-package-";
@@ -54,12 +65,11 @@ public class TgzFormatIntegrationTest extends AbstractIntegrationTest
return; return;
} }
File archive = new File(targetDir, ARTIFACT_NAME+version+".tgz"); assertTrue("File does not exist: "+ updatePackage, updatePackage.exists());
assertTrue("File does not exist: "+archive, archive.exists());
FileInputStream fis = null; FileInputStream fis = null;
try try
{ {
fis = new FileInputStream(archive); fis = new FileInputStream(updatePackage);
handleArchiveEntries(fis, new ArchiveEntryHandler() handleArchiveEntries(fis, new ArchiveEntryHandler()
{ {