Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Niefer2010-06-23 18:29:16 +0000
committerAndrew Niefer2010-06-23 18:29:16 +0000
commitfcaec223d277c2a66e22e1422f0246db0b825546 (patch)
treef965277e91a95ab49db8c77f5f52c987c3f453a9 /bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant
parent5d889bc176aadf2651ae204708332b23bcc3434c (diff)
downloadrt.equinox.p2-fcaec223d277c2a66e22e1422f0246db0b825546.tar.gz
rt.equinox.p2-fcaec223d277c2a66e22e1422f0246db0b825546.tar.xz
rt.equinox.p2-fcaec223d277c2a66e22e1422f0246db0b825546.zip
bug 317711 - Use add elements directly
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/CompositeRepositoryTaskTest.java25
1 files changed, 23 insertions, 2 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/CompositeRepositoryTaskTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/CompositeRepositoryTaskTest.java
index 759155a62..4ea8f7480 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/CompositeRepositoryTaskTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/CompositeRepositoryTaskTest.java
@@ -11,8 +11,7 @@
package org.eclipse.equinox.p2.tests.ant;
import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URI;
+import java.net.*;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.URIUtil;
import org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository;
@@ -124,6 +123,28 @@ public class CompositeRepositoryTaskTest extends AbstractAntProvisioningTest {
assertTrue("Repository does not contain child", repo.getChildren().contains(childSite));
}
+ public void testAddChild() throws URISyntaxException {
+ // Create repository
+ createCompositeRepository(TYPE_METADATA);
+ // Create the modify repository task
+ AntTaskElement modify = createCompositeRepositoryTaskElement(TYPE_METADATA);
+ addTask(modify);
+
+ // Create the Add element
+ AntTaskElement add = new AntTaskElement(ADD_ELEMENT);
+ add.addAttribute("location", "childSite");
+ add.addAttribute("kind", TYPE_METADATA);
+ modify.addElement(add);
+
+ // Run the task
+ runAntTask();
+
+ CompositeMetadataRepository repo = (CompositeMetadataRepository) getCompositeRepository(TYPE_METADATA);
+ URI child = URIUtil.fromString("childSite");
+ child = URIUtil.makeAbsolute(child, repo.getLocation());
+ assertTrue("Repository does not contain child", repo.getChildren().contains(child));
+ }
+
/*
* Test adding a child to both types of repositories (which already exist)
*/

Back to the top