Modified: incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/PersistentTestManual.java URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/PersistentTestManual.java?view=diff&rev=561365&r1=561364&r2=561365 ============================================================================== --- incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/PersistentTestManual.java (original) +++ incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/PersistentTestManual.java Tue Jul 31 08:53:37 2007 @@ -1,39 +1,41 @@ /* - * 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 + * 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 * - * 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. + * 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. * - * */ package org.apache.qpid.server.queue; -import org.apache.qpid.client.AMQConnection; -import org.apache.qpid.client.AMQSession; -import org.apache.qpid.AMQException; +import org.apache.log4j.Logger; + import org.apache.qpid.AMQChannelClosedException; import org.apache.qpid.AMQConnectionClosedException; -import org.apache.qpid.util.CommandLineParser; +import org.apache.qpid.AMQException; +import org.apache.qpid.client.AMQConnection; +import org.apache.qpid.client.AMQSession; import org.apache.qpid.url.URLSyntaxException; -import org.apache.log4j.Logger; +import org.apache.qpid.util.CommandLineParser; -import javax.jms.Session; import javax.jms.JMSException; -import javax.jms.Queue; import javax.jms.MessageProducer; +import javax.jms.Queue; +import javax.jms.Session; import javax.jms.TextMessage; + import java.io.IOException; import java.util.Properties; @@ -41,7 +43,6 @@ { private static final Logger _logger = Logger.getLogger(PersistentTestManual.class); - private static final String QUEUE = "direct://amq.direct//PersistentTest-Queue2?durable='true',exclusive='true'"; protected AMQConnection _connection; @@ -89,7 +90,7 @@ public void test() throws AMQException, URLSyntaxException { - //Create the Durable Queue + // Create the Durable Queue try { _session.createConsumer(_session.createQueue(QUEUE)).close(); @@ -121,16 +122,17 @@ System.out.println("Continuing...."); } - //Test queue is still there. - AMQConnection connection = new AMQConnection(_brokerDetails, _username, _password, "DifferentClientID", _virtualpath); + // Test queue is still there. + AMQConnection connection = + new AMQConnection(_brokerDetails, _username, _password, "DifferentClientID", _virtualpath); AMQSession session = (AMQSession) connection.createSession(false, Session.AUTO_ACKNOWLEDGE); try { session.createConsumer(session.createQueue(QUEUE)); - _logger.error("Create consumer succeeded." + - " This shouldn't be allowed as this means the queue didn't exist when it should"); + _logger.error("Create consumer succeeded." + + " This shouldn't be allowed as this means the queue didn't exist when it should"); connection.close(); @@ -189,6 +191,7 @@ { // } + System.exit(0); } @@ -196,7 +199,7 @@ { String TEST_TEXT = "init"; - //Create a new session to send producer + // Create a new session to send producer Session session = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE); Queue q = session.createQueue(QUEUE); @@ -204,10 +207,9 @@ producer.send(session.createTextMessage(TEST_TEXT)); - //create a new consumer on the original session + // create a new consumer on the original session TextMessage m = (TextMessage) _session.createConsumer(q).receive(); - if ((m != null) && m.getText().equals(TEST_TEXT)) { return true; @@ -216,6 +218,7 @@ { _logger.error("Incorrect values returned from Queue Test:" + m); System.exit(0); + return false; } } @@ -259,8 +262,8 @@ { PersistentTestManual test; - Properties options = CommandLineParser.processCommandLine(args, new CommandLineParser(new String[][]{})); - + Properties options = + CommandLineParser.processCommandLine(args, new CommandLineParser(new String[][] {}), System.getProperties()); test = new PersistentTestManual(options); try
Modified: incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/VMTestCase.java URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/VMTestCase.java?view=diff&rev=561365&r1=561364&r2=561365 ============================================================================== --- incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/VMTestCase.java (original) +++ incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/VMTestCase.java Tue Jul 31 08:53:37 2007 @@ -1,4 +1,5 @@ /* + * * 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 @@ -20,29 +21,32 @@ package org.apache.qpid.test; import junit.extensions.TestSetup; + import junit.framework.Test; import junit.framework.TestCase; import org.apache.qpid.client.transport.TransportConnection; import org.apache.qpid.jndi.PropertiesFileInitialContextFactory; +import org.apache.qpid.server.registry.ApplicationRegistry; -import javax.naming.Context; -import javax.naming.spi.InitialContextFactory; -import javax.jms.Queue; -import javax.jms.ConnectionFactory; -import javax.jms.Session; import javax.jms.Connection; +import javax.jms.ConnectionFactory; import javax.jms.MessageProducer; +import javax.jms.Queue; +import javax.jms.Session; +import javax.naming.Context; +import javax.naming.spi.InitialContextFactory; + +import java.util.HashMap; import java.util.Hashtable; -import java.util.List; import java.util.LinkedList; +import java.util.List; import java.util.Map; -import java.util.HashMap; public class VMTestCase extends TestCase { - protected long RECEIVE_TIMEOUT = 1000l; // 1 sec - protected long CLOSE_TIMEOUT = 10000l; // 10 secs + protected long RECEIVE_TIMEOUT = 1000L; // 1 sec + protected long CLOSE_TIMEOUT = 10000L; // 10 secs protected Context _context; protected String _clientID; @@ -84,8 +88,8 @@ _brokerlist = "vm://:1"; } - env.put("connectionfactory.connection", "amqp://guest:guest@" + - _clientID + _virtualhost + "?brokerlist='" + _brokerlist + "'"); + env.put("connectionfactory.connection", "amqp://guest:guest@" + _clientID + _virtualhost + "?brokerlist='" + + _brokerlist + "'"); for (Map.Entry<String, String> c : _connections.entrySet()) { @@ -112,6 +116,8 @@ protected void tearDown() throws Exception { TransportConnection.killVMBroker(1); + ApplicationRegistry.remove(1); + super.tearDown(); } Modified: incubator/qpid/trunk/qpid/ruby/qpid/test.rb URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/ruby/qpid/test.rb?view=diff&rev=561365&r1=561364&r2=561365 ============================================================================== --- incubator/qpid/trunk/qpid/ruby/qpid/test.rb (original) +++ incubator/qpid/trunk/qpid/ruby/qpid/test.rb Tue Jul 31 08:53:37 2007 @@ -1,3 +1,24 @@ + + +# 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. +# +#/ + require "qpid/spec" require "qpid/client"
