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 66925 Details for
Bug 177676
[JUnit] Problems with JUnits with multiple versions of same bundle
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
revert
patch_177676.txt (text/plain), 6.59 KB, created by
Benno Baumgartner
on 2007-05-11 14:54:08 EDT
(
hide
)
Description:
revert
Filename:
MIME Type:
Creator:
Benno Baumgartner
Created:
2007-05-11 14:54:08 EDT
Size:
6.59 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.junit >Index: src/org/eclipse/jdt/internal/junit/buildpath/JUnitHomeInitializer.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/buildpath/JUnitHomeInitializer.java,v >retrieving revision 1.2 >diff -u -r1.2 JUnitHomeInitializer.java >--- src/org/eclipse/jdt/internal/junit/buildpath/JUnitHomeInitializer.java 11 May 2007 12:46:10 -0000 1.2 >+++ src/org/eclipse/jdt/internal/junit/buildpath/JUnitHomeInitializer.java 11 May 2007 18:46:50 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2007 IBM Corporation and others. >+ * Copyright (c) 2000, 2006 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 >@@ -34,7 +34,7 @@ > > private void initializeHome() { > try { >- IPath location= BuildPathSupport.getBundleLocation(BuildPathSupport.JUNIT3_PLUGIN); >+ IPath location= BuildPathSupport.getBundleLocation(BuildPathSupport.JUNIT3_PLUGIN_ID); > if (location != null) { > JavaCore.setClasspathVariable(JUnitPlugin.JUNIT_HOME, location, null); > } else { >@@ -47,7 +47,7 @@ > > private void initializeSource() { > try { >- IPath sourceLocation= BuildPathSupport.getSourceLocation(BuildPathSupport.JUNIT3_PLUGIN); >+ IPath sourceLocation= BuildPathSupport.getSourceLocation(BuildPathSupport.JUNIT3_PLUGIN_ID); > if (sourceLocation != null) { > JavaCore.setClasspathVariable(JUnitPlugin.JUNIT_SRC_HOME, sourceLocation, null); > } else { >Index: src/org/eclipse/jdt/internal/junit/buildpath/BuildPathSupport.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/buildpath/BuildPathSupport.java,v >retrieving revision 1.11 >diff -u -r1.11 BuildPathSupport.java >--- src/org/eclipse/jdt/internal/junit/buildpath/BuildPathSupport.java 11 May 2007 12:46:10 -0000 1.11 >+++ src/org/eclipse/jdt/internal/junit/buildpath/BuildPathSupport.java 11 May 2007 18:46:50 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2007 IBM Corporation and others. >+ * Copyright (c) 2000, 2006 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 >@@ -18,9 +18,6 @@ > import org.eclipse.core.runtime.FileLocator; > import org.eclipse.core.runtime.IPath; > import org.eclipse.core.runtime.Path; >-import org.eclipse.core.runtime.Platform; >- >-import org.eclipse.osgi.service.resolver.VersionRange; > > import org.eclipse.jdt.core.IAccessRule; > import org.eclipse.jdt.core.IClasspathAttribute; >@@ -31,51 +28,17 @@ > import org.eclipse.jdt.internal.junit.ui.JUnitPreferencesConstants; > > import org.osgi.framework.Bundle; >-import org.osgi.framework.Constants; >-import org.osgi.framework.Version; > > /** > * > */ > public class BuildPathSupport { > >- public static class JUnitPluginDescription { >- private final String fBundleId; >- private final VersionRange fVersionRange; >- >- public JUnitPluginDescription(String bundleId, VersionRange versionRange) { >- fBundleId= bundleId; >- fVersionRange= versionRange; >- } >- >- public Bundle getBundle() { >- Bundle[] bundles= Platform.getBundles(fBundleId, null); >- if (bundles != null) { >- for (int i= 0; i < bundles.length; i++) { >- Bundle curr= bundles[i]; >- String version= (String) curr.getHeaders().get(Constants.BUNDLE_VERSION); >- try { >- if (fVersionRange.isIncluded(Version.parseVersion(version))) { >- return curr; >- } >- } catch (IllegalArgumentException e) { >- // ignore >- } >- } >- } >- return null; >- } >- >- public String getBundleId() { >- return fBundleId; >- } >- } >- >- public static final JUnitPluginDescription JUNIT3_PLUGIN= new JUnitPluginDescription("org.junit", new VersionRange("[3.8.2,3.9)")); //$NON-NLS-1$ //$NON-NLS-2$ >- public static final JUnitPluginDescription JUNIT4_PLUGIN= new JUnitPluginDescription("org.junit4", new VersionRange("[4.3.1,4.4.0)")); //$NON-NLS-1$ //$NON-NLS-2$ >+ public static final String JUNIT3_PLUGIN_ID= "org.junit"; //$NON-NLS-1$ >+ public static final String JUNIT4_PLUGIN_ID= "org.junit4"; //$NON-NLS-1$ > >- public static IPath getBundleLocation(JUnitPluginDescription pluginDesc) { >- Bundle bundle= pluginDesc.getBundle(); >+ public static IPath getBundleLocation(String bundleName) { >+ Bundle bundle= JUnitPlugin.getDefault().getBundle(bundleName); > if (bundle == null) > return null; > >@@ -89,8 +52,8 @@ > return Path.fromOSString(fullPath); > } > >- public static IPath getSourceLocation(JUnitPluginDescription pluginDesc) { >- Bundle bundle= pluginDesc.getBundle(); >+ public static IPath getSourceLocation(String bundleName) { >+ Bundle bundle= JUnitPlugin.getDefault().getBundle(bundleName); > if (bundle == null) > return null; > >@@ -109,7 +72,7 @@ > return null; > } > String fullPath= new File(local.getPath()).getAbsolutePath() >- + File.separator + "src" + File.separator + pluginDesc.getBundleId() + "_" + version; //$NON-NLS-1$ //$NON-NLS-2$ >+ + File.separator + "src" + File.separator + bundleName + "_" + version; //$NON-NLS-1$ //$NON-NLS-2$ > return Path.fromOSString(fullPath); > } > >@@ -122,11 +85,11 @@ > } > > public static IClasspathEntry getJUnit3LibraryEntry() { >- IPath bundleBase= getBundleLocation(JUNIT3_PLUGIN); >+ IPath bundleBase= getBundleLocation(JUNIT3_PLUGIN_ID); > if (bundleBase != null) { > IPath jarLocation= bundleBase.append("junit.jar"); //$NON-NLS-1$ > >- IPath sourceBase= getSourceLocation(JUNIT3_PLUGIN); >+ IPath sourceBase= getSourceLocation(JUNIT3_PLUGIN_ID); > IPath srcLocation= sourceBase != null ? sourceBase.append("junitsrc.zip") : null; //$NON-NLS-1$ > > IAccessRule[] accessRules= { }; >@@ -140,11 +103,11 @@ > } > > public static IClasspathEntry getJUnit4LibraryEntry() { >- IPath bundleBase= getBundleLocation(JUNIT4_PLUGIN); >+ IPath bundleBase= getBundleLocation(JUNIT4_PLUGIN_ID); > if (bundleBase != null) { > IPath jarLocation= bundleBase.append("junit.jar"); //$NON-NLS-1$ > >- IPath sourceBase= getSourceLocation(JUNIT4_PLUGIN); >+ IPath sourceBase= getSourceLocation(JUNIT4_PLUGIN_ID); > IPath srcLocation= sourceBase != null ? sourceBase.append("junitsrc.zip") : null; //$NON-NLS-1$ > > IAccessRule[] accessRules= { };
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
Actions:
View
|
Diff
Attachments on
bug 177676
:
61024
|
66684
|
66925
|
67026