Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/org.eclipse.epp.packaging.core.test/src/org/eclipse/epp/packaging/core/DummyPackagerConfiguration.java9
-rw-r--r--test/org.eclipse.epp.packaging.core.test/src/org/eclipse/epp/packaging/core/configuration/Platform_Test.java12
-rw-r--r--test/org.eclipse.epp.packaging.core.test/src/org/eclipse/epp/packaging/core/configuration/xml/ConfigurationParser_PdeTest.java48
-rw-r--r--test/org.eclipse.epp.packaging.core.test/src/org/eclipse/epp/packaging/core/download/UpdateSiteManager_PdeTest.java24
4 files changed, 44 insertions, 49 deletions
diff --git a/test/org.eclipse.epp.packaging.core.test/src/org/eclipse/epp/packaging/core/DummyPackagerConfiguration.java b/test/org.eclipse.epp.packaging.core.test/src/org/eclipse/epp/packaging/core/DummyPackagerConfiguration.java
index fb328aec..1b8f285e 100644
--- a/test/org.eclipse.epp.packaging.core.test/src/org/eclipse/epp/packaging/core/DummyPackagerConfiguration.java
+++ b/test/org.eclipse.epp.packaging.core.test/src/org/eclipse/epp/packaging/core/DummyPackagerConfiguration.java
@@ -78,15 +78,16 @@ public class DummyPackagerConfiguration implements IPackagerConfiguration {
throw new UnsupportedOperationException( "Not yet implemented." ); //$NON-NLS-1$
}
- public File getConfigIni() {
+ public String getProductName() {
throw new UnsupportedOperationException( "Not yet implemented." ); //$NON-NLS-1$
}
- public String getProductName() {
+ public String getEclipseProductId() {
throw new UnsupportedOperationException( "Not yet implemented." ); //$NON-NLS-1$
}
- public String getInstallerConfigurationFolder() {
- throw new UnsupportedOperationException( "Not yet implemented." ); //$NON-NLS-1$;
+ public String getInitialPerspectiveId() {
+ throw new UnsupportedOperationException( "Not yet implemented." ); //$NON-NLS-1$
}
+
} \ No newline at end of file
diff --git a/test/org.eclipse.epp.packaging.core.test/src/org/eclipse/epp/packaging/core/configuration/Platform_Test.java b/test/org.eclipse.epp.packaging.core.test/src/org/eclipse/epp/packaging/core/configuration/Platform_Test.java
index 5c07fb86..808c5d70 100644
--- a/test/org.eclipse.epp.packaging.core.test/src/org/eclipse/epp/packaging/core/configuration/Platform_Test.java
+++ b/test/org.eclipse.epp.packaging.core.test/src/org/eclipse/epp/packaging/core/configuration/Platform_Test.java
@@ -19,28 +19,28 @@ import junit.framework.TestCase;
public class Platform_Test extends TestCase {
public void testEquals() throws Exception {
- Platform platform = new Platform( "win32", "win32", "x86" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- Platform secondPlatform = new Platform( "win32", "win32", "x86" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ Platform platform = new Platform( "win32", "win32", "x86", null, null ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ Platform secondPlatform = new Platform( "win32", "win32", "x86", null, null ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
assertTrue( platform.equals( secondPlatform ) );
}
public void testToString() throws Exception {
- Platform platform = new Platform( "win32", "win32", "x86" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ Platform platform = new Platform( "win32", "win32", "x86", null, null ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
Assert.assertEquals( "win32,win32,x86", platform.toString() ); //$NON-NLS-1$
}
public void testAdvancedToString() throws Exception {
- Platform platform = new Platform( "win32", "win32", "x86" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ Platform platform = new Platform( "win32", "win32", "x86", null, null ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
Assert.assertEquals( "win32nwin32nx86", platform.toString( 'n' ) ); //$NON-NLS-1$
}
public void testDefaultArchiveFormat() {
- Platform platform = new Platform( "win32", "win32", "x86" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ Platform platform = new Platform( "win32", "win32", "x86", null, null ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
Assert.assertEquals( "antZip", platform.getArchiveFormat().name() ); //$NON-NLS-1$
}
public void testSetArchiveFormat() throws Exception {
- Platform platform = new Platform( "win32", "win32", "x86" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ Platform platform = new Platform( "win32", "win32", "x86", null, null ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
platform.setArchiveFormat( "tar" ); //$NON-NLS-1$
Assert.assertEquals( "tar", platform.getArchiveFormat().name() ); //$NON-NLS-1$
}
diff --git a/test/org.eclipse.epp.packaging.core.test/src/org/eclipse/epp/packaging/core/configuration/xml/ConfigurationParser_PdeTest.java b/test/org.eclipse.epp.packaging.core.test/src/org/eclipse/epp/packaging/core/configuration/xml/ConfigurationParser_PdeTest.java
index b1756706..95366fc9 100644
--- a/test/org.eclipse.epp.packaging.core.test/src/org/eclipse/epp/packaging/core/configuration/xml/ConfigurationParser_PdeTest.java
+++ b/test/org.eclipse.epp.packaging.core.test/src/org/eclipse/epp/packaging/core/configuration/xml/ConfigurationParser_PdeTest.java
@@ -26,7 +26,9 @@ public class ConfigurationParser_PdeTest extends TestCase {
private final static String xml = "<configuration>" //$NON-NLS-1$
+ "<rcp version=\"3.2\"/>" //$NON-NLS-1$
- + "<product name=\"EPPBuild\" configIni=\"/home/urs/config.ini\"/>" //$NON-NLS-1$
+ + "<product name=\"EPPBuild\"" //$NON-NLS-1$
+ + " eclipseProductId=\"org.eclipse.platform.ide\"" //$NON-NLS-1$
+ + " initialPerspectiveId=\"org.eclipse.cdt.ui.CPerspective\" />" //$NON-NLS-1$
+ "<updateSites>" //$NON-NLS-1$
+ " <updateSite url=\"http://update.eclipse.org/updates/3.2/\"/>" //$NON-NLS-1$
+ "</updateSites>" //$NON-NLS-1$
@@ -34,43 +36,41 @@ public class ConfigurationParser_PdeTest extends TestCase {
+ " <feature id=\"org.eclipse.rcp\" version=\"3.1.1\"/>" //$NON-NLS-1$
+ "</requiredFeatures>" //$NON-NLS-1$
+ "<packagerConfigurationFolder folder=\"/home/help\"/>" //$NON-NLS-1$
- + "<installerConfigurationFolder folder=\"/home/installer\"/>" //$NON-NLS-1$
+ "<rootFileFolder folder=\"/home/root\"/>" //$NON-NLS-1$
+ "<extensionSite relativeFolder=\"site\"/>" //$NON-NLS-1$
+ "<targetPlatforms>" //$NON-NLS-1$
- + " <platform os=\"linux\" ws=\"gtk\" arch=\"x86\"/>" //$NON-NLS-1$
+ + " <platform os=\"linux\" ws=\"gtk\" arch=\"x86\">" //$NON-NLS-1$
+ + " <eclipseIniFileContent path=\"/eclipse/\">Content" //$NON-NLS-1$
+ + "of first eclipse.ini</eclipseIniFileContent>" //$NON-NLS-1$
+ + " </platform>" //$NON-NLS-1$
+ " <platform os=\"win32\" ws=\"win32\" arch=\"x86\">" //$NON-NLS-1$
+ " <archiveFormat format=\"tar\"/>" //$NON-NLS-1$
+ + " <eclipseIniFileContent path=\"/eclipse/\">Content" //$NON-NLS-1$
+ + "of second eclipse.ini</eclipseIniFileContent>" //$NON-NLS-1$
+ " </platform>" //$NON-NLS-1$
+ "</targetPlatforms>" //$NON-NLS-1$
+ "</configuration>"; //$NON-NLS-1$
public void testParseUpdateSites() throws Exception {
- IPackagerConfiguration config = new ConfigurationParser().parseConfiguration( xml );
+ IPackagerConfiguration config = new ConfigurationParser( null ).parseConfiguration( xml );
Assert.assertEquals( "http://update.eclipse.org/updates/3.2/", //$NON-NLS-1$
config.getUpdateSites()[ 0 ].toExternalForm() );
}
public void testParseFeatures() throws Exception {
- IPackagerConfiguration config = new ConfigurationParser().parseConfiguration( xml );
+ IPackagerConfiguration config = new ConfigurationParser( null ).parseConfiguration( xml );
Assert.assertEquals( new VersionedIdentifier( "org.eclipse.rcp", "3.1.1" ), //$NON-NLS-1$ //$NON-NLS-2$
config.getRequiredFeatures()[ 0 ] );
}
public void testParsePackagerConfigurationFolder() throws Exception {
- IPackagerConfiguration config = new ConfigurationParser().parseConfiguration( xml );
+ IPackagerConfiguration config = new ConfigurationParser( null ).parseConfiguration( xml );
Assert.assertEquals( new File( "/home/help" ), //$NON-NLS-1$
config.getPackagerConfigurationFolder() );
}
- public void testParseInstallerConfigurationFolder() throws Exception {
- IPackagerConfiguration config = new ConfigurationParser().parseConfiguration( xml );
- Assert.assertEquals( "/home/installer", //$NON-NLS-1$
- config.getInstallerConfigurationFolder() );
- }
-
public void testParseRelativeExtensionSite() throws Exception {
- IPackagerConfiguration config = new ConfigurationParser().parseConfiguration( xml );
+ IPackagerConfiguration config = new ConfigurationParser( null ).parseConfiguration( xml );
Assert.assertEquals( new File( org.eclipse.core.runtime.Platform.getLocation()
.toFile(),
"site" ), //$NON-NLS-1$
@@ -78,40 +78,34 @@ public class ConfigurationParser_PdeTest extends TestCase {
}
public void testParseTargetPlatformWithoutFormat() throws Exception {
- IPackagerConfiguration config = new ConfigurationParser().parseConfiguration( xml );
+ IPackagerConfiguration config = new ConfigurationParser( null ).parseConfiguration( xml );
IPlatform platform = config.getTargetPlatforms()[ 0 ];
- Assert.assertEquals( new Platform( "linux", "gtk", "x86" ), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ Assert.assertEquals( new Platform( "linux", "gtk", "x86", null, null ), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
platform );
Assert.assertEquals( ArchiveFormat.antZip, platform.getArchiveFormat() );
}
public void testParsePlatformWithFormat() throws Exception {
- IPackagerConfiguration config = new ConfigurationParser().parseConfiguration( xml );
+ IPackagerConfiguration config = new ConfigurationParser( null ).parseConfiguration( xml );
IPlatform platform = config.getTargetPlatforms()[ 1 ];
- Assert.assertEquals( new Platform( "win32", "win32", "x86" ), platform ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ Assert.assertEquals( new Platform( "win32", "win32", "x86", null, null ), platform ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
Assert.assertEquals( ArchiveFormat.tar, platform.getArchiveFormat() );
}
public void testParseRcpVersion() throws Exception {
- IPackagerConfiguration config = new ConfigurationParser().parseConfiguration( xml );
+ IPackagerConfiguration config = new ConfigurationParser( null ).parseConfiguration( xml );
String basename = config.getRootFileBaseName();
- Assert.assertEquals( "eclipse-RCP-3.2-", basename ); //$NON-NLS-1$
+ Assert.assertEquals( "eclipse-platform-3.2-", basename ); //$NON-NLS-1$
}
public void testParseRootFiles() throws Exception {
- IPackagerConfiguration config = new ConfigurationParser().parseConfiguration( xml );
+ IPackagerConfiguration config = new ConfigurationParser( null ).parseConfiguration( xml );
File folder = config.getRootFileFolder();
Assert.assertEquals( new File( "/home/root" ), folder ); //$NON-NLS-1$
}
- public void testParseConfigFile() throws Exception {
- IPackagerConfiguration config = new ConfigurationParser().parseConfiguration( xml );
- File configIni = config.getConfigIni();
- Assert.assertEquals( new File( "/home/urs/config.ini" ), configIni ); //$NON-NLS-1$
- }
-
public void testParseProductName() throws Exception {
- IPackagerConfiguration config = new ConfigurationParser().parseConfiguration( xml );
+ IPackagerConfiguration config = new ConfigurationParser( null ).parseConfiguration( xml );
Assert.assertEquals( "EPPBuild", config.getProductName() ); //$NON-NLS-1$
}
} \ No newline at end of file
diff --git a/test/org.eclipse.epp.packaging.core.test/src/org/eclipse/epp/packaging/core/download/UpdateSiteManager_PdeTest.java b/test/org.eclipse.epp.packaging.core.test/src/org/eclipse/epp/packaging/core/download/UpdateSiteManager_PdeTest.java
index 118f380f..3d8457e7 100644
--- a/test/org.eclipse.epp.packaging.core.test/src/org/eclipse/epp/packaging/core/download/UpdateSiteManager_PdeTest.java
+++ b/test/org.eclipse.epp.packaging.core.test/src/org/eclipse/epp/packaging/core/download/UpdateSiteManager_PdeTest.java
@@ -25,14 +25,14 @@ import org.eclipse.update.core.VersionedIdentifier;
/** Test class*/
public class UpdateSiteManager_PdeTest extends TestCase {
- private static final String BUCKMINSTER_UPDATESITE_URL
- = "http://download.eclipse.org/technology/buckminster/updates/"; //$NON-NLS-1$
- private static final VersionedIdentifier BUCKMINSTERIDENTIFIER
- = new VersionedIdentifier( "org.eclipse.buckminster.core.feature", //$NON-NLS-1$
- "1.0.0.v20070220" ); //$NON-NLS-1$
- private static final VersionedIdentifier HEADLESSIDENTIFIER
- = new VersionedIdentifier( "org.eclipse.buckminster.svn.headless.feature", //$NON-NLS-1$
- "1.0.0.v20070207" ); //$NON-NLS-1$
+ private static final String UPDATESITE_URL
+ = "http://download.eclipse.org/eclipse/updates/"; //$NON-NLS-1$
+ private static final VersionedIdentifier FEATURE_1
+ = new VersionedIdentifier( "org.eclipse.platform", //$NON-NLS-1$
+ "2.0.0" ); //$NON-NLS-1$
+ private static final VersionedIdentifier FEATURE_2
+ = new VersionedIdentifier( "org.eclipse.jdt", //$NON-NLS-1$
+ "2.0.0" ); //$NON-NLS-1$
private DummyPackagerConfiguration configuration;
private UpdateSiteManager manager;
@@ -40,9 +40,9 @@ public class UpdateSiteManager_PdeTest extends TestCase {
protected void setUp() throws Exception {
super.setUp();
this.configuration = new DummyPackagerConfiguration();
- this.configuration.setUpdateSite( BUCKMINSTER_UPDATESITE_URL );
- this.configuration.addRequiredFeature( BUCKMINSTERIDENTIFIER );
- this.configuration.addRequiredFeature( HEADLESSIDENTIFIER );
+ this.configuration.setUpdateSite( UPDATESITE_URL );
+ this.configuration.addRequiredFeature( FEATURE_1 );
+ this.configuration.addRequiredFeature( FEATURE_2 );
this.manager = new UpdateSiteManager( this.configuration );
}
@@ -59,7 +59,7 @@ public class UpdateSiteManager_PdeTest extends TestCase {
{
this.manager = new UpdateSiteManager( this.configuration );
Assert.assertTrue( this.manager.areFeaturesPresent( new VersionedIdentifier[]{
- BUCKMINSTERIDENTIFIER, HEADLESSIDENTIFIER
+ FEATURE_1, FEATURE_2
} ) );
}
}

Back to the top