diff options
author | Pascal Rapicault (Ericsson) | 2012-11-15 17:51:40 +0000 |
---|---|---|
committer | Pascal Rapicault | 2012-11-17 03:47:47 +0000 |
commit | 75af22b1a4156b7792b11c9a29076c024a873f29 (patch) | |
tree | 5fbc643a3afb530a64d5d6bf8103ee06f71a0bab /bundles | |
parent | 98e6cf1c4dae02db99a1e85d2c30d2c111137602 (diff) | |
download | rt.equinox.p2-75af22b1a4156b7792b11c9a29076c024a873f29.tar.gz rt.equinox.p2-75af22b1a4156b7792b11c9a29076c024a873f29.tar.xz rt.equinox.p2-75af22b1a4156b7792b11c9a29076c024a873f29.zip |
Add test for p2.runnable change in eclipse.touchpoint
Diffstat (limited to 'bundles')
3 files changed, 77 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/UtilTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/UtilTest.java index 4e3e786d5..a779cb3ab 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/UtilTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/UtilTest.java @@ -15,9 +15,13 @@ import java.net.MalformedURLException; import java.util.Properties; import junit.framework.Test; import junit.framework.TestSuite; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.equinox.internal.p2.touchpoint.eclipse.AggregatedBundleRepository; import org.eclipse.equinox.internal.p2.touchpoint.eclipse.Util; import org.eclipse.equinox.p2.core.IAgentLocation; +import org.eclipse.equinox.p2.core.ProvisionException; import org.eclipse.equinox.p2.engine.IProfile; +import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository; import org.eclipse.equinox.p2.tests.AbstractProvisioningTest; /** @@ -51,4 +55,20 @@ public class UtilTest extends AbstractProvisioningTest { IProfile profile = createProfile("test", props); assertEquals(cacheDir.toURL().toExternalForm(), Util.getBundlePoolLocation(getAgent(), profile).toString()); } + + public void testCheckRunnableArtifactRepos() throws ProvisionException { + File withFlag = getTestData("Get artifact repo in runnable format", "testData/utilTest/repoWithFlag"); + File withoutFlag = getTestData("Get artifact repo in runnable format", "testData/utilTest/repoWithoutFlag"); + IArtifactRepository repoWithFlag = getArtifactRepositoryManager().loadRepository(withFlag.toURI(), new NullProgressMonitor()); + IArtifactRepository repoWithoutFlag = getArtifactRepositoryManager().loadRepository(withoutFlag.toURI(), new NullProgressMonitor()); + + assertNotNull(repoWithFlag.getProperty(IArtifactRepository.PROP_RUNNABLE)); + assertTrue(Boolean.TRUE.toString().equalsIgnoreCase(repoWithFlag.getProperty(IArtifactRepository.PROP_RUNNABLE))); + assertNull(repoWithoutFlag.getProperty(IArtifactRepository.PROP_RUNNABLE)); + + AggregatedBundleRepository repos = (AggregatedBundleRepository) Util.getAggregatedBundleRepository(getAgent(), null, 0); + assertTrue(repos.testGetBundleRepositories().contains(repoWithFlag)); + assertTrue(!repos.testGetBundleRepositories().contains(repoWithoutFlag)); + + } } diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/utilTest/repoWithFlag/artifacts.xml b/bundles/org.eclipse.equinox.p2.tests/testData/utilTest/repoWithFlag/artifacts.xml new file mode 100644 index 000000000..eb059e7d4 --- /dev/null +++ b/bundles/org.eclipse.equinox.p2.tests/testData/utilTest/repoWithFlag/artifacts.xml @@ -0,0 +1,29 @@ +<?xml version='1.0' encoding='UTF-8'?> +<?artifactRepository version='1.1.0'?> +<repository name='file:/c:/dev/p2ericsson/us/runnable/' type='org.eclipse.equinox.p2.artifact.repository.simpleRepository' version='1'> + <properties size='3'> + <property name='p2.timestamp' value='1353000277015'/> + <property name='p2.compressed' value='true'/> + <property name='p2.runnable' value='true'/> + </properties> + <mappings size='3'> + <rule filter='(& (classifier=osgi.bundle))' output='${repoUrl}/plugins/${id}_${version}.jar'/> + <rule filter='(& (classifier=binary))' output='${repoUrl}/binary/${id}_${version}'/> + <rule filter='(& (classifier=org.eclipse.update.feature))' output='${repoUrl}/features/${id}_${version}.jar'/> + </mappings> + <artifacts size='2'> + <artifact classifier='org.eclipse.update.feature' id='USF' version='1.0.0.201209162337'> + <properties size='1'> + <property name='download.size' value='397'/> + </properties> + <repositoryProperties size='1'> + <property name='artifact.folder' value='true'/> + </repositoryProperties> + </artifact> + <artifact classifier='osgi.bundle' id='USP' version='1.0.0.201209162337'> + <properties size='1'> + <property name='download.size' value='1160'/> + </properties> + </artifact> + </artifacts> +</repository> diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/utilTest/repoWithoutFlag/artifacts.xml b/bundles/org.eclipse.equinox.p2.tests/testData/utilTest/repoWithoutFlag/artifacts.xml new file mode 100644 index 000000000..ac2b0d3b1 --- /dev/null +++ b/bundles/org.eclipse.equinox.p2.tests/testData/utilTest/repoWithoutFlag/artifacts.xml @@ -0,0 +1,28 @@ +<?xml version='1.0' encoding='UTF-8'?> +<?artifactRepository version='1.1.0'?> +<repository name='file:/c:/dev/p2ericsson/us/runnable/' type='org.eclipse.equinox.p2.artifact.repository.simpleRepository' version='1'> + <properties size='2'> + <property name='p2.timestamp' value='1352844761950'/> + <property name='p2.compressed' value='true'/> + </properties> + <mappings size='3'> + <rule filter='(& (classifier=osgi.bundle))' output='${repoUrl}/plugins/${id}_${version}.jar'/> + <rule filter='(& (classifier=binary))' output='${repoUrl}/binary/${id}_${version}'/> + <rule filter='(& (classifier=org.eclipse.update.feature))' output='${repoUrl}/features/${id}_${version}.jar'/> + </mappings> + <artifacts size='2'> + <artifact classifier='org.eclipse.update.feature' id='USF' version='1.0.0.201209162337'> + <properties size='1'> + <property name='download.size' value='397'/> + </properties> + <repositoryProperties size='1'> + <property name='artifact.folder' value='true'/> + </repositoryProperties> + </artifact> + <artifact classifier='osgi.bundle' id='USP' version='1.0.0.201209162337'> + <properties size='1'> + <property name='download.size' value='1160'/> + </properties> + </artifact> + </artifacts> +</repository> |