You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-dev@jakarta.apache.org by jr...@apache.org on 2003/01/17 16:22:48 UTC
cvs commit: jakarta-cactus/Eclipse-Plugin/src/java/org/apache/cactus/eclipse/ui CactusPlugin.java CactusMessages.properties
jruaux 2003/01/17 07:22:48
Modified: Eclipse-Plugin/src/java/org/apache/cactus/eclipse/ui
CactusPlugin.java CactusMessages.properties
Log:
Improved error handling and reporting
Revision Changes Path
1.14 +25 -1 jakarta-cactus/Eclipse-Plugin/src/java/org/apache/cactus/eclipse/ui/CactusPlugin.java
Index: CactusPlugin.java
===================================================================
RCS file: /home/cvs/jakarta-cactus/Eclipse-Plugin/src/java/org/apache/cactus/eclipse/ui/CactusPlugin.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- CactusPlugin.java 16 Jan 2003 11:37:45 -0000 1.13
+++ CactusPlugin.java 17 Jan 2003 15:22:48 -0000 1.14
@@ -58,6 +58,7 @@
import org.apache.cactus.eclipse.containers.IContainerProvider;
import org.apache.cactus.eclipse.containers.ant.GenericAntProvider;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPluginDescriptor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -200,7 +201,7 @@
"CactusPreferencePage.label.context.init"));
theStore.setDefault(
CactusPreferences.JARS_DIR,
- CactusMessages.getString("CactusPreferencePage.label.temp.init"));
+ CactusMessages.getString("CactusPreferencePage.label.jars.init"));
theStore.setDefault(
CactusPreferences.TEMP_DIR,
System.getProperty("java.io.tmpdir"));
@@ -209,8 +210,10 @@
/**
* Returns a container provider.
* @return IContainerProvider a container provider to use for Cactus tests.
+ * @throws CoreException if the container provider can't be contructed
*/
public static IContainerProvider getContainerProvider()
+ throws CoreException
{
return new GenericAntProvider(
CactusPreferences.getContextURLPort(),
@@ -234,4 +237,25 @@
theTitle,
theMessage);
}
+ /**
+ * Helper method for other classes. Throws a CoreException with
+ * the message corresponding to the given message key.
+ * @param theMessageKey the key of the message to be thrown
+ * @param theException a low-level exception, or null if not applicable
+ * @throws CoreException always thrown
+ */
+ public static void throwCoreException(
+ String theMessageKey,
+ Throwable theException)
+ throws CoreException
+ {
+ String message = CactusMessages.getString(theMessageKey);
+ throw new CoreException(
+ new Status(
+ IStatus.ERROR,
+ CactusPlugin.getPluginId(),
+ IStatus.OK,
+ message,
+ theException));
+ }
}
1.5 +11 -3 jakarta-cactus/Eclipse-Plugin/src/java/org/apache/cactus/eclipse/ui/CactusMessages.properties
Index: CactusMessages.properties
===================================================================
RCS file: /home/cvs/jakarta-cactus/Eclipse-Plugin/src/java/org/apache/cactus/eclipse/ui/CactusMessages.properties,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- CactusMessages.properties 16 Jan 2003 11:37:45 -0000 1.4
+++ CactusMessages.properties 17 Jan 2003 15:22:48 -0000 1.5
@@ -4,11 +4,15 @@
# Version $Id$
# ---------------------------------------------------------------------------
+CactusLaunch.dialog.title = Cactus launch
CactusLaunch.message.prepare = Preparing for Cactus tests
+CactusLaunch.message.prepare.error = Preparation failed
+CactusLaunch.message.teardown = Tearing down Cactus tests
+CactusLaunch.message.teardown.error = Tearing down failed
CactusLaunch.message.error = Error when launching tests
CactusLaunch.message.notests = No test selected
-CactusLaunch.dialog.title = Cactus launch
-CactusLaunch.message.teardown.error = Error while tearing down Cactus tests
+CactusLaunch.message.war = Creating the WAR file
+CactusLaunch.message.war.error = Can't create the WAR file
CactusLaunch.message.war.malformed = The WAR file's URL is malformed
CactusLaunch.message.start = Starting the container
CactusLaunch.message.start.error = Failed to start the container
@@ -17,6 +21,10 @@
CactusLaunch.message.deploy = Deploying the container
CactusLaunch.message.undeploy = Undeploying the container
CactusLaunch.message.start.url.error = A testURL attribute must be specified
+CactusLaunch.message.invalidproperty.port = Invalid port number
+CactusLaunch.message.invalidproperty.contextpath = Invalid context path
+CactusLaunch.message.invalidproperty.tempdir = Invalid temp dir
+CactusLaunch.message.invalidproperty.containers = No container configured
CactusPreferencePage.description = Preferences of the Apache Cactus plug-in for in-container unit testing
CactusPreferencePage.label.protocol = Protocol:
@@ -34,4 +42,4 @@
CactusPreferencePage.label.host.init = localhost
CactusPreferencePage.label.port.init = 8080
CactusPreferencePage.label.context.init = test
-CactusPreferencePage.label.temp.init = C:/jakarta-cactus-13-1.4b1/lib
+CactusPreferencePage.label.jars.init = C:/jakarta-cactus-13-1.4b1/lib
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>