Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 114108 Details for
Bug 248045
Director creates metadata directory with default content.xml if not existing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Updated fix and more tests
248045patch.txt (text/plain), 29.92 KB, created by
Andrew Cattle
on 2008-10-02 10:54:54 EDT
(
hide
)
Description:
Updated fix and more tests
Filename:
MIME Type:
Creator:
Andrew Cattle
Created:
2008-10-02 10:54:54 EDT
Size:
29.92 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.equinox.p2.director.app >Index: src/org/eclipse/equinox/internal/p2/director/app/Application.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/Application.java,v >retrieving revision 1.35 >diff -u -r1.35 Application.java >--- src/org/eclipse/equinox/internal/p2/director/app/Application.java 14 Aug 2008 20:54:31 -0000 1.35 >+++ src/org/eclipse/equinox/internal/p2/director/app/Application.java 2 Oct 2008 14:49:39 -0000 >@@ -21,10 +21,13 @@ > import org.eclipse.equinox.internal.p2.console.ProvisioningHelper; > import org.eclipse.equinox.internal.p2.core.helpers.LogHelper; > import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper; >+import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepositoryManager; >+import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; > import org.eclipse.equinox.internal.provisional.p2.director.*; > import org.eclipse.equinox.internal.provisional.p2.engine.*; > import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit; > import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery; >+import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepositoryManager; > import org.eclipse.equinox.internal.provisional.p2.query.Collector; > import org.eclipse.osgi.service.resolver.VersionRange; > import org.eclipse.osgi.util.NLS; >@@ -162,20 +165,49 @@ > } > > private void initializeRepositories(boolean throwException) throws CoreException { >+ > if (artifactRepositoryLocations == null) { > if (throwException) > missingArgument("artifactRepository"); //$NON-NLS-1$ > } else { >+ IArtifactRepositoryManager manager = (IArtifactRepositoryManager) ServiceHelper.getService(Activator.getContext(), IArtifactRepositoryManager.class.getName()); >+ if (manager == null) >+ throw new ProvisionException(Messages.Application_NoManager); >+ >+ int failedLoads = 0; //used to count the number of failed repository loads > for (int i = 0; i < artifactRepositoryLocations.length; i++) >- ProvisioningHelper.addArtifactRepository(artifactRepositoryLocations[i]); >+ try { >+ manager.loadRepository(artifactRepositoryLocations[i], null); >+ } catch (ProvisionException e) { >+ //one of the repositories did not load >+ LogHelper.log(new Status(IStatus.ERROR, Activator.ID, artifactRepositoryLocations[i].getPath() + " failed to load", e)); //$NON-NLS-1$ >+ failedLoads++; >+ } >+ if (throwException && (failedLoads == artifactRepositoryLocations.length)) >+ //all repositories failed to load >+ throw new ProvisionException(Messages.Application_NoRepositories); > } > > if (metadataRepositoryLocations == null) { > if (throwException) > missingArgument("metadataRepository"); //$NON-NLS-1$ > } else { >+ IMetadataRepositoryManager manager = (IMetadataRepositoryManager) ServiceHelper.getService(Activator.getContext(), IMetadataRepositoryManager.class.getName()); >+ if (manager == null) >+ throw new ProvisionException(Messages.Application_NoManager); >+ >+ int failedLoads = 0; //used to count the number of failed repository loads > for (int i = 0; i < metadataRepositoryLocations.length; i++) >- ProvisioningHelper.addMetadataRepository(metadataRepositoryLocations[i]); >+ try { >+ manager.loadRepository(metadataRepositoryLocations[i], null); >+ } catch (ProvisionException e) { >+ //one of the repositories did not load >+ LogHelper.log(new Status(IStatus.ERROR, Activator.ID, metadataRepositoryLocations[i].getPath() + " failed to load", e)); //$NON-NLS-1$ >+ failedLoads++; >+ } >+ if (throwException && (failedLoads == metadataRepositoryLocations.length)) >+ //all repositories failed to load >+ throw new ProvisionException(Messages.Application_NoRepositories); > } > } > >Index: src/org/eclipse/equinox/internal/p2/director/app/Messages.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/Messages.java,v >retrieving revision 1.5 >diff -u -r1.5 Messages.java >--- src/org/eclipse/equinox/internal/p2/director/app/Messages.java 14 May 2008 21:34:22 -0000 1.5 >+++ src/org/eclipse/equinox/internal/p2/director/app/Messages.java 2 Oct 2008 14:49:39 -0000 >@@ -29,6 +29,8 @@ > > public static String Listing; > public static String Ambigous_Command; >+ public static String Application_NoManager; >+ public static String Application_NoRepositories; > public static String Missing_Required_Argument; > > public static String Installing; >Index: src/org/eclipse/equinox/internal/p2/director/app/messages.properties >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/messages.properties,v >retrieving revision 1.7 >diff -u -r1.7 messages.properties >--- src/org/eclipse/equinox/internal/p2/director/app/messages.properties 15 May 2008 14:44:24 -0000 1.7 >+++ src/org/eclipse/equinox/internal/p2/director/app/messages.properties 2 Oct 2008 14:49:39 -0000 >@@ -24,6 +24,8 @@ > Missing_IU=The installable unit {0} has not been found. > Missing_Required_Argument=Missing required argument -{0}. > Ambigous_Command=Cannot execute both {0} and {1} in one invocation >+Application_NoManager=Error occured while aquiring manager >+Application_NoRepositories=Unable to load repositories > Listing=Listing Installable Units from {0} > Installing=Installing {0} {1}. > Uninstalling=Uninstalling {0} {1}. >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.director.app/META-INF/MANIFEST.MF,v >retrieving revision 1.12 >diff -u -r1.12 MANIFEST.MF >--- META-INF/MANIFEST.MF 10 Jul 2008 17:16:55 -0000 1.12 >+++ META-INF/MANIFEST.MF 2 Oct 2008 14:49:38 -0000 >@@ -10,6 +10,7 @@ > org.eclipse.equinox.internal.p2.core.helpers, > org.eclipse.equinox.internal.p2.engine, > org.eclipse.equinox.internal.provisional.p2.artifact.repository, >+ org.eclipse.equinox.internal.provisional.p2.core, > org.eclipse.equinox.internal.provisional.p2.core.location, > org.eclipse.equinox.internal.provisional.p2.director, > org.eclipse.equinox.internal.provisional.p2.engine, >#P org.eclipse.equinox.p2.tests >Index: src/org/eclipse/equinox/p2/tests/director/AllTests.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/AllTests.java,v >retrieving revision 1.5 >diff -u -r1.5 AllTests.java >--- src/org/eclipse/equinox/p2/tests/director/AllTests.java 21 Nov 2007 20:14:48 -0000 1.5 >+++ src/org/eclipse/equinox/p2/tests/director/AllTests.java 2 Oct 2008 14:49:39 -0000 >@@ -32,6 +32,7 @@ > suite.addTestSuite(SingletonTest.class); > suite.addTestSuite(UninstallTest.class); > suite.addTestSuite(UpdateTest.class); >+ suite.addTestSuite(DirectorAppTest.class); > return suite; > } > >Index: src/org/eclipse/equinox/p2/tests/director/DirectorAppTest.java >=================================================================== >RCS file: src/org/eclipse/equinox/p2/tests/director/DirectorAppTest.java >diff -N src/org/eclipse/equinox/p2/tests/director/DirectorAppTest.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/equinox/p2/tests/director/DirectorAppTest.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,530 @@ >+/******************************************************************************* >+ * Copyright (c) 2008 IBM Corporation 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: IBM Corporation - initial API and implementation >+ ******************************************************************************/ >+package org.eclipse.equinox.p2.tests.director; >+ >+import java.io.File; >+import java.net.MalformedURLException; >+import java.util.HashMap; >+import java.util.Map; >+import org.eclipse.equinox.app.IApplicationContext; >+import org.eclipse.equinox.internal.p2.director.app.Application; >+import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; >+import org.eclipse.equinox.p2.tests.AbstractProvisioningTest; >+import org.osgi.framework.Bundle; >+ >+/** >+ * Various automated tests of the {@link IDirector} API. >+ */ >+public class DirectorAppTest extends AbstractProvisioningTest { >+ >+ /** >+ * runs default director app. >+ */ >+ private void runDirectorApp(String message, final String[] args) throws Exception { >+ Application application = new Application(); >+ application.start(new IApplicationContext() { >+ >+ public void applicationRunning() { >+ } >+ >+ public Map getArguments() { >+ Map arguments = new HashMap(); >+ >+ arguments.put(IApplicationContext.APPLICATION_ARGS, args); >+ >+ return arguments; >+ } >+ >+ public String getBrandingApplication() { >+ return null; >+ } >+ >+ public Bundle getBrandingBundle() { >+ return null; >+ } >+ >+ public String getBrandingDescription() { >+ return null; >+ } >+ >+ public String getBrandingId() { >+ return null; >+ } >+ >+ public String getBrandingName() { >+ return null; >+ } >+ >+ public String getBrandingProperty(String key) { >+ return null; >+ } >+ }); >+ } >+ >+ /** >+ * creates the director app arguments based on the arguments submitted with bug 248045 >+ */ >+ private String[] getSingleRepoArgs(String message, File metadataRepo, File artifactRepo, File destinationRepo, String installIU) { >+ String[] args = new String[0]; >+ try { >+ args = new String[] {"-metadataRepository", metadataRepo.toURL().toExternalForm(), "-artifactRepository", artifactRepo.toURL().toExternalForm(), "-installIU", installIU, "-destination", destinationRepo.toURL().toExternalForm(), "-profile", "PlatformSDKProfile", "-profileProperties", "org.eclipse.update.install.features=true", "-bundlepool", destinationRepo.toURL().toExternalForm(), "-roaming", "-vmargs", "-Declipse.p2.data.area=", destinationRepo.toURL().toExternalForm()}; >+ } catch (MalformedURLException e) { >+ fail(message, e); >+ } >+ return args; >+ } >+ >+ /** >+ * creates the director app arguments based on the arguments submitted with bug 248045 but with multiple repositories for both metadata and artifacts >+ */ >+ private String[] getMultipleRepoArgs(String message, File metadataRepo1, File metadataRepo2, File artifactRepo1, File artifactRepo2, File destinationRepo, String installIU) { >+ String[] args = new String[0]; >+ try { >+ args = new String[] {"-metadataRepository", metadataRepo1.toURL().toExternalForm() + "," + metadataRepo2.toURL().toExternalForm(), "-artifactRepository", artifactRepo1.toURL().toExternalForm() + "," + artifactRepo2.toURL().toExternalForm(), "-installIU", installIU, "-destination", destinationRepo.toURL().toExternalForm(), "-profile", "PlatformSDKProfile", "-profileProperties", "org.eclipse.update.install.features=true", "-bundlepool", destinationRepo.toURL().toExternalForm(), "-roaming", "-vmargs", "-Declipse.p2.data.area=", destinationRepo.toURL().toExternalForm()}; >+ } catch (MalformedURLException e) { >+ fail(message, e); >+ } >+ return args; >+ } >+ >+ /** >+ * Test the application's behaviour given a single metadata and artifact repository where both are invalid >+ */ >+ public void testSingleRepoCreationBothInvalid() { >+ //Setup: Create the folders >+ File metadataRepo = new File(getTempFolder(), "DirectorApp Metadata"); >+ File artifactRepo = new File(getTempFolder(), "DirectorApp Artifact"); >+ File destinationRepo = new File(getTempFolder(), "DirectorApp Destination"); >+ String installIU = "invalidIU"; >+ >+ //Setup: ensure folders do not exist >+ delete(metadataRepo); >+ delete(artifactRepo); >+ delete(destinationRepo); >+ >+ //Setup: use default arguments >+ String[] args = getSingleRepoArgs("1.0", metadataRepo, artifactRepo, destinationRepo, installIU); >+ >+ try { >+ runDirectorApp("1.1", args); >+ } catch (ProvisionException e) { >+ //expected, fall through >+ } catch (Exception e) { >+ fail("1.2", e); >+ } >+ >+ //ensures that repositories have not been mistakenly created >+ assertFalse("1.3", metadataRepo.exists()); >+ assertFalse("1.4", artifactRepo.exists()); >+ assertFalse("1.5", destinationRepo.exists()); >+ >+ //Cleanup: delete the folders >+ delete(metadataRepo); >+ delete(artifactRepo); >+ delete(destinationRepo); >+ } >+ >+ /** >+ * Test the application's behaviour given a single metadata and artifact repository where the metadata repo is invalid >+ */ >+ public void testSingleRepoCreationMetadataInvalid() { >+ //Setup: create repos >+ File metadataRepo = new File(getTempFolder(), "DirectorApp Metadata"); >+ //Valid repository >+ File artifactRepo = getTestData("2.0", "/testData/mirror/mirrorSourceRepo1"); >+ File destinationRepo = new File(getTempFolder(), "DirectorApp Destination"); >+ String installIU = "invalidIU"; >+ >+ //Setup: ensure folders do not exist >+ delete(metadataRepo); >+ delete(destinationRepo); >+ >+ //Setup: use default arguments >+ String[] args = getSingleRepoArgs("2.1", metadataRepo, artifactRepo, destinationRepo, installIU); >+ >+ try { >+ runDirectorApp("2.2", args); >+ } catch (ProvisionException e) { >+ //expected, fall through >+ } catch (Exception e) { >+ fail("2.3", e); >+ } >+ >+ //ensures that repository has not been mistakenly created >+ assertFalse("2.4", metadataRepo.exists()); >+ assertTrue("2.5", artifactRepo.exists()); >+ assertFalse("2.6", destinationRepo.exists()); >+ >+ //Cleanup: delete the folders >+ delete(metadataRepo); >+ delete(destinationRepo); >+ } >+ >+ /** >+ * Test the application's behaviour given a single metadata and artifact repository where the artifact repo is invalid >+ */ >+ public void testSingleRepoCreationArtifactInvalid() { >+ //Setup: create repos >+ //Valid repository >+ File metadataRepo = getTestData("3.0", "/testData/mirror/mirrorSourceRepo1"); >+ File artifactRepo = new File(getTempFolder(), "DirectorApp Artifact"); >+ File destinationRepo = new File(getTempFolder(), "DirectorApp Destination"); >+ String installIU = "invalidIU"; >+ >+ //Setup: ensure folders do not exist >+ delete(artifactRepo); >+ delete(destinationRepo); >+ >+ //Setup: use default arguments >+ String[] args = getSingleRepoArgs("3.1", metadataRepo, artifactRepo, destinationRepo, installIU); >+ >+ try { >+ runDirectorApp("3.2", args); >+ } catch (ProvisionException e) { >+ //expected, fall through >+ } catch (Exception e) { >+ fail("3.3", e); >+ } >+ >+ //ensures that repository has not been mistakenly created >+ assertFalse("3.4", artifactRepo.exists()); >+ assertTrue("3.5", metadataRepo.exists()); >+ assertFalse("3.6", destinationRepo.exists()); >+ >+ //Cleanup: delete the folders >+ delete(artifactRepo); >+ delete(destinationRepo); >+ } >+ >+ /** >+ * Test the application's behaviour given multiple metadata and artifact repositories where all are invalid >+ */ >+ public void testMultipleRepoCreationAllInvalid() { >+ //Setup: Create the folders >+ File metadataRepo1 = new File(getTempFolder(), "DirectorApp Metadata1"); >+ File metadataRepo2 = new File(getTempFolder(), "DirectorApp Metadata2"); >+ File artifactRepo1 = new File(getTempFolder(), "DirectorApp Artifact1"); >+ File artifactRepo2 = new File(getTempFolder(), "DirectorApp Artifact2"); >+ File destinationRepo = new File(getTempFolder(), "DirectorApp Destination"); >+ String installIU = "invalidIU"; >+ >+ //Setup: ensure folders do not exist >+ delete(metadataRepo1); >+ delete(metadataRepo2); >+ delete(artifactRepo1); >+ delete(artifactRepo2); >+ delete(destinationRepo); >+ >+ //Setup: create the args >+ String[] args = getMultipleRepoArgs("4.0", metadataRepo1, metadataRepo2, artifactRepo1, artifactRepo2, destinationRepo, installIU); >+ >+ try { >+ runDirectorApp("4.1", args); >+ } catch (ProvisionException e) { >+ //expected, fall through >+ } catch (Exception e) { >+ fail("4.3", e); >+ } >+ >+ //ensures that repositories have not been mistakenly created >+ assertFalse("4.4", metadataRepo1.exists()); >+ assertFalse("4.5", metadataRepo2.exists()); >+ assertFalse("4.6", artifactRepo1.exists()); >+ assertFalse("4.6", artifactRepo2.exists()); >+ assertFalse("4.7", destinationRepo.exists()); >+ >+ //Cleanup: delete the folders >+ delete(metadataRepo1); >+ delete(metadataRepo2); >+ delete(artifactRepo1); >+ delete(artifactRepo2); >+ delete(destinationRepo); >+ } >+ >+ /** >+ * Test the application's behaviour given multiple metadata and artifact repositories where both metadata repos are invalid >+ */ >+ public void testMultipleRepoCreationAllMetadataInvalid() { >+ //Setup: Create the folders >+ File metadataRepo1 = new File(getTempFolder(), "DirectorApp Metadata1"); >+ File metadataRepo2 = new File(getTempFolder(), "DirectorApp Metadata2"); >+ //Valid repositories >+ File artifactRepo1 = getTestData("5.0", "/testData/mirror/mirrorSourceRepo1"); >+ File artifactRepo2 = getTestData("5.1", "/testData/mirror/mirrorSourceRepo2"); >+ File destinationRepo = new File(getTempFolder(), "DirectorApp Destination"); >+ String installIU = "invalidIU"; >+ >+ //Setup: ensure folders do not exist >+ delete(metadataRepo1); >+ delete(metadataRepo2); >+ delete(destinationRepo); >+ >+ //Setup: create the args >+ String[] args = getMultipleRepoArgs("5.2", metadataRepo1, metadataRepo2, artifactRepo1, artifactRepo2, destinationRepo, installIU); >+ >+ try { >+ runDirectorApp("5.3", args); >+ } catch (ProvisionException e) { >+ //expected, fall through >+ } catch (Exception e) { >+ fail("5.5", e); >+ } >+ >+ //ensures that repositories have not been mistakenly created >+ assertFalse("5.6", metadataRepo1.exists()); >+ assertFalse("5.7", metadataRepo2.exists()); >+ assertTrue("5.8", artifactRepo1.exists()); >+ assertTrue("5.9", artifactRepo2.exists()); >+ assertFalse("5.10", destinationRepo.exists()); >+ >+ //Cleanup: delete the folders >+ delete(metadataRepo1); >+ delete(metadataRepo2); >+ delete(destinationRepo); >+ } >+ >+ /** >+ * Test the application's behaviour given multiple metadata and artifact repositories where only one metadata repo is invalid >+ * Note: this test should end with "The installable unit invalidIU has not been found." >+ */ >+ public void testMultipleRepoCreationOneMetadataInvalid() { >+ //Setup: Create the folders >+ File metadataRepo1 = new File(getTempFolder(), "DirectorApp Metadata1"); >+ //Valid repositories >+ File metadataRepo2 = getTestData("6.0", "/testData/mirror/mirrorSourceRepo1"); >+ File artifactRepo1 = getTestData("6.1", "/testData/mirror/mirrorSourceRepo1"); >+ File artifactRepo2 = getTestData("6.2", "/testData/mirror/mirrorSourceRepo2"); >+ File destinationRepo = new File(getTempFolder(), "DirectorApp Destination"); >+ String installIU = "invalidIU"; >+ >+ //Setup: ensure folders do not exist >+ delete(metadataRepo1); >+ delete(destinationRepo); >+ >+ //Setup: create the args >+ String[] args = getMultipleRepoArgs("6.3", metadataRepo1, metadataRepo2, artifactRepo1, artifactRepo2, destinationRepo, installIU); >+ >+ try { >+ runDirectorApp("6.4", args); >+ } catch (ProvisionException e) { >+ fail("6.5", e); >+ } catch (Exception e) { >+ fail("6.6", e); >+ } >+ >+ //ensures that repositories have not been mistakenly created >+ assertFalse("6.7", metadataRepo1.exists()); >+ assertTrue("6.8", metadataRepo2.exists()); >+ assertTrue("6.9", artifactRepo1.exists()); >+ assertTrue("6.10", artifactRepo2.exists()); >+ assertFalse("6.11", destinationRepo.exists()); >+ >+ //Cleanup: delete the folders >+ delete(metadataRepo1); >+ delete(destinationRepo); >+ } >+ >+ /** >+ * Test the application's behaviour given multiple metadata and artifact repositories where both artifact repos are invalid >+ */ >+ public void testMultipleRepoCreationAllArtifactInvalid() { >+ //Setup: Create the folders >+ File artifactRepo1 = new File(getTempFolder(), "DirectorApp Artifact1"); >+ File artifactRepo2 = new File(getTempFolder(), "DirectorApp Artifact2"); >+ //Valid repositories >+ File metadataRepo1 = getTestData("7.0", "/testData/mirror/mirrorSourceRepo1"); >+ File metadataRepo2 = getTestData("7.1", "/testData/mirror/mirrorSourceRepo2"); >+ File destinationRepo = new File(getTempFolder(), "DirectorApp Destination"); >+ String installIU = "invalidIU"; >+ >+ //Setup: ensure folders do not exist >+ delete(artifactRepo1); >+ delete(artifactRepo2); >+ delete(destinationRepo); >+ >+ //Setup: create the args >+ String[] args = getMultipleRepoArgs("7.2", metadataRepo1, metadataRepo2, artifactRepo1, artifactRepo2, destinationRepo, installIU); >+ >+ try { >+ runDirectorApp("7.3", args); >+ } catch (ProvisionException e) { >+ //expected, fall through >+ } catch (Exception e) { >+ fail("7.5", e); >+ } >+ >+ //ensures that repositories have not been mistakenly created >+ assertTrue("7.6", metadataRepo1.exists()); >+ assertTrue("7.7", metadataRepo2.exists()); >+ assertFalse("7.8", artifactRepo1.exists()); >+ assertFalse("7.9", artifactRepo2.exists()); >+ assertFalse("7.10", destinationRepo.exists()); >+ >+ //Cleanup: delete the folders >+ delete(artifactRepo1); >+ delete(artifactRepo2); >+ delete(destinationRepo); >+ } >+ >+ /** >+ * Test the application's behaviour given multiple metadata and artifact repositories where only one artifact repo is invalid >+ * Note: this test should end with "The installable unit invalidIU has not been found." >+ */ >+ public void testMultipleRepoCreationOneArtifactInvalid() { >+ //Setup: Create the folders >+ File artifactRepo1 = new File(getTempFolder(), "DirectorApp Artifact1"); >+ //Valid repositories >+ File artifactRepo2 = getTestData("8.0", "/testData/mirror/mirrorSourceRepo1"); >+ File metadataRepo1 = getTestData("8.1", "/testData/mirror/mirrorSourceRepo1"); >+ File metadataRepo2 = getTestData("8.2", "/testData/mirror/mirrorSourceRepo2"); >+ File destinationRepo = new File(getTempFolder(), "DirectorApp Destination"); >+ String installIU = "invalidIU"; >+ >+ //Setup: ensure folders do not exist >+ delete(artifactRepo1); >+ delete(destinationRepo); >+ >+ //Setup: create the args >+ String[] args = getMultipleRepoArgs("8.3", metadataRepo1, metadataRepo2, artifactRepo1, artifactRepo2, destinationRepo, installIU); >+ >+ try { >+ runDirectorApp("8.4", args); >+ } catch (ProvisionException e) { >+ fail("8.5", e); >+ } catch (Exception e) { >+ fail("8.6", e); >+ } >+ >+ //ensures that repositories have not been mistakenly created >+ assertTrue("8.7", metadataRepo1.exists()); >+ assertTrue("8.8", metadataRepo2.exists()); >+ assertFalse("8.9", artifactRepo1.exists()); >+ assertTrue("8.10", artifactRepo2.exists()); >+ assertFalse("8.11", destinationRepo.exists()); >+ >+ //Cleanup: delete the folders >+ delete(artifactRepo1); >+ delete(destinationRepo); >+ } >+ >+ /** >+ * Test the application's behaviour given multiple metadata and artifact repositories where only one artifact repo and only one metadata repo are invalid >+ * Note: this test should end with "The installable unit invalidIU has not been found." >+ */ >+ public void testMultipleRepoCreationOneArtifactOneMetadataInvalid() { >+ //Setup: Create the folders >+ File artifactRepo1 = new File(getTempFolder(), "DirectorApp Artifact1"); >+ File metadataRepo1 = new File(getTempFolder(), "DirectorApp Metadata1"); >+ //Valid repositories >+ File artifactRepo2 = getTestData("9.0", "/testData/mirror/mirrorSourceRepo1"); >+ File metadataRepo2 = getTestData("9.1", "/testData/mirror/mirrorSourceRepo1"); >+ File destinationRepo = new File(getTempFolder(), "DirectorApp Destination"); >+ String installIU = "invalidIU"; >+ >+ //Setup: ensure folders do not exist >+ delete(artifactRepo1); >+ delete(destinationRepo); >+ >+ //Setup: create the args >+ String[] args = getMultipleRepoArgs("9.2", metadataRepo1, metadataRepo2, artifactRepo1, artifactRepo2, destinationRepo, installIU); >+ >+ try { >+ runDirectorApp("9.3", args); >+ } catch (ProvisionException e) { >+ fail("9.4", e); >+ } catch (Exception e) { >+ fail("9.5", e); >+ } >+ >+ //ensures that repositories have not been mistakenly created >+ assertFalse("9.6", metadataRepo1.exists()); >+ assertTrue("9.7", metadataRepo2.exists()); >+ assertFalse("9.8", artifactRepo1.exists()); >+ assertTrue("9.9", artifactRepo2.exists()); >+ assertFalse("9.10", destinationRepo.exists()); >+ >+ //Cleanup: delete the folders >+ delete(artifactRepo1); >+ delete(metadataRepo1); >+ delete(destinationRepo); >+ } >+ >+ /** >+ * Test the application's behaviour given a single metadata and a single artifact repository where all are valid >+ * Note: this test should end with "The installable unit invalidIU has not been found." >+ */ >+ public void testSingleRepoCreationNoneInvalid() { >+ //Setup: get repositories >+ File artifactRepo = getTestData("10.0", "/testData/mirror/mirrorSourceRepo1"); >+ File metadataRepo = getTestData("10.1", "/testData/mirror/mirrorSourceRepo1"); >+ File destinationRepo = new File(getTempFolder(), "DirectorApp Destination"); >+ String installIU = "invalidIU"; >+ >+ //Setup: ensure folders do not exist >+ delete(destinationRepo); >+ >+ //Setup: create the args >+ String[] args = getSingleRepoArgs("10.2", metadataRepo, artifactRepo, destinationRepo, installIU); >+ >+ try { >+ runDirectorApp("10.3", args); >+ } catch (ProvisionException e) { >+ fail("10.4", e); >+ } catch (Exception e) { >+ fail("10.5", e); >+ } >+ >+ //ensures that repositories have not been mistakenly created >+ assertTrue("10.6", metadataRepo.exists()); >+ assertTrue("10.7", artifactRepo.exists()); >+ assertFalse("10.8", destinationRepo.exists()); >+ >+ //Cleanup: delete the folders >+ delete(destinationRepo); >+ } >+ >+ /** >+ * Test the application's behaviour given multiple metadata and artifact repositories where all repos are valid >+ * Note: this test should end with "The installable unit invalidIU has not been found." >+ */ >+ public void testMultipleRepoCreationNoneInvalid() { >+ //Setup: Create the folders >+ //Valid repositories >+ File artifactRepo1 = getTestData("11.0", "/testData/mirror/mirrorSourceRepo1"); >+ File metadataRepo1 = getTestData("11.1", "/testData/mirror/mirrorSourceRepo1"); >+ File artifactRepo2 = getTestData("11.2", "/testData/mirror/mirrorSourceRepo2"); >+ File metadataRepo2 = getTestData("11.3", "/testData/mirror/mirrorSourceRepo2"); >+ File destinationRepo = new File(getTempFolder(), "DirectorApp Destination"); >+ String installIU = "invalidIU"; >+ >+ //Setup: ensure folders do not exist >+ delete(destinationRepo); >+ >+ //Setup: create the args >+ String[] args = getMultipleRepoArgs("11.4", metadataRepo1, metadataRepo2, artifactRepo1, artifactRepo2, destinationRepo, installIU); >+ >+ try { >+ runDirectorApp("11.5", args); >+ } catch (ProvisionException e) { >+ fail("11.6", e); >+ } catch (Exception e) { >+ fail("11.7", e); >+ } >+ >+ //ensures that repositories have not been mistakenly created >+ assertTrue("11.8", metadataRepo1.exists()); >+ assertTrue("11.9", metadataRepo2.exists()); >+ assertTrue("11.10", artifactRepo1.exists()); >+ assertTrue("11.11", artifactRepo2.exists()); >+ assertFalse("11.12", destinationRepo.exists()); >+ >+ //Cleanup: delete the folders >+ delete(destinationRepo); >+ } >+} >#P org.eclipse.equinox.p2.artifact.repository >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.artifact.repository/META-INF/MANIFEST.MF,v >retrieving revision 1.27 >diff -u -r1.27 MANIFEST.MF >--- META-INF/MANIFEST.MF 26 Sep 2008 19:57:45 -0000 1.27 >+++ META-INF/MANIFEST.MF 2 Oct 2008 14:49:40 -0000 >@@ -13,6 +13,7 @@ > org.eclipse.equinox.internal.provisional.p2.artifact.repository; > x-friends:="org.eclipse.equinox.p2.artifact.optimizers, > org.eclipse.equinox.p2.artifact.processors, >+ org.eclipse.equinox.p2.director.app, > org.eclipse.equinox.p2.directorywatcher, > org.eclipse.equinox.p2.metadata.generator, > org.eclipse.equinox.p2.updatesite, >#P org.eclipse.equinox.p2.metadata.repository >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata.repository/META-INF/MANIFEST.MF,v >retrieving revision 1.25 >diff -u -r1.25 MANIFEST.MF >--- META-INF/MANIFEST.MF 30 Sep 2008 14:20:21 -0000 1.25 >+++ META-INF/MANIFEST.MF 2 Oct 2008 14:49:41 -0000 >@@ -20,6 +20,7 @@ > org.eclipse.equinox.p2.updatechecker, > org.eclipse.equinox.p2.console, > org.eclipse.equinox.p2.director, >+ org.eclipse.equinox.p2.director.app, > org.eclipse.equinox.p2.directorywatcher, > org.eclipse.equinox.p2.engine, > org.eclipse.equinox.p2.metadata.generator, >#P org.eclipse.equinox.p2.core >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.core/META-INF/MANIFEST.MF,v >retrieving revision 1.24 >diff -u -r1.24 MANIFEST.MF >--- META-INF/MANIFEST.MF 26 Sep 2008 19:55:59 -0000 1.24 >+++ META-INF/MANIFEST.MF 2 Oct 2008 14:49:42 -0000 >@@ -51,6 +51,7 @@ > org.eclipse.equinox.internal.p2.persistence;x-friends:="org.eclipse.equinox.p2.artifact.repository,org.eclipse.equinox.p2.engine,org.eclipse.equinox.p2.metadata.repository", > org.eclipse.equinox.internal.provisional.p2.core; > x-friends:="org.eclipse.equinox.p2.artifact.repository, >+ org.eclipse.equinox.p2.director.app, > org.eclipse.equinox.p2.extensionlocation, > org.eclipse.equinox.p2.metadata.repository, > org.eclipse.equinox.p2.ui,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
dj.houghton
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 248045
:
114028
| 114108