[jboss-cvs] JBossAS SVN: r100567 - in projects/jboss-osgi/branches/1.0.0.Beta6/testsuite/functional/src/test: java/javax/jms and 3 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Feb 5 15:42:27 EST 2010
Author: thomas.diesler at jboss.com
Date: 2010-02-05 15:42:27 -0500 (Fri, 05 Feb 2010)
New Revision: 100567
Added:
projects/jboss-osgi/branches/1.0.0.Beta6/testsuite/functional/src/test/java/javax/jms/
projects/jboss-osgi/branches/1.0.0.Beta6/testsuite/functional/src/test/java/javax/jms/JMSException.java
Removed:
projects/jboss-osgi/branches/1.0.0.Beta6/testsuite/functional/src/test/java/javax/xml/ws/WebServiceException.java
Modified:
projects/jboss-osgi/branches/1.0.0.Beta6/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi287/OSGi287TestCase.java
projects/jboss-osgi/branches/1.0.0.Beta6/testsuite/functional/src/test/resources/jbosgi287/jbosgi287-bundleC.bnd
Log:
Use Messaging API
Copied: projects/jboss-osgi/branches/1.0.0.Beta6/testsuite/functional/src/test/java/javax/jms/JMSException.java (from rev 100556, projects/jboss-osgi/branches/1.0.0.Beta6/testsuite/functional/src/test/java/javax/xml/ws/WebServiceException.java)
===================================================================
--- projects/jboss-osgi/branches/1.0.0.Beta6/testsuite/functional/src/test/java/javax/jms/JMSException.java (rev 0)
+++ projects/jboss-osgi/branches/1.0.0.Beta6/testsuite/functional/src/test/java/javax/jms/JMSException.java 2010-02-05 20:42:27 UTC (rev 100567)
@@ -0,0 +1,105 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package javax.jms;
+
+/**
+ * <P>This is the root class of all JMS API exceptions.
+ *
+ * <P>It provides the following information:
+ * <UL>
+ * <LI> A provider-specific string describing the error. This string is
+ * the standard exception message and is available via the
+ * <CODE>getMessage</CODE> method.
+ * <LI> A provider-specific string error code
+ * <LI> A reference to another exception. Often a JMS API exception will
+ * be the result of a lower-level problem. If appropriate, this
+ * lower-level exception can be linked to the JMS API exception.
+ * </UL>
+ **/
+
+public class JMSException extends Exception
+{
+ private static final long serialVersionUID = 8951994251593378324L;
+
+ /** Vendor-specific error code.
+ **/
+ private String errorCode;
+
+ /** <CODE>Exception</CODE> reference.
+ **/
+ private Exception linkedException;
+
+ /** Constructs a <CODE>JMSException</CODE> with the specified reason and
+ * error code.
+ *
+ * @param reason a description of the exception
+ * @param errorCode a string specifying the vendor-specific
+ * error code
+ **/
+ public JMSException(String reason, String errorCode)
+ {
+ super(reason);
+ this.errorCode = errorCode;
+ linkedException = null;
+ }
+
+ /** Constructs a <CODE>JMSException</CODE> with the specified reason and with
+ * the error code defaulting to null.
+ *
+ * @param reason a description of the exception
+ **/
+ public JMSException(String reason)
+ {
+ super(reason);
+ this.errorCode = null;
+ linkedException = null;
+ }
+
+ /** Gets the vendor-specific error code.
+ * @return a string specifying the vendor-specific
+ * error code
+ **/
+ public String getErrorCode()
+ {
+ return this.errorCode;
+ }
+
+ /**
+ * Gets the exception linked to this one.
+ *
+ * @return the linked <CODE>Exception</CODE>, null if none
+ **/
+ public Exception getLinkedException()
+ {
+ return (linkedException);
+ }
+
+ /**
+ * Adds a linked <CODE>Exception</CODE>.
+ *
+ * @param ex the linked <CODE>Exception</CODE>
+ **/
+ public synchronized void setLinkedException(Exception ex)
+ {
+ linkedException = ex;
+ }
+}
Deleted: projects/jboss-osgi/branches/1.0.0.Beta6/testsuite/functional/src/test/java/javax/xml/ws/WebServiceException.java
===================================================================
--- projects/jboss-osgi/branches/1.0.0.Beta6/testsuite/functional/src/test/java/javax/xml/ws/WebServiceException.java 2010-02-05 20:37:13 UTC (rev 100566)
+++ projects/jboss-osgi/branches/1.0.0.Beta6/testsuite/functional/src/test/java/javax/xml/ws/WebServiceException.java 2010-02-05 20:42:27 UTC (rev 100567)
@@ -1,64 +0,0 @@
-/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
- * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
- */
-
-package javax.xml.ws;
-
-/** The <code>WebServiceException</code> class is the base
- * exception class for all JAX-WS API runtime exceptions.
- *
- * @since JAX-WS 2.0
-**/
-
- at SuppressWarnings("serial")
-public class WebServiceException extends java.lang.RuntimeException
-{
-
- /** Constructs a new exception with <code>null</code> as its
- * detail message. The cause is not initialized.
- **/
- public WebServiceException()
- {
- super();
- }
-
- /** Constructs a new exception with the specified detail
- * message. The cause is not initialized.
- * @param message The detail message which is later
- * retrieved using the getMessage method
- **/
- public WebServiceException(String message)
- {
- super(message);
- }
-
- /** Constructs a new exception with the specified detail
- * message and cause.
- *
- * @param message The detail message which is later retrieved
- * using the getMessage method
- * @param cause The cause which is saved for the later
- * retrieval throw by the getCause method
- **/
- public WebServiceException(String message, Throwable cause)
- {
- super(message, cause);
- }
-
- /** Constructs a new WebServiceException with the specified cause
- * and a detail message of <tt>(cause==null ? null :
- * cause.toString())</tt> (which typically contains the
- * class and detail message of <tt>cause</tt>).
- *
- * @param cause The cause which is saved for the later
- * retrieval throw by the getCause method.
- * (A <tt>null</tt> value is permitted, and
- * indicates that the cause is nonexistent or
- * unknown.)
- **/
- public WebServiceException(Throwable cause)
- {
- super(cause);
- }
-}
Modified: projects/jboss-osgi/branches/1.0.0.Beta6/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi287/OSGi287TestCase.java
===================================================================
--- projects/jboss-osgi/branches/1.0.0.Beta6/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi287/OSGi287TestCase.java 2010-02-05 20:37:13 UTC (rev 100566)
+++ projects/jboss-osgi/branches/1.0.0.Beta6/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi287/OSGi287TestCase.java 2010-02-05 20:42:27 UTC (rev 100567)
@@ -147,7 +147,7 @@
}
@Test
- public void testServletAPI() throws Exception
+ public void testMessagingAPI() throws Exception
{
OSGiRuntime runtime = getDefaultRuntime();
try
@@ -157,14 +157,14 @@
// Import-Package: javax.xml.ws
OSGiBundle bundleA = runtime.installBundle("jbosgi287-bundleC.jar");
- OSGiBundle exporterA = bundleA.loadClass("javax.xml.ws.WebServiceException");
+ OSGiBundle exporterA = bundleA.loadClass("javax.jms.JMSException");
assertEquals(Bundle.RESOLVED, bundleA.getState());
assertEquals(bundleA, exporterA);
// Try to load a class that is not part of the bundle
try
{
- bundleA.loadClass("javax.xml.ws.WebServiceContext");
+ bundleA.loadClass("javax.jms.MessageProducer");
fail("ClassNotFoundException expected");
}
catch (ClassNotFoundException ex)
Modified: projects/jboss-osgi/branches/1.0.0.Beta6/testsuite/functional/src/test/resources/jbosgi287/jbosgi287-bundleC.bnd
===================================================================
--- projects/jboss-osgi/branches/1.0.0.Beta6/testsuite/functional/src/test/resources/jbosgi287/jbosgi287-bundleC.bnd 2010-02-05 20:37:13 UTC (rev 100566)
+++ projects/jboss-osgi/branches/1.0.0.Beta6/testsuite/functional/src/test/resources/jbosgi287/jbosgi287-bundleC.bnd 2010-02-05 20:42:27 UTC (rev 100567)
@@ -1,6 +1,6 @@
# bnd build -classpath target/test-classes -output target/test-libs/jbosgi287-bundleB.jar src/test/resources/jbosgi287/jbosgi287-bundle.bnd
Bundle-SymbolicName: jbosgi287-bundleC
-Export-Package: javax.xml.ws
-Import-Package: javax.xml.ws
+Export-Package: javax.jms
+Import-Package: javax.jms
More information about the jboss-cvs-commits
mailing list