diff options
author | Thomas Watson | 2013-05-16 18:47:08 +0000 |
---|---|---|
committer | Pascal Rapicault | 2013-06-18 19:59:36 +0000 |
commit | f49bb27f39ea8a1eccc63b7ba5ab439dd888355e (patch) | |
tree | 575e57cdf8584df4cda3100fadf2e33631984657 /bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal | |
parent | c5ec81ceab34199727866af97ed65b1458d96542 (diff) | |
download | rt.equinox.p2-f49bb27f39ea8a1eccc63b7ba5ab439dd888355e.tar.gz rt.equinox.p2-f49bb27f39ea8a1eccc63b7ba5ab439dd888355e.tar.xz rt.equinox.p2-f49bb27f39ea8a1eccc63b7ba5ab439dd888355e.zip |
Remove internal references to org.eclipse.osgi
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal')
4 files changed, 291 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal/p2/tests/verifier/EclipseAdaptorMessages.properties b/bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal/p2/tests/verifier/EclipseAdaptorMessages.properties new file mode 100644 index 000000000..4e67bcb00 --- /dev/null +++ b/bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal/p2/tests/verifier/EclipseAdaptorMessages.properties @@ -0,0 +1,114 @@ +############################################################################### +# Copyright (c) 2004, 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 +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# IBM Corporation - initial API and implementation +############################################################################### + +#External Messages for EN locale + +#EclipseAdaptor messages +ECLIPSE_ADAPTOR_ERROR_XML_SERVICE=Error registering XML parser services. +ECLIPSE_ADAPTOR_RUNTIME_ERROR=An unexpected runtime error has occurred. +ECLIPSE_ADAPTOR_EXITING=The application will terminate. + +#EclipseStarter messages +ECLIPSE_STARTUP_BUNDLE_NOT_FOUND=Bundle {0} not found. +ECLIPSE_STARTUP_ROOTS_NOT_RESOLVED=One or more bundles are not resolved because the following root constraints are not resolved: +ECLIPSE_STARTUP_ALL_NOT_RESOLVED=The following is a complete list of bundles which are not resolved, see the prior log entry for the root cause if it exists: +ECLIPSE_STARTUP_ERROR_BUNDLE_NOT_RESOLVED=Bundle {0} was not resolved. +ECLIPSE_STARTUP_ERROR_BUNDLE_NOT_ACTIVE=Bundle {0} is not active. +ECLIPSE_STARTUP_ERROR_NO_APPLICATION=Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini). +#Don't use double quotes in the ECLIPSE_STARTUP_ERROR_CHECK_LOG. (See bug 86085) +ECLIPSE_STARTUP_ERROR_CHECK_LOG=An error has occurred. See the log file\n{0}. +ECLIPSE_STARTUP_ALREADY_RUNNING=Platform already running +ECLIPSE_STARTUP_NOT_RUNNING=Platform not running +ECLIPSE_STARTUP_STARTUP_ERROR=Startup error +ECLIPSE_STARTUP_APP_ERROR=Application error +ECLIPSE_STARTUP_SHUTDOWN_ERROR=Shutdown error +ECLIPSE_STARTUP_FAILED_INSTALL=Error installing bundle: {0} +ECLIPSE_STARTUP_FAILED_UNINSTALL=Error uninstalling bundle: {0} +ECLIPSE_STARTUP_FAILED_START=Error starting bundle: {0} +ECLIPSE_STARTUP_FILEMANAGER_OPEN_ERROR=Error reading configuration: {0} +ECLIPSE_STARTUP_PROPS_NOT_SET=Cannot start without the following system properties set: {0} + +#EclipseBundleData messages +ECLIPSE_DATA_MANIFEST_NOT_FOUND=Manifest not found: {0} +ECLIPSE_DATA_ERROR_READING_MANIFEST=Error reading manifest for bundle at the location: {0} + +#Console extension +ECLIPSE_CONSOLE_NO_BUNDLE_SPECIFIED_ERROR=No bundle specified! +ECLIPSE_CONSOLE_CANNOT_FIND_BUNDLE_ERROR=Cannot find bundle {0}. +ECLIPSE_CONSOLE_NO_CONSTRAINTS_NO_PLATFORM_ADMIN_MESSAGE=No unresolved constraints [PlatformAdmin service is not registered]. +ECLIPSE_CONSOLE_NO_CONSTRAINTS=No unresolved constraints. +ECLIPSE_CONSOLE_DIRECT_CONSTRAINTS=Direct constraints which are unresolved: +ECLIPSE_CONSOLE_LEAF_CONSTRAINTS=Leaf constraints in the dependency chain which are unresolved: +ECLIPSE_CONSOLE_COMMANDS_HEADER=Eclipse Runtime commands +ECLIPSE_CONSOLE_HELP_DIAG_COMMAND_DESCRIPTION=Displays unsatisfied constraints for the specified bundle(s). +ECLIPSE_CONSOLE_HELP_ENABLE_COMMAND_DESCRIPTION=enable the specified bundle(s) +ECLIPSE_CONSOLE_HELP_DISABLE_COMMAND_DESCRIPTION=disable the specified bundle(s) +ECLIPSE_CONSOLE_HELP_LD_COMMAND_DESCRIPTION=list disabled bundles in the system +ECLIPSE_CONSOLE_BUNDLE_DISABLED_MESSAGE=Bundle disabled at console +ECLIPSE_CONSOLE_DISABLED_COUNT_MESSAGE={0} disabled bundle(s) in the system +ECLIPSE_CONSOLE_DISABLED_BUNDLE_HEADER=Bundle :\t{0} (id={1}) +ECLIPSE_CONSOLE_DISABLED_BUNDLE_REASON1=Reason(s):\t{0} (policy={1}) + +#Bundle resolution messages +ECLIPSE_MISSING_OPTIONAL_REQUIRED_BUNDLE=Missing optionally required bundle {0}. +ECLIPSE_MISSING_REQUIRED_BUNDLE=Missing required bundle {0}. +ECLIPSE_MISSING_IMPORTED_PACKAGE=Missing imported package {0}. +ECLIPSE_MISSING_OPTIONAL_IMPORTED_PACKAGE=Missing optionally imported package {0}. +ECLIPSE_MISSING_DYNAMIC_IMPORTED_PACKAGE=Missing dynamically imported package {0}. +ECLIPSE_MISSING_HOST=Missing host {0}. +ECLIPSE_MISSING_NATIVECODE=Missing native code match {0}. +ECLIPSE_MISSING_REQUIRED_CAPABILITY=Missing required capability {0}. +ECLIPSE_MISSING_REQUIREMENT=Missing the requirement {0}. + +#Conversion messages +ECLIPSE_CONVERTER_ERROR_CONVERTING=Error converting plugin at {0}. +ECLIPSE_CONVERTER_ERROR_CREATING_BUNDLE_MANIFEST=Error creating bundle manifest file for {0} at {1}. +ECLIPSE_CONVERTER_ERROR_PARSING_PLUGIN_MANIFEST=Error parsing plugin manifest file {0} at {1}. +ECLIPSE_CONVERTER_MISSING_ATTRIBUTE=Error parsing {0} manifest. Missing attribute \"{1}\" in element \"{2}\". +ECLIPSE_CONVERTER_PLUGIN_LIBRARY_IGNORED=Plugin library {0} ignored when creating manifest for {1}. +ECLIPSE_CONVERTER_NO_SAX_FACTORY=No SAX factory parser has been found. +ECLIPSE_CONVERTER_PARSE_UNKNOWNTOP_ELEMENT = Unknown element \"{0}\", found at the top level, ignored. +ECLIPSE_CONVERTER_FILENOTFOUND = Could not find a META-INF/MANIFEST.MF, plugin.xml or a fragment.xml in {0}. +parse_error=Error parsing manifest: {0} +parse_errorNameLineColumn=Error parsing manifest at \"{0}\" line \"{1}\" column \"{2}\": {3} + +#Classloader messages +ECLIPSE_CLASSLOADER_CANNOT_GET_HEADERS=Error loading bundle manifest for {0}. Using default auto-activation settings. +ECLIPSE_CLASSLOADER_CONCURRENT_STARTUP=While loading class "{1}", thread "{0}" timed out waiting ({4}ms) for thread "{2}" to finish starting bundle "{3}". To avoid deadlock, thread "{0}" is proceeding but "{1}" may not be fully initialized. +ECLIPSE_CLASSLOADER_ACTIVATION=An error occurred while automatically activating bundle {0} ({1}). + +#CachedManifest messages +ECLIPSE_CACHEDMANIFEST_UNEXPECTED_EXCEPTION=Unexpected exception occurred loading manifest for bundle at the location: {0}. + +#BundleStopper messages +ECLIPSE_BUNDLESTOPPER_CYCLES_FOUND=Info: cycle(s) found while stopping bundles: {0}. + +#Location message +ECLIPSE_CANNOT_CHANGE_LOCATION = Cannot change the location once it is set. + +#NL Problem +error_badNL=Bad value: \"{0}\" for NL. Using system default. + +#FileMananger messages +fileManager_cannotLock = Unable to create lock manager. +fileManager_updateFailed = File update failed on one or more files. +fileManager_illegalInReadOnlyMode = Cannot perform operation while in read-only mode. +fileManager_notOpen = Manager is not opened. + +#Location messages +location_cannotLockNIO = An error occurred while locking file \"{0}\": \"{1}\". A common reason is that the file system or Runtime Environment does not support file locking for that location. Please choose a different location, or disable file locking by passing {2} as a VM argument. +location_cannotLock = An error occurred while locking file \"{0}\". +location_folderReadOnly = The folder \"{0}\" is read-only. +location_notSet = The location has not been set. +location_notFileProtocol = Unable to lock the location. The set location is not a file URL: {0} +location_noLockFile = The lock file has not been set. + +ECLIPSE_PLUGIN_EXTRACTION_PROBLEM = The URL \"{0}\" could not be extracted probably due to insufficient permissions or insufficient disk space. diff --git a/bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal/p2/tests/verifier/EclipseAdaptorMsg.java b/bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal/p2/tests/verifier/EclipseAdaptorMsg.java new file mode 100644 index 000000000..663690d49 --- /dev/null +++ b/bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal/p2/tests/verifier/EclipseAdaptorMsg.java @@ -0,0 +1,110 @@ +/******************************************************************************* + * Copyright (c) 2004, 2013 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.internal.p2.tests.verifier; + +import org.eclipse.osgi.util.NLS; + +public class EclipseAdaptorMsg extends NLS { + private static final String BUNDLE_NAME = "org.eclipse.equinox.internal.p2.tests.verifier.EclipseAdaptorMessages"; //$NON-NLS-1$ + + public static String ECLIPSE_MISSING_IMPORTED_PACKAGE; + public static String ECLIPSE_MISSING_OPTIONAL_IMPORTED_PACKAGE; + public static String ECLIPSE_MISSING_DYNAMIC_IMPORTED_PACKAGE; + public static String ECLIPSE_MISSING_OPTIONAL_REQUIRED_BUNDLE; + public static String ECLIPSE_MISSING_REQUIRED_BUNDLE; + public static String ECLIPSE_MISSING_HOST; + public static String ECLIPSE_MISSING_NATIVECODE; + public static String ECLIPSE_MISSING_REQUIRED_CAPABILITY; + public static String ECLIPSE_MISSING_REQUIREMENT; + public static String ECLIPSE_CANNOT_CHANGE_LOCATION; + public static String ECLIPSE_BUNDLESTOPPER_CYCLES_FOUND; + public static String ECLIPSE_CACHEDMANIFEST_UNEXPECTED_EXCEPTION; + + public static String fileManager_cannotLock; + public static String fileManager_updateFailed; + public static String fileManager_illegalInReadOnlyMode; + public static String fileManager_notOpen; + + public static String ECLIPSE_ADAPTOR_ERROR_XML_SERVICE; + public static String ECLIPSE_ADAPTOR_RUNTIME_ERROR; + public static String ECLIPSE_ADAPTOR_EXITING; + + public static String ECLIPSE_DATA_MANIFEST_NOT_FOUND; + public static String ECLIPSE_CONVERTER_ERROR_CONVERTING; + public static String ECLIPSE_DATA_ERROR_READING_MANIFEST; + public static String ECLIPSE_CLASSLOADER_CANNOT_GET_HEADERS; + + public static String ECLIPSE_CLASSLOADER_CONCURRENT_STARTUP; + public static String ECLIPSE_CLASSLOADER_ACTIVATION; + + public static String ECLIPSE_CONSOLE_COMMANDS_HEADER; + public static String ECLIPSE_CONSOLE_HELP_DIAG_COMMAND_DESCRIPTION; + public static String ECLIPSE_CONSOLE_HELP_ENABLE_COMMAND_DESCRIPTION; + public static String ECLIPSE_CONSOLE_HELP_DISABLE_COMMAND_DESCRIPTION; + public static String ECLIPSE_CONSOLE_HELP_LD_COMMAND_DESCRIPTION; + public static String ECLIPSE_CONSOLE_NO_BUNDLE_SPECIFIED_ERROR; + public static String ECLIPSE_CONSOLE_NO_CONSTRAINTS_NO_PLATFORM_ADMIN_MESSAGE; + public static String ECLIPSE_CONSOLE_CANNOT_FIND_BUNDLE_ERROR; + public static String ECLIPSE_CONSOLE_NO_CONSTRAINTS; + public static String ECLIPSE_CONSOLE_DIRECT_CONSTRAINTS; + public static String ECLIPSE_CONSOLE_LEAF_CONSTRAINTS; + public static String ECLIPSE_CONSOLE_BUNDLE_DISABLED_MESSAGE; + public static String ECLIPSE_CONSOLE_DISABLED_COUNT_MESSAGE; + public static String ECLIPSE_CONSOLE_DISABLED_BUNDLE_HEADER; + public static String ECLIPSE_CONSOLE_DISABLED_BUNDLE_REASON1; + + public static String ECLIPSE_STARTUP_ALREADY_RUNNING; + public static String ECLIPSE_STARTUP_STARTUP_ERROR; + public static String ECLIPSE_STARTUP_SHUTDOWN_ERROR; + public static String ECLIPSE_STARTUP_ERROR_CHECK_LOG; + public static String ECLIPSE_STARTUP_NOT_RUNNING; + public static String ECLIPSE_STARTUP_ERROR_NO_APPLICATION; + public static String ECLIPSE_STARTUP_ROOTS_NOT_RESOLVED; + public static String ECLIPSE_STARTUP_ALL_NOT_RESOLVED; + public static String ECLIPSE_STARTUP_ERROR_BUNDLE_NOT_ACTIVE; + public static String ECLIPSE_STARTUP_ERROR_BUNDLE_NOT_RESOLVED; + public static String ECLIPSE_STARTUP_BUNDLE_NOT_FOUND; + public static String ECLIPSE_STARTUP_FAILED_UNINSTALL; + public static String ECLIPSE_STARTUP_FAILED_INSTALL; + public static String ECLIPSE_STARTUP_FAILED_START; + public static String ECLIPSE_STARTUP_APP_ERROR; + public static String ECLIPSE_STARTUP_FILEMANAGER_OPEN_ERROR; + public static String ECLIPSE_STARTUP_PROPS_NOT_SET; + + public static String error_badNL; + + public static String location_cannotLock; + public static String location_cannotLockNIO; + public static String location_folderReadOnly; + public static String location_notSet; + public static String location_notFileProtocol; + public static String location_noLockFile; + + public static String ECLIPSE_CONVERTER_FILENOTFOUND; + public static String ECLIPSE_CONVERTER_ERROR_CREATING_BUNDLE_MANIFEST; + public static String ECLIPSE_CONVERTER_PLUGIN_LIBRARY_IGNORED; + + public static String ECLIPSE_CONVERTER_ERROR_PARSING_PLUGIN_MANIFEST; + public static String ECLIPSE_CONVERTER_MISSING_ATTRIBUTE; + public static String parse_error; + public static String parse_errorNameLineColumn; + + public static String ECLIPSE_CONVERTER_NO_SAX_FACTORY; + public static String ECLIPSE_CONVERTER_PARSE_UNKNOWNTOP_ELEMENT; + + public static String ECLIPSE_PLUGIN_EXTRACTION_PROBLEM; + + static { + // initialize resource bundles + NLS.initializeMessages(BUNDLE_NAME, EclipseAdaptorMsg.class); + } + +} diff --git a/bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal/p2/tests/verifier/MessageHelper.java b/bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal/p2/tests/verifier/MessageHelper.java new file mode 100644 index 000000000..046c93c5b --- /dev/null +++ b/bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal/p2/tests/verifier/MessageHelper.java @@ -0,0 +1,66 @@ +/******************************************************************************* + * Copyright (c) 2006, 2013 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.internal.p2.tests.verifier; + +import java.util.Date; +import org.eclipse.osgi.service.resolver.*; +import org.eclipse.osgi.util.NLS; +import org.osgi.framework.Constants; + +/** + * @since 3.3 + */ +public class MessageHelper { + public static String getResolutionFailureMessage(VersionConstraint unsatisfied) { + if (unsatisfied.isResolved()) + throw new IllegalArgumentException(); + if (unsatisfied instanceof ImportPackageSpecification) { + if (ImportPackageSpecification.RESOLUTION_OPTIONAL.equals(((ImportPackageSpecification) unsatisfied).getDirective(Constants.RESOLUTION_DIRECTIVE))) + return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_OPTIONAL_IMPORTED_PACKAGE, toString(unsatisfied)); + if (ImportPackageSpecification.RESOLUTION_DYNAMIC.equals(((ImportPackageSpecification) unsatisfied).getDirective(Constants.RESOLUTION_DIRECTIVE))) + return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_DYNAMIC_IMPORTED_PACKAGE, toString(unsatisfied)); + return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_IMPORTED_PACKAGE, toString(unsatisfied)); + } else if (unsatisfied instanceof BundleSpecification) { + if (((BundleSpecification) unsatisfied).isOptional()) + return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_OPTIONAL_REQUIRED_BUNDLE, toString(unsatisfied)); + return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_REQUIRED_BUNDLE, toString(unsatisfied)); + } else if (unsatisfied instanceof HostSpecification) { + return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_HOST, toString(unsatisfied)); + } else if (unsatisfied instanceof NativeCodeSpecification) { + return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_NATIVECODE, unsatisfied.toString()); + } else if (unsatisfied instanceof GenericSpecification) { + return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_REQUIRED_CAPABILITY, unsatisfied.toString()); + } + return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_REQUIREMENT, unsatisfied.toString()); + } + + /** + * Print a debug message to the console. + * Pre-pend the message with the current date and the name of the current thread. + */ + public static void debug(String message) { + StringBuffer buffer = new StringBuffer(); + buffer.append(new Date(System.currentTimeMillis())); + buffer.append(" - ["); //$NON-NLS-1$ + buffer.append(Thread.currentThread().getName()); + buffer.append("] "); //$NON-NLS-1$ + buffer.append(message); + System.out.println(buffer.toString()); + } + + private static String toString(VersionConstraint constraint) { + org.eclipse.osgi.service.resolver.VersionRange versionRange = constraint.getVersionRange(); + if (versionRange == null) + return constraint.getName(); + return constraint.getName() + '_' + versionRange; + } + +} diff --git a/bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal/p2/tests/verifier/VerifierApplication.java b/bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal/p2/tests/verifier/VerifierApplication.java index da825d7e3..5d01fac56 100644 --- a/bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal/p2/tests/verifier/VerifierApplication.java +++ b/bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal/p2/tests/verifier/VerifierApplication.java @@ -16,8 +16,6 @@ import java.net.URI; import java.util.*; import java.util.Map.Entry; import org.eclipse.core.runtime.*; -import org.eclipse.core.runtime.internal.adaptor.EclipseAdaptorMsg; -import org.eclipse.core.runtime.internal.adaptor.MessageHelper; import org.eclipse.equinox.app.IApplication; import org.eclipse.equinox.app.IApplicationContext; import org.eclipse.equinox.internal.p2.core.helpers.LogHelper; @@ -28,11 +26,11 @@ import org.eclipse.equinox.p2.engine.IProfile; import org.eclipse.equinox.p2.engine.IProfileRegistry; import org.eclipse.equinox.p2.query.IQueryResult; import org.eclipse.equinox.p2.query.QueryUtil; -import org.eclipse.osgi.framework.internal.core.Constants; import org.eclipse.osgi.service.resolver.*; import org.eclipse.osgi.util.NLS; import org.eclipse.swt.widgets.Display; import org.osgi.framework.Bundle; +import org.osgi.framework.Constants; import org.osgi.service.packageadmin.PackageAdmin; /** |