You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ad...@apache.org on 2003/12/07 17:28:07 UTC
cvs commit: incubator-geronimo/specs/jms/src/test/javax/jms IllegalStateExceptionTest.java InvalidClientIDExceptionTest.java InvalidDestinationExceptionTest.java InvalidSelectorExceptionTest.java JMSExceptionTest.java JMSSecurityExceptionTest.java MessageEOFExceptionTest.java MessageFormatExceptionTest.java MessageNotReadableExceptionTest.java MessageNotWriteableExceptionTest.java QueueRequestorTest.java ResourceAllocationExceptionTest.java TopicRequestorTest.java TransactionInProgressExceptionTest.java TransactionRolledBackExceptionTest.java
adc 2003/12/07 08:28:07
Modified: specs/jms project.xml
specs/jms/src/java/javax/jms QueueRequestor.java
Added: specs/jms/src/test/javax/jms IllegalStateExceptionTest.java
InvalidClientIDExceptionTest.java
InvalidDestinationExceptionTest.java
InvalidSelectorExceptionTest.java
JMSExceptionTest.java JMSSecurityExceptionTest.java
MessageEOFExceptionTest.java
MessageFormatExceptionTest.java
MessageNotReadableExceptionTest.java
MessageNotWriteableExceptionTest.java
QueueRequestorTest.java
ResourceAllocationExceptionTest.java
TopicRequestorTest.java
TransactionInProgressExceptionTest.java
TransactionRolledBackExceptionTest.java
Log:
Unit tests from Brent Worden.
Revision Changes Path
1.3 +37 -15 incubator-geronimo/specs/jms/project.xml
Index: project.xml
===================================================================
RCS file: /home/cvs/incubator-geronimo/specs/jms/project.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- project.xml 16 Aug 2003 15:14:13 -0000 1.2
+++ project.xml 7 Dec 2003 16:28:07 -0000 1.3
@@ -3,18 +3,40 @@
<!-- $Revision$ $Date$ -->
<project>
- <pomVersion>3</pomVersion>
- <extend>${basedir}/../../etc/project.xml</extend>
-
- <name>Geronimo :: JMS Specification</name>
- <groupId>geronimo-spec</groupId>
- <id>geronimo-spec-jms</id>
- <shortDescription>J2EE JMS Specification</shortDescription>
- <description>J2EE Java Message Service Specification</description>
- <siteDirectory></siteDirectory>
- <distributionDirectory></distributionDirectory>
-
- <package>javax.jms</package>
- <currentVersion>DEV</currentVersion>
-
+ <pomVersion>3</pomVersion>
+ <extend>${basedir}/../../etc/project.xml</extend>
+ <name>Geronimo :: JMS Specification</name>
+ <groupId>geronimo-spec</groupId>
+ <id>geronimo-spec-jms</id>
+ <shortDescription>J2EE JMS Specification</shortDescription>
+ <description>J2EE Java Message Service Specification</description>
+ <siteDirectory>
+ </siteDirectory>
+ <distributionDirectory>
+ </distributionDirectory>
+ <package>javax.jms</package>
+ <currentVersion>DEV</currentVersion>
+
+ <dependencies>
+
+ <!-- Plugin Dependencies -->
+
+ <dependency>
+ <id>mockobjects+jdk1.4-j2ee1.3</id>
+ <version>0.09</version>
+ <properties>
+ <runtime>false</runtime>
+ </properties>
+ </dependency>
+
+ <dependency>
+ <id>mockobjects+core</id>
+ <version>0.09</version>
+ <properties>
+ <runtime>false</runtime>
+ </properties>
+ </dependency>
+
+ </dependencies>
+
</project>
1.3 +8 -12 incubator-geronimo/specs/jms/src/java/javax/jms/QueueRequestor.java
Index: QueueRequestor.java
===================================================================
RCS file: /home/cvs/incubator-geronimo/specs/jms/src/java/javax/jms/QueueRequestor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- QueueRequestor.java 24 Aug 2003 06:26:46 -0000 1.2
+++ QueueRequestor.java 7 Dec 2003 16:28:07 -0000 1.3
@@ -67,16 +67,20 @@
*/
public class QueueRequestor {
private QueueSession session;
- private Queue queue;
private TemporaryQueue temporaryQueue;
private QueueSender sender;
private QueueReceiver receiver;
public QueueRequestor(QueueSession session, Queue queue)
- throws JMSException {
+ throws JMSException
+ {
super();
+
+ if(queue == null) {
+ throw new InvalidDestinationException("Invalid queue");
+ }
+
setSession(session);
- setQueue(queue);
setTemporaryQueue(session.createTemporaryQueue());
setSender(session.createSender(queue));
setReceiver(session.createReceiver(getTemporaryQueue()));
@@ -91,14 +95,6 @@
public void close() throws JMSException {
getSession().close();
getTemporaryQueue().delete();
- }
-
- private void setQueue(Queue queue) {
- this.queue = queue;
- }
-
- private Queue getQueue() {
- return queue;
}
private void setReceiver(QueueReceiver receiver) {
1.1 incubator-geronimo/specs/jms/src/test/javax/jms/IllegalStateExceptionTest.java
Index: IllegalStateExceptionTest.java
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http:www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Geronimo" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Geronimo", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http:www.apache.org/>.
*
* ====================================================================
*/
package javax.jms;
import junit.framework.TestCase;
/**
*
* @version $Revision: 1.1 $ $Date: 2003/12/07 16:28:07 $
*/
public class IllegalStateExceptionTest extends TestCase {
public void testConstructorNull() {
IllegalStateException ex = new IllegalStateException(null);
assertNull(ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorNullNull() {
IllegalStateException ex = new IllegalStateException(null, null);
assertNull(ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorNullString() {
String expected = "some code";
IllegalStateException ex = new IllegalStateException(null, expected);
assertNull(ex.getMessage());
assertEquals(expected, ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorString() {
String expected = "some message";
IllegalStateException ex = new IllegalStateException(expected);
assertEquals(expected, ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorStringNull() {
String expected = "some message";
IllegalStateException ex = new IllegalStateException(expected, null);
assertEquals(expected, ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorStringString() {
String expectedMessage = "some message";
String expectedCode = "some code";
IllegalStateException ex = new IllegalStateException(expectedMessage, expectedCode);
assertEquals(expectedMessage, ex.getMessage());
assertEquals(expectedCode, ex.getErrorCode());
assertNull(ex.getLinkedException());
}
}
1.1 incubator-geronimo/specs/jms/src/test/javax/jms/InvalidClientIDExceptionTest.java
Index: InvalidClientIDExceptionTest.java
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http:www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Geronimo" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Geronimo", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http:www.apache.org/>.
*
* ====================================================================
*/
package javax.jms;
import junit.framework.TestCase;
/**
*
* @version $Revision: 1.1 $ $Date: 2003/12/07 16:28:07 $
*/
public class InvalidClientIDExceptionTest extends TestCase {
public void testConstructorNull() {
InvalidClientIDException ex = new InvalidClientIDException(null);
assertNull(ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorNullNull() {
InvalidClientIDException ex = new InvalidClientIDException(null, null);
assertNull(ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorNullString() {
String expected = "some code";
InvalidClientIDException ex = new InvalidClientIDException(null, expected);
assertNull(ex.getMessage());
assertEquals(expected, ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorString() {
String expected = "some message";
InvalidClientIDException ex = new InvalidClientIDException(expected);
assertEquals(expected, ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorStringNull() {
String expected = "some message";
InvalidClientIDException ex = new InvalidClientIDException(expected, null);
assertEquals(expected, ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorStringString() {
String expectedMessage = "some message";
String expectedCode = "some code";
InvalidClientIDException ex = new InvalidClientIDException(expectedMessage, expectedCode);
assertEquals(expectedMessage, ex.getMessage());
assertEquals(expectedCode, ex.getErrorCode());
assertNull(ex.getLinkedException());
}
}
1.1 incubator-geronimo/specs/jms/src/test/javax/jms/InvalidDestinationExceptionTest.java
Index: InvalidDestinationExceptionTest.java
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Geronimo" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Geronimo", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* ====================================================================
*/
package javax.jms;
import junit.framework.TestCase;
/**
* @version $Revision: 1.1 $ $Date: 2003/12/07 16:28:07 $
*/
public class InvalidDestinationExceptionTest extends TestCase {
public void testConstructorNull() {
InvalidDestinationException ex = new InvalidDestinationException(null);
assertNull(ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorNullNull() {
InvalidDestinationException ex = new InvalidDestinationException(null, null);
assertNull(ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorNullString() {
String expected = "some code";
InvalidDestinationException ex = new InvalidDestinationException(null, expected);
assertNull(ex.getMessage());
assertEquals(expected, ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorString() {
String expected = "some message";
InvalidDestinationException ex = new InvalidDestinationException(expected);
assertEquals(expected, ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorStringNull() {
String expected = "some message";
InvalidDestinationException ex = new InvalidDestinationException(expected, null);
assertEquals(expected, ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorStringString() {
String expectedMessage = "some message";
String expectedCode = "some code";
InvalidDestinationException ex = new InvalidDestinationException(expectedMessage, expectedCode);
assertEquals(expectedMessage, ex.getMessage());
assertEquals(expectedCode, ex.getErrorCode());
assertNull(ex.getLinkedException());
}
}
1.1 incubator-geronimo/specs/jms/src/test/javax/jms/InvalidSelectorExceptionTest.java
Index: InvalidSelectorExceptionTest.java
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Geronimo" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Geronimo", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* ====================================================================
*/
package javax.jms;
import junit.framework.TestCase;
/**
* @version $Revision: 1.1 $ $Date: 2003/12/07 16:28:07 $
*/
public class InvalidSelectorExceptionTest extends TestCase {
public void testConstructorNull() {
InvalidSelectorException ex = new InvalidSelectorException(null);
assertNull(ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorNullNull() {
InvalidSelectorException ex = new InvalidSelectorException(null, null);
assertNull(ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorNullString() {
String expected = "some code";
InvalidSelectorException ex = new InvalidSelectorException(null, expected);
assertNull(ex.getMessage());
assertEquals(expected, ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorString() {
String expected = "some message";
InvalidSelectorException ex = new InvalidSelectorException(expected);
assertEquals(expected, ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorStringNull() {
String expected = "some message";
InvalidSelectorException ex = new InvalidSelectorException(expected, null);
assertEquals(expected, ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorStringString() {
String expectedMessage = "some message";
String expectedCode = "some code";
InvalidSelectorException ex = new InvalidSelectorException(expectedMessage, expectedCode);
assertEquals(expectedMessage, ex.getMessage());
assertEquals(expectedCode, ex.getErrorCode());
assertNull(ex.getLinkedException());
}
}
1.1 incubator-geronimo/specs/jms/src/test/javax/jms/JMSExceptionTest.java
Index: JMSExceptionTest.java
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Geronimo" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Geronimo", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* ====================================================================
*/
package javax.jms;
import junit.framework.TestCase;
/**
* @version $Revision: 1.1 $ $Date: 2003/12/07 16:28:07 $
*/
public class JMSExceptionTest extends TestCase {
public void testConstructorNull() {
JMSException ex = new JMSException(null);
assertNull(ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorNullNull() {
JMSException ex = new JMSException(null, null);
assertNull(ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorNullString() {
String expected = "some code";
JMSException ex = new JMSException(null, expected);
assertNull(ex.getMessage());
assertEquals(expected, ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorString() {
String expected = "some message";
JMSException ex = new JMSException(expected);
assertEquals(expected, ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorStringNull() {
String expected = "some message";
JMSException ex = new JMSException(expected, null);
assertEquals(expected, ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorStringString() {
String expectedMessage = "some message";
String expectedCode = "some code";
JMSException ex = new JMSException(expectedMessage, expectedCode);
assertEquals(expectedMessage, ex.getMessage());
assertEquals(expectedCode, ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testSetLinkedException() {
Exception expected = new Exception();
JMSException ex = new JMSException(null);
ex.setLinkedException(expected);
assertEquals(expected, ex.getLinkedException());
}
}
1.1 incubator-geronimo/specs/jms/src/test/javax/jms/JMSSecurityExceptionTest.java
Index: JMSSecurityExceptionTest.java
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Geronimo" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Geronimo", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* ====================================================================
*/
package javax.jms;
import junit.framework.TestCase;
/**
* @version $Revision: 1.1 $ $Date: 2003/12/07 16:28:07 $
*/
public class JMSSecurityExceptionTest extends TestCase {
public void testConstructorNull() {
JMSSecurityException ex = new JMSSecurityException(null);
assertNull(ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorNullNull() {
JMSSecurityException ex = new JMSSecurityException(null, null);
assertNull(ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorNullString() {
String expected = "some code";
JMSSecurityException ex = new JMSSecurityException(null, expected);
assertNull(ex.getMessage());
assertEquals(expected, ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorString() {
String expected = "some message";
JMSSecurityException ex = new JMSSecurityException(expected);
assertEquals(expected, ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorStringNull() {
String expected = "some message";
JMSSecurityException ex = new JMSSecurityException(expected, null);
assertEquals(expected, ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorStringString() {
String expectedMessage = "some message";
String expectedCode = "some code";
JMSSecurityException ex = new JMSSecurityException(expectedMessage, expectedCode);
assertEquals(expectedMessage, ex.getMessage());
assertEquals(expectedCode, ex.getErrorCode());
assertNull(ex.getLinkedException());
}
}
1.1 incubator-geronimo/specs/jms/src/test/javax/jms/MessageEOFExceptionTest.java
Index: MessageEOFExceptionTest.java
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Geronimo" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Geronimo", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* ====================================================================
*/
package javax.jms;
import junit.framework.TestCase;
/**
* @version $Revision: 1.1 $ $Date: 2003/12/07 16:28:07 $
*/
public class MessageEOFExceptionTest extends TestCase {
public void testConstructorNull() {
MessageEOFException ex = new MessageEOFException(null);
assertNull(ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorNullNull() {
MessageEOFException ex = new MessageEOFException(null, null);
assertNull(ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorNullString() {
String expected = "some code";
MessageEOFException ex = new MessageEOFException(null, expected);
assertNull(ex.getMessage());
assertEquals(expected, ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorString() {
String expected = "some message";
MessageEOFException ex = new MessageEOFException(expected);
assertEquals(expected, ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorStringNull() {
String expected = "some message";
MessageEOFException ex = new MessageEOFException(expected, null);
assertEquals(expected, ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorStringString() {
String expectedMessage = "some message";
String expectedCode = "some code";
MessageEOFException ex = new MessageEOFException(expectedMessage, expectedCode);
assertEquals(expectedMessage, ex.getMessage());
assertEquals(expectedCode, ex.getErrorCode());
assertNull(ex.getLinkedException());
}
}
1.1 incubator-geronimo/specs/jms/src/test/javax/jms/MessageFormatExceptionTest.java
Index: MessageFormatExceptionTest.java
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Geronimo" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Geronimo", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* ====================================================================
*/
package javax.jms;
import junit.framework.TestCase;
/**
* @version $Revision: 1.1 $ $Date: 2003/12/07 16:28:07 $
*/
public class MessageFormatExceptionTest extends TestCase {
public void testConstructorNull() {
MessageFormatException ex = new MessageFormatException(null);
assertNull(ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorNullNull() {
MessageFormatException ex = new MessageFormatException(null, null);
assertNull(ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorNullString() {
String expected = "some code";
MessageFormatException ex = new MessageFormatException(null, expected);
assertNull(ex.getMessage());
assertEquals(expected, ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorString() {
String expected = "some message";
MessageFormatException ex = new MessageFormatException(expected);
assertEquals(expected, ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorStringNull() {
String expected = "some message";
MessageFormatException ex = new MessageFormatException(expected, null);
assertEquals(expected, ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorStringString() {
String expectedMessage = "some message";
String expectedCode = "some code";
MessageFormatException ex = new MessageFormatException(expectedMessage, expectedCode);
assertEquals(expectedMessage, ex.getMessage());
assertEquals(expectedCode, ex.getErrorCode());
assertNull(ex.getLinkedException());
}
}
1.1 incubator-geronimo/specs/jms/src/test/javax/jms/MessageNotReadableExceptionTest.java
Index: MessageNotReadableExceptionTest.java
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Geronimo" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Geronimo", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* ====================================================================
*/
package javax.jms;
import junit.framework.TestCase;
/**
* @version $Revision: 1.1 $ $Date: 2003/12/07 16:28:07 $
*/
public class MessageNotReadableExceptionTest extends TestCase {
public void testConstructorNull() {
MessageNotReadableException ex = new MessageNotReadableException(null);
assertNull(ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorNullNull() {
MessageNotReadableException ex = new MessageNotReadableException(null, null);
assertNull(ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorNullString() {
String expected = "some code";
MessageNotReadableException ex = new MessageNotReadableException(null, expected);
assertNull(ex.getMessage());
assertEquals(expected, ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorString() {
String expected = "some message";
MessageNotReadableException ex = new MessageNotReadableException(expected);
assertEquals(expected, ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorStringNull() {
String expected = "some message";
MessageNotReadableException ex = new MessageNotReadableException(expected, null);
assertEquals(expected, ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorStringString() {
String expectedMessage = "some message";
String expectedCode = "some code";
MessageNotReadableException ex = new MessageNotReadableException(expectedMessage, expectedCode);
assertEquals(expectedMessage, ex.getMessage());
assertEquals(expectedCode, ex.getErrorCode());
assertNull(ex.getLinkedException());
}
}
1.1 incubator-geronimo/specs/jms/src/test/javax/jms/MessageNotWriteableExceptionTest.java
Index: MessageNotWriteableExceptionTest.java
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Geronimo" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Geronimo", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* ====================================================================
*/
package javax.jms;
import junit.framework.TestCase;
/**
* @version $Revision: 1.1 $ $Date: 2003/12/07 16:28:07 $
*/
public class MessageNotWriteableExceptionTest extends TestCase {
public void testConstructorNull() {
MessageNotWriteableException ex = new MessageNotWriteableException(null);
assertNull(ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorNullNull() {
MessageNotWriteableException ex = new MessageNotWriteableException(null, null);
assertNull(ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorNullString() {
String expected = "some code";
MessageNotWriteableException ex = new MessageNotWriteableException(null, expected);
assertNull(ex.getMessage());
assertEquals(expected, ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorString() {
String expected = "some message";
MessageNotWriteableException ex = new MessageNotWriteableException(expected);
assertEquals(expected, ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorStringNull() {
String expected = "some message";
MessageNotWriteableException ex = new MessageNotWriteableException(expected, null);
assertEquals(expected, ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorStringString() {
String expectedMessage = "some message";
String expectedCode = "some code";
MessageNotWriteableException ex = new MessageNotWriteableException(expectedMessage, expectedCode);
assertEquals(expectedMessage, ex.getMessage());
assertEquals(expectedCode, ex.getErrorCode());
assertNull(ex.getLinkedException());
}
}
1.1 incubator-geronimo/specs/jms/src/test/javax/jms/QueueRequestorTest.java
Index: QueueRequestorTest.java
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Geronimo" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Geronimo", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* ====================================================================
*/
package javax.jms;
import com.mockobjects.jms.MockMessage;
import com.mockobjects.jms.MockQueue;
import com.mockobjects.jms.MockQueueReceiver;
import com.mockobjects.jms.MockQueueSender;
import com.mockobjects.jms.MockQueueSession;
import com.mockobjects.jms.MockTemporaryQueue;
import com.mockobjects.jms.MockTextMessage;
import junit.framework.TestCase;
/**
* @version $Revision: 1.1 $ $Date: 2003/12/07 16:28:07 $
*/
public class QueueRequestorTest extends TestCase {
public void testConstructorNullQueue() {
MockQueue queue = new MockQueue();
try {
new QueueRequestor(null, queue);
fail();
} catch (JMSException ex) {
fail("JMSException should not have been thrown.");
} catch (NullPointerException ex) {
// success.
}
queue.verify();
}
public void testConstructorSessionNull() {
MockQueueSession session = new MockQueueSession();
try {
new QueueRequestor(session, null);
fail();
} catch (JMSException ex) {
// success
}
session.verify();
}
public void testConstructorSessionQueue() {
MockQueue queue = new MockQueue();
MockQueueReceiver receiver = new MockQueueReceiver();
MockQueueSender sender = new MockQueueSender();
MockQueueSession session = new MockQueueSession();
MockTemporaryQueue tempQueue = new MockTemporaryQueue();
session.setupReceiver(receiver);
session.setupSender(sender);
session.setupTemporaryQueue(tempQueue);
try {
new QueueRequestor(session, queue);
// success
} catch (JMSException ex) {
fail();
}
queue.verify();
receiver.verify();
sender.verify();
session.verify();
tempQueue.verify();
}
public void testRequestNull() {
MockQueue queue = new MockQueue();
MockQueueReceiver receiver = new MockQueueReceiver();
MockQueueSender sender = new MockQueueSender();
MockQueueSession session = new MockQueueSession();
MockTemporaryQueue tempQueue = new MockTemporaryQueue();
session.setupReceiver(receiver);
session.setupSender(sender);
session.setupTemporaryQueue(tempQueue);
try {
QueueRequestor requestor = new QueueRequestor(session, queue);
requestor.request(null);
fail();
} catch (JMSException ex) {
fail("JMSException should not have been thrown.");
} catch (NullPointerException ex) {
// success
}
queue.verify();
receiver.verify();
sender.verify();
session.verify();
tempQueue.verify();
}
public void testRequestMessage() {
MockMessage reply = new MockTextMessage();
MockMessage request = new MockTextMessage();
MockQueue queue = new MockQueue();
MockQueueReceiver receiver = new MockQueueReceiver();
MockQueueSender sender = new MockQueueSender();
MockQueueSession session = new MockQueueSession();
MockTemporaryQueue tempQueue = new MockTemporaryQueue();
request.setExpectedJMSReplyTo(tempQueue);
receiver.setExpectedReceiveCalls(1);
receiver.setupReceivedMessage(reply);
sender.setExpectedSendCalls(1);
session.setupReceiver(receiver);
session.setupSender(sender);
session.setupTemporaryQueue(tempQueue);
try {
QueueRequestor requestor = new QueueRequestor(session, queue);
Message jmsReply = requestor.request(request);
assertEquals(jmsReply, reply);
} catch (JMSException ex) {
fail("JMSException should not have been thrown.");
}
reply.verify();
request.verify();
queue.verify();
receiver.verify();
sender.verify();
session.verify();
tempQueue.verify();
}
public void testClose() {
MockQueue queue = new MockQueue();
MockQueueReceiver receiver = new MockQueueReceiver();
MockQueueSender sender = new MockQueueSender();
MockQueueSession session = new MockQueueSession();
MockTemporaryQueue tempQueue = new MockTemporaryQueue();
session.setExpectedCloseCalls(1);
session.setupReceiver(receiver);
session.setupSender(sender);
session.setupTemporaryQueue(tempQueue);
tempQueue.setExpectedDeleteCalls(1);
try {
QueueRequestor requestor = new QueueRequestor(session, queue);
requestor.close();
} catch (JMSException ex) {
fail();
}
queue.verify();
receiver.verify();
sender.verify();
session.verify();
tempQueue.verify();
}
}
1.1 incubator-geronimo/specs/jms/src/test/javax/jms/ResourceAllocationExceptionTest.java
Index: ResourceAllocationExceptionTest.java
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Geronimo" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Geronimo", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* ====================================================================
*/
package javax.jms;
import junit.framework.TestCase;
/**
* @version $Revision: 1.1 $ $Date: 2003/12/07 16:28:07 $
*/
public class ResourceAllocationExceptionTest extends TestCase {
public void testConstructorNull() {
ResourceAllocationException ex = new ResourceAllocationException(null);
assertNull(ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorNullNull() {
ResourceAllocationException ex = new ResourceAllocationException(null, null);
assertNull(ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorNullString() {
String expected = "some code";
ResourceAllocationException ex = new ResourceAllocationException(null, expected);
assertNull(ex.getMessage());
assertEquals(expected, ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorString() {
String expected = "some message";
ResourceAllocationException ex = new ResourceAllocationException(expected);
assertEquals(expected, ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorStringNull() {
String expected = "some message";
ResourceAllocationException ex = new ResourceAllocationException(expected, null);
assertEquals(expected, ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorStringString() {
String expectedMessage = "some message";
String expectedCode = "some code";
ResourceAllocationException ex = new ResourceAllocationException(expectedMessage, expectedCode);
assertEquals(expectedMessage, ex.getMessage());
assertEquals(expectedCode, ex.getErrorCode());
assertNull(ex.getLinkedException());
}
}
1.1 incubator-geronimo/specs/jms/src/test/javax/jms/TopicRequestorTest.java
Index: TopicRequestorTest.java
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Geronimo" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Geronimo", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* ====================================================================
*/
package javax.jms;
import com.mockobjects.jms.MockTopic;
import junit.framework.TestCase;
/**
* @version $Revision: 1.1 $ $Date: 2003/12/07 16:28:07 $
*/
public class TopicRequestorTest extends TestCase {
public void testConstructorNullTopic() {
MockTopic topic = new MockTopic();
try {
new TopicRequestor(null, topic);
fail();
} catch (JMSException ex) {
fail("JMSException should not have been thrown.");
} catch (NullPointerException ex) {
// success.
}
topic.verify();
}
}
1.1 incubator-geronimo/specs/jms/src/test/javax/jms/TransactionInProgressExceptionTest.java
Index: TransactionInProgressExceptionTest.java
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Geronimo" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Geronimo", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* ====================================================================
*/
package javax.jms;
import junit.framework.TestCase;
/**
* @version $Revision: 1.1 $ $Date: 2003/12/07 16:28:07 $
*/
public class TransactionInProgressExceptionTest extends TestCase {
public void testConstructorNull() {
TransactionInProgressException ex = new TransactionInProgressException(null);
assertNull(ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorNullNull() {
TransactionInProgressException ex = new TransactionInProgressException(null, null);
assertNull(ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorNullString() {
String expected = "some code";
TransactionInProgressException ex = new TransactionInProgressException(null, expected);
assertNull(ex.getMessage());
assertEquals(expected, ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorString() {
String expected = "some message";
TransactionInProgressException ex = new TransactionInProgressException(expected);
assertEquals(expected, ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorStringNull() {
String expected = "some message";
TransactionInProgressException ex = new TransactionInProgressException(expected, null);
assertEquals(expected, ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorStringString() {
String expectedMessage = "some message";
String expectedCode = "some code";
TransactionInProgressException ex = new TransactionInProgressException(expectedMessage, expectedCode);
assertEquals(expectedMessage, ex.getMessage());
assertEquals(expectedCode, ex.getErrorCode());
assertNull(ex.getLinkedException());
}
}
1.1 incubator-geronimo/specs/jms/src/test/javax/jms/TransactionRolledBackExceptionTest.java
Index: TransactionRolledBackExceptionTest.java
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Geronimo" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Geronimo", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* ====================================================================
*/
package javax.jms;
import junit.framework.TestCase;
/**
* @version $Revision: 1.1 $ $Date: 2003/12/07 16:28:07 $
*/
public class TransactionRolledBackExceptionTest extends TestCase {
public void testConstructorNull() {
TransactionRolledBackException ex = new TransactionRolledBackException(null);
assertNull(ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorNullNull() {
TransactionRolledBackException ex = new TransactionRolledBackException(null, null);
assertNull(ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorNullString() {
String expected = "some code";
TransactionRolledBackException ex = new TransactionRolledBackException(null, expected);
assertNull(ex.getMessage());
assertEquals(expected, ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorString() {
String expected = "some message";
TransactionRolledBackException ex = new TransactionRolledBackException(expected);
assertEquals(expected, ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorStringNull() {
String expected = "some message";
TransactionRolledBackException ex = new TransactionRolledBackException(expected, null);
assertEquals(expected, ex.getMessage());
assertNull(ex.getErrorCode());
assertNull(ex.getLinkedException());
}
public void testConstructorStringString() {
String expectedMessage = "some message";
String expectedCode = "some code";
TransactionRolledBackException ex = new TransactionRolledBackException(expectedMessage, expectedCode);
assertEquals(expectedMessage, ex.getMessage());
assertEquals(expectedCode, ex.getErrorCode());
assertNull(ex.getLinkedException());
}
}