### Eclipse Workspace Patch 1.0 #P org.eclipse.equinox.p2.tests Index: src/org/eclipse/equinox/p2/tests/ant/CompositeRepositoryTaskTest.java =================================================================== RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/CompositeRepositoryTaskTest.java,v retrieving revision 1.4 diff -u -r1.4 CompositeRepositoryTaskTest.java --- src/org/eclipse/equinox/p2/tests/ant/CompositeRepositoryTaskTest.java 2 May 2011 23:03:09 -0000 1.4 +++ src/org/eclipse/equinox/p2/tests/ant/CompositeRepositoryTaskTest.java 3 May 2011 18:26:50 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2010 IBM Corporation and others. + * Copyright (c) 2009, 2011 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 @@ -11,7 +11,8 @@ package org.eclipse.equinox.p2.tests.ant; import java.io.File; -import java.net.*; +import java.net.URI; +import java.net.URISyntaxException; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.URIUtil; import org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository; @@ -389,15 +390,11 @@ runAntTaskWithExceptions(); } catch (CoreException e) { exception = e; - if (!(rootCause(e) instanceof MalformedURLException)) - fail("Expected MalformedURLException.", e); - else { - try { - getArtifactRepositoryManager().loadRepository(location, null); - fail("Repository with invalid location loaded."); - } catch (ProvisionException e2) { - // This is a success - } + try { + getArtifactRepositoryManager().loadRepository(location, null); + fail("Repository with invalid location loaded."); + } catch (ProvisionException e2) { + // This is a success } } if (exception == null) Index: src/org/eclipse/equinox/p2/tests/ant/MirrorTaskTest.java =================================================================== RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/MirrorTaskTest.java,v retrieving revision 1.13 diff -u -r1.13 MirrorTaskTest.java --- src/org/eclipse/equinox/p2/tests/ant/MirrorTaskTest.java 16 Sep 2010 19:00:49 -0000 1.13 +++ src/org/eclipse/equinox/p2/tests/ant/MirrorTaskTest.java 3 May 2011 18:26:50 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2010 IBM Corporation and others. + * Copyright (c) 2009, 2011 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 @@ -307,7 +307,8 @@ while (exception.getCause() != null && !(exception instanceof ProvisionException)) exception = exception.getCause(); - assertEquals("Unexpected error", NLS.bind(org.eclipse.equinox.p2.internal.repository.tools.Messages.exception_invalidSource, location), exception.getMessage()); + assertTrue("Expecting a CoreException", exception instanceof CoreException); + assertEquals("Unexpected error code.", ProvisionException.REPOSITORY_FAILED_READ, ((CoreException) exception).getStatus().getCode()); } /* Index: src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java =================================================================== RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java,v retrieving revision 1.47 diff -u -r1.47 MetadataRepositoryManagerTest.java --- src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java 2 May 2011 23:03:09 -0000 1.47 +++ src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java 3 May 2011 18:26:51 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2010 IBM Corporation and others. + * Copyright (c) 2007, 2011 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 @@ -126,14 +126,14 @@ try { factory.load(location, 0, new NullProgressMonitor()); } catch (ProvisionException e) { - assertEquals(ProvisionException.REPOSITORY_INVALID_LOCATION, e.getStatus().getCode()); + assertEquals(ProvisionException.REPOSITORY_FAILED_READ, e.getStatus().getCode()); } factory = new UpdateSiteMetadataRepositoryFactory(); factory.setAgent(getAgent()); try { factory.load(location, 0, new NullProgressMonitor()); } catch (ProvisionException e) { - assertEquals(ProvisionException.REPOSITORY_INVALID_LOCATION, e.getStatus().getCode()); + assertEquals(ProvisionException.REPOSITORY_FAILED_READ, e.getStatus().getCode()); } }