You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rg...@apache.org on 2010/09/13 00:40:45 UTC
svn commit: r996393 [4/5] - in /qpid/trunk/qpid/java:
broker/src/main/java/org/apache/log4j/
broker/src/main/java/org/apache/log4j/xml/
broker/src/main/java/org/apache/qpid/configuration/
broker/src/main/java/org/apache/qpid/qmf/ broker/src/main/java/o...
Modified: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQTypeMap.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQTypeMap.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQTypeMap.java (original)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQTypeMap.java Sun Sep 12 22:40:40 2010
@@ -25,7 +25,7 @@ import java.util.Map;
public class AMQTypeMap
{
- public static Map<Byte, AMQType> _reverseTypeMap = new HashMap<Byte, AMQType>();
+ public static final Map<Byte, AMQType> _reverseTypeMap = new HashMap<Byte, AMQType>();
static
{
Modified: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/HeartbeatBody.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/HeartbeatBody.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/HeartbeatBody.java (original)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/HeartbeatBody.java Sun Sep 12 22:40:40 2010
@@ -27,7 +27,7 @@ import org.apache.qpid.AMQException;
public class HeartbeatBody implements AMQBody
{
public static final byte TYPE = 8;
- public static AMQFrame FRAME = new HeartbeatBody().toFrame();
+ public static final AMQFrame FRAME = new HeartbeatBody().toFrame();
public HeartbeatBody()
{
Modified: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/ProtocolInitiation.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/ProtocolInitiation.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/ProtocolInitiation.java (original)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/ProtocolInitiation.java Sun Sep 12 22:40:40 2010
@@ -24,12 +24,13 @@ import org.apache.qpid.AMQException;
import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
+import java.util.Arrays;
public class ProtocolInitiation extends AMQDataBlock implements EncodableAMQDataBlock
{
// TODO: generate these constants automatically from the xml protocol spec file
- public static final byte[] AMQP_HEADER = new byte[]{(byte)'A',(byte)'M',(byte)'Q',(byte)'P'};
+ private static final byte[] AMQP_HEADER = new byte[]{(byte)'A',(byte)'M',(byte)'Q',(byte)'P'};
private static final byte CURRENT_PROTOCOL_CLASS = 1;
private static final byte TCP_PROTOCOL_INSTANCE = 1;
@@ -124,6 +125,17 @@ public class ProtocolInitiation extends
_protocolMinor == pi._protocolMinor);
}
+ @Override
+ public int hashCode()
+ {
+ int result = _protocolHeader != null ? Arrays.hashCode(_protocolHeader) : 0;
+ result = 31 * result + (int) _protocolClass;
+ result = 31 * result + (int) _protocolInstance;
+ result = 31 * result + (int) _protocolMajor;
+ result = 31 * result + (int) _protocolMinor;
+ return result;
+ }
+
public static class Decoder //implements MessageDecoder
{
/**
Modified: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/messaging/util/Lexicon.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/messaging/util/Lexicon.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/messaging/util/Lexicon.java (original)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/messaging/util/Lexicon.java Sun Sep 12 22:40:40 2010
@@ -58,30 +58,30 @@ public class Lexicon
public Lexer compile()
{
- String joined = "";
+ StringBuilder joined = new StringBuilder();
for (Token.Type t : types)
{
if (joined.length() > 0)
{
- joined += "|";
+ joined.append('|');
}
- joined += "(" + t.getPattern() + ")";
+ joined.append('(').append(t.getPattern()).append(')');
}
- Pattern rexp = Pattern.compile(joined);
+ Pattern rexp = Pattern.compile(joined.toString());
return new Lexer(new ArrayList<Token.Type>(types), eof, rexp);
}
public static final void main(String[] args)
{
- String input = "";
+ StringBuilder input = new StringBuilder();
for (String a : args)
{
if (input.length() > 0)
{
- input += " ";
+ input.append(" ");
}
- input += a;
+ input.append(a);
}
Lexicon lxi = new Lexicon();
@@ -94,7 +94,7 @@ public class Lexicon
lxi.eof("EOF");
Lexer lx = lxi.compile();
- for (Token t : lx.lex(input))
+ for (Token t : lx.lex(input.toString()))
{
System.out.println(t);
}
Modified: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/ClientDelegate.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/ClientDelegate.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/ClientDelegate.java (original)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/ClientDelegate.java Sun Sep 12 22:40:40 2010
@@ -52,14 +52,21 @@ public class ClientDelegate extends Conn
private static final Logger log = Logger.get(ClientDelegate.class);
private static final String KRB5_OID_STR = "1.2.840.113554.1.2.2";
- protected static Oid KRB5_OID;
+ protected static final Oid KRB5_OID;
static
{
+ Oid oid;
try
{
- KRB5_OID = new Oid(KRB5_OID_STR);
- } catch (GSSException ignore) {}
+ oid = new Oid(KRB5_OID_STR);
+ }
+ catch (GSSException ignore)
+ {
+ oid = null;
+ }
+
+ KRB5_OID = oid;
}
private List<String> clientMechs;
Modified: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Connection.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Connection.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Connection.java (original)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Connection.java Sun Sep 12 22:40:40 2010
@@ -61,7 +61,7 @@ public class Connection extends Connecti
public enum State { NEW, CLOSED, OPENING, OPEN, CLOSING, CLOSE_RCVD }
- class DefaultConnectionListener implements ConnectionListener
+ static class DefaultConnectionListener implements ConnectionListener
{
public void opened(Connection conn) {}
public void exception(Connection conn, ConnectionException exception)
Modified: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Session.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Session.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Session.java (original)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Session.java Sun Sep 12 22:40:40 2010
@@ -60,7 +60,7 @@ public class Session extends SessionInvo
enum State { NEW, DETACHED, RESUMING, OPEN, CLOSING, CLOSED }
- class DefaultSessionListener implements SessionListener
+ static class DefaultSessionListener implements SessionListener
{
public void opened(Session ssn) {}
Modified: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/TransportBuilder.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/TransportBuilder.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/TransportBuilder.java (original)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/TransportBuilder.java Sun Sep 12 22:40:40 2010
@@ -61,8 +61,6 @@ public class TransportBuilder
public void buildReceiverPipe(Receiver<ProtocolEvent> delegate)
{
- ConnectionSettings settings = con.getConnectionSettings();
-
Receiver<ByteBuffer> receiver = new InputHandler(new Assembler(delegate));
// Security layer
Modified: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/sasl/SASLReceiver.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/sasl/SASLReceiver.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/sasl/SASLReceiver.java (original)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/sasl/SASLReceiver.java Sun Sep 12 22:40:40 2010
@@ -41,20 +41,18 @@ public class SASLReceiver extends SASLEn
this.delegate = delegate;
}
- @Override
public void closed()
{
delegate.closed();
}
- @Override
+
public void exception(Throwable t)
{
- delegate.equals(t);
+ delegate.exception(t);
}
- @Override
- public void received(ByteBuffer buf)
+ public void received(ByteBuffer buf)
{
if (isSecurityLayerEstablished())
{
Modified: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLSender.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLSender.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLSender.java (original)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLSender.java Sun Sep 12 22:40:40 2010
@@ -82,9 +82,10 @@ public class SSLSender implements Sender
throw new SenderException("Error closing SSL connection",e);
}
- while (!engine.isOutboundDone())
+
+ synchronized(engineState)
{
- synchronized(engineState)
+ while (!engine.isOutboundDone())
{
try
{
@@ -94,6 +95,7 @@ public class SSLSender implements Sender
{
// pass
}
+
}
}
delegate.close();
Modified: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/url/AMQBindingURL.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/url/AMQBindingURL.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/url/AMQBindingURL.java (original)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/url/AMQBindingURL.java Sun Sep 12 22:40:40 2010
@@ -55,7 +55,8 @@ public class AMQBindingURL implements Bi
private void parseBindingURL() throws URISyntaxException
{
- BindingURLParser parser = new BindingURLParser(_url,this);
+ BindingURLParser parser = new BindingURLParser();
+ parser.parse(_url,this);
processOptions();
_logger.debug("URL Parsed: " + this);
}
Modified: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/url/BindingURLParser.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/url/BindingURLParser.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/url/BindingURLParser.java (original)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/url/BindingURLParser.java Sun Sep 12 22:40:40 2010
@@ -52,15 +52,24 @@ public class BindingURLParser
private String _error;
private int _index = 0;
private String _currentPropName;
- private Map<String,Object> _options = new HashMap<String,Object>();
+ private Map<String,Object> _options;
+
+
+ public BindingURLParser()
+ {
+ }
//<exch_class>://<exch_name>/[<destination>]/[<queue>]?<option>='<value>'[,<option>='<value>']*
- public BindingURLParser(String url,AMQBindingURL bindingURL) throws URISyntaxException
+ public synchronized void parse(String url,AMQBindingURL bindingURL) throws URISyntaxException
{
_url = (url + END_OF_URL_MARKER_CHAR).toCharArray();
_bindingURL = bindingURL;
_currentParserState = BindingURLParserState.BINDING_URL_START;
BindingURLParserState prevState = _currentParserState;
+ _index = 0;
+ _currentPropName = null;
+ _error = null;
+ _options = new HashMap<String,Object>();
try
{
@@ -432,6 +441,7 @@ public class BindingURLParser
public static void main(String[] args)
{
+
String[] urls = new String[]
{
"topic://amq.topic//myTopic?routingkey='stocks.#'",
@@ -447,11 +457,13 @@ public class BindingURLParser
try
{
+ BindingURLParser parser = new BindingURLParser();
+
for (String url: urls)
{
System.out.println("URL " + url);
AMQBindingURL bindingURL = new AMQBindingURL(url);
- BindingURLParser parser = new BindingURLParser(url,bindingURL);
+ parser.parse(url,bindingURL);
System.out.println("\nX " + bindingURL.toString() + " \n");
}
Modified: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/url/URLHelper.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/url/URLHelper.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/url/URLHelper.java (original)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/url/URLHelper.java Sun Sep 12 22:40:40 2010
@@ -25,9 +25,9 @@ import java.util.Map;
public class URLHelper
{
- public static char DEFAULT_OPTION_SEPERATOR = '&';
- public static char ALTERNATIVE_OPTION_SEPARATOR = ',';
- public static char BROKER_SEPARATOR = ';';
+ public static final char DEFAULT_OPTION_SEPERATOR = '&';
+ public static final char ALTERNATIVE_OPTION_SEPARATOR = ',';
+ public static final char BROKER_SEPARATOR = ';';
public static void parseOptions(Map<String, String> optionMap, String options) throws URLSyntaxException
{
Modified: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/util/CommandLineParser.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/util/CommandLineParser.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/util/CommandLineParser.java (original)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/util/CommandLineParser.java Sun Sep 12 22:40:40 2010
@@ -160,14 +160,14 @@ public class CommandLineParser
}
// Concatenate all the parsing errors together.
- String result = "";
+ StringBuilder result = new StringBuilder();
for (String s : parsingErrors)
{
- result += s;
+ result.append(s);
}
- return result;
+ return result.toString();
}
/**
@@ -184,14 +184,17 @@ public class CommandLineParser
}
// List all the properties.
- String result = "Options in force:\n";
+ StringBuilder result = new StringBuilder("Options in force:\n");
for (Map.Entry<Object, Object> property : parsedProperties.entrySet())
{
- result += property.getKey() + " = " + property.getValue() + "\n";
+ result.append(property.getKey())
+ .append(" = ")
+ .append(property.getValue())
+ .append('\n');
}
- return result;
+ return result.toString();
}
/**
@@ -257,7 +260,7 @@ public class CommandLineParser
boolean ignore = false;
// Create the regular expression matcher for the command line options.
- String regexp = "^(";
+ StringBuilder regexp = new StringBuilder("^(");
int optionsAdded = 0;
for (Iterator<String> i = optionMap.keySet().iterator(); i.hasNext();)
@@ -279,15 +282,18 @@ public class CommandLineParser
// Add the option to the regular expression matcher if it is not a free argument definition.
if (notFree)
{
- regexp += nextOption + (i.hasNext() ? "|" : "");
+ regexp.append(nextOption)
+ .append(i.hasNext() ? "|" : "");
optionsAdded++;
}
}
// There has to be more that one option in the regular expression or else the compiler complains that the close
// cannot be nullable if the '?' token is used to make the matched option string optional.
- regexp += ")" + ((optionsAdded > 0) ? "?" : "") + "(.*)";
- Pattern pattern = Pattern.compile(regexp);
+ regexp.append(')')
+ .append(((optionsAdded > 0) ? "?" : ""))
+ .append("(.*)");
+ Pattern pattern = Pattern.compile(regexp.toString());
// Loop through all the command line arguments.
for (int i = 0; i < args.length; i++)
@@ -645,7 +651,7 @@ public class CommandLineParser
* <tr><td> Hold details of a command line option.
* </table>
*/
- protected class CommandLineOption
+ protected static class CommandLineOption
{
/** Holds the text for the flag to match this argument with. */
public String option = null;
Modified: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/util/FileUtils.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/util/FileUtils.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/util/FileUtils.java (original)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/util/FileUtils.java Sun Sep 12 22:40:40 2010
@@ -215,23 +215,34 @@ public class FileUtils
public static void copyCheckedEx(File src, File dst) throws IOException
{
InputStream in = new FileInputStream(src);
- if (!dst.exists())
+ try
{
- dst.createNewFile();
- }
-
- OutputStream out = new FileOutputStream(dst);
+ if (!dst.exists())
+ {
+ dst.createNewFile();
+ }
- // Transfer bytes from in to out
- byte[] buf = new byte[1024];
- int len;
- while ((len = in.read(buf)) > 0)
+ OutputStream out = new FileOutputStream(dst);
+
+ try
+ {
+ // Transfer bytes from in to out
+ byte[] buf = new byte[1024];
+ int len;
+ while ((len = in.read(buf)) > 0)
+ {
+ out.write(buf, 0, len);
+ }
+ }
+ finally
+ {
+ out.close();
+ }
+ }
+ finally
{
- out.write(buf, 0, len);
+ in.close();
}
-
- in.close();
- out.close();
}
/*
Modified: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/util/PrettyPrintingUtils.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/util/PrettyPrintingUtils.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/util/PrettyPrintingUtils.java (original)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/util/PrettyPrintingUtils.java Sun Sep 12 22:40:40 2010
@@ -40,16 +40,16 @@ public class PrettyPrintingUtils
*/
public static String printArray(int[] array)
{
- String result = "[";
+ StringBuilder result = new StringBuilder("[");
for (int i = 0; i < array.length; i++)
{
- result += array[i];
- result += (i < (array.length - 1)) ? ", " : "";
+ result.append(array[i])
+ .append((i < (array.length - 1)) ? ", " : "");
}
- result += "]";
+ result.append(']');
- return result;
+ return result.toString();
}
/**
Modified: qpid/trunk/qpid/java/common/templates/method/version/MethodBodyClass.vm
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/templates/method/version/MethodBodyClass.vm?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/common/templates/method/version/MethodBodyClass.vm (original)
+++ qpid/trunk/qpid/java/common/templates/method/version/MethodBodyClass.vm Sun Sep 12 22:40:40 2010
@@ -70,9 +70,9 @@ public class ${javaClassName} extends AM
return FACTORY_INSTANCE;
}
- public static int CLASS_ID = $clazz.ClassId;
+ public static final int CLASS_ID = $clazz.ClassId;
- public static int METHOD_ID = $method.MethodId;
+ public static final int METHOD_ID = $method.MethodId;
@@ -196,7 +196,11 @@ public class ${javaClassName} extends AM
StringBuilder buf = new StringBuilder("[$javaClassName: ");
#foreach( $field in $method.FieldList )
buf.append( "$field.Name=" );
- buf.append( get#toUpperCamel( $field.Name )() );
+#if( $field.NativeType == "byte[]" )
+ buf.append( get#toUpperCamel( $field.Name )() == null ? "null" : java.util.Arrays.toString( get#toUpperCamel( $field.Name )() ) );
+#else
+ buf.append( get#toUpperCamel( $field.Name )() );
+#end
#if( $velocityCount != $method.FieldList.size() )
buf.append( ", " );
#end
Modified: qpid/trunk/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/AsymptoticTestDecorator.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/AsymptoticTestDecorator.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/AsymptoticTestDecorator.java (original)
+++ qpid/trunk/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/AsymptoticTestDecorator.java Sun Sep 12 22:40:40 2010
@@ -136,24 +136,27 @@ public class AsymptoticTestDecorator ext
log.debug("params = " + ((params == null) ? null : MathUtils.printArray(params)));
log.debug("repeat = " + repeat);
- for (int n : params)
+ if(params != null)
{
- for (int j = 0; j < repeat; j++)
+ for (int n : params)
{
- log.debug("n = " + n);
+ for (int j = 0; j < repeat; j++)
+ {
+ log.debug("n = " + n);
- // Set the integer parameter in the TKTestResult to be passed to the tests.
- tkResult.setN(n);
+ // Set the integer parameter in the TKTestResult to be passed to the tests.
+ tkResult.setN(n);
- if (tkResult.shouldStop())
- {
- log.debug("tkResult.shouldStop = " + true);
+ if (tkResult.shouldStop())
+ {
+ log.debug("tkResult.shouldStop = " + true);
- break;
- }
+ break;
+ }
- log.debug("Calling super#run");
- super.run(tkResult);
+ log.debug("Calling super#run");
+ super.run(tkResult);
+ }
}
}
}
Modified: qpid/trunk/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/ParameterVariationTestDecorator.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/ParameterVariationTestDecorator.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/ParameterVariationTestDecorator.java (original)
+++ qpid/trunk/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/ParameterVariationTestDecorator.java Sun Sep 12 22:40:40 2010
@@ -138,24 +138,27 @@ public class ParameterVariationTestDecor
log.debug("params = " + ((params == null) ? null : MathUtils.printArray(params)));
log.debug("repeat = " + repeat);
- for (int n : params)
+ if(params != null)
{
- for (int j = 0; j < repeat; j++)
+ for (int n : params)
{
- log.debug("n = " + n);
+ for (int j = 0; j < repeat; j++)
+ {
+ log.debug("n = " + n);
- // Set the integer parameter in the TKTestResult to be passed to the tests.
- tkResult.setN(n);
+ // Set the integer parameter in the TKTestResult to be passed to the tests.
+ tkResult.setN(n);
- if (tkResult.shouldStop())
- {
- log.debug("tkResult.shouldStop = " + true);
+ if (tkResult.shouldStop())
+ {
+ log.debug("tkResult.shouldStop = " + true);
- break;
- }
+ break;
+ }
- log.debug("Calling super#run");
- super.run(tkResult);
+ log.debug("Calling super#run");
+ super.run(tkResult);
+ }
}
}
}
Modified: qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/Names.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/Names.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/Names.java (original)
+++ qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/Names.java Sun Sep 12 22:40:40 2010
@@ -28,39 +28,39 @@ import javax.xml.namespace.QName;
*/
public abstract class Names
{
- public static String MANAGEMENT_EXCHANGE = "qpid.management";
- public static String MANAGEMENT_ROUTING_KEY = "console.#";
+ public static final String MANAGEMENT_EXCHANGE = "qpid.management";
+ public static final String MANAGEMENT_ROUTING_KEY = "console.#";
- public static String MANAGEMENT_QUEUE_PREFIX = "management.";
- public static String METHOD_REPLY_QUEUE_PREFIX = "reply.";
+ public static final String MANAGEMENT_QUEUE_PREFIX = "management.";
+ public static final String METHOD_REPLY_QUEUE_PREFIX = "reply.";
- public static String AMQ_DIRECT_QUEUE = "amq.direct";
- public static String AGENT_ROUTING_KEY_PREFIX = "agent.";
- public static String AGENT_ROUTING_KEY = AGENT_ROUTING_KEY_PREFIX+"1.0";
+ public static final String AMQ_DIRECT_QUEUE = "amq.direct";
+ public static final String AGENT_ROUTING_KEY_PREFIX = "agent.";
+ public static final String AGENT_ROUTING_KEY = AGENT_ROUTING_KEY_PREFIX+"1.0";
- public static String APPLICATION_NAME ="Q-Man";
+ public static final String APPLICATION_NAME ="Q-Man";
// Attributes
- public static String PACKAGE = "package";
- public static String CLASS = "class";
- public static String EVENT = "event";
- public static String OBJECT_ID="objectId";
- public static String BROKER_ID = "brokerId";
- public static String DOMAIN_NAME = "Q-MAN";
+ public static final String PACKAGE = "package";
+ public static final String CLASS = "class";
+ public static final String EVENT = "event";
+ public static final String OBJECT_ID="objectId";
+ public static final String BROKER_ID = "brokerId";
+ public static final String DOMAIN_NAME = "Q-MAN";
- public static String ARG_COUNT_PARAM_NAME = "argCount";
- public static String DEFAULT_PARAM_NAME ="default";
+ public static final String ARG_COUNT_PARAM_NAME = "argCount";
+ public static final String DEFAULT_PARAM_NAME ="default";
- public static String NUMBER_VALIDATOR = "org.apache.qpid.management.domain.model.QpidProperty$NumberValidator";
- public static String STRING_VALIDATOR = "org.apache.qpid.management.domain.model.QpidProperty$StringValidator";
+ public static final String NUMBER_VALIDATOR = "org.apache.qpid.management.domain.model.QpidProperty$NumberValidator";
+ public static final String STRING_VALIDATOR = "org.apache.qpid.management.domain.model.QpidProperty$StringValidator";
- public static String QMAN_CONFIG_OPTION_NAME = "qman-config";
+ public static final String QMAN_CONFIG_OPTION_NAME = "qman-config";
- public static String ADD_BROKER_OPERATION_NAME = "addBroker";
+ public static final String ADD_BROKER_OPERATION_NAME = "addBroker";
- public static String NOT_AVAILABLE = "N.A.";
+ public static final String NOT_AVAILABLE = "N.A.";
- public static ObjectName QPID_EMULATOR_OBJECT_NAME;
+ public static final ObjectName QPID_EMULATOR_OBJECT_NAME;
static
{
try
@@ -77,7 +77,7 @@ public abstract class Names
}
}
- public static ObjectName QMAN_OBJECT_NAME;
+ public static final ObjectName QMAN_OBJECT_NAME;
static
{
try
@@ -95,11 +95,11 @@ public abstract class Names
}
// WSDM Stuff
- public static String NAMESPACE_URI = "http://amqp.apache.org/qpid/management/qman";
+ public static final String NAMESPACE_URI = "http://amqp.apache.org/qpid/management/qman";
public final static String PREFIX = "qman";
- public static String ADDRESSING_URI = "http://amqp.apache.org/qpid/management/qman/addressing";
- public static String ADDRESSING_PREFIX = "qman-wsa";
+ public static final String ADDRESSING_URI = "http://amqp.apache.org/qpid/management/qman/addressing";
+ public static final String ADDRESSING_PREFIX = "qman-wsa";
public static final QName RESOURCE_ID_QNAME = new QName(
ADDRESSING_URI,
Modified: qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/BrokerConnectionData.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/BrokerConnectionData.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/BrokerConnectionData.java (original)
+++ qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/BrokerConnectionData.java Sun Sep 12 22:40:40 2010
@@ -251,16 +251,26 @@ public class BrokerConnectionData
}
@Override
- public boolean equals(Object object) {
- try
- {
- BrokerConnectionData connectionData = (BrokerConnectionData) object;
- return (_host.equals(connectionData._host) )
- && (_port == connectionData._port)
- && (_virtualHost.equals(connectionData._virtualHost));
- } catch (Exception exception) {
- return false;
- }
+ public boolean equals(Object object)
+ {
+ if(object instanceof BrokerConnectionData)
+ {
+ try
+ {
+ BrokerConnectionData connectionData = (BrokerConnectionData) object;
+ return (_host.equals(connectionData._host) )
+ && (_port == connectionData._port)
+ && (_virtualHost.equals(connectionData._virtualHost));
+ }
+ catch (Exception exception)
+ {
+ return false;
+ }
+ }
+ else
+ {
+ return false;
+ }
}
@Override
Modified: qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/Configuration.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/Configuration.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/Configuration.java (original)
+++ qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/Configuration.java Sun Sep 12 22:40:40 2010
@@ -88,10 +88,6 @@ public final class Configuration
addTypeMappings();
}
- void clean()
- {
- INSTANCE = new Configuration();
- }
/**
* Returns the singleton instance.
Modified: qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/WorkerManagerConfigurationParser.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/WorkerManagerConfigurationParser.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/WorkerManagerConfigurationParser.java (original)
+++ qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/WorkerManagerConfigurationParser.java Sun Sep 12 22:40:40 2010
@@ -71,6 +71,7 @@ class WorkerManagerConfigurationParser i
case MAX_POOL_CAPACITY :
{
_maxPoolSizeAsString = _currentValue;
+ break;
}
case KEEP_ALIVE_TIME:
{
Modified: qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidPackage.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidPackage.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidPackage.java (original)
+++ qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidPackage.java Sun Sep 12 22:40:40 2010
@@ -71,8 +71,15 @@ final class QpidPackage
@Override
public boolean equals (Object obj)
{
- QpidClassIdentity identity = (QpidClassIdentity) obj;
- return name.equals(identity.name) && hash.equals(identity.hash);
+ if(obj instanceof QpidClassIdentity)
+ {
+ QpidClassIdentity identity = (QpidClassIdentity) obj;
+ return name.equals(identity.name) && hash.equals(identity.hash);
+ }
+ else
+ {
+ return false;
+ }
}
}
Modified: qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Binary.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Binary.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Binary.java (original)
+++ qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Binary.java Sun Sep 12 22:40:40 2010
@@ -102,11 +102,18 @@ public final class Binary implements Ser
@Override
public boolean equals (Object obj)
{
- try
+ if(obj instanceof Binary)
{
- Binary binary = (Binary)obj;
- return Arrays.equals(_bytes, binary._bytes);
- } catch (Exception exception)
+ try
+ {
+ Binary binary = (Binary)obj;
+ return Arrays.equals(_bytes, binary._bytes);
+ } catch (Exception exception)
+ {
+ return false;
+ }
+ }
+ else
{
return false;
}
Modified: qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Type.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Type.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Type.java (original)
+++ qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Type.java Sun Sep 12 22:40:40 2010
@@ -82,13 +82,13 @@ public abstract class Type
@Override
public boolean equals (Object obj)
{
- return getClass() == obj.getClass();
+ return (obj instanceof Type) && getJavaType() == ((Type)obj).getJavaType();
}
@Override
public int hashCode ()
{
- return getClass().hashCode();
+ return getJavaType().hashCode();
}
/**
Modified: qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedQueue.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedQueue.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedQueue.java (original)
+++ qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedQueue.java Sun Sep 12 22:40:40 2010
@@ -21,6 +21,7 @@
package org.apache.qpid.management.common.mbeans;
import java.io.IOException;
+import java.util.*;
import javax.management.JMException;
import javax.management.MBeanOperationInfo;
@@ -54,45 +55,48 @@ public interface ManagedQueue
String[] VIEW_MSG_CONTENT_COMPOSITE_ITEM_DESCRIPTIONS = { "AMQ MessageId", "MimeType", "Encoding", "Content" };
//Individual attribute name constants
- String ATTR_NAME = "Name";
- String ATTR_OWNER = "Owner";
- String ATTR_MAX_MSG_AGE = "MaximumMessageAge";
- String ATTR_MAX_MSG_COUNT = "MaximumMessageCount";
- String ATTR_MAX_QUEUE_DEPTH = "MaximumQueueDepth";
- String ATTR_MAX_MSG_SIZE = "MaximumMessageSize";
- String ATTR_DURABLE = "Durable";
- String ATTR_AUTODELETE = "AutoDelete";
- String ATTR_CONSUMER_COUNT = "ConsumerCount";
- String ATTR_ACTIVE_CONSUMER_COUNT = "ActiveConsumerCount";
- String ATTR_MSG_COUNT = "MessageCount";
- String ATTR_QUEUE_DEPTH = "QueueDepth";
- String ATTR_RCVD_MSG_COUNT = "ReceivedMessageCount";
- String ATTR_CAPACITY = "Capacity";
- String ATTR_FLOW_OVERFULL = "FlowOverfull";
- String ATTR_FLOW_RESUME_CAPACITY = "FlowResumeCapacity";
- String ATTR_EXCLUSIVE = "Exclusive";
+ static final String ATTR_NAME = "Name";
+ static final String ATTR_OWNER = "Owner";
+ static final String ATTR_MAX_MSG_AGE = "MaximumMessageAge";
+ static final String ATTR_MAX_MSG_COUNT = "MaximumMessageCount";
+ static final String ATTR_MAX_QUEUE_DEPTH = "MaximumQueueDepth";
+ static final String ATTR_MAX_MSG_SIZE = "MaximumMessageSize";
+ static final String ATTR_DURABLE = "Durable";
+ static final String ATTR_AUTODELETE = "AutoDelete";
+ static final String ATTR_CONSUMER_COUNT = "ConsumerCount";
+ static final String ATTR_ACTIVE_CONSUMER_COUNT = "ActiveConsumerCount";
+ static final String ATTR_MSG_COUNT = "MessageCount";
+ static final String ATTR_QUEUE_DEPTH = "QueueDepth";
+ static final String ATTR_RCVD_MSG_COUNT = "ReceivedMessageCount";
+ static final String ATTR_CAPACITY = "Capacity";
+ static final String ATTR_FLOW_OVERFULL = "FlowOverfull";
+ static final String ATTR_FLOW_RESUME_CAPACITY = "FlowResumeCapacity";
+ static final String ATTR_EXCLUSIVE = "Exclusive";
//All attribute names constant
- String[] QUEUE_ATTRIBUTES = new String[]{
- ATTR_NAME,
- ATTR_OWNER,
- ATTR_MAX_MSG_AGE,
- ATTR_MAX_MSG_COUNT,
- ATTR_MAX_QUEUE_DEPTH,
- ATTR_MAX_MSG_SIZE,
- ATTR_DURABLE,
- ATTR_AUTODELETE,
- ATTR_CONSUMER_COUNT,
- ATTR_ACTIVE_CONSUMER_COUNT,
- ATTR_MSG_COUNT,
- ATTR_QUEUE_DEPTH,
- ATTR_RCVD_MSG_COUNT,
- ATTR_CAPACITY,
- ATTR_FLOW_OVERFULL,
- ATTR_FLOW_RESUME_CAPACITY,
- ATTR_EXCLUSIVE
- };
-
+ static final List<String> QUEUE_ATTRIBUTES
+ = Collections.unmodifiableList(
+ new ArrayList<String>(
+ new HashSet<String>(
+ Arrays.asList(
+ ATTR_NAME,
+ ATTR_OWNER,
+ ATTR_MAX_MSG_AGE,
+ ATTR_MAX_MSG_COUNT,
+ ATTR_MAX_QUEUE_DEPTH,
+ ATTR_MAX_MSG_SIZE,
+ ATTR_DURABLE,
+ ATTR_AUTODELETE,
+ ATTR_CONSUMER_COUNT,
+ ATTR_ACTIVE_CONSUMER_COUNT,
+ ATTR_MSG_COUNT,
+ ATTR_QUEUE_DEPTH,
+ ATTR_RCVD_MSG_COUNT,
+ ATTR_CAPACITY,
+ ATTR_FLOW_OVERFULL,
+ ATTR_FLOW_RESUME_CAPACITY,
+ ATTR_EXCLUSIVE))));
+
/**
* Returns the Name of the ManagedQueue.
* @return the name of the managedQueue.
Modified: qpid/trunk/qpid/java/management/common/src/test/java/org/apache/qpid/management/common/mbeans/ManagedQueueTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/common/src/test/java/org/apache/qpid/management/common/mbeans/ManagedQueueTest.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/common/src/test/java/org/apache/qpid/management/common/mbeans/ManagedQueueTest.java (original)
+++ qpid/trunk/qpid/java/management/common/src/test/java/org/apache/qpid/management/common/mbeans/ManagedQueueTest.java Sun Sep 12 22:40:40 2010
@@ -48,12 +48,8 @@ public class ManagedQueueTest extends Te
{
StandardMBean mbean = new StandardMBean(impl, ManagedQueue.class);
- List<String> attributeList = new ArrayList<String>();
- for(String attr : ManagedQueue.QUEUE_ATTRIBUTES)
- {
- attributeList.add(attr);
- }
-
+ List<String> attributeList = ManagedQueue.QUEUE_ATTRIBUTES;
+
//retrieve the attributes from the constructed MBeanInfo
MBeanAttributeInfo[] attributes = mbean.getMBeanInfo().getAttributes();
Modified: qpid/trunk/qpid/java/management/console/src/main/java/org/apache/qpid/console/Session.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/console/src/main/java/org/apache/qpid/console/Session.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/console/src/main/java/org/apache/qpid/console/Session.java (original)
+++ qpid/trunk/qpid/java/management/console/src/main/java/org/apache/qpid/console/Session.java Sun Sep 12 22:40:40 2010
@@ -477,7 +477,7 @@ public class Session
Object sClass = args.get("_schema");
Object oid = args.get("_objectID");
long[] hash = (long[]) args.get("_hash");
- if ((className == null) && (oid == null) && (oid == null))
+ if ((className == null) && (oid == null))
{
throw new ConsoleException(
"No class supplied, use '_schema', '_key', '_class', or '_objectId' argument");
Modified: qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ServerRegistry.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ServerRegistry.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ServerRegistry.java (original)
+++ qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ServerRegistry.java Sun Sep 12 22:40:40 2010
@@ -135,7 +135,7 @@ public abstract class ServerRegistry
protected void removeVirtualHostManagerMBean(ManagedBean mbean)
{
- _vhostManagers.remove(mbean);
+ _vhostManagers.remove(mbean.getVirtualHostName());
}
public ManagedBean getVirtualHostManagerMBean(String virtualHost)
Modified: qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ViewUtility.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ViewUtility.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ViewUtility.java (original)
+++ qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ViewUtility.java Sun Sep 12 22:40:40 2010
@@ -271,7 +271,7 @@ public class ViewUtility
List objectData = (List)compositeHolder.getData();
if (objectData == null || objectData.isEmpty())
{
- // TODO
+ // TODO
}
// Get the index of record to be shown.
Modified: qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/QueueTypeTabControl.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/QueueTypeTabControl.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/QueueTypeTabControl.java (original)
+++ qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/QueueTypeTabControl.java Sun Sep 12 22:40:40 2010
@@ -650,7 +650,6 @@ public class QueueTypeTabControl extends
private class QueueLabelProviderImpl extends LabelProvider implements ITableLabelProvider
{
@SuppressWarnings("unchecked")
- @Override
public String getColumnText(Object element, int columnIndex)
{
List<Object> attributes = (List<Object>) element;
@@ -677,8 +676,7 @@ public class QueueTypeTabControl extends
return String.valueOf(attributes.get(columnIndex));
}
}
-
- @Override
+
public Image getColumnImage(Object element, int columnIndex)
{
return null;
Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/ReportGenerator.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/ReportGenerator.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/ReportGenerator.java (original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/ReportGenerator.java Sun Sep 12 22:40:40 2010
@@ -48,7 +48,7 @@ public class ReportGenerator implements
generatereport();
try
{
- Thread.sleep(this.interval * 60000);
+ Thread.sleep((long)this.interval * 60000L);
}
catch (Exception ex)
{
Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandget.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandget.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandget.java (original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandget.java Sun Sep 12 22:40:40 2010
@@ -34,7 +34,7 @@ public class Commandget extends CommandI
private String _attributeName;
private String _value;
- public static String COMMAND_NAME = "get";
+ public static final String COMMAND_NAME = "get";
public Commandget(JMXinfo info)
{
Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandset.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandset.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandset.java (original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandset.java Sun Sep 12 22:40:40 2010
@@ -34,7 +34,7 @@ public class Commandset extends CommandI
{
private String _attributeName;
private String _value;
- public static String COMMAND_NAME = "set";
+ public static final String COMMAND_NAME = "set";
public Commandset(JMXinfo info)
{
Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandview.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandview.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandview.java (original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandview.java Sun Sep 12 22:40:40 2010
@@ -58,10 +58,8 @@ public class Commandview extends Command
public void viewmessages()
{
- Set set = null;
- Object temp[] = { null };
objname.setQueryString(this.getObject(), this.getName(), this.getVirtualhost());
- set = objname.returnObjects();
+ Set set = objname.returnObjects();
String header = "", temp_header = "", message_data = "", outline = "";
if (objname.getSet().size() != 0)
Modified: qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandviewcontent.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandviewcontent.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandviewcontent.java (original)
+++ qpid/trunk/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandviewcontent.java Sun Sep 12 22:40:40 2010
@@ -56,10 +56,8 @@ public class Commandviewcontent extends
public void viewcontent()
{
- Set set = null;
- Object temp[] = { null };
objname.setQueryString(getObject(), getName(), getVirtualhost());
- set = objname.returnObjects();
+ Set set = objname.returnObjects();
String temp_header = "", header = "", message_data = "", encoding = null;
if (objname.getSet().size() != 0)
Modified: qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingSendOnlyClient.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingSendOnlyClient.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingSendOnlyClient.java (original)
+++ qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingSendOnlyClient.java Sun Sep 12 22:40:40 2010
@@ -67,7 +67,7 @@ public class PingSendOnlyClient extends
// pingProducer.getConnection().setExceptionListener(pingProducer);
// Run the test procedure.
- int sent = pingProducer.send();
+ pingProducer.send();
pingProducer.waitForUser("Press return to close connection and quit.");
pingProducer.closeConnection();
Modified: qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/test/testcases/MessageThroughputPerf.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/test/testcases/MessageThroughputPerf.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/test/testcases/MessageThroughputPerf.java (original)
+++ qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/test/testcases/MessageThroughputPerf.java Sun Sep 12 22:40:40 2010
@@ -126,7 +126,7 @@ public class MessageThroughputPerf exten
{
NDC.push(getName());
- testProps = TestContextProperties.getInstance(MessagingTestConfigProperties.defaults);
+ setTestProps(TestContextProperties.getInstance(MessagingTestConfigProperties.defaults));
}
/**
@@ -143,7 +143,7 @@ public class MessageThroughputPerf exten
public void threadSetUp()
{
// Run the test setup tasks. This may create an in-vm broker, if a decorator has injected a task for this.
- taskHandler.runSetupTasks();
+ getTaskHandler().runSetupTasks();
// Get the test parameters, any overrides on the command line will have been applied.
ParsedProperties testProps = TestContextProperties.getInstance(MessagingTestConfigProperties.defaults);
@@ -178,7 +178,7 @@ public class MessageThroughputPerf exten
public void threadTearDown()
{
// Run the test teardown tasks. This may destroy the in-vm broker, if a decorator has injected a task for this.
- taskHandler.runSetupTasks();
+ getTaskHandler().runSetupTasks();
}
/**
Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/DispatcherTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/DispatcherTest.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/DispatcherTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/DispatcherTest.java Sun Sep 12 22:40:40 2010
@@ -77,10 +77,6 @@ public class DispatcherTest extends Qpid
{
super.setUp();
- InitialContextFactory factory = new PropertiesFileInitialContextFactory();
-
- Hashtable<String, String> env = new Hashtable<String, String>();
-
// Create Client 1
_clientConnection = getConnection();
Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AbstractTestLogging.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AbstractTestLogging.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AbstractTestLogging.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AbstractTestLogging.java Sun Sep 12 22:40:40 2010
@@ -71,17 +71,17 @@ public class AbstractTestLogging extends
@Override
protected void createBroker() throws Exception
{
- _started = true;
+ setStarted(true);
CurrentActor.set(new TestLogActor(new SystemOutMessageLogger()));
// Prevent the InVM broker from logging and spoiling tests.
_serverConfiguration.getConfig().setProperty(ServerConfiguration.STATUS_UPDATES, "off");
- _configuration = _serverConfiguration;
- _registry = new TestApplicationRegistry(_configuration)
+ setConfiguration(_serverConfiguration);
+ setRegistry(new TestApplicationRegistry(getConfiguration())
{
/**
- * Create a virtualhost with a {@link SkeletonMessageStore} instead
+ * Create a virtualhost with a {@link org.apache.qpid.server.store.SkeletonMessageStore} instead
* of the configured one, but remember the original configuration.
*/
@Override
@@ -93,8 +93,8 @@ public class AbstractTestLogging extends
vhostConfig.setMessageStoreClass(oldClass);
return host;
}
- };
- ApplicationRegistry.initialise(_registry);
+ });
+ ApplicationRegistry.initialise(getRegistry());
}
Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AccessControlLoggingTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AccessControlLoggingTest.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AccessControlLoggingTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AccessControlLoggingTest.java Sun Sep 12 22:40:40 2010
@@ -55,7 +55,7 @@ public class AccessControlLoggingTest ex
super.setUp();
}
- /** FIXME This comes from {@link SimpleACLTest} and makes me suspicious. */
+ /** FIXME This comes from SimpleACLTest and makes me suspicious. */
@Override
public void tearDown() throws Exception
{
@@ -135,7 +135,7 @@ public class AccessControlLoggingTest ex
assertEquals("Should only be one ACL log message", 1, matches.size());
- String log = getLogMessage(matches, 0);;
+ String log = getLogMessage(matches, 0);
String actor = fromActor(log);
String subject = fromSubject(log);
String message = getMessageString(fromMessage(log));
Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java Sun Sep 12 22:40:40 2010
@@ -46,7 +46,7 @@ import org.apache.qpid.url.URLSyntaxExce
*
* These tests require an access control security plugin to be configured in the broker, and carry out various broker
* operations that will succeed or fail depending on the user and virtual host. See the {@code config-systests-acl-setup.xml}
- * configuration file for the {@link SimpleXML} version of the ACLs used by the Java broker only, or the various {@code .txt}
+ * configuration file for the SimpleXML version of the ACLs used by the Java broker only, or the various {@code .txt}
* files in the system tests directory for the external version 3 ACL files used by both the Java and C++ brokers.
* <p>
* This class can be extended and the {@link #getConfig()} method overridden to run the same tests with a different type
Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserAutoAckTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserAutoAckTest.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserAutoAckTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserAutoAckTest.java Sun Sep 12 22:40:40 2010
@@ -265,8 +265,8 @@ public class QueueBrowserAutoAckTest ext
protected void checkOverlappingMultipleGetEnum(int expectedMessages, int browserEnumerationCount, String selector) throws JMSException
{
QueueBrowser queueBrowser = selector == null ?
- _clientSession.createBrowser(_queue, selector) :
- _clientSession.createBrowser(_queue);
+ _clientSession.createBrowser(_queue) : _clientSession.createBrowser(_queue);
+// _clientSession.createBrowser(_queue) : _clientSession.createBrowser(_queue, selector);
Enumeration[] msgs = new Enumeration[browserEnumerationCount];
int[] msgCount = new int[browserEnumerationCount];
Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/failover/FailoverTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/failover/FailoverTest.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/failover/FailoverTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/failover/FailoverTest.java Sun Sep 12 22:40:40 2010
@@ -306,7 +306,7 @@ public class FailoverTest extends Failov
//Start the connection
connection.start();
- long FAILOVER_DELAY = (RETRIES * DELAY);
+ long FAILOVER_DELAY = ((long)RETRIES * (long)DELAY);
// Use Nano seconds as it is more accurate for comparision.
long failTime = System.nanoTime() + FAILOVER_DELAY * 1000000;
Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/FrameworkBaseCase.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/FrameworkBaseCase.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/FrameworkBaseCase.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/FrameworkBaseCase.java Sun Sep 12 22:40:40 2010
@@ -53,20 +53,15 @@ public class FrameworkBaseCase extends Q
/** Used for debugging purposes. */
private static final Logger log = Logger.getLogger(FrameworkBaseCase.class);
- /** Holds the test sequencer to create and run test circuits with. */
- protected CircuitFactory circuitFactory = new LocalAMQPCircuitFactory();
+ private CircuitFactory circuitFactory = new LocalAMQPCircuitFactory();
- /** Used to read the tests configurable properties through. */
- protected ParsedProperties testProps;
+ private ParsedProperties testProps;
- /** A default setup task processor to delegate setup tasks to. */
- protected SetupTaskHandler taskHandler = new SetupTaskHandler();
+ private SetupTaskHandler taskHandler = new SetupTaskHandler();
- /** Flag used to track whether the test is in-vm or not. */
- protected boolean isUsingInVM;
+ private boolean isUsingInVM;
- /** Holds the failure mechanism. */
- protected CauseFailure failureMechanism = new CauseFailureUserPrompt();
+ private CauseFailure failureMechanism = new CauseFailureUserPrompt();
/**
* Creates a new test case with the specified name.
@@ -78,7 +73,7 @@ public class FrameworkBaseCase extends Q
super(name);
}
- /**
+ /** Holds the test sequencer to create and run test circuits with. */ /**
* Returns the test case sequencer that provides test circuit, and test sequence implementations. The sequencer
* that this base case returns by default is suitable for running a test circuit with both circuit ends colocated
* on the same JVM.
@@ -283,4 +278,24 @@ public class FrameworkBaseCase extends Q
{
this.failureMechanism = failureMechanism;
}
+
+ protected ParsedProperties getTestProps()
+ {
+ return testProps;
+ }
+
+ protected void setTestProps(ParsedProperties testProps)
+ {
+ this.testProps = testProps;
+ }
+
+ protected SetupTaskHandler getTaskHandler()
+ {
+ return taskHandler;
+ }
+
+ protected CauseFailure getFailureMechanism()
+ {
+ return failureMechanism;
+ }
}
Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/LocalAMQPCircuitFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/LocalAMQPCircuitFactory.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/LocalAMQPCircuitFactory.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/LocalAMQPCircuitFactory.java Sun Sep 12 22:40:40 2010
@@ -75,7 +75,7 @@ public class LocalAMQPCircuitFactory ext
MessageProducer producer =
props.getPublisherProducerBind()
- ? ((props.getImmediate() | props.getMandatory())
+ ? ((props.getImmediate() || props.getMandatory())
? ((AMQSession) session).createProducer(destination, props.getMandatory(), props.getImmediate())
: session.createProducer(destination)) : null;
Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/FailoverTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/FailoverTest.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/FailoverTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/FailoverTest.java Sun Sep 12 22:40:40 2010
@@ -76,18 +76,18 @@ public class FailoverTest extends Framew
public void testTxP2PFailover() throws Exception
{
// Set up the test properties to match the test cases requirements.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, true);
- testProps.setProperty(ACK_MODE_PROPNAME, Session.AUTO_ACKNOWLEDGE);
- testProps.setProperty(PUBSUB_PROPNAME, false);
+ getTestProps().setProperty(TRANSACTED_PUBLISHER_PROPNAME, true);
+ getTestProps().setProperty(ACK_MODE_PROPNAME, Session.AUTO_ACKNOWLEDGE);
+ getTestProps().setProperty(PUBSUB_PROPNAME, false);
// MessagingTestConfigProperties props = this.getTestParameters();
// Create the test circuit from the test configuration parameters.
CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
+ Circuit testCircuit = circuitFactory.createCircuit(getConnection(), getTestProps());
// Create an assertion that all messages are received.
- Assertion allMessagesReceived = testCircuit.getReceiver().allMessagesReceivedAssertion(testProps);
+ Assertion allMessagesReceived = testCircuit.getReceiver().allMessagesReceivedAssertion(getTestProps());
// This test case assumes it is using a local circuit.
LocalCircuitImpl localCircuit = (LocalCircuitImpl) testCircuit;
@@ -105,7 +105,7 @@ public class FailoverTest extends Framew
// Cause a failover.
if (i == 50)
{
- failureMechanism.causeFailure();
+ getFailureMechanism().causeFailure();
}
// Wait for the reconnection to complete.
Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/ImmediateMessageTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/ImmediateMessageTest.java?rev=996393&r1=996392&r2=996393&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/ImmediateMessageTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/ImmediateMessageTest.java Sun Sep 12 22:40:40 2010
@@ -78,226 +78,226 @@ public class ImmediateMessageTest extend
public void test_QPID_517_ImmediateOkNoTxP2P() throws Exception
{
// Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, false);
- testProps.setProperty(PUBSUB_PROPNAME, false);
+ getTestProps().setProperty(TRANSACTED_PUBLISHER_PROPNAME, false);
+ getTestProps().setProperty(PUBSUB_PROPNAME, false);
// Run the default test sequence over the test circuit checking for no errors.
CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
+ Circuit testCircuit = circuitFactory.createCircuit(getConnection(), getTestProps());
- assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion(testProps))));
+ assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion(getTestProps()))));
}
/** Check that an immediate message is committed succesfully in a transaction when a consumer is connected. */
public void test_QPID_517_ImmediateOkTxP2P() throws Exception
{
// Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, true);
- testProps.setProperty(PUBSUB_PROPNAME, false);
+ getTestProps().setProperty(TRANSACTED_PUBLISHER_PROPNAME, true);
+ getTestProps().setProperty(PUBSUB_PROPNAME, false);
// Send one message with no errors.
CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
+ Circuit testCircuit = circuitFactory.createCircuit(getConnection(), getTestProps());
- assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion(testProps))));
+ assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion(getTestProps()))));
}
/** Check that an immediate message results in no consumers code, not using transactions, when a consumer is disconnected. */
public void test_QPID_517_ImmediateFailsConsumerDisconnectedNoTxP2P() throws Exception
{
// Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, false);
- testProps.setProperty(PUBSUB_PROPNAME, false);
+ getTestProps().setProperty(TRANSACTED_PUBLISHER_PROPNAME, false);
+ getTestProps().setProperty(PUBSUB_PROPNAME, false);
// Disconnect the consumer.
- testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false);
+ getTestProps().setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false);
CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
+ Circuit testCircuit = circuitFactory.createCircuit(getConnection(), getTestProps());
// Send one message and get a linked no consumers exception.
assertNoFailures(testCircuit.test(1,
- assertionList(((AMQPPublisher) testCircuit.getPublisher()).noConsumersAssertion(testProps))));
+ assertionList(((AMQPPublisher) testCircuit.getPublisher()).noConsumersAssertion(getTestProps()))));
}
/** Check that an immediate message results in no consumers code, in a transaction, when a consumer is disconnected. */
public void test_QPID_517_ImmediateFailsConsumerDisconnectedTxP2P() throws Exception
{
// Ensure transactional sessions are on.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, true);
- testProps.setProperty(PUBSUB_PROPNAME, false);
+ getTestProps().setProperty(TRANSACTED_PUBLISHER_PROPNAME, true);
+ getTestProps().setProperty(PUBSUB_PROPNAME, false);
// Disconnect the consumer.
- testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false);
+ getTestProps().setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false);
CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
+ Circuit testCircuit = circuitFactory.createCircuit(getConnection(), getTestProps());
// Send one message and get a linked no consumers exception.
assertNoFailures(testCircuit.test(1,
- assertionList(((AMQPPublisher) testCircuit.getPublisher()).noConsumersAssertion(testProps))));
+ assertionList(((AMQPPublisher) testCircuit.getPublisher()).noConsumersAssertion(getTestProps()))));
}
/** Check that an immediate message results in no route code, not using transactions, when no outgoing route is connected. */
public void test_QPID_517_ImmediateFailsNoRouteNoTxP2P() throws Exception
{
// Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, false);
- testProps.setProperty(PUBSUB_PROPNAME, false);
+ getTestProps().setProperty(TRANSACTED_PUBLISHER_PROPNAME, false);
+ getTestProps().setProperty(PUBSUB_PROPNAME, false);
// Set up the messaging topology so that only the publishers producer is bound (do not set up the receivers to
// collect its messages).
- testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false);
+ getTestProps().setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false);
// Send one message and get a linked no route exception.
CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
+ Circuit testCircuit = circuitFactory.createCircuit(getConnection(), getTestProps());
assertNoFailures(testCircuit.test(1,
- assertionList(((AMQPPublisher) testCircuit.getPublisher()).noRouteAssertion(testProps))));
+ assertionList(((AMQPPublisher) testCircuit.getPublisher()).noRouteAssertion(getTestProps()))));
}
/** Check that an immediate message results in no route code, upon transaction commit, when no outgoing route is connected. */
public void test_QPID_517_ImmediateFailsNoRouteTxP2P() throws Exception
{
// Ensure transactional sessions are on.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, true);
- testProps.setProperty(PUBSUB_PROPNAME, false);
+ getTestProps().setProperty(TRANSACTED_PUBLISHER_PROPNAME, true);
+ getTestProps().setProperty(PUBSUB_PROPNAME, false);
// Set up the messaging topology so that only the publishers producer is bound (do not set up the receivers to
// collect its messages).
- testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false);
+ getTestProps().setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false);
// Send one message and get a linked no route exception.
CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
+ Circuit testCircuit = circuitFactory.createCircuit(getConnection(), getTestProps());
assertNoFailures(testCircuit.test(1,
- assertionList(((AMQPPublisher) testCircuit.getPublisher()).noRouteAssertion(testProps))));
+ assertionList(((AMQPPublisher) testCircuit.getPublisher()).noRouteAssertion(getTestProps()))));
}
/** Check that an immediate message is sent succesfully not using transactions when a consumer is connected. */
public void test_QPID_517_ImmediateOkNoTxPubSub() throws Exception
{
// Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, false);
- testProps.setProperty(PUBSUB_PROPNAME, true);
+ getTestProps().setProperty(TRANSACTED_PUBLISHER_PROPNAME, false);
+ getTestProps().setProperty(PUBSUB_PROPNAME, true);
// Send one message with no errors.
CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
+ Circuit testCircuit = circuitFactory.createCircuit(getConnection(), getTestProps());
assertNoFailures(testCircuit.test(1,
- assertionList(((AMQPPublisher) testCircuit.getPublisher()).noExceptionsAssertion(testProps))));
+ assertionList(((AMQPPublisher) testCircuit.getPublisher()).noExceptionsAssertion(getTestProps()))));
}
/** Check that an immediate message is committed succesfully in a transaction when a consumer is connected. */
public void test_QPID_517_ImmediateOkTxPubSub() throws Exception
{
// Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, true);
- testProps.setProperty(PUBSUB_PROPNAME, true);
+ getTestProps().setProperty(TRANSACTED_PUBLISHER_PROPNAME, true);
+ getTestProps().setProperty(PUBSUB_PROPNAME, true);
// Send one message with no errors.
CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
+ Circuit testCircuit = circuitFactory.createCircuit(getConnection(), getTestProps());
assertNoFailures(testCircuit.test(1,
- assertionList(((AMQPPublisher) testCircuit.getPublisher()).noExceptionsAssertion(testProps))));
+ assertionList(((AMQPPublisher) testCircuit.getPublisher()).noExceptionsAssertion(getTestProps()))));
}
/** Check that an immediate message results in no consumers code, not using transactions, when a consumer is disconnected. */
public void test_QPID_517_ImmediateFailsConsumerDisconnectedNoTxPubSub() throws Exception
{
// Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, false);
- testProps.setProperty(PUBSUB_PROPNAME, true);
+ getTestProps().setProperty(TRANSACTED_PUBLISHER_PROPNAME, false);
+ getTestProps().setProperty(PUBSUB_PROPNAME, true);
// Use durable subscriptions, so that the route remains open with no subscribers.
- testProps.setProperty(DURABLE_SUBSCRIPTION_PROPNAME, true);
+ getTestProps().setProperty(DURABLE_SUBSCRIPTION_PROPNAME, true);
// Disconnect the consumer.
- testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false);
+ getTestProps().setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false);
CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
+ Circuit testCircuit = circuitFactory.createCircuit(getConnection(), getTestProps());
// Send one message and get a linked no consumers exception.
assertNoFailures(testCircuit.test(1,
- assertionList(((AMQPPublisher) testCircuit.getPublisher()).noConsumersAssertion(testProps))));
+ assertionList(((AMQPPublisher) testCircuit.getPublisher()).noConsumersAssertion(getTestProps()))));
}
/** Check that an immediate message results in no consumers code, in a transaction, when a consumer is disconnected. */
public void test_QPID_517_ImmediateFailsConsumerDisconnectedTxPubSub() throws Exception
{
// Ensure transactional sessions are on.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, true);
- testProps.setProperty(PUBSUB_PROPNAME, true);
+ getTestProps().setProperty(TRANSACTED_PUBLISHER_PROPNAME, true);
+ getTestProps().setProperty(PUBSUB_PROPNAME, true);
// Use durable subscriptions, so that the route remains open with no subscribers.
- testProps.setProperty(DURABLE_SUBSCRIPTION_PROPNAME, true);
+ getTestProps().setProperty(DURABLE_SUBSCRIPTION_PROPNAME, true);
// Disconnect the consumer.
- testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false);
+ getTestProps().setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false);
CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
+ Circuit testCircuit = circuitFactory.createCircuit(getConnection(), getTestProps());
// Send one message and get a linked no consumers exception.
assertNoFailures(testCircuit.test(1,
- assertionList(((AMQPPublisher) testCircuit.getPublisher()).noConsumersAssertion(testProps))));
+ assertionList(((AMQPPublisher) testCircuit.getPublisher()).noConsumersAssertion(getTestProps()))));
}
/** Check that an immediate message results in no route code, not using transactions, when no outgoing route is connected. */
public void test_QPID_517_ImmediateFailsNoRouteNoTxPubSub() throws Exception
{
// Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, false);
- testProps.setProperty(PUBSUB_PROPNAME, true);
+ getTestProps().setProperty(TRANSACTED_PUBLISHER_PROPNAME, false);
+ getTestProps().setProperty(PUBSUB_PROPNAME, true);
// Set up the messaging topology so that only the publishers producer is bound (do not set up the receivers to
// collect its messages).
- testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false);
+ getTestProps().setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false);
// Send one message and get a linked no route exception.
CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
+ Circuit testCircuit = circuitFactory.createCircuit(getConnection(), getTestProps());
assertNoFailures(testCircuit.test(1,
- assertionList(((AMQPPublisher) testCircuit.getPublisher()).noRouteAssertion(testProps))));
+ assertionList(((AMQPPublisher) testCircuit.getPublisher()).noRouteAssertion(getTestProps()))));
}
/** Check that an immediate message results in no route code, upon transaction commit, when no outgoing route is connected. */
public void test_QPID_517_ImmediateFailsNoRouteTxPubSub() throws Exception
{
// Ensure transactional sessions are on.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, true);
- testProps.setProperty(PUBSUB_PROPNAME, true);
+ getTestProps().setProperty(TRANSACTED_PUBLISHER_PROPNAME, true);
+ getTestProps().setProperty(PUBSUB_PROPNAME, true);
// Set up the messaging topology so that only the publishers producer is bound (do not set up the receivers to
// collect its messages).
- testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false);
+ getTestProps().setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false);
// Send one message and get a linked no route exception.
CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
+ Circuit testCircuit = circuitFactory.createCircuit(getConnection(), getTestProps());
assertNoFailures(testCircuit.test(1,
- assertionList(((AMQPPublisher) testCircuit.getPublisher()).noRouteAssertion(testProps))));
+ assertionList(((AMQPPublisher) testCircuit.getPublisher()).noRouteAssertion(getTestProps()))));
}
protected void setUp() throws Exception
{
super.setUp();
- testProps = TestContextProperties.getInstance(MessagingTestConfigProperties.defaults);
+ setTestProps(TestContextProperties.getInstance(MessagingTestConfigProperties.defaults));
/** All these tests should have the immediate flag on. */
- testProps.setProperty(IMMEDIATE_PROPNAME, true);
- testProps.setProperty(MANDATORY_PROPNAME, false);
+ getTestProps().setProperty(IMMEDIATE_PROPNAME, true);
+ getTestProps().setProperty(MANDATORY_PROPNAME, false);
/** Bind the receivers consumer by default. */
- testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, true);
- testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, true);
+ getTestProps().setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, true);
+ getTestProps().setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, true);
}
}
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org