mirror of https://github.com/apache/activemq.git
[AMQ-9239] jakarta.jms - activemq-joram-jms-tests conversion
This commit is contained in:
parent
699a0b6e7f
commit
770032d483
|
@ -1,16 +1,19 @@
|
|||
/*
|
||||
* Copyright 2009 Red Hat, Inc.
|
||||
* Red Hat licenses this file to you under the Apache License, version
|
||||
* 2.0 (the "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.objectweb.jtests.jms.admin;
|
||||
|
||||
import javax.naming.Context;
|
||||
|
|
|
@ -1,16 +1,19 @@
|
|||
/*
|
||||
* Copyright 2009 Red Hat, Inc.
|
||||
* Red Hat licenses this file to you under the Apache License, version
|
||||
* 2.0 (the "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.objectweb.jtests.jms.admin;
|
||||
|
||||
import java.util.Properties;
|
||||
|
|
|
@ -1,25 +1,28 @@
|
|||
/*
|
||||
* Copyright 2009 Red Hat, Inc.
|
||||
* Red Hat licenses this file to you under the Apache License, version
|
||||
* 2.0 (the "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.objectweb.jtests.jms.conform.connection;
|
||||
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.MessageListener;
|
||||
import javax.jms.Session;
|
||||
import javax.jms.TextMessage;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Message;
|
||||
import jakarta.jms.MessageListener;
|
||||
import jakarta.jms.Session;
|
||||
import jakarta.jms.TextMessage;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
|
@ -60,26 +63,26 @@ public class ConnectionTest extends PTPTestCase
|
|||
Message m = receiver.receive(TestConfig.TIMEOUT);
|
||||
receiverConnection.close();
|
||||
m.acknowledge();
|
||||
Assert.fail("sec. 4.3.5 Invoking the acknowledge method of a received message from a closed " + "connection's session must throw a [javax.jms.]IllegalStateException.\n");
|
||||
Assert.fail("sec. 4.3.5 Invoking the acknowledge method of a received message from a closed " + "connection's session must throw a [jakarta.jms.]IllegalStateException.\n");
|
||||
}
|
||||
catch (javax.jms.IllegalStateException e)
|
||||
catch (jakarta.jms.IllegalStateException e)
|
||||
{
|
||||
}
|
||||
catch (JMSException e)
|
||||
{
|
||||
Assert.fail("sec. 4.3.5 Invoking the acknowledge method of a received message from a closed " + "connection's session must throw a [javax.jms.]IllegalStateException, not a " +
|
||||
Assert.fail("sec. 4.3.5 Invoking the acknowledge method of a received message from a closed " + "connection's session must throw a [jakarta.jms.]IllegalStateException, not a " +
|
||||
e);
|
||||
}
|
||||
catch (java.lang.IllegalStateException e)
|
||||
{
|
||||
Assert.fail("sec. 4.3.5 Invoking the acknowledge method of a received message from a closed " + "connection's session must throw an [javax.jms.]IllegalStateException "
|
||||
Assert.fail("sec. 4.3.5 Invoking the acknowledge method of a received message from a closed " + "connection's session must throw an [jakarta.jms.]IllegalStateException "
|
||||
+ "[not a java.lang.IllegalStateException]");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that an attempt to use a <code>Connection</code> which has been closed
|
||||
* throws a <code>javax.jms.IllegalStateException</code>.
|
||||
* throws a <code>jakarta.jms.IllegalStateException</code>.
|
||||
*/
|
||||
public void testUseClosedConnection()
|
||||
{
|
||||
|
@ -87,18 +90,18 @@ public class ConnectionTest extends PTPTestCase
|
|||
{
|
||||
senderConnection.close();
|
||||
senderConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
|
||||
Assert.fail("Should raise a javax.jms.IllegalStateException");
|
||||
Assert.fail("Should raise a jakarta.jms.IllegalStateException");
|
||||
}
|
||||
catch (javax.jms.IllegalStateException e)
|
||||
catch (jakarta.jms.IllegalStateException e)
|
||||
{
|
||||
}
|
||||
catch (JMSException e)
|
||||
{
|
||||
Assert.fail("Should raise a javax.jms.IllegalStateException, not a " + e);
|
||||
Assert.fail("Should raise a jakarta.jms.IllegalStateException, not a " + e);
|
||||
}
|
||||
catch (java.lang.IllegalStateException e)
|
||||
{
|
||||
Assert.fail("Should raise a javax.jms.IllegalStateException, not a java.lang.IllegalStateException");
|
||||
Assert.fail("Should raise a jakarta.jms.IllegalStateException, not a java.lang.IllegalStateException");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,21 +1,24 @@
|
|||
/*
|
||||
* Copyright 2009 Red Hat, Inc.
|
||||
* Red Hat licenses this file to you under the Apache License, version
|
||||
* 2.0 (the "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.objectweb.jtests.jms.conform.connection;
|
||||
|
||||
import javax.jms.JMSException;
|
||||
import jakarta.jms.JMSException;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
|
@ -56,18 +59,18 @@ public class TopicConnectionTest extends PubSubTestCase
|
|||
|
||||
// a attempt to set a client ID should now throw an IllegalStateException
|
||||
subscriberConnection.setClientID("another client ID");
|
||||
Assert.fail("Should raise a javax.jms.IllegalStateException");
|
||||
Assert.fail("Should raise a jakarta.jms.IllegalStateException");
|
||||
}
|
||||
catch (javax.jms.IllegalStateException e)
|
||||
catch (jakarta.jms.IllegalStateException e)
|
||||
{
|
||||
}
|
||||
catch (JMSException e)
|
||||
{
|
||||
Assert.fail("Should raise a javax.jms.IllegalStateException, not a " + e);
|
||||
Assert.fail("Should raise a jakarta.jms.IllegalStateException, not a " + e);
|
||||
}
|
||||
catch (java.lang.IllegalStateException e)
|
||||
{
|
||||
Assert.fail("Should raise a javax.jms.IllegalStateException, not a java.lang.IllegalStateException");
|
||||
Assert.fail("Should raise a jakarta.jms.IllegalStateException, not a java.lang.IllegalStateException");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -98,18 +101,18 @@ public class TopicConnectionTest extends PubSubTestCase
|
|||
|
||||
// an attempt to set the client ID now should throw a IllegalStateException
|
||||
subscriberConnection.setClientID("testSetClientID_2");
|
||||
Assert.fail("Should throw a javax.jms.IllegalStateException");
|
||||
Assert.fail("Should throw a jakarta.jms.IllegalStateException");
|
||||
}
|
||||
catch (javax.jms.IllegalStateException e)
|
||||
catch (jakarta.jms.IllegalStateException e)
|
||||
{
|
||||
}
|
||||
catch (JMSException e)
|
||||
{
|
||||
Assert.fail("Should raise a javax.jms.IllegalStateException, not a " + e);
|
||||
Assert.fail("Should raise a jakarta.jms.IllegalStateException, not a " + e);
|
||||
}
|
||||
catch (java.lang.IllegalStateException e)
|
||||
{
|
||||
Assert.fail("Should raise a javax.jms.IllegalStateException, not a java.lang.IllegalStateException");
|
||||
Assert.fail("Should raise a jakarta.jms.IllegalStateException, not a java.lang.IllegalStateException");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -145,7 +148,7 @@ public class TopicConnectionTest extends PubSubTestCase
|
|||
TopicConnection connection_2 = subscriberTCF.createTopicConnection();
|
||||
assertTrue(connection_2.getClientID() == null);
|
||||
connection_2.setClientID("testSetClientID_3");
|
||||
fail("Should throw a javax.jms.InvalidClientIDException");
|
||||
fail("Should throw a jakarta.jms.InvalidClientIDException");
|
||||
}
|
||||
catch (InvalidClientIDException e)
|
||||
{
|
||||
|
|
|
@ -1,24 +1,27 @@
|
|||
/*
|
||||
* Copyright 2009 Red Hat, Inc.
|
||||
* Red Hat licenses this file to you under the Apache License, version
|
||||
* 2.0 (the "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.objectweb.jtests.jms.conform.message;
|
||||
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.MessageNotWriteableException;
|
||||
import javax.jms.TextMessage;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Message;
|
||||
import jakarta.jms.MessageNotWriteableException;
|
||||
import jakarta.jms.TextMessage;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
|
|
|
@ -1,29 +1,32 @@
|
|||
/*
|
||||
* Copyright 2009 Red Hat, Inc.
|
||||
* Red Hat licenses this file to you under the Apache License, version
|
||||
* 2.0 (the "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.objectweb.jtests.jms.conform.message;
|
||||
|
||||
import javax.jms.DeliveryMode;
|
||||
import javax.jms.Message;
|
||||
import jakarta.jms.DeliveryMode;
|
||||
import jakarta.jms.Message;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
import org.objectweb.jtests.jms.framework.JMSTestCase;
|
||||
|
||||
/**
|
||||
* Test the default constants of the <code>javax.jms.Message</code> interface.
|
||||
* Test the default constants of the <code>jakarta.jms.Message</code> interface.
|
||||
*
|
||||
* @author Jeff Mesnil (jmesnil@gmail.com)
|
||||
* @version $Id: MessageDefaultTest.java,v 1.1 2007/03/29 04:28:37 starksm Exp $
|
||||
|
@ -32,8 +35,8 @@ public class MessageDefaultTest extends JMSTestCase
|
|||
{
|
||||
|
||||
/**
|
||||
* test that the <code>DEFAULT_DELIVERY_MODE</code> of <code>javax.jms.Message</code>
|
||||
* corresponds to <code>javax.jms.Delivery.PERSISTENT</code>.
|
||||
* test that the <code>DEFAULT_DELIVERY_MODE</code> of <code>jakarta.jms.Message</code>
|
||||
* corresponds to <code>jakarta.jms.Delivery.PERSISTENT</code>.
|
||||
*/
|
||||
public void testDEFAULT_DELIVERY_MODE()
|
||||
{
|
||||
|
@ -43,7 +46,7 @@ public class MessageDefaultTest extends JMSTestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* test that the <code>DEFAULT_PRIORITY</code> of <code>javax.jms.Message</code>
|
||||
* test that the <code>DEFAULT_PRIORITY</code> of <code>jakarta.jms.Message</code>
|
||||
* corresponds to 4.
|
||||
*/
|
||||
public void testDEFAULT_PRIORITY()
|
||||
|
|
|
@ -1,30 +1,33 @@
|
|||
/*
|
||||
* Copyright 2009 Red Hat, Inc.
|
||||
* Red Hat licenses this file to you under the Apache License, version
|
||||
* 2.0 (the "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.objectweb.jtests.jms.conform.message;
|
||||
|
||||
import java.util.Enumeration;
|
||||
import java.util.Vector;
|
||||
|
||||
import javax.jms.BytesMessage;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.MapMessage;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.ObjectMessage;
|
||||
import javax.jms.StreamMessage;
|
||||
import javax.jms.TextMessage;
|
||||
import jakarta.jms.BytesMessage;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.MapMessage;
|
||||
import jakarta.jms.Message;
|
||||
import jakarta.jms.ObjectMessage;
|
||||
import jakarta.jms.StreamMessage;
|
||||
import jakarta.jms.TextMessage;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
|
|
|
@ -1,28 +1,31 @@
|
|||
/*
|
||||
* Copyright 2009 Red Hat, Inc.
|
||||
* Red Hat licenses this file to you under the Apache License, version
|
||||
* 2.0 (the "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.objectweb.jtests.jms.conform.message.headers;
|
||||
|
||||
import javax.jms.DeliveryMode;
|
||||
import javax.jms.Destination;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.Queue;
|
||||
import javax.jms.TemporaryQueue;
|
||||
import jakarta.jms.DeliveryMode;
|
||||
import jakarta.jms.Destination;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Message;
|
||||
import jakarta.jms.Queue;
|
||||
import jakarta.jms.TemporaryQueue;
|
||||
import javax.naming.Context;
|
||||
import javax.naming.NamingException;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
|
|
|
@ -1,26 +1,29 @@
|
|||
/*
|
||||
* Copyright 2009 Red Hat, Inc.
|
||||
* Red Hat licenses this file to you under the Apache License, version
|
||||
* 2.0 (the "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.objectweb.jtests.jms.conform.message.properties;
|
||||
|
||||
import java.util.Enumeration;
|
||||
|
||||
import javax.jms.ConnectionMetaData;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.TextMessage;
|
||||
import jakarta.jms.ConnectionMetaData;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Message;
|
||||
import jakarta.jms.TextMessage;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
|
|
|
@ -1,30 +1,33 @@
|
|||
/*
|
||||
* Copyright 2009 Red Hat, Inc.
|
||||
* Red Hat licenses this file to you under the Apache License, version
|
||||
* 2.0 (the "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.objectweb.jtests.jms.conform.message.properties;
|
||||
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.MessageFormatException;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Message;
|
||||
import jakarta.jms.MessageFormatException;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
import org.objectweb.jtests.jms.framework.PTPTestCase;
|
||||
|
||||
/**
|
||||
* Test the conversion of primitive types for the <code>javax.jms.Message</code> properties.
|
||||
* Test the conversion of primitive types for the <code>jakarta.jms.Message</code> properties.
|
||||
* <br />
|
||||
* See JMS Specification, sec. 3.5.4 Property Value Conversion and the corresponding table (p.33-34).
|
||||
* <br />
|
||||
|
@ -49,7 +52,7 @@ import org.objectweb.jtests.jms.framework.PTPTestCase;
|
|||
* </pre>
|
||||
* A value set as the row type can be read as the column type.
|
||||
* <br />
|
||||
* The unmarked cases must throw a <code>javax.jms.MessageFormatException</code>
|
||||
* The unmarked cases must throw a <code>jakarta.jms.MessageFormatException</code>
|
||||
* <br />
|
||||
* The cases marked with a Y should throw a <code>java.lang.MessageFormatException</code> <strong>if</strong> the
|
||||
* String is not a correct representation of the column type (otherwise, it returns the property).
|
||||
|
@ -416,7 +419,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>double</code>,
|
||||
* to get is as a <code>float</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as a <code>float</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testDouble2Float()
|
||||
{
|
||||
|
@ -438,7 +441,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>double</code>,
|
||||
* to get is as a <code>long</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as a <code>long</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testDouble2Long()
|
||||
{
|
||||
|
@ -460,7 +463,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>double</code>,
|
||||
* to get is as an <code>int</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as an <code>int</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testDouble2Int()
|
||||
{
|
||||
|
@ -482,7 +485,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>double</code>,
|
||||
* to get is as a <code>short</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as a <code>short</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testDouble2Short()
|
||||
{
|
||||
|
@ -505,7 +508,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>double</code>,
|
||||
* to get is as a <code>byte</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as a <code>byte</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testDouble2Byte()
|
||||
{
|
||||
|
@ -528,7 +531,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>double</code>,
|
||||
* to get is as a <code>boolean</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as a <code>boolean</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testDouble2Boolean()
|
||||
{
|
||||
|
@ -605,7 +608,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>float</code>,
|
||||
* to get is as a <code>long</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as a <code>long</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testFloat2Long()
|
||||
{
|
||||
|
@ -627,7 +630,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>float</code>,
|
||||
* to get is as a <code>int</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as a <code>int</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testFloat2Int()
|
||||
{
|
||||
|
@ -649,7 +652,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>float</code>,
|
||||
* to get is as a <code>short</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as a <code>short</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testFloat2Short()
|
||||
{
|
||||
|
@ -672,7 +675,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>float</code>,
|
||||
* to get is as a <code>byte</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as a <code>byte</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testFloat2Byte()
|
||||
{
|
||||
|
@ -695,7 +698,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>float</code>,
|
||||
* to get is as a <code>boolean</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as a <code>boolean</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testFloat2Boolean()
|
||||
{
|
||||
|
@ -736,7 +739,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>long</code>,
|
||||
* to get is as a <code>double</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as a <code>double</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testLong2Double()
|
||||
{
|
||||
|
@ -758,7 +761,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>long</code>,
|
||||
* to get is as a <code>float</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as a <code>float</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testLong2Float()
|
||||
{
|
||||
|
@ -798,7 +801,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>long</code>,
|
||||
* to get is as an <code>int</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as an <code>int</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testLong2Int()
|
||||
{
|
||||
|
@ -820,7 +823,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>long</code>,
|
||||
* to get is as a <code>short</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as a <code>short</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testLong2Short()
|
||||
{
|
||||
|
@ -843,7 +846,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>long</code>,
|
||||
* to get is as a <code>byte</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as a <code>byte</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testLong2Byte()
|
||||
{
|
||||
|
@ -866,7 +869,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>long</code>,
|
||||
* to get is as a <code>boolean</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as a <code>boolean</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testLong2Boolean()
|
||||
{
|
||||
|
@ -907,7 +910,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>int</code>,
|
||||
* to get is as a <code>double</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as a <code>double</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testInt2Double()
|
||||
{
|
||||
|
@ -929,7 +932,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>int</code>,
|
||||
* to get is as a <code>float</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as a <code>float</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testInt2Float()
|
||||
{
|
||||
|
@ -987,7 +990,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>int</code>,
|
||||
* to get is as a <code>short</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as a <code>short</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testInt2Short()
|
||||
{
|
||||
|
@ -1010,7 +1013,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>int</code>,
|
||||
* to get is as a <code>byte</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as a <code>byte</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testInt2Byte()
|
||||
{
|
||||
|
@ -1033,7 +1036,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>int</code>,
|
||||
* to get is as a <code>boolean</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as a <code>boolean</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testInt2Boolean()
|
||||
{
|
||||
|
@ -1074,7 +1077,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>short</code>,
|
||||
* to get is as a <code>double</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as a <code>double</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testShort2Double()
|
||||
{
|
||||
|
@ -1096,7 +1099,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>short</code>,
|
||||
* to get is as a <code>float</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as a <code>float</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testShort2Float()
|
||||
{
|
||||
|
@ -1172,7 +1175,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>short</code>,
|
||||
* to get is as a <code>byte</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as a <code>byte</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testShort2Byte()
|
||||
{
|
||||
|
@ -1194,7 +1197,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>short</code>,
|
||||
* to get is as a <code>boolean</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as a <code>boolean</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testShort2Boolean()
|
||||
{
|
||||
|
@ -1235,7 +1238,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>byte</code>,
|
||||
* to get is as a <code>double</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as a <code>double</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testByte2Double()
|
||||
{
|
||||
|
@ -1257,7 +1260,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>byte</code>,
|
||||
* to get is as a <code>float</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as a <code>float</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testByte2Float()
|
||||
{
|
||||
|
@ -1351,7 +1354,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>byte</code>,
|
||||
* to get is as a <code>boolean</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as a <code>boolean</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testByte2Boolean()
|
||||
{
|
||||
|
@ -1392,7 +1395,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>boolean</code>,
|
||||
* to get is as a <code>double</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as a <code>double</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testBoolean2Double()
|
||||
{
|
||||
|
@ -1415,7 +1418,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>boolean</code>,
|
||||
* to get is as a <code>float</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as a <code>float</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testBoolean2Float()
|
||||
{
|
||||
|
@ -1438,7 +1441,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>boolean</code>,
|
||||
* to get is as a <code>long</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as a <code>long</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testBoolean2Long()
|
||||
{
|
||||
|
@ -1461,7 +1464,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>boolean</code>,
|
||||
* to get is as a <code>int</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as a <code>int</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testBoolean2Int()
|
||||
{
|
||||
|
@ -1484,7 +1487,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>boolean</code>,
|
||||
* to get is as a <code>short</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as a <code>short</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testBoolean2Short()
|
||||
{
|
||||
|
@ -1507,7 +1510,7 @@ public class MessagePropertyConversionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* if a property is set as a <code>boolean</code>,
|
||||
* to get is as a <code>byte</code> throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* to get is as a <code>byte</code> throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testBoolean2Byte()
|
||||
{
|
||||
|
|
|
@ -1,34 +1,37 @@
|
|||
/*
|
||||
* Copyright 2009 Red Hat, Inc.
|
||||
* Red Hat licenses this file to you under the Apache License, version
|
||||
* 2.0 (the "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.objectweb.jtests.jms.conform.message.properties;
|
||||
|
||||
import java.util.Enumeration;
|
||||
import java.util.Vector;
|
||||
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.MessageFormatException;
|
||||
import javax.jms.TextMessage;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Message;
|
||||
import jakarta.jms.MessageFormatException;
|
||||
import jakarta.jms.TextMessage;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
import org.objectweb.jtests.jms.framework.PTPTestCase;
|
||||
|
||||
/**
|
||||
* Test the <code>javax.jms.Message</code> properties.
|
||||
* Test the <code>jakarta.jms.Message</code> properties.
|
||||
* <br />
|
||||
* See JMS Specification, sec. 3.5 Message Properties (p.32-37)
|
||||
*
|
||||
|
@ -41,7 +44,7 @@ public class MessagePropertyTest extends PTPTestCase
|
|||
/**
|
||||
* Test that any other class than <code>Boolean, Byte, Short, Integer, Long,
|
||||
* Float, Double</code> and <code>String</code> used in the <code>Message.setObjectProperty()</code>
|
||||
* method throws a <code>javax.jms.MessageFormatException</code>.
|
||||
* method throws a <code>jakarta.jms.MessageFormatException</code>.
|
||||
*/
|
||||
public void testSetObjectProperty_2()
|
||||
{
|
||||
|
@ -56,7 +59,7 @@ public class MessagePropertyTest extends PTPTestCase
|
|||
}
|
||||
catch (JMSException e)
|
||||
{
|
||||
Assert.fail("Should throw a javax.jms.MessageFormatException, not a " + e);
|
||||
Assert.fail("Should throw a jakarta.jms.MessageFormatException, not a " + e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -69,7 +72,7 @@ public class MessagePropertyTest extends PTPTestCase
|
|||
try
|
||||
{
|
||||
Message message = senderSession.createMessage();
|
||||
message.setObjectProperty("pi", new Float(3.14159f));
|
||||
message.setObjectProperty("pi", Float.valueOf(3.14159f));
|
||||
Assert.assertEquals(3.14159f, message.getFloatProperty("pi"), 0);
|
||||
}
|
||||
catch (JMSException e)
|
||||
|
|
|
@ -1,26 +1,29 @@
|
|||
/*
|
||||
* Copyright 2009 Red Hat, Inc.
|
||||
* Red Hat licenses this file to you under the Apache License, version
|
||||
* 2.0 (the "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.objectweb.jtests.jms.conform.queue;
|
||||
|
||||
import java.util.Enumeration;
|
||||
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.QueueBrowser;
|
||||
import javax.jms.TextMessage;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Message;
|
||||
import jakarta.jms.QueueBrowser;
|
||||
import jakarta.jms.TextMessage;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
|
@ -28,7 +31,7 @@ import org.objectweb.jtests.jms.framework.PTPTestCase;
|
|||
import org.objectweb.jtests.jms.framework.TestConfig;
|
||||
|
||||
/**
|
||||
* Test the <code>javax.jms.QueueBrowser</code> features.
|
||||
* Test the <code>jakarta.jms.QueueBrowser</code> features.
|
||||
*
|
||||
* @author Jeff Mesnil (jmesnil@gmail.com)
|
||||
* @version $Id: QueueBrowserTest.java,v 1.2 2007/06/19 23:32:35 csuconic Exp $
|
||||
|
|
|
@ -1,25 +1,28 @@
|
|||
/*
|
||||
* Copyright 2009 Red Hat, Inc.
|
||||
* Red Hat licenses this file to you under the Apache License, version
|
||||
* 2.0 (the "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.objectweb.jtests.jms.conform.queue;
|
||||
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.QueueReceiver;
|
||||
import javax.jms.TemporaryQueue;
|
||||
import javax.jms.TextMessage;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Message;
|
||||
import jakarta.jms.QueueReceiver;
|
||||
import jakarta.jms.TemporaryQueue;
|
||||
import jakarta.jms.TextMessage;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
|
@ -27,7 +30,7 @@ import org.objectweb.jtests.jms.framework.PTPTestCase;
|
|||
import org.objectweb.jtests.jms.framework.TestConfig;
|
||||
|
||||
/**
|
||||
* Test the <code>javax.jms.TemporaryQueue</code> features.
|
||||
* Test the <code>jakarta.jms.TemporaryQueue</code> features.
|
||||
*
|
||||
* @author Jeff Mesnil (jmesnil@gmail.com)
|
||||
* @version $Id: TemporaryQueueTest.java,v 1.1 2007/03/29 04:28:37 starksm Exp $
|
||||
|
|
|
@ -1,22 +1,25 @@
|
|||
/*
|
||||
* Copyright 2009 Red Hat, Inc.
|
||||
* Red Hat licenses this file to you under the Apache License, version
|
||||
* 2.0 (the "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.objectweb.jtests.jms.conform.selector;
|
||||
|
||||
import javax.jms.InvalidSelectorException;
|
||||
import javax.jms.JMSException;
|
||||
import jakarta.jms.InvalidSelectorException;
|
||||
import jakarta.jms.JMSException;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
|
|
|
@ -1,22 +1,25 @@
|
|||
/*
|
||||
* Copyright 2009 Red Hat, Inc.
|
||||
* Red Hat licenses this file to you under the Apache License, version
|
||||
* 2.0 (the "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.objectweb.jtests.jms.conform.selector;
|
||||
|
||||
import javax.jms.DeliveryMode;
|
||||
import javax.jms.TextMessage;
|
||||
import jakarta.jms.DeliveryMode;
|
||||
import jakarta.jms.TextMessage;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
|
|
|
@ -1,26 +1,29 @@
|
|||
/*
|
||||
* Copyright 2009 Red Hat, Inc.
|
||||
* Red Hat licenses this file to you under the Apache License, version
|
||||
* 2.0 (the "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.objectweb.jtests.jms.conform.session;
|
||||
|
||||
import javax.jms.InvalidDestinationException;
|
||||
import javax.jms.InvalidSelectorException;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.Queue;
|
||||
import javax.jms.TextMessage;
|
||||
import jakarta.jms.InvalidDestinationException;
|
||||
import jakarta.jms.InvalidSelectorException;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Message;
|
||||
import jakarta.jms.Queue;
|
||||
import jakarta.jms.TextMessage;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
|
@ -108,81 +111,81 @@ public class QueueSessionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* Test that a call to the <code>createBrowser()</code> method with an invalid
|
||||
* messaeg session throws a <code>javax.jms.InvalidSelectorException</code>.
|
||||
* messaeg session throws a <code>jakarta.jms.InvalidSelectorException</code>.
|
||||
*/
|
||||
public void testCreateBrowser_2()
|
||||
{
|
||||
try
|
||||
{
|
||||
senderSession.createBrowser(senderQueue, "definitely not a message selector!");
|
||||
Assert.fail("Should throw a javax.jms.InvalidSelectorException.\n");
|
||||
Assert.fail("Should throw a jakarta.jms.InvalidSelectorException.\n");
|
||||
}
|
||||
catch (InvalidSelectorException e)
|
||||
{
|
||||
}
|
||||
catch (JMSException e)
|
||||
{
|
||||
Assert.fail("Should throw a javax.jms.InvalidSelectorException, not a " + e);
|
||||
Assert.fail("Should throw a jakarta.jms.InvalidSelectorException, not a " + e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that a call to the <code>createBrowser()</code> method with an invalid
|
||||
* <code>Queue</code> throws a <code>javax.jms.InvalidDestinationException</code>.
|
||||
* <code>Queue</code> throws a <code>jakarta.jms.InvalidDestinationException</code>.
|
||||
*/
|
||||
public void testCreateBrowser_1()
|
||||
{
|
||||
try
|
||||
{
|
||||
senderSession.createBrowser((Queue)null);
|
||||
Assert.fail("Should throw a javax.jms.InvalidDestinationException.\n");
|
||||
Assert.fail("Should throw a jakarta.jms.InvalidDestinationException.\n");
|
||||
}
|
||||
catch (InvalidDestinationException e)
|
||||
{
|
||||
}
|
||||
catch (JMSException e)
|
||||
{
|
||||
Assert.fail("Should throw a javax.jms.InvalidDestinationException, not a " + e);
|
||||
Assert.fail("Should throw a jakarta.jms.InvalidDestinationException, not a " + e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that a call to the <code>createReceiver()</code> method with an invalid
|
||||
* message selector throws a <code>javax.jms.InvalidSelectorException</code>.
|
||||
* message selector throws a <code>jakarta.jms.InvalidSelectorException</code>.
|
||||
*/
|
||||
public void testCreateReceiver_2()
|
||||
{
|
||||
try
|
||||
{
|
||||
receiver = senderSession.createReceiver(senderQueue, "definitely not a message selector!");
|
||||
Assert.fail("Should throw a javax.jms.InvalidSelectorException.\n");
|
||||
Assert.fail("Should throw a jakarta.jms.InvalidSelectorException.\n");
|
||||
}
|
||||
catch (InvalidSelectorException e)
|
||||
{
|
||||
}
|
||||
catch (JMSException e)
|
||||
{
|
||||
Assert.fail("Should throw a javax.jms.InvalidSelectorException, not a " + e);
|
||||
Assert.fail("Should throw a jakarta.jms.InvalidSelectorException, not a " + e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that a call to the <code>createReceiver()</code> method with an invalid
|
||||
* <code>Queue</code> throws a <code>javax.jms.InvalidDestinationException</code>>
|
||||
* <code>Queue</code> throws a <code>jakarta.jms.InvalidDestinationException</code>>
|
||||
*/
|
||||
public void testCreateReceiver_1()
|
||||
{
|
||||
try
|
||||
{
|
||||
receiver = senderSession.createReceiver((Queue)null);
|
||||
Assert.fail("Should throw a javax.jms.InvalidDestinationException.\n");
|
||||
Assert.fail("Should throw a jakarta.jms.InvalidDestinationException.\n");
|
||||
}
|
||||
catch (InvalidDestinationException e)
|
||||
{
|
||||
}
|
||||
catch (JMSException e)
|
||||
{
|
||||
Assert.fail("Should throw a javax.jms.InvalidDestinationException, not a " + e);
|
||||
Assert.fail("Should throw a jakarta.jms.InvalidDestinationException, not a " + e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,24 +1,27 @@
|
|||
/*
|
||||
* Copyright 2009 Red Hat, Inc.
|
||||
* Red Hat licenses this file to you under the Apache License, version
|
||||
* 2.0 (the "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.objectweb.jtests.jms.conform.session;
|
||||
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.Session;
|
||||
import javax.jms.TextMessage;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Message;
|
||||
import jakarta.jms.Session;
|
||||
import jakarta.jms.TextMessage;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
|
@ -39,7 +42,7 @@ public class SessionTest extends PTPTestCase
|
|||
/**
|
||||
* Test that an attempt to call the <code>recover()</code> method on a
|
||||
* <strong>transacted </strong> <code>Session</code> throws a
|
||||
* <code>javax.jms.IllegalStateException</code>.
|
||||
* <code>jakarta.jms.IllegalStateException</code>.
|
||||
*/
|
||||
public void testRecoverTransactedSession()
|
||||
{
|
||||
|
@ -53,16 +56,16 @@ public class SessionTest extends PTPTestCase
|
|||
senderSession.recover();
|
||||
Assert.fail("Should raise an IllegalStateException, the session is not transacted.\n");
|
||||
}
|
||||
catch (javax.jms.IllegalStateException e)
|
||||
catch (jakarta.jms.IllegalStateException e)
|
||||
{
|
||||
}
|
||||
catch (java.lang.IllegalStateException e)
|
||||
{
|
||||
Assert.fail("Should raise a javax.jms.IllegalStateException, not a java.lang.IllegalStateException.\n");
|
||||
Assert.fail("Should raise a jakarta.jms.IllegalStateException, not a java.lang.IllegalStateException.\n");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Assert.fail("Should raise a javax.jms.IllegalStateException, not a " + e);
|
||||
Assert.fail("Should raise a jakarta.jms.IllegalStateException, not a " + e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -137,7 +140,7 @@ public class SessionTest extends PTPTestCase
|
|||
/**
|
||||
* Test that an attempt to call the <code>roolback()</code> method on a
|
||||
* <strong>non transacted</strong> <code>Session</code> throws a
|
||||
* <code>javax.jms.IllegalStateException</code>.
|
||||
* <code>jakarta.jms.IllegalStateException</code>.
|
||||
*/
|
||||
public void testRollbackNonTransactedSession()
|
||||
{
|
||||
|
@ -148,23 +151,23 @@ public class SessionTest extends PTPTestCase
|
|||
senderSession.rollback();
|
||||
Assert.fail("Should raise an IllegalStateException, the session is not transacted.\n");
|
||||
}
|
||||
catch (javax.jms.IllegalStateException e)
|
||||
catch (jakarta.jms.IllegalStateException e)
|
||||
{
|
||||
}
|
||||
catch (java.lang.IllegalStateException e)
|
||||
{
|
||||
Assert.fail("Should raise a javax.jms.IllegalStateException, not a java.lang.IllegalStateException.\n");
|
||||
Assert.fail("Should raise a jakarta.jms.IllegalStateException, not a java.lang.IllegalStateException.\n");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Assert.fail("Should raise a javax.jms.IllegalStateException, not a " + e);
|
||||
Assert.fail("Should raise a jakarta.jms.IllegalStateException, not a " + e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that an attempt to call the <code>commit()</code> method on a
|
||||
* <strong>non transacted</strong> <code>Session</code> throws a
|
||||
* <code>javax.jms.IllegalStateException</code>.
|
||||
* <code>jakarta.jms.IllegalStateException</code>.
|
||||
*/
|
||||
public void testCommitNonTransactedSession()
|
||||
{
|
||||
|
@ -175,16 +178,16 @@ public class SessionTest extends PTPTestCase
|
|||
senderSession.commit();
|
||||
Assert.fail("Should raise an IllegalStateException, the session is not transacted.\n");
|
||||
}
|
||||
catch (javax.jms.IllegalStateException e)
|
||||
catch (jakarta.jms.IllegalStateException e)
|
||||
{
|
||||
}
|
||||
catch (java.lang.IllegalStateException e)
|
||||
{
|
||||
Assert.fail("Should raise a javax.jms.IllegalStateException, not a java.lang.IllegalStateException.\n");
|
||||
Assert.fail("Should raise a jakarta.jms.IllegalStateException, not a java.lang.IllegalStateException.\n");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Assert.fail("Should raise a javax.jms.IllegalStateException, not a " + e);
|
||||
Assert.fail("Should raise a jakarta.jms.IllegalStateException, not a " + e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -229,18 +232,18 @@ public class SessionTest extends PTPTestCase
|
|||
Message m = receiver.receive(TestConfig.TIMEOUT);
|
||||
receiverSession.close();
|
||||
m.acknowledge();
|
||||
Assert.fail("sec. 4.4.1 Invoking the acknowledge method of a received message from a closed " + " session must throw an [javax.jms.]IllegalStateException.\n");
|
||||
Assert.fail("sec. 4.4.1 Invoking the acknowledge method of a received message from a closed " + " session must throw an [jakarta.jms.]IllegalStateException.\n");
|
||||
}
|
||||
catch (javax.jms.IllegalStateException e)
|
||||
catch (jakarta.jms.IllegalStateException e)
|
||||
{
|
||||
}
|
||||
catch (JMSException e)
|
||||
{
|
||||
Assert.fail("Should raise a javax.jms.IllegalStateException, not a " + e);
|
||||
Assert.fail("Should raise a jakarta.jms.IllegalStateException, not a " + e);
|
||||
}
|
||||
catch (java.lang.IllegalStateException e)
|
||||
{
|
||||
Assert.fail("sec. 4.4.1 Invoking the acknowledge method of a received message from a closed " + "session must throw an [javax.jms.]IllegalStateException, "
|
||||
Assert.fail("sec. 4.4.1 Invoking the acknowledge method of a received message from a closed " + "session must throw an [jakarta.jms.]IllegalStateException, "
|
||||
+ "[not a java.lang.IllegalStateException]");
|
||||
}
|
||||
}
|
||||
|
@ -269,7 +272,7 @@ public class SessionTest extends PTPTestCase
|
|||
|
||||
/**
|
||||
* Test that an attempt to use a <code>Session</code> which has been closed
|
||||
* throws a <code>javax.jms.IllegalStateException</code>.
|
||||
* throws a <code>jakarta.jms.IllegalStateException</code>.
|
||||
*/
|
||||
public void testUsedClosedSession()
|
||||
{
|
||||
|
@ -277,18 +280,18 @@ public class SessionTest extends PTPTestCase
|
|||
{
|
||||
senderSession.close();
|
||||
senderSession.createMessage();
|
||||
Assert.fail("sec. 4.4.1 An attempt to use [a closed session] must throw a [javax.jms.]IllegalStateException.\n");
|
||||
Assert.fail("sec. 4.4.1 An attempt to use [a closed session] must throw a [jakarta.jms.]IllegalStateException.\n");
|
||||
}
|
||||
catch (javax.jms.IllegalStateException e)
|
||||
catch (jakarta.jms.IllegalStateException e)
|
||||
{
|
||||
}
|
||||
catch (JMSException e)
|
||||
{
|
||||
Assert.fail("Should raise a javax.jms.IllegalStateException, not a " + e);
|
||||
Assert.fail("Should raise a jakarta.jms.IllegalStateException, not a " + e);
|
||||
}
|
||||
catch (java.lang.IllegalStateException e)
|
||||
{
|
||||
Assert.fail("Should raise a javax.jms.IllegalStateException, not a java.lang.IllegalStateException");
|
||||
Assert.fail("Should raise a jakarta.jms.IllegalStateException, not a java.lang.IllegalStateException");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,27 +1,30 @@
|
|||
/*
|
||||
* Copyright 2009 Red Hat, Inc.
|
||||
* Red Hat licenses this file to you under the Apache License, version
|
||||
* 2.0 (the "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.objectweb.jtests.jms.conform.session;
|
||||
|
||||
import javax.jms.InvalidDestinationException;
|
||||
import javax.jms.InvalidSelectorException;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.Session;
|
||||
import javax.jms.TextMessage;
|
||||
import javax.jms.Topic;
|
||||
import jakarta.jms.InvalidDestinationException;
|
||||
import jakarta.jms.InvalidSelectorException;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Message;
|
||||
import jakarta.jms.Session;
|
||||
import jakarta.jms.TextMessage;
|
||||
import jakarta.jms.Topic;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
|
@ -149,81 +152,81 @@ public class TopicSessionTest extends PubSubTestCase
|
|||
|
||||
/**
|
||||
* Test that a call to the <code>createDurableSubscriber()</code> method with an invalid
|
||||
* message selector throws a <code>javax.jms.InvalidSelectorException</code>.
|
||||
* message selector throws a <code>jakarta.jms.InvalidSelectorException</code>.
|
||||
*/
|
||||
public void testCreateDurableSubscriber_2()
|
||||
{
|
||||
try
|
||||
{
|
||||
subscriberSession.createDurableSubscriber(subscriberTopic, "topic", "definitely not a message selector!", true);
|
||||
Assert.fail("Should throw a javax.jms.InvalidSelectorException.\n");
|
||||
Assert.fail("Should throw a jakarta.jms.InvalidSelectorException.\n");
|
||||
}
|
||||
catch (InvalidSelectorException e)
|
||||
{
|
||||
}
|
||||
catch (JMSException e)
|
||||
{
|
||||
Assert.fail("Should throw a javax.jms.InvalidSelectorException, not a " + e);
|
||||
Assert.fail("Should throw a jakarta.jms.InvalidSelectorException, not a " + e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that a call to the <code>createDurableSubscriber()</code> method with an invalid
|
||||
* <code>Topic</code> throws a <code>javax.jms.InvalidDestinationException</code>.
|
||||
* <code>Topic</code> throws a <code>jakarta.jms.InvalidDestinationException</code>.
|
||||
*/
|
||||
public void testCreateDurableSubscriber_1()
|
||||
{
|
||||
try
|
||||
{
|
||||
subscriberSession.createDurableSubscriber((Topic)null, "topic");
|
||||
Assert.fail("Should throw a javax.jms.InvalidDestinationException.\n");
|
||||
Assert.fail("Should throw a jakarta.jms.InvalidDestinationException.\n");
|
||||
}
|
||||
catch (InvalidDestinationException e)
|
||||
{
|
||||
}
|
||||
catch (JMSException e)
|
||||
{
|
||||
Assert.fail("Should throw a javax.jms.InvalidDestinationException, not a " + e);
|
||||
Assert.fail("Should throw a jakarta.jms.InvalidDestinationException, not a " + e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that a call to the <code>createSubscriber()</code> method with an invalid
|
||||
* message selector throws a <code>javax.jms.InvalidSelectorException</code>.
|
||||
* message selector throws a <code>jakarta.jms.InvalidSelectorException</code>.
|
||||
*/
|
||||
public void testCreateSubscriber_2()
|
||||
{
|
||||
try
|
||||
{
|
||||
subscriberSession.createSubscriber(subscriberTopic, "definitely not a message selector!", true);
|
||||
Assert.fail("Should throw a javax.jms.InvalidSelectorException.\n");
|
||||
Assert.fail("Should throw a jakarta.jms.InvalidSelectorException.\n");
|
||||
}
|
||||
catch (InvalidSelectorException e)
|
||||
{
|
||||
}
|
||||
catch (JMSException e)
|
||||
{
|
||||
Assert.fail("Should throw a javax.jms.InvalidSelectorException, not a " + e);
|
||||
Assert.fail("Should throw a jakarta.jms.InvalidSelectorException, not a " + e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that a call to the <code>createSubscriber()</code> method with an invalid
|
||||
* <code>Topic</code> throws a <code>javax.jms.InvalidDestinationException</code>.
|
||||
* <code>Topic</code> throws a <code>jakarta.jms.InvalidDestinationException</code>.
|
||||
*/
|
||||
public void testCreateSubscriber_1()
|
||||
{
|
||||
try
|
||||
{
|
||||
subscriberSession.createSubscriber((Topic)null);
|
||||
Assert.fail("Should throw a javax.jms.InvalidDestinationException.\n");
|
||||
Assert.fail("Should throw a jakarta.jms.InvalidDestinationException.\n");
|
||||
}
|
||||
catch (InvalidDestinationException e)
|
||||
{
|
||||
}
|
||||
catch (JMSException e)
|
||||
{
|
||||
Assert.fail("Should throw a javax.jms.InvalidDestinationException, not a " + e);
|
||||
Assert.fail("Should throw a jakarta.jms.InvalidDestinationException, not a " + e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,27 +1,30 @@
|
|||
/*
|
||||
* Copyright 2009 Red Hat, Inc.
|
||||
* Red Hat licenses this file to you under the Apache License, version
|
||||
* 2.0 (the "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.objectweb.jtests.jms.conform.session;
|
||||
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.QueueConnection;
|
||||
import javax.jms.QueueSession;
|
||||
import javax.jms.ServerSessionPool;
|
||||
import javax.jms.Session;
|
||||
import javax.jms.TopicConnection;
|
||||
import javax.jms.TopicSession;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.QueueConnection;
|
||||
import jakarta.jms.QueueSession;
|
||||
import jakarta.jms.ServerSessionPool;
|
||||
import jakarta.jms.Session;
|
||||
import jakarta.jms.TopicConnection;
|
||||
import jakarta.jms.TopicSession;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
|
@ -62,7 +65,7 @@ public class UnifiedSessionTest extends UnifiedTestCase
|
|||
/**
|
||||
* Test that a call to <code>createDurableConnectionConsumer()</code> method
|
||||
* on a <code>QueueConnection</code> throws a
|
||||
* <code>javax.jms.IllegalStateException</code>.
|
||||
* <code>jakarta.jms.IllegalStateException</code>.
|
||||
* (see JMS 1.1 specs, table 4-1).
|
||||
*
|
||||
* @since JMS 1.1
|
||||
|
@ -72,21 +75,21 @@ public class UnifiedSessionTest extends UnifiedTestCase
|
|||
try
|
||||
{
|
||||
queueConnection.createDurableConnectionConsumer(topic, "subscriptionName", "", (ServerSessionPool)null, 1);
|
||||
Assert.fail("Should throw a javax.jms.IllegalStateException");
|
||||
Assert.fail("Should throw a jakarta.jms.IllegalStateException");
|
||||
}
|
||||
catch (javax.jms.IllegalStateException e)
|
||||
catch (jakarta.jms.IllegalStateException e)
|
||||
{
|
||||
}
|
||||
catch (JMSException e)
|
||||
{
|
||||
Assert.fail("Should throw a javax.jms.IllegalStateException, not a " + e);
|
||||
Assert.fail("Should throw a jakarta.jms.IllegalStateException, not a " + e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that a call to <code>createDurableSubscriber()</code> method
|
||||
* on a <code>QueueSession</code> throws a
|
||||
* <code>javax.jms.IllegalStateException</code>.
|
||||
* <code>jakarta.jms.IllegalStateException</code>.
|
||||
* (see JMS 1.1 specs, table 4-1).
|
||||
*
|
||||
* @since JMS 1.1
|
||||
|
@ -96,21 +99,21 @@ public class UnifiedSessionTest extends UnifiedTestCase
|
|||
try
|
||||
{
|
||||
queueSession.createDurableSubscriber(topic, "subscriptionName");
|
||||
Assert.fail("Should throw a javax.jms.IllegalStateException");
|
||||
Assert.fail("Should throw a jakarta.jms.IllegalStateException");
|
||||
}
|
||||
catch (javax.jms.IllegalStateException e)
|
||||
catch (jakarta.jms.IllegalStateException e)
|
||||
{
|
||||
}
|
||||
catch (JMSException e)
|
||||
{
|
||||
Assert.fail("Should throw a javax.jms.IllegalStateException, not a " + e);
|
||||
Assert.fail("Should throw a jakarta.jms.IllegalStateException, not a " + e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that a call to <code>createTemporaryTopic()</code> method
|
||||
* on a <code>QueueSession</code> throws a
|
||||
* <code>javax.jms.IllegalStateException</code>.
|
||||
* <code>jakarta.jms.IllegalStateException</code>.
|
||||
* (see JMS 1.1 specs, table 4-1).
|
||||
*
|
||||
* @since JMS 1.1
|
||||
|
@ -120,21 +123,21 @@ public class UnifiedSessionTest extends UnifiedTestCase
|
|||
try
|
||||
{
|
||||
queueSession.createTemporaryTopic();
|
||||
Assert.fail("Should throw a javax.jms.IllegalStateException");
|
||||
Assert.fail("Should throw a jakarta.jms.IllegalStateException");
|
||||
}
|
||||
catch (javax.jms.IllegalStateException e)
|
||||
catch (jakarta.jms.IllegalStateException e)
|
||||
{
|
||||
}
|
||||
catch (JMSException e)
|
||||
{
|
||||
Assert.fail("Should throw a javax.jms.IllegalStateException, not a " + e);
|
||||
Assert.fail("Should throw a jakarta.jms.IllegalStateException, not a " + e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that a call to <code>createTopic()</code> method
|
||||
* on a <code>QueueSession</code> throws a
|
||||
* <code>javax.jms.IllegalStateException</code>.
|
||||
* <code>jakarta.jms.IllegalStateException</code>.
|
||||
* (see JMS 1.1 specs, table 4-1).
|
||||
*
|
||||
* @since JMS 1.1
|
||||
|
@ -144,21 +147,21 @@ public class UnifiedSessionTest extends UnifiedTestCase
|
|||
try
|
||||
{
|
||||
queueSession.createTopic("topic_name");
|
||||
Assert.fail("Should throw a javax.jms.IllegalStateException");
|
||||
Assert.fail("Should throw a jakarta.jms.IllegalStateException");
|
||||
}
|
||||
catch (javax.jms.IllegalStateException e)
|
||||
catch (jakarta.jms.IllegalStateException e)
|
||||
{
|
||||
}
|
||||
catch (JMSException e)
|
||||
{
|
||||
Assert.fail("Should throw a javax.jms.IllegalStateException, not a " + e);
|
||||
Assert.fail("Should throw a jakarta.jms.IllegalStateException, not a " + e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that a call to <code>unsubscribe()</code> method
|
||||
* on a <code>QueueSession</code> throws a
|
||||
* <code>javax.jms.IllegalStateException</code>.
|
||||
* <code>jakarta.jms.IllegalStateException</code>.
|
||||
* (see JMS 1.1 specs, table 4-1).
|
||||
*
|
||||
* @since JMS 1.1
|
||||
|
@ -168,21 +171,21 @@ public class UnifiedSessionTest extends UnifiedTestCase
|
|||
try
|
||||
{
|
||||
queueSession.unsubscribe("subscriptionName");
|
||||
Assert.fail("Should throw a javax.jms.IllegalStateException");
|
||||
Assert.fail("Should throw a jakarta.jms.IllegalStateException");
|
||||
}
|
||||
catch (javax.jms.IllegalStateException e)
|
||||
catch (jakarta.jms.IllegalStateException e)
|
||||
{
|
||||
}
|
||||
catch (JMSException e)
|
||||
{
|
||||
Assert.fail("Should throw a javax.jms.IllegalStateException, not a " + e);
|
||||
Assert.fail("Should throw a jakarta.jms.IllegalStateException, not a " + e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that a call to <code>createBrowser()</code> method
|
||||
* on a <code>TopicSession</code> throws a
|
||||
* <code>javax.jms.IllegalStateException</code>.
|
||||
* <code>jakarta.jms.IllegalStateException</code>.
|
||||
* (see JMS 1.1 specs, table 4-1).
|
||||
*
|
||||
* @since JMS 1.1
|
||||
|
@ -192,21 +195,21 @@ public class UnifiedSessionTest extends UnifiedTestCase
|
|||
try
|
||||
{
|
||||
topicSession.createBrowser(queue);
|
||||
Assert.fail("Should throw a javax.jms.IllegalStateException");
|
||||
Assert.fail("Should throw a jakarta.jms.IllegalStateException");
|
||||
}
|
||||
catch (javax.jms.IllegalStateException e)
|
||||
catch (jakarta.jms.IllegalStateException e)
|
||||
{
|
||||
}
|
||||
catch (JMSException e)
|
||||
{
|
||||
Assert.fail("Should throw a javax.jms.IllegalStateException, not a " + e);
|
||||
Assert.fail("Should throw a jakarta.jms.IllegalStateException, not a " + e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that a call to <code>createQueue()</code> method
|
||||
* on a <code>TopicSession</code> throws a
|
||||
* <code>javax.jms.IllegalStateException</code>.
|
||||
* <code>jakarta.jms.IllegalStateException</code>.
|
||||
* (see JMS 1.1 specs, table 4-1).
|
||||
*
|
||||
* @since JMS 1.1
|
||||
|
@ -216,21 +219,21 @@ public class UnifiedSessionTest extends UnifiedTestCase
|
|||
try
|
||||
{
|
||||
topicSession.createQueue("queue_name");
|
||||
Assert.fail("Should throw a javax.jms.IllegalStateException");
|
||||
Assert.fail("Should throw a jakarta.jms.IllegalStateException");
|
||||
}
|
||||
catch (javax.jms.IllegalStateException e)
|
||||
catch (jakarta.jms.IllegalStateException e)
|
||||
{
|
||||
}
|
||||
catch (JMSException e)
|
||||
{
|
||||
Assert.fail("Should throw a javax.jms.IllegalStateException, not a " + e);
|
||||
Assert.fail("Should throw a jakarta.jms.IllegalStateException, not a " + e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that a call to <code>createTemporaryQueue()</code> method
|
||||
* on a <code>TopicSession</code> throws a
|
||||
* <code>javax.jms.IllegalStateException</code>.
|
||||
* <code>jakarta.jms.IllegalStateException</code>.
|
||||
* (see JMS 1.1 specs, table 4-1).
|
||||
*
|
||||
* @since JMS 1.1
|
||||
|
@ -240,14 +243,14 @@ public class UnifiedSessionTest extends UnifiedTestCase
|
|||
try
|
||||
{
|
||||
topicSession.createTemporaryQueue();
|
||||
Assert.fail("Should throw a javax.jms.IllegalStateException");
|
||||
Assert.fail("Should throw a jakarta.jms.IllegalStateException");
|
||||
}
|
||||
catch (javax.jms.IllegalStateException e)
|
||||
catch (jakarta.jms.IllegalStateException e)
|
||||
{
|
||||
}
|
||||
catch (JMSException e)
|
||||
{
|
||||
Assert.fail("Should throw a javax.jms.IllegalStateException, not a " + e);
|
||||
Assert.fail("Should throw a jakarta.jms.IllegalStateException, not a " + e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,25 +1,28 @@
|
|||
/*
|
||||
* Copyright 2009 Red Hat, Inc.
|
||||
* Red Hat licenses this file to you under the Apache License, version
|
||||
* 2.0 (the "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.objectweb.jtests.jms.conform.topic;
|
||||
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.TemporaryTopic;
|
||||
import javax.jms.TextMessage;
|
||||
import javax.jms.TopicSubscriber;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Message;
|
||||
import jakarta.jms.TemporaryTopic;
|
||||
import jakarta.jms.TextMessage;
|
||||
import jakarta.jms.TopicSubscriber;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
|
|
|
@ -1,22 +1,25 @@
|
|||
/*
|
||||
* Copyright 2009 Red Hat, Inc.
|
||||
* Red Hat licenses this file to you under the Apache License, version
|
||||
* 2.0 (the "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.objectweb.jtests.jms.framework;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.jms.JMSException;
|
||||
import jakarta.jms.JMSException;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
|
@ -44,13 +47,13 @@ public abstract class JMSTestCase extends TestCase
|
|||
/**
|
||||
* Fails a test with an exception which will be used for a message.
|
||||
*
|
||||
* If the exception is an instance of <code>javax.jms.JMSException</code>, the
|
||||
* If the exception is an instance of <code>jakarta.jms.JMSException</code>, the
|
||||
* message of the failure will contained both the JMSException and its linked exception
|
||||
* (provided there's one).
|
||||
*/
|
||||
public void fail(final Exception e)
|
||||
{
|
||||
if (e instanceof javax.jms.JMSException)
|
||||
if (e instanceof jakarta.jms.JMSException)
|
||||
{
|
||||
JMSException exception = (JMSException)e;
|
||||
String message = e.toString();
|
||||
|
|
|
@ -1,25 +1,28 @@
|
|||
/*
|
||||
* Copyright 2009 Red Hat, Inc.
|
||||
* Red Hat licenses this file to you under the Apache License, version
|
||||
* 2.0 (the "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.objectweb.jtests.jms.framework;
|
||||
|
||||
import javax.jms.Queue;
|
||||
import javax.jms.QueueConnection;
|
||||
import javax.jms.QueueConnectionFactory;
|
||||
import javax.jms.QueueReceiver;
|
||||
import javax.jms.QueueSender;
|
||||
import javax.jms.QueueSession;
|
||||
import javax.jms.Session;
|
||||
import jakarta.jms.Queue;
|
||||
import jakarta.jms.QueueConnection;
|
||||
import jakarta.jms.QueueConnectionFactory;
|
||||
import jakarta.jms.QueueReceiver;
|
||||
import jakarta.jms.QueueSender;
|
||||
import jakarta.jms.QueueSession;
|
||||
import jakarta.jms.Session;
|
||||
import javax.naming.Context;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,25 +1,28 @@
|
|||
/*
|
||||
* Copyright 2009 Red Hat, Inc.
|
||||
* Red Hat licenses this file to you under the Apache License, version
|
||||
* 2.0 (the "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.objectweb.jtests.jms.framework;
|
||||
|
||||
import javax.jms.Session;
|
||||
import javax.jms.Topic;
|
||||
import javax.jms.TopicConnection;
|
||||
import javax.jms.TopicConnectionFactory;
|
||||
import javax.jms.TopicPublisher;
|
||||
import javax.jms.TopicSession;
|
||||
import javax.jms.TopicSubscriber;
|
||||
import jakarta.jms.Session;
|
||||
import jakarta.jms.Topic;
|
||||
import jakarta.jms.TopicConnection;
|
||||
import jakarta.jms.TopicConnectionFactory;
|
||||
import jakarta.jms.TopicPublisher;
|
||||
import jakarta.jms.TopicSession;
|
||||
import jakarta.jms.TopicSubscriber;
|
||||
import javax.naming.Context;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,16 +1,19 @@
|
|||
/*
|
||||
* Copyright 2009 Red Hat, Inc.
|
||||
* Red Hat licenses this file to you under the Apache License, version
|
||||
* 2.0 (the "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.objectweb.jtests.jms.framework;
|
||||
|
||||
import java.util.Properties;
|
||||
|
|
|
@ -1,28 +1,31 @@
|
|||
/*
|
||||
* Copyright 2009 Red Hat, Inc.
|
||||
* Red Hat licenses this file to you under the Apache License, version
|
||||
* 2.0 (the "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.objectweb.jtests.jms.framework;
|
||||
|
||||
import javax.jms.Connection;
|
||||
import javax.jms.ConnectionFactory;
|
||||
import javax.jms.Destination;
|
||||
import javax.jms.MessageConsumer;
|
||||
import javax.jms.MessageProducer;
|
||||
import javax.jms.Queue;
|
||||
import javax.jms.QueueConnectionFactory;
|
||||
import javax.jms.Session;
|
||||
import javax.jms.Topic;
|
||||
import javax.jms.TopicConnectionFactory;
|
||||
import jakarta.jms.Connection;
|
||||
import jakarta.jms.ConnectionFactory;
|
||||
import jakarta.jms.Destination;
|
||||
import jakarta.jms.MessageConsumer;
|
||||
import jakarta.jms.MessageProducer;
|
||||
import jakarta.jms.Queue;
|
||||
import jakarta.jms.QueueConnectionFactory;
|
||||
import jakarta.jms.Session;
|
||||
import jakarta.jms.Topic;
|
||||
import jakarta.jms.TopicConnectionFactory;
|
||||
import javax.naming.Context;
|
||||
|
||||
|
||||
|
@ -164,16 +167,16 @@ public abstract class UnifiedTestCase extends JMSTestCase
|
|||
ctx = admin.createContext();
|
||||
|
||||
producerCF = (ConnectionFactory)ctx.lookup(UnifiedTestCase.CF_NAME);
|
||||
// we see destination of the unified domain as a javax.jms.Destination
|
||||
// instead of a javax.jms.Queue to be more generic
|
||||
// we see destination of the unified domain as a jakarta.jms.Destination
|
||||
// instead of a jakarta.jms.Queue to be more generic
|
||||
producerDestination = (Destination)ctx.lookup(UnifiedTestCase.DESTINATION_NAME);
|
||||
producerConnection = producerCF.createConnection();
|
||||
producerSession = producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
|
||||
producer = producerSession.createProducer(producerDestination);
|
||||
|
||||
consumerCF = (ConnectionFactory)ctx.lookup(UnifiedTestCase.CF_NAME);
|
||||
// we see destination of the unified domain as a javax.jms.Destination
|
||||
// instead of a javax.jms.Queue to be more generic
|
||||
// we see destination of the unified domain as a jakarta.jms.Destination
|
||||
// instead of a jakarta.jms.Queue to be more generic
|
||||
consumerDestination = (Destination)ctx.lookup(UnifiedTestCase.DESTINATION_NAME);
|
||||
consumerConnection = consumerCF.createConnection();
|
||||
consumerSession = consumerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
|
||||
|
|
Loading…
Reference in New Issue