diff options
author | Ian Bull | 2010-08-24 22:04:25 +0000 |
---|---|---|
committer | Ian Bull | 2010-08-24 22:04:25 +0000 |
commit | cb45aabd8e5bdcab386fc2f38f07c537cc6b6d24 (patch) | |
tree | 386b1106f0d9cd297e0042e94bad3282b3cfb0a9 /bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests | |
parent | 00821620a73a67f4e9153b0e522849be1c5e5b3e (diff) | |
download | rt.equinox.p2-cb45aabd8e5bdcab386fc2f38f07c537cc6b6d24.tar.gz rt.equinox.p2-cb45aabd8e5bdcab386fc2f38f07c537cc6b6d24.tar.xz rt.equinox.p2-cb45aabd8e5bdcab386fc2f38f07c537cc6b6d24.zip |
bug 315757: [publisher][regression] Cannot provide -contextMetadata to publisher application
https://bugs.eclipse.org/bugs/show_bug.cgi?id=315757
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests')
2 files changed, 60 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/AllTests.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/AllTests.java index 259e79f44..3b562cc44 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/AllTests.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/AllTests.java @@ -23,6 +23,7 @@ public class AllTests extends TestCase { suite.addTestSuite(BundlesActionTest.class); suite.addTestSuite(CategoryPublisherTest.class); suite.addTestSuite(ConfigCUsActionTest.class); + suite.addTestSuite(ContextRepositoryTest.class); suite.addTestSuite(DefaultCUsActionTest.class); suite.addTestSuite(EquinoxExecutableActionTest.class); suite.addTestSuite(EquinoxLauncherCUActionTest.class); diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ContextRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ContextRepositoryTest.java new file mode 100644 index 000000000..520bab510 --- /dev/null +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ContextRepositoryTest.java @@ -0,0 +1,59 @@ +/******************************************************************************* +* Copyright (c) 2010 EclipseSource and others. All rights reserved. This +* program and the accompanying materials are made available under the terms of +* the Eclipse Public License v1.0 which accompanies this distribution, and is +* available at http://www.eclipse.org/legal/epl-v10.html +* +* Contributors: +* EclipseSource - initial API and implementation +******************************************************************************/ +package org.eclipse.equinox.p2.tests.publisher.actions; + +import java.io.File; +import java.net.URI; +import org.eclipse.equinox.p2.publisher.*; +import org.eclipse.equinox.p2.tests.AbstractProvisioningTest; +import org.eclipse.equinox.p2.tests.TestActivator; + +/** + * + */ +public class ContextRepositoryTest extends AbstractProvisioningTest { + + /** + * runs default director app. + */ + public class TestPublisherApplication extends AbstractPublisherApplication { + + /* (non-Javadoc) + * @see org.eclipse.equinox.p2.publisher.AbstractPublisherApplication#createActions() + */ + protected IPublisherAction[] createActions() { + return new IPublisherAction[0]; + } + + public IPublisherInfo getInfo() { + return info; + } + } + + public void testContextMetadataRepository() throws Exception { + URI tempRepo = getTempFolder().toURI(); + File repository = new File(TestActivator.getTestDataFolder(), "metadataRepo/good"); + + String[] firstRun = new String[] {"-mr", tempRepo.toString(), "-contextMetadata", repository.toURI().toString()}; + TestPublisherApplication application = new TestPublisherApplication(); + application.run(firstRun); + assertNotNull(application.getInfo().getContextMetadataRepository()); + } + + public void testContextArtifactRepository() throws Exception { + URI tempRepo = getTempFolder().toURI(); + File repository = new File(TestActivator.getTestDataFolder(), "artifactRepo/simple"); + + String[] firstRun = new String[] {"-mr", tempRepo.toString(), "-contextArtifacts", repository.toURI().toString()}; + TestPublisherApplication application = new TestPublisherApplication(); + application.run(firstRun); + assertNotNull(application.getInfo().getContextArtifactRepository()); + } +} |