activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1443267 [3/4] - in /activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq: ./ advisory/ blob/ broker/jmx/ broker/policy/ broker/store/ bugs/amq1095/ config/ console/command/ filter/ jndi/ load/ memory/ network/ network/jms/ ...
Date Wed, 06 Feb 2013 22:56:13 GMT
Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/TestPurgeCommand.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/TestPurgeCommand.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/TestPurgeCommand.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/TestPurgeCommand.java Wed Feb  6 22:56:12 2013
@@ -52,417 +52,417 @@ import org.springframework.context.suppo
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 public class TestPurgeCommand extends TestCase {
-	private static final Logger LOG = LoggerFactory
-			.getLogger(TestPurgeCommand.class);
+    private static final Logger LOG = LoggerFactory
+            .getLogger(TestPurgeCommand.class);
+
+    protected static final int MESSAGE_COUNT = 10;
+    protected static final String PROPERTY_NAME = "XTestProperty";
+    protected static final String PROPERTY_VALUE = "1:1";
+
+    // check for existence of property
+    protected static final String MSG_SEL_WITH_PROPERTY = PROPERTY_NAME
+            + " is not null";
+
+    // check for non-existence of property
+    protected static final String MSG_SEL_WITHOUT_PROPERTY = PROPERTY_NAME
+            + " is null";
+
+    // complex message selector query using XTestProperty and JMSPriority
+    protected static final String MSG_SEL_COMPLEX = PROPERTY_NAME + "='" +
+            "1:1" + "',JMSPriority>3";
+
+    // complex message selector query using XTestProperty AND JMSPriority
+    // but in SQL-92 syntax
+    protected static final String MSG_SEL_COMPLEX_SQL_AND = "(" + PROPERTY_NAME + "='" +
+            "1:1" + "') AND (JMSPriority>3)";
+
+    // complex message selector query using XTestProperty OR JMSPriority
+    // but in SQL-92 syntax
+    protected static final String MSG_SEL_COMPLEX_SQL_OR = "(" + PROPERTY_NAME + "='" +
+            "1:1" + "') OR (JMSPriority>3)";
+
+
+    protected static final String QUEUE_NAME = "org.apache.activemq.network.jms.QueueBridgeTest";
+
+    protected AbstractApplicationContext context;
+    protected QueueConnection localConnection;
+    protected QueueRequestor requestor;
+    protected QueueSession requestServerSession;
+    protected MessageConsumer requestServerConsumer;
+    protected MessageProducer requestServerProducer;
+    protected Queue theQueue;
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+
+        context = createApplicationContext();
+
+        createConnections();
+
+        requestServerSession = localConnection.createQueueSession(false,
+                Session.AUTO_ACKNOWLEDGE);
+        theQueue = requestServerSession.createQueue(QUEUE_NAME);
+        requestServerConsumer = requestServerSession.createConsumer(theQueue);
+        requestServerProducer = requestServerSession.createProducer(null);
+
+        QueueSession session = localConnection.createQueueSession(false,
+                Session.AUTO_ACKNOWLEDGE);
+        requestor = new QueueRequestor(session, theQueue);
+    }
+
+    protected void createConnections() throws JMSException {
+        ActiveMQConnectionFactory fac = (ActiveMQConnectionFactory) context
+                .getBean("localFactory");
+        localConnection = fac.createQueueConnection();
+        localConnection.start();
+    }
+
+    protected AbstractApplicationContext createApplicationContext() {
+        return new ClassPathXmlApplicationContext("org/apache/activemq/console/command/activemq.xml");
+    }
+
+    @Override
+    protected void tearDown() throws Exception {
+        localConnection.close();
+        BrokerService broker = (BrokerService) context.getBean("localbroker");
+        broker.stop();
+        broker = (BrokerService) context.getBean("default");
+        broker.stop();
+        super.tearDown();
+    }
+
+    public int getMessageCount(QueueBrowser browser, String prefix) throws JMSException {
+        Enumeration<?> e = browser.getEnumeration();
+        int with = 0;
+        while (e.hasMoreElements()) {
+            Object o = e.nextElement();
+            System.out.println(prefix + o);
+            with++;
+        }
+        return with;
+    }
+
+    public void cleanup() throws JMSException {
+        for (int i = 0; i < MESSAGE_COUNT * 2; i++) {
+            requestServerConsumer.receive();
+        }
+    }
+
+    protected MBeanServerConnection createJmxConnection() throws IOException {
+        return ManagementFactory.getPlatformMBeanServer();
+    }
+
+    @SuppressWarnings("unchecked")
+    public void purgeAllMessages() throws IOException, Exception {
+        List<String> tokens = Arrays.asList(new String[] { "*" });
+        for (String token : tokens) {
+            List<ObjectInstance> queueList = JmxMBeansUtil.queryMBeans(
+                    createJmxConnection(), "Type=Queue,Destination=" + token
+                            + ",*");
+            for (ObjectInstance oi : queueList) {
+                ObjectName queueName = oi.getObjectName();
+                LOG.info("Purging all messages in queue: "
+                        + queueName.getKeyProperty("Destination"));
+                createJmxConnection().invoke(queueName, "purge",
+                        new Object[] {}, new String[] {});
+            }
+        }
+    }
+
+    public void addMessages() throws IOException, Exception {
+        // first clean out any messages that may exist.
+        purgeAllMessages();
+
+        for (int i = 0; i < MESSAGE_COUNT; i++) {
+            TextMessage msg = requestServerSession
+                    .createTextMessage("test msg: " + i);
+            msg.setStringProperty(PROPERTY_NAME, PROPERTY_VALUE);
+            requestServerProducer.send(theQueue, msg);
+        }
+        for (int i = 0; i < MESSAGE_COUNT; i++) {
+            TextMessage msg = requestServerSession
+                    .createTextMessage("test msg: " + i);
+            requestServerProducer.send(theQueue, msg);
+        }
+
+    }
+
+    public void validateCounts(int expectedWithCount, int expectedWithoutCount,
+            int expectedAllCount) throws JMSException {
+        QueueBrowser withPropertyBrowser = requestServerSession.createBrowser(
+                theQueue, MSG_SEL_WITH_PROPERTY);
+        QueueBrowser withoutPropertyBrowser = requestServerSession
+                .createBrowser(theQueue, MSG_SEL_WITHOUT_PROPERTY);
+        QueueBrowser allBrowser = requestServerSession.createBrowser(theQueue);
+
+        int withCount = getMessageCount(withPropertyBrowser, "withProperty ");
+        int withoutCount = getMessageCount(withoutPropertyBrowser,
+                "withoutProperty ");
+        int allCount = getMessageCount(allBrowser, "allMessages ");
+
+        withPropertyBrowser.close();
+        withoutPropertyBrowser.close();
+        allBrowser.close();
+
+        assertEquals("Expected withCount to be " + expectedWithCount + " was "
+                + withCount, expectedWithCount, withCount);
+        assertEquals("Expected withoutCount to be " + expectedWithoutCount
+                + " was " + withoutCount, expectedWithoutCount, withoutCount);
+        assertEquals("Expected allCount to be " + expectedAllCount + " was "
+                + allCount, expectedAllCount, allCount);
+        LOG.info("withCount = " + withCount + "\n withoutCount = "
+                + withoutCount + "\n allCount = " + allCount + "\n  = " + "\n");
+    }
+
+    /**
+     * This test ensures that the queueViewMbean will work.
+     *
+     * @throws Exception
+     */
+    @SuppressWarnings("unchecked")
+    public void testQueueViewMbean() throws Exception {
+
+        try {
+            addMessages();
+
+            validateCounts(MESSAGE_COUNT, MESSAGE_COUNT, MESSAGE_COUNT * 2);
+
+            List<String> tokens = Arrays.asList(new String[] { "*" });
+            for (String token : tokens) {
+                List<ObjectInstance> queueList = JmxMBeansUtil.queryMBeans(
+                        createJmxConnection(), "Type=Queue,Destination="
+                                + token + ",*");
+
+                for (ObjectInstance queue : queueList) {
+                    ObjectName queueName = queue
+                            .getObjectName();
+                    QueueViewMBean proxy = MBeanServerInvocationHandler
+                            .newProxyInstance(createJmxConnection(), queueName,
+                                    QueueViewMBean.class, true);
+                    int removed = proxy
+                            .removeMatchingMessages(MSG_SEL_WITH_PROPERTY);
+                    LOG.info("Removed: " + removed);
+                }
+            }
+
+            validateCounts(0, MESSAGE_COUNT, MESSAGE_COUNT);
+
+        } finally {
+            purgeAllMessages();
+        }
+    }
+
+    public void testPurgeCommandSimpleSelector() throws Exception {
+        try {
+            PurgeCommand purgeCommand = new PurgeCommand();
+            CommandContext context = new CommandContext();
+
+            context.setFormatter(new CommandShellOutputFormatter(System.out));
+
+            purgeCommand.setCommandContext(context);
+            purgeCommand.setJmxUseLocal(true);
+
+            List<String> tokens = new ArrayList<String>();
+            tokens.add("--msgsel");
+            tokens.add(MSG_SEL_WITH_PROPERTY);
+
+            addMessages();
+            validateCounts(MESSAGE_COUNT, MESSAGE_COUNT, MESSAGE_COUNT * 2);
+
+            purgeCommand.execute(tokens);
+
+            validateCounts(0, MESSAGE_COUNT, MESSAGE_COUNT);
+        } finally {
+            purgeAllMessages();
+        }
+    }
+
+    public void testPurgeCommandComplexSelector() throws Exception {
+        try {
+            PurgeCommand purgeCommand = new PurgeCommand();
+            CommandContext context = new CommandContext();
+
+            context.setFormatter(new CommandShellOutputFormatter(System.out));
+
+            purgeCommand.setCommandContext(context);
+            purgeCommand.setJmxUseLocal(true);
+
+            List<String> tokens = new ArrayList<String>();
+            tokens.add("--msgsel");
+            tokens.add(MSG_SEL_COMPLEX);
+
+            addMessages();
+            validateCounts(MESSAGE_COUNT, MESSAGE_COUNT, MESSAGE_COUNT * 2);
+
+            purgeCommand.execute(tokens);
+
+            QueueBrowser withPropertyBrowser = requestServerSession.createBrowser(
+                    theQueue, MSG_SEL_COMPLEX);
+            QueueBrowser allBrowser = requestServerSession.createBrowser(theQueue);
+
+            int withCount = getMessageCount(withPropertyBrowser, "withProperty ");
+            int allCount = getMessageCount(allBrowser, "allMessages ");
+
+            withPropertyBrowser.close();
+            allBrowser.close();
+
+            assertEquals("Expected withCount to be " + "0" + " was "
+                    + withCount, 0, withCount);
+            assertEquals("Expected allCount to be " + MESSAGE_COUNT + " was "
+                    + allCount, MESSAGE_COUNT, allCount);
+            LOG.info("withCount = " + withCount + "\n allCount = " +
+                    allCount + "\n  = " + "\n");
+        } finally {
+            purgeAllMessages();
+        }
+    }
+
+    public void testPurgeCommandComplexSQLSelector_AND() throws Exception {
+        try {
+
+            String one = "ID:mac.fritz.box:1213242.3231.1:1:1:100";
+            String two = "\\*:100";
+            try {
+            if (one.matches(two))
+                LOG.info("String matches.");
+            else
+                LOG.info("string does not match.");
+            } catch (Exception ex) {
+                LOG.error(ex.getMessage());
+            }
+
+            PurgeCommand purgeCommand = new PurgeCommand();
+            CommandContext context = new CommandContext();
+
+            context.setFormatter(new CommandShellOutputFormatter(System.out));
+
+            purgeCommand.setCommandContext(context);
+            purgeCommand.setJmxUseLocal(true);
+
+            List<String> tokens = new ArrayList<String>();
+            tokens.add("--msgsel");
+            tokens.add(MSG_SEL_COMPLEX_SQL_AND);
+
+            addMessages();
+            validateCounts(MESSAGE_COUNT, MESSAGE_COUNT, MESSAGE_COUNT * 2);
+
+            purgeCommand.execute(tokens);
+
+            QueueBrowser withPropertyBrowser = requestServerSession.createBrowser(
+                    theQueue, MSG_SEL_COMPLEX_SQL_AND);
+            QueueBrowser allBrowser = requestServerSession.createBrowser(theQueue);
+
+            int withCount = getMessageCount(withPropertyBrowser, "withProperty ");
+            int allCount = getMessageCount(allBrowser, "allMessages ");
+
+            withPropertyBrowser.close();
+            allBrowser.close();
+
+            assertEquals("Expected withCount to be " + "0" + " was "
+                    + withCount, 0, withCount);
+            assertEquals("Expected allCount to be " + MESSAGE_COUNT + " was "
+                    + allCount, MESSAGE_COUNT, allCount);
+            LOG.info("withCount = " + withCount + "\n allCount = " +
+                    allCount + "\n  = " + "\n");
+        } finally {
+            purgeAllMessages();
+        }
+    }
+
+    public void testPurgeCommandComplexSQLSelector_OR() throws Exception {
+        try {
+            PurgeCommand purgeCommand = new PurgeCommand();
+            CommandContext context = new CommandContext();
+
+            context.setFormatter(new CommandShellOutputFormatter(System.out));
+
+            purgeCommand.setCommandContext(context);
+            purgeCommand.setJmxUseLocal(true);
+
+            List<String> tokens = new ArrayList<String>();
+            tokens.add("--msgsel");
+            tokens.add(MSG_SEL_COMPLEX_SQL_OR);
+
+            addMessages();
+            validateCounts(MESSAGE_COUNT, MESSAGE_COUNT, MESSAGE_COUNT * 2);
+
+            purgeCommand.execute(tokens);
+
+            QueueBrowser withPropertyBrowser = requestServerSession.createBrowser(
+                    theQueue, MSG_SEL_COMPLEX_SQL_OR);
+            QueueBrowser allBrowser = requestServerSession.createBrowser(theQueue);
+
+            int withCount = getMessageCount(withPropertyBrowser, "withProperty ");
+            int allCount = getMessageCount(allBrowser, "allMessages ");
+
+            withPropertyBrowser.close();
+            allBrowser.close();
+
+            assertEquals("Expected withCount to be 0 but was "
+                    + withCount, 0, withCount);
+            assertEquals("Expected allCount to be 0 but was "
+                    + allCount, 0, allCount);
+            LOG.info("withCount = " + withCount + "\n allCount = " +
+                    allCount + "\n  = " + "\n");
+        } finally {
+            purgeAllMessages();
+        }
+    }
+
+    public void testDummy() throws Exception {
+        try {
+
+            String one = "ID:mac.fritz.box:1213242.3231.1:1:1:100";
+            String two = "ID*:100";
+            try {
+            if (one.matches(two))
+                LOG.info("String matches.");
+            else
+                LOG.info("string does not match.");
+            } catch (Exception ex) {
+                LOG.error(ex.getMessage());
+            }
+
+            PurgeCommand purgeCommand = new PurgeCommand();
+            CommandContext context = new CommandContext();
+
+            context.setFormatter(new CommandShellOutputFormatter(System.out));
+
+            purgeCommand.setCommandContext(context);
+            purgeCommand.setJmxUseLocal(true);
+
+            List<String> tokens = new ArrayList<String>();
+            tokens.add("--msgsel");
+            tokens.add("(XTestProperty LIKE '1:*') AND (JMSPriority>3)");
+
+            addMessages();
+
+            purgeCommand.execute(tokens);
+
+            /*
+            QueueBrowser withPropertyBrowser = requestServerSession.createBrowser(
+                    theQueue, MSG_SEL_COMPLEX_SQL_AND);
+            QueueBrowser allBrowser = requestServerSession.createBrowser(theQueue);
+
+            int withCount = getMessageCount(withPropertyBrowser, "withProperty ");
+            int allCount = getMessageCount(allBrowser, "allMessages ");
+
+            withPropertyBrowser.close();
+            allBrowser.close();
+
+            assertEquals("Expected withCount to be " + "0" + " was "
+                    + withCount, 0, withCount);
+            assertEquals("Expected allCount to be " + MESSAGE_COUNT + " was "
+                    + allCount, MESSAGE_COUNT, allCount);
+            LOG.info("withCount = " + withCount + "\n allCount = " +
+                    allCount + "\n  = " + "\n");
+            */
+        } finally {
+            purgeAllMessages();
+        }
+    }
+
+
 
-	protected static final int MESSAGE_COUNT = 10;
-	protected static final String PROPERTY_NAME = "XTestProperty";
-	protected static final String PROPERTY_VALUE = "1:1";
-	
-	// check for existence of property
-	protected static final String MSG_SEL_WITH_PROPERTY = PROPERTY_NAME
-			+ " is not null";
-
-	// check for non-existence of property
-	protected static final String MSG_SEL_WITHOUT_PROPERTY = PROPERTY_NAME
-			+ " is null";
-	
-	// complex message selector query using XTestProperty and JMSPriority
-	protected static final String MSG_SEL_COMPLEX = PROPERTY_NAME + "='" + 
-			"1:1" + "',JMSPriority>3";
-	
-	// complex message selector query using XTestProperty AND JMSPriority 
-	// but in SQL-92 syntax 
-	protected static final String MSG_SEL_COMPLEX_SQL_AND = "(" + PROPERTY_NAME + "='" + 
-			"1:1" + "') AND (JMSPriority>3)";
-
-	// complex message selector query using XTestProperty OR JMSPriority 
-	// but in SQL-92 syntax	
-	protected static final String MSG_SEL_COMPLEX_SQL_OR = "(" + PROPERTY_NAME + "='" + 
-			"1:1" + "') OR (JMSPriority>3)";
-	
-	
-	protected static final String QUEUE_NAME = "org.apache.activemq.network.jms.QueueBridgeTest";
-
-	protected AbstractApplicationContext context;
-	protected QueueConnection localConnection;
-	protected QueueRequestor requestor;
-	protected QueueSession requestServerSession;
-	protected MessageConsumer requestServerConsumer;
-	protected MessageProducer requestServerProducer;
-	protected Queue theQueue;
-
-	protected void setUp() throws Exception {
-		super.setUp();
-
-		context = createApplicationContext();
-
-		createConnections();
-
-		requestServerSession = localConnection.createQueueSession(false,
-				Session.AUTO_ACKNOWLEDGE);
-		theQueue = requestServerSession.createQueue(QUEUE_NAME);
-		requestServerConsumer = requestServerSession.createConsumer(theQueue);
-		requestServerProducer = requestServerSession.createProducer(null);
-
-		QueueSession session = localConnection.createQueueSession(false,
-				Session.AUTO_ACKNOWLEDGE);
-		requestor = new QueueRequestor(session, theQueue);
-	}
-
-	protected void createConnections() throws JMSException {
-		ActiveMQConnectionFactory fac = (ActiveMQConnectionFactory) context
-				.getBean("localFactory");
-		localConnection = fac.createQueueConnection();
-		localConnection.start();
-	}
-
-	protected AbstractApplicationContext createApplicationContext() {
-		return new ClassPathXmlApplicationContext("org/apache/activemq/console/command/activemq.xml");
-	}
-
-	protected void tearDown() throws Exception {
-		localConnection.close();
-		BrokerService broker = (BrokerService) context.getBean("localbroker");
-		broker.stop();
-		broker = (BrokerService) context.getBean("default");
-		broker.stop();
-		super.tearDown();
-	}
-
-	@SuppressWarnings("unchecked")
-	public int getMessageCount(QueueBrowser browser, String prefix)
-			throws JMSException {
-		Enumeration e = browser.getEnumeration();
-		int with = 0;
-		while (e.hasMoreElements()) {
-			Object o = e.nextElement();
-			System.out.println(prefix + o);
-			with++;
-		}
-		return with;
-	}
-
-	public void cleanup() throws JMSException {
-		for (int i = 0; i < MESSAGE_COUNT * 2; i++) {
-			requestServerConsumer.receive();
-		}
-	}
-
-	protected MBeanServerConnection createJmxConnection() throws IOException {
-		return ManagementFactory.getPlatformMBeanServer();
-	}
-
-	@SuppressWarnings("unchecked")
-	public void purgeAllMessages() throws IOException, Exception {
-		List<String> tokens = Arrays.asList(new String[] { "*" });
-		for (String token : tokens) {
-			List<ObjectInstance> queueList = JmxMBeansUtil.queryMBeans(
-					createJmxConnection(), "Type=Queue,Destination=" + token
-							+ ",*");
-			for (ObjectInstance oi : queueList) {
-				ObjectName queueName = oi.getObjectName();
-				LOG.info("Purging all messages in queue: "
-						+ queueName.getKeyProperty("Destination"));
-				createJmxConnection().invoke(queueName, "purge",
-						new Object[] {}, new String[] {});
-			}
-		}
-	}
-
-	public void addMessages() throws IOException, Exception {
-		// first clean out any messages that may exist.
-		purgeAllMessages();
-
-		for (int i = 0; i < MESSAGE_COUNT; i++) {
-			TextMessage msg = requestServerSession
-					.createTextMessage("test msg: " + i);
-			msg.setStringProperty(PROPERTY_NAME, PROPERTY_VALUE);
-			requestServerProducer.send(theQueue, msg);
-		}
-		for (int i = 0; i < MESSAGE_COUNT; i++) {
-			TextMessage msg = requestServerSession
-					.createTextMessage("test msg: " + i);
-			requestServerProducer.send(theQueue, msg);
-		}
-
-	}
-
-	public void validateCounts(int expectedWithCount, int expectedWithoutCount,
-			int expectedAllCount) throws JMSException {
-		QueueBrowser withPropertyBrowser = requestServerSession.createBrowser(
-				theQueue, MSG_SEL_WITH_PROPERTY);
-		QueueBrowser withoutPropertyBrowser = requestServerSession
-				.createBrowser(theQueue, MSG_SEL_WITHOUT_PROPERTY);
-		QueueBrowser allBrowser = requestServerSession.createBrowser(theQueue);
-
-		int withCount = getMessageCount(withPropertyBrowser, "withProperty ");
-		int withoutCount = getMessageCount(withoutPropertyBrowser,
-				"withoutProperty ");
-		int allCount = getMessageCount(allBrowser, "allMessages ");
-
-		withPropertyBrowser.close();
-		withoutPropertyBrowser.close();
-		allBrowser.close();
-
-		assertEquals("Expected withCount to be " + expectedWithCount + " was "
-				+ withCount, expectedWithCount, withCount);
-		assertEquals("Expected withoutCount to be " + expectedWithoutCount
-				+ " was " + withoutCount, expectedWithoutCount, withoutCount);
-		assertEquals("Expected allCount to be " + expectedAllCount + " was "
-				+ allCount, expectedAllCount, allCount);
-		LOG.info("withCount = " + withCount + "\n withoutCount = "
-				+ withoutCount + "\n allCount = " + allCount + "\n  = " + "\n");
-	}
-
-	/**
-	 * This test ensures that the queueViewMbean will work.
-	 * 
-	 * @throws Exception
-	 */
-	@SuppressWarnings("unchecked")
-	public void testQueueViewMbean() throws Exception {
-
-		try {
-			addMessages();
-
-			validateCounts(MESSAGE_COUNT, MESSAGE_COUNT, MESSAGE_COUNT * 2);
-
-			List<String> tokens = Arrays.asList(new String[] { "*" });
-			for (String token : tokens) {
-				List<ObjectInstance> queueList = JmxMBeansUtil.queryMBeans(
-						createJmxConnection(), "Type=Queue,Destination="
-								+ token + ",*");
-
-				for (ObjectInstance queue : queueList) {
-					ObjectName queueName = ((ObjectInstance) queue)
-							.getObjectName();
-					QueueViewMBean proxy = (QueueViewMBean) MBeanServerInvocationHandler
-							.newProxyInstance(createJmxConnection(), queueName,
-									QueueViewMBean.class, true);
-					int removed = proxy
-							.removeMatchingMessages(MSG_SEL_WITH_PROPERTY);
-					LOG.info("Removed: " + removed);
-				}
-			}
-
-			validateCounts(0, MESSAGE_COUNT, MESSAGE_COUNT);
-
-		} finally {
-			purgeAllMessages();
-		}
-	}
-
-	public void testPurgeCommandSimpleSelector() throws Exception {
-		try {
-			PurgeCommand purgeCommand = new PurgeCommand();
-			CommandContext context = new CommandContext();
-
-			context.setFormatter(new CommandShellOutputFormatter(System.out));
-
-			purgeCommand.setCommandContext(context);
-			purgeCommand.setJmxUseLocal(true);
-
-			List<String> tokens = new ArrayList<String>();
-			tokens.add("--msgsel");
-			tokens.add(MSG_SEL_WITH_PROPERTY);
-			
-			addMessages();
-			validateCounts(MESSAGE_COUNT, MESSAGE_COUNT, MESSAGE_COUNT * 2);
-
-			purgeCommand.execute(tokens);
-
-			validateCounts(0, MESSAGE_COUNT, MESSAGE_COUNT);
-		} finally {
-			purgeAllMessages();
-		}
-	}
-	
-	public void testPurgeCommandComplexSelector() throws Exception {
-		try {
-			PurgeCommand purgeCommand = new PurgeCommand();
-			CommandContext context = new CommandContext();
-
-			context.setFormatter(new CommandShellOutputFormatter(System.out));
-
-			purgeCommand.setCommandContext(context);
-			purgeCommand.setJmxUseLocal(true);
-
-			List<String> tokens = new ArrayList<String>();
-			tokens.add("--msgsel");
-			tokens.add(MSG_SEL_COMPLEX);
-			
-			addMessages();
-			validateCounts(MESSAGE_COUNT, MESSAGE_COUNT, MESSAGE_COUNT * 2);
-
-			purgeCommand.execute(tokens);
-
-			QueueBrowser withPropertyBrowser = requestServerSession.createBrowser(
-					theQueue, MSG_SEL_COMPLEX);
-			QueueBrowser allBrowser = requestServerSession.createBrowser(theQueue);
-
-			int withCount = getMessageCount(withPropertyBrowser, "withProperty ");
-			int allCount = getMessageCount(allBrowser, "allMessages ");
-
-			withPropertyBrowser.close();
-			allBrowser.close();
-			
-			assertEquals("Expected withCount to be " + "0" + " was "
-					+ withCount, 0, withCount);
-			assertEquals("Expected allCount to be " + MESSAGE_COUNT + " was "
-					+ allCount, MESSAGE_COUNT, allCount);
-			LOG.info("withCount = " + withCount + "\n allCount = " + 
-					allCount + "\n  = " + "\n");
-		} finally {
-			purgeAllMessages();
-		}
-	}
-	
-	public void testPurgeCommandComplexSQLSelector_AND() throws Exception {
-		try {
-			
-			String one = "ID:mac.fritz.box:1213242.3231.1:1:1:100";
-			String two = "\\*:100";
-			try {
-			if (one.matches(two)) 
-				LOG.info("String matches.");
-			else 
-				LOG.info("string does not match.");
-			} catch (Exception ex) {
-				LOG.error(ex.getMessage());
-			}
-			
-			PurgeCommand purgeCommand = new PurgeCommand();
-			CommandContext context = new CommandContext();
-
-			context.setFormatter(new CommandShellOutputFormatter(System.out));
-
-			purgeCommand.setCommandContext(context);
-			purgeCommand.setJmxUseLocal(true);
-
-			List<String> tokens = new ArrayList<String>();
-			tokens.add("--msgsel");
-			tokens.add(MSG_SEL_COMPLEX_SQL_AND);
-			
-			addMessages();
-			validateCounts(MESSAGE_COUNT, MESSAGE_COUNT, MESSAGE_COUNT * 2);
-
-			purgeCommand.execute(tokens);
-
-			QueueBrowser withPropertyBrowser = requestServerSession.createBrowser(
-					theQueue, MSG_SEL_COMPLEX_SQL_AND);
-			QueueBrowser allBrowser = requestServerSession.createBrowser(theQueue);
-
-			int withCount = getMessageCount(withPropertyBrowser, "withProperty ");
-			int allCount = getMessageCount(allBrowser, "allMessages ");
-
-			withPropertyBrowser.close();
-			allBrowser.close();
-			
-			assertEquals("Expected withCount to be " + "0" + " was "
-					+ withCount, 0, withCount);
-			assertEquals("Expected allCount to be " + MESSAGE_COUNT + " was "
-					+ allCount, MESSAGE_COUNT, allCount);
-			LOG.info("withCount = " + withCount + "\n allCount = " + 
-					allCount + "\n  = " + "\n");
-		} finally {
-			purgeAllMessages();
-		}
-	}
-	
-	public void testPurgeCommandComplexSQLSelector_OR() throws Exception {
-		try {
-			PurgeCommand purgeCommand = new PurgeCommand();
-			CommandContext context = new CommandContext();
-
-			context.setFormatter(new CommandShellOutputFormatter(System.out));
-
-			purgeCommand.setCommandContext(context);
-			purgeCommand.setJmxUseLocal(true);
-
-			List<String> tokens = new ArrayList<String>();
-			tokens.add("--msgsel");
-			tokens.add(MSG_SEL_COMPLEX_SQL_OR);
-			
-			addMessages();
-			validateCounts(MESSAGE_COUNT, MESSAGE_COUNT, MESSAGE_COUNT * 2);
-
-			purgeCommand.execute(tokens);
-
-			QueueBrowser withPropertyBrowser = requestServerSession.createBrowser(
-					theQueue, MSG_SEL_COMPLEX_SQL_OR);
-			QueueBrowser allBrowser = requestServerSession.createBrowser(theQueue);
-
-			int withCount = getMessageCount(withPropertyBrowser, "withProperty ");
-			int allCount = getMessageCount(allBrowser, "allMessages ");
-
-			withPropertyBrowser.close();
-			allBrowser.close();
-			
-			assertEquals("Expected withCount to be 0 but was "
-					+ withCount, 0, withCount);
-			assertEquals("Expected allCount to be 0 but was "
-					+ allCount, 0, allCount);
-			LOG.info("withCount = " + withCount + "\n allCount = " + 
-					allCount + "\n  = " + "\n");
-		} finally {
-			purgeAllMessages();
-		}
-	}
-	
-	public void testDummy() throws Exception {
-		try {
-			
-			String one = "ID:mac.fritz.box:1213242.3231.1:1:1:100";
-			String two = "ID*:100";
-			try {
-			if (one.matches(two)) 
-				LOG.info("String matches.");
-			else 
-				LOG.info("string does not match.");
-			} catch (Exception ex) {
-				LOG.error(ex.getMessage());
-			}
-			
-			PurgeCommand purgeCommand = new PurgeCommand();
-			CommandContext context = new CommandContext();
-
-			context.setFormatter(new CommandShellOutputFormatter(System.out));
-
-			purgeCommand.setCommandContext(context);
-			purgeCommand.setJmxUseLocal(true);
-
-			List<String> tokens = new ArrayList<String>();
-			tokens.add("--msgsel");
-			tokens.add("(XTestProperty LIKE '1:*') AND (JMSPriority>3)");
-			
-			addMessages();
-			
-			purgeCommand.execute(tokens);
-
-			/*
-			QueueBrowser withPropertyBrowser = requestServerSession.createBrowser(
-					theQueue, MSG_SEL_COMPLEX_SQL_AND);
-			QueueBrowser allBrowser = requestServerSession.createBrowser(theQueue);
-
-			int withCount = getMessageCount(withPropertyBrowser, "withProperty ");
-			int allCount = getMessageCount(allBrowser, "allMessages ");
-
-			withPropertyBrowser.close();
-			allBrowser.close();
-			
-			assertEquals("Expected withCount to be " + "0" + " was "
-					+ withCount, 0, withCount);
-			assertEquals("Expected allCount to be " + MESSAGE_COUNT + " was "
-					+ allCount, MESSAGE_COUNT, allCount);
-			LOG.info("withCount = " + withCount + "\n allCount = " + 
-					allCount + "\n  = " + "\n");
-			*/
-		} finally {
-			purgeAllMessages();
-		}
-	}
-	
-	
-	
 }

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/filter/DestinationMapTempDestinationTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/filter/DestinationMapTempDestinationTest.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/filter/DestinationMapTempDestinationTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/filter/DestinationMapTempDestinationTest.java Wed Feb  6 22:56:12 2013
@@ -17,13 +17,15 @@
 package org.apache.activemq.filter;
 
 import java.util.Set;
+
 import junit.framework.TestCase;
+
 import org.apache.activemq.command.ActiveMQTempQueue;
 import org.apache.activemq.command.ConnectionId;
 import org.apache.activemq.util.IdGenerator;
 
 public class DestinationMapTempDestinationTest extends TestCase {
-    
+
     public void testtestTempDestinations() throws Exception {
         ConnectionId id = new ConnectionId(new IdGenerator().generateId());
         DestinationMap map = new DestinationMap();
@@ -36,7 +38,7 @@ public class DestinationMapTempDestinati
         for (int i = 0; i < count; i++) {
             ActiveMQTempQueue queue = new ActiveMQTempQueue(id, i);
             map.remove(queue, value);
-            Set set = map.get(queue);
+            Set<?> set = map.get(queue);
             assertTrue(set.isEmpty());
         }
     }

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/filter/DestinationMapTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/filter/DestinationMapTest.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/filter/DestinationMapTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/filter/DestinationMapTest.java Wed Feb  6 22:56:12 2013
@@ -24,6 +24,7 @@ import java.util.List;
 import java.util.Set;
 
 import junit.framework.TestCase;
+
 import org.apache.activemq.command.ActiveMQDestination;
 import org.apache.activemq.command.ActiveMQQueue;
 import org.apache.activemq.command.ActiveMQTopic;
@@ -50,7 +51,6 @@ public class DestinationMapTest extends 
         map.put(d1, d1);
         map.put(d2, d2);
         map.get(createDestination("TEST.BAR.D2,TEST.BAR.D3"));
-
     }
 
     public void testSimpleDestinations() throws Exception {
@@ -131,7 +131,7 @@ public class DestinationMapTest extends 
         map.put(d2, v2);
         map.put(d3, v3);
 
-        List allValues = Arrays.asList(new Object[] {v1, v2, v3});
+        List<Object> allValues = Arrays.asList(new Object[] {v1, v2, v3});
 
         assertMapValue(">", allValues);
         assertMapValue("TEST.>", allValues);
@@ -305,10 +305,9 @@ public class DestinationMapTest extends 
         put("FOO.B", v2);
         assertMapValue("FOO.>", v1, v2);
 
-        Set set = map.removeAll(createDestination("FOO.A"));
+        map.removeAll(createDestination("FOO.A"));
 
         assertMapValue("FOO.>", v2);
-
     }
 
     protected void loadSample2() {
@@ -371,7 +370,7 @@ public class DestinationMapTest extends 
         assertMapValue(destinationName, Arrays.asList(new Object[] {expected1, expected2, expected3, expected4, expected5, expected6}));
     }
 
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({ "unchecked", "rawtypes" })
     protected void assertMapValue(ActiveMQDestination destination, Object expected) {
         List expectedList = null;
         if (expected == null) {

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/filter/DummyPolicy.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/filter/DummyPolicy.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/filter/DummyPolicy.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/filter/DummyPolicy.java Wed Feb  6 22:56:12 2013
@@ -20,17 +20,21 @@ import java.util.List;
 
 /**
  * Represents a destination based policy
- * 
- * 
+ *
+ *
  */
 public class DummyPolicy extends DestinationMap {
 
+    @SuppressWarnings({ "rawtypes", "unchecked" })
+    @Override
     protected Class getEntryClass() {
         return DummyPolicyEntry.class;
     }
 
+    @SuppressWarnings({ "rawtypes", "unchecked" })
+    @Override
     public void setEntries(List entries) {
         super.setEntries(entries);
     }
-    
+
 }

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/filter/DummyPolicyTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/filter/DummyPolicyTest.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/filter/DummyPolicyTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/filter/DummyPolicyTest.java Wed Feb  6 22:56:12 2013
@@ -31,11 +31,12 @@ public class DummyPolicyTest extends Spr
     public void testPolicy() throws Exception {
         DummyPolicy policy = (DummyPolicy)getBean("policy");
 
-        Set set = policy.get(new ActiveMQTopic("FOO.BAR"));
+        Set<?> set = policy.get(new ActiveMQTopic("FOO.BAR"));
 
         assertSetEquals("FOO.BAR set", new Object[] {"Edam", "Cheddar"}, set);
     }
 
+    @Override
     protected AbstractApplicationContext createApplicationContext() {
         return new ClassPathXmlApplicationContext("org/apache/activemq/filter/dummyPolicy.xml");
     }

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/jndi/CustomConnectionFactoryNameTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/jndi/CustomConnectionFactoryNameTest.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/jndi/CustomConnectionFactoryNameTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/jndi/CustomConnectionFactoryNameTest.java Wed Feb  6 22:56:12 2013
@@ -23,16 +23,17 @@ import org.apache.activemq.ActiveMQConne
 /**
  * Test case for AMQ-141
  *
- * 
+ *
  */
 public class CustomConnectionFactoryNameTest extends ActiveMQInitialContextFactoryTest {
-    
+
+    @Override
     public void testConnectionFactoriesArePresent() throws NamingException {
         super.testConnectionFactoriesArePresent();
         assertConnectionFactoryPresent("jms/Connection");
         assertConnectionFactoryPresent("jms/DURABLE_SUB_CONNECTION_FACTORY");
     }
-    
+
     public void testConnectionFactoriesAreConfigured() throws NamingException {
         super.testConnectionFactoriesArePresent();
         ActiveMQConnectionFactory factory1 = (ActiveMQConnectionFactory) context.lookup("jms/Connection");
@@ -41,10 +42,12 @@ public class CustomConnectionFactoryName
         assertEquals("testclient", factory2.getClientID());
     }
 
+    @Override
     protected String getConnectionFactoryLookupName() {
         return "myConnectionFactory";
     }
 
+    @Override
     protected void configureEnvironment() {
         super.configureEnvironment();
         environment.put("connectionFactoryNames", " myConnectionFactory, jms/Connection, jms/DURABLE_SUB_CONNECTION_FACTORY");

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/jndi/DestinationNameWithSlashTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/jndi/DestinationNameWithSlashTest.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/jndi/DestinationNameWithSlashTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/jndi/DestinationNameWithSlashTest.java Wed Feb  6 22:56:12 2013
@@ -20,7 +20,7 @@ package org.apache.activemq.jndi;
 /**
  * Test case for AMQ-140
  *
- * 
+ *
  */
 public class DestinationNameWithSlashTest extends JNDITestSupport {
     public void testNameWithSlash() throws Exception {
@@ -28,6 +28,7 @@ public class DestinationNameWithSlashTes
 
     }
 
+    @Override
     protected void configureEnvironment() {
         super.configureEnvironment();
         environment.put("queue.jms/Queue", "example.myqueue");

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/jndi/JNDITestSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/jndi/JNDITestSupport.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/jndi/JNDITestSupport.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/jndi/JNDITestSupport.java Wed Feb  6 22:56:12 2013
@@ -28,17 +28,18 @@ import javax.naming.NamingException;
 import javax.naming.spi.InitialContextFactory;
 
 import junit.framework.TestCase;
+
 import org.apache.activemq.ActiveMQConnectionFactory;
 
 /**
- * 
+ *
  */
 public abstract class JNDITestSupport extends TestCase {
-    
+
     private static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory
             .getLog(JNDITestSupport.class);
-    
-    protected Hashtable environment = new Hashtable();
+
+    protected Hashtable<String, String> environment = new Hashtable<String, String>();
     protected Context context;
 
     protected void assertConnectionFactoryPresent(String lookupName) throws NamingException {
@@ -53,15 +54,16 @@ public abstract class JNDITestSupport ex
         assertTrue("Should have got a child context but got: " + object, object instanceof Context);
 
         Context childContext = (Context) object;
-        NamingEnumeration iter = childContext.listBindings("");
+        NamingEnumeration<Binding> iter = childContext.listBindings("");
         while (iter.hasMore()) {
-            Binding destinationBinding = (Binding) iter.next();
+            Binding destinationBinding = iter.next();
             LOG.info("Found destination: " + destinationBinding.getName());
             Object destination = destinationBinding.getObject();
             assertTrue("Should have a Destination but got: " + destination, destination instanceof Destination);
         }
     }
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
 
@@ -77,10 +79,11 @@ public abstract class JNDITestSupport ex
      *
      * @throws javax.naming.NamingException
      */
+    @Override
     protected void tearDown() throws NamingException, JMSException {
-        NamingEnumeration iter = context.listBindings("");
+        NamingEnumeration<Binding> iter = context.listBindings("");
         while (iter.hasMore()) {
-            Binding binding = (Binding) iter.next();
+            Binding binding = iter.next();
             Object connFactory = binding.getObject();
             if (connFactory instanceof ActiveMQConnectionFactory) {
                // ((ActiveMQConnectionFactory) connFactory).stop();

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/load/LoadController.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/load/LoadController.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/load/LoadController.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/load/LoadController.java Wed Feb  6 22:56:12 2013
@@ -24,25 +24,26 @@ import javax.jms.Destination;
 import javax.jms.JMSException;
 
 /**
- * 
+ *
  */
 public class LoadController extends LoadClient{
+
     private int numberOfBatches=1;
     private int batchSize =1000;
     private int count;
     private final CountDownLatch stopped = new CountDownLatch(1);
-     
 
     public LoadController(String name,ConnectionFactory factory) {
        super(name,factory);
     }
 
-       
+
     public int awaitTestComplete() throws InterruptedException {
-        boolean complete = stopped.await(60*5,TimeUnit.SECONDS);
+        stopped.await(60*5,TimeUnit.SECONDS);
         return count;
     }
 
+    @Override
     public void stop() throws JMSException, InterruptedException {
         running = false;
         stopped.countDown();
@@ -50,7 +51,8 @@ public class LoadController extends Load
             this.connection.stop();
         }
     }
-    
+
+    @Override
     public void run() {
         try {
             for (int i = 0; i < numberOfBatches; i++) {
@@ -73,33 +75,29 @@ public class LoadController extends Load
         }
     }
 
-
     public int getNumberOfBatches() {
         return numberOfBatches;
     }
 
-
     public void setNumberOfBatches(int numberOfBatches) {
         this.numberOfBatches = numberOfBatches;
     }
 
-
     public int getBatchSize() {
         return batchSize;
     }
 
-
     public void setBatchSize(int batchSize) {
         this.batchSize = batchSize;
     }
-    
+
+    @Override
     protected Destination getSendDestination() {
         return startDestination;
     }
-    
+
+    @Override
     protected Destination getConsumeDestination() {
         return nextDestination;
     }
-    
-    
 }

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/memory/MemoryPropertyTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/memory/MemoryPropertyTest.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/memory/MemoryPropertyTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/memory/MemoryPropertyTest.java Wed Feb  6 22:56:12 2013
@@ -16,30 +16,25 @@
  */
 package org.apache.activemq.memory;
 
-import java.io.File;
+import junit.framework.TestCase;
 
-import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.broker.BrokerFactory;
 import org.apache.activemq.broker.BrokerService;
-import org.apache.activemq.xbean.BrokerFactoryBean;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-import junit.framework.TestCase;
 
 public class MemoryPropertyTest extends TestCase {
 
     private static final transient Logger LOG = LoggerFactory.getLogger(MemoryPropertyTest.class);
     BrokerService broker;
 
-    
+
     /**
      * Sets up a test where the producer and consumer have their own connection.
-     * 
+     *
      * @see junit.framework.TestCase#setUp()
      */
+    @Override
     protected void setUp() throws Exception {
         // Create broker from resource
         LOG.info("Creating broker... ");
@@ -47,17 +42,17 @@ public class MemoryPropertyTest extends 
         LOG.info("Success");
         super.setUp();
     }
-    
+
     protected BrokerService createBroker(String resource) throws Exception {
         return BrokerFactory.createBroker(resource);
     }
 
-
     /*
      * Stops the Broker
-     * 
+     *
      * @see junit.framework.TestCase#tearDown()
      */
+    @Override
     protected void tearDown() throws Exception {
         LOG.info("Closing Broker");
         if (broker != null) {
@@ -66,18 +61,15 @@ public class MemoryPropertyTest extends 
         LOG.info("Broker closed...");
     }
 
-
-
     public void testBrokerInitialized() {
         assertTrue("We should have a broker", broker != null);
 
         assertEquals("test-broker", broker.getBrokerName());
         assertEquals(1024, broker.getSystemUsage().getMemoryUsage().getLimit());
         assertEquals(34, broker.getSystemUsage().getMemoryUsage().getPercentUsageMinDelta());
-        
+
         assertNotNull(broker.getSystemUsage().getStoreUsage().getStore());
         // non persistent broker so no temp storage
         assertNull(broker.getSystemUsage().getTempUsage().getStore());
     }
-
 }

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/CompressionOverNetworkTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/CompressionOverNetworkTest.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/CompressionOverNetworkTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/CompressionOverNetworkTest.java Wed Feb  6 22:56:12 2013
@@ -16,9 +16,9 @@
  */
 package org.apache.activemq.network;
 
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.net.URI;
 import java.util.Arrays;

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/DemandForwardingBridgeTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/DemandForwardingBridgeTest.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/DemandForwardingBridgeTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/DemandForwardingBridgeTest.java Wed Feb  6 22:56:12 2013
@@ -19,6 +19,7 @@ package org.apache.activemq.network;
 import javax.jms.DeliveryMode;
 
 import junit.framework.Test;
+
 import org.apache.activemq.broker.StubConnection;
 import org.apache.activemq.command.ActiveMQDestination;
 import org.apache.activemq.command.ConnectionInfo;
@@ -78,9 +79,10 @@ public class DemandForwardingBridgeTest 
 
         // Make sure the message was delivered via the remote.
         assertTrue("message was received", Wait.waitFor(new Wait.Condition() {
+            @Override
             public boolean isSatisified() throws Exception {
                 return receiveMessage(connection2) != null;
-            }            
+            }
         }));
     }
 
@@ -122,9 +124,10 @@ public class DemandForwardingBridgeTest 
         // Send the message to the local boker.
         connection1.request(createMessage(producerInfo, destination, deliveryMode));
         // Make sure the message was delivered via the remote.
-        Message m = receiveMessage(connection2);
+        receiveMessage(connection2);
     }
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         NetworkBridgeConfiguration config = new NetworkBridgeConfiguration();
@@ -135,6 +138,7 @@ public class DemandForwardingBridgeTest 
         bridge.start();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         bridge.stop();
         super.tearDown();

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/DuplexNetworkTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/DuplexNetworkTest.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/DuplexNetworkTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/DuplexNetworkTest.java Wed Feb  6 22:56:12 2013
@@ -16,16 +16,16 @@
  */
 package org.apache.activemq.network;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 import javax.jms.MessageProducer;
 import javax.jms.TemporaryQueue;
+
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.util.Wait;
 import org.junit.Test;
 
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertTrue;
-
 public class DuplexNetworkTest extends SimpleNetworkTest {
 
     @Override

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/DynamicallyIncludedDestinationsDuplexNetworkTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/DynamicallyIncludedDestinationsDuplexNetworkTest.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/DynamicallyIncludedDestinationsDuplexNetworkTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/DynamicallyIncludedDestinationsDuplexNetworkTest.java Wed Feb  6 22:56:12 2013
@@ -16,18 +16,19 @@
  */
 package org.apache.activemq.network;
 
-import org.apache.activemq.advisory.AdvisorySupport;
-import org.apache.activemq.broker.BrokerService;
-import org.apache.activemq.broker.TransportConnection;
-import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+
+import java.lang.reflect.Field;
 
 import javax.jms.MessageProducer;
 import javax.jms.TemporaryQueue;
-import java.lang.reflect.Field;
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
+import org.apache.activemq.advisory.AdvisorySupport;
+import org.apache.activemq.broker.BrokerService;
+import org.apache.activemq.broker.TransportConnection;
+import org.junit.Test;
 
 /**
  * @author <a href="http://www.christianposta.com/blog">Christian Posta</a>

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/NetworkConnectionsCleanedupTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/NetworkConnectionsCleanedupTest.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/NetworkConnectionsCleanedupTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/NetworkConnectionsCleanedupTest.java Wed Feb  6 22:56:12 2013
@@ -16,40 +16,22 @@
  */
 package org.apache.activemq.network;
 
-import java.net.URI;
 import java.util.ArrayList;
 import java.util.List;
 
 import javax.jms.Connection;
-import javax.jms.DeliveryMode;
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
 import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.jms.TopicRequestor;
-import javax.jms.TopicSession;
 
 import junit.framework.TestCase;
 
-import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.command.ActiveMQDestination;
 import org.apache.activemq.command.ActiveMQTopic;
-import org.apache.activemq.xbean.BrokerFactoryBean;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.springframework.context.support.AbstractApplicationContext;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
 
 public class NetworkConnectionsCleanedupTest extends TestCase {
 
     protected static final int MESSAGE_COUNT = 10;
-    private static final Logger LOG = LoggerFactory.getLogger(NetworkConnectionsCleanedupTest.class);
 
     protected AbstractApplicationContext context;
     protected Connection localConnection;
@@ -65,28 +47,25 @@ public class NetworkConnectionsCleanedup
     // skip this test. it runs for an hour, doesn't assert anything, and could probably
     // just be removed (seems like a throwaway impl for https://issues.apache.org/activemq/browse/AMQ-1202)
     public void skipTestNetworkConnections() throws Exception {
-    	String uri = "static:(tcp://localhost:61617)?initialReconnectDelay=100";
-    	List<ActiveMQDestination> list = new ArrayList<ActiveMQDestination>();
-    	for (int i =0;i < 100;i++){
-    	    list.add(new ActiveMQTopic("FOO"+i));
-    	}
-    	String bindAddress = "tcp://localhost:61616";
-		BrokerService broker = new BrokerService();
-		broker.setUseJmx(false);
-		broker.setPersistent(false);
-		broker.addConnector(bindAddress);
-		NetworkConnector network = broker.addNetworkConnector(uri);
-		network.setDynamicOnly(true);
-		network.setStaticallyIncludedDestinations(list);
-		uri = "static:(tcp://localhost:61618)?initialReconnectDelay=100";
-		network = broker.addNetworkConnector(uri);
+        String uri = "static:(tcp://localhost:61617)?initialReconnectDelay=100";
+        List<ActiveMQDestination> list = new ArrayList<ActiveMQDestination>();
+        for (int i =0;i < 100;i++){
+            list.add(new ActiveMQTopic("FOO"+i));
+        }
+        String bindAddress = "tcp://localhost:61616";
+        BrokerService broker = new BrokerService();
+        broker.setUseJmx(false);
+        broker.setPersistent(false);
+        broker.addConnector(bindAddress);
+        NetworkConnector network = broker.addNetworkConnector(uri);
         network.setDynamicOnly(true);
         network.setStaticallyIncludedDestinations(list);
-		broker.setUseShutdownHook(false);
-		broker.start();
-		Thread.sleep(1000 * 3600);
+        uri = "static:(tcp://localhost:61618)?initialReconnectDelay=100";
+        network = broker.addNetworkConnector(uri);
+        network.setDynamicOnly(true);
+        network.setStaticallyIncludedDestinations(list);
+        broker.setUseShutdownHook(false);
+        broker.start();
+        Thread.sleep(1000 * 3600);
     }
-
-    
-
 }

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/NetworkFailoverTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/NetworkFailoverTest.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/NetworkFailoverTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/NetworkFailoverTest.java Wed Feb  6 22:56:12 2013
@@ -37,7 +37,6 @@ import org.apache.activemq.ActiveMQConne
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.DestinationDoesNotExistException;
 import org.apache.activemq.broker.BrokerService;
-import org.apache.activemq.broker.region.policy.AbstractDeadLetterStrategy;
 import org.apache.activemq.broker.region.policy.SharedDeadLetterStrategy;
 import org.apache.activemq.command.ActiveMQQueue;
 import org.apache.activemq.transport.TransportFilter;
@@ -62,9 +61,9 @@ public class NetworkFailoverTest extends
     protected Session localSession;
     protected Session remoteSession;
     protected ActiveMQQueue included=new ActiveMQQueue("include.test.foo");
-    private AtomicInteger replyToNonExistDest = new AtomicInteger(0);
-    private AtomicInteger roundTripComplete = new AtomicInteger(0);
-    private AtomicInteger remoteDLQCount = new AtomicInteger(0);
+    private final AtomicInteger replyToNonExistDest = new AtomicInteger(0);
+    private final AtomicInteger roundTripComplete = new AtomicInteger(0);
+    private final AtomicInteger remoteDLQCount = new AtomicInteger(0);
 
     public void testRequestReply() throws Exception {
         final MessageProducer remoteProducer = remoteSession.createProducer(null);
@@ -116,7 +115,7 @@ public class NetworkFailoverTest extends
                 remoteDLQCount.incrementAndGet();
             }
         });
-       
+
         // allow for consumer infos to perculate arround
         Thread.sleep(2000);
         long done = System.currentTimeMillis() + (MESSAGE_COUNT * 6000);

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/NetworkRemovesSubscriptionsTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/NetworkRemovesSubscriptionsTest.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/NetworkRemovesSubscriptionsTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/NetworkRemovesSubscriptionsTest.java Wed Feb  6 22:56:12 2013
@@ -31,7 +31,7 @@ import org.apache.activemq.command.Activ
 /**
  * Various Tests to show the memory leak suspect in network of brokers. This is
  * for https://issues.apache.org/activemq/browse/AMQ-2530
- * 
+ *
  */
 public class NetworkRemovesSubscriptionsTest extends TestCase {
     private final static String frontEndAddress = "tcp://0.0.0.0:61617";
@@ -109,6 +109,7 @@ public class NetworkRemovesSubscriptions
         for (int i = 0; i < 100; i++) {
             TopicSession subscriberSession = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
             TopicSubscriber subscriber = subscriberSession.createSubscriber(topic);
+            assertNotNull(subscriber);
         }
 
         connection.close();
@@ -121,7 +122,7 @@ public class NetworkRemovesSubscriptions
     /**
      * Running this test you can produce a leak of only 2 ConsumerInfo on BE
      * broker, NOT 200 as in other cases!
-     * 
+     *
      */
     public void testWithoutSessionAndSubsciberClosePlayAround() throws Exception {
 
@@ -148,6 +149,7 @@ public class NetworkRemovesSubscriptions
 
     class DummyMessageListener implements MessageListener {
 
+        @Override
         public void onMessage(Message arg0) {
             // TODO Auto-generated method stub
 

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/NetworkTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/NetworkTestSupport.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/NetworkTestSupport.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/NetworkTestSupport.java Wed Feb  6 22:56:12 2013
@@ -36,7 +36,7 @@ import org.apache.activemq.usage.SystemU
 
 public class NetworkTestSupport extends BrokerTestSupport {
 
-    protected ArrayList connections = new ArrayList();
+    protected ArrayList<StubConnection> connections = new ArrayList<StubConnection>();
 
     protected TransportConnector connector;
 
@@ -46,18 +46,19 @@ public class NetworkTestSupport extends 
     protected TransportConnector remoteConnector;
     protected boolean useJmx = false;
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
 
-        remotePersistenceAdapter = createRemotePersistenceAdapter(true);        
+        remotePersistenceAdapter = createRemotePersistenceAdapter(true);
         remoteBroker = createRemoteBroker(remotePersistenceAdapter);
         remoteConnector = createRemoteConnector();
         remoteBroker.addConnector( remoteConnector );
         BrokerRegistry.getInstance().bind("remotehost", remoteBroker);
         remoteBroker.start();
     }
-    
-    
+
+    @Override
     protected BrokerService createBroker() throws Exception {
         BrokerService broker = BrokerFactory.createBroker(new URI("broker:()/localhost?persistent=false&useJmx=false&"));
         connector = createConnector();
@@ -66,7 +67,6 @@ public class NetworkTestSupport extends 
         return broker;
     }
 
-
     /**
      * @return
      * @throws Exception
@@ -111,6 +111,7 @@ public class NetworkTestSupport extends 
         return answer;
     }
 
+    @Override
     protected StubConnection createConnection() throws Exception {
         Transport transport = TransportFactory.connect(connector.getServer().getConnectURI());
         StubConnection connection = new StubConnection(transport);
@@ -138,7 +139,7 @@ public class NetworkTestSupport extends 
     /**
      * Simulates a broker restart. The memory based persistence adapter is
      * reused so that it does not "loose" it's "persistent" messages.
-     * 
+     *
      * @throws Exception
      */
     protected void restartRemoteBroker() throws Exception {
@@ -150,16 +151,17 @@ public class NetworkTestSupport extends 
         remotePersistenceAdapter.stop();
         remotePersistenceAdapter = createRemotePersistenceAdapter(false);
         remotePersistenceAdapter.start();
-        
+
         remoteBroker = createRemoteBroker(remotePersistenceAdapter);
         remoteBroker.addConnector(getRemoteURI());
         remoteBroker.start();
         BrokerRegistry.getInstance().bind("remotehost", remoteBroker);
     }
 
+    @Override
     protected void tearDown() throws Exception {
-        for (Iterator iter = connections.iterator(); iter.hasNext();) {
-            StubConnection connection = (StubConnection)iter.next();
+        for (Iterator<StubConnection> iter = connections.iterator(); iter.hasNext();) {
+            StubConnection connection = iter.next();
             connection.stop();
             iter.remove();
         }

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/SSHTunnelNetworkReconnectTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/SSHTunnelNetworkReconnectTest.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/SSHTunnelNetworkReconnectTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/SSHTunnelNetworkReconnectTest.java Wed Feb  6 22:56:12 2013
@@ -20,45 +20,43 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.net.URI;
 import java.util.ArrayList;
-import java.util.Iterator;
 
 import org.apache.activemq.broker.BrokerFactory;
 import org.apache.activemq.broker.BrokerService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  * Test network reconnects over SSH tunnels. This case can be especially tricky
  * since the SSH tunnels fool the TCP transport into thinking that they are
  * initially connected.
- * 
- * @author chirino
+ *
  */
 public class SSHTunnelNetworkReconnectTest extends NetworkReconnectTest {
-    private static final transient Logger LOG = LoggerFactory.getLogger(SSHTunnelNetworkReconnectTest.class);
 
-    ArrayList processes = new ArrayList();
+    ArrayList<Process> processes = new ArrayList<Process>();
 
+    @Override
     protected BrokerService createFirstBroker() throws Exception {
         return BrokerFactory
             .createBroker(new URI("xbean:org/apache/activemq/network/ssh-reconnect-broker1.xml"));
     }
 
+    @Override
     protected BrokerService createSecondBroker() throws Exception {
         return BrokerFactory
             .createBroker(new URI("xbean:org/apache/activemq/network/ssh-reconnect-broker2.xml"));
     }
 
+    @Override
     protected void setUp() throws Exception {
         startProcess("ssh -Nn -L60006:localhost:61616 localhost");
         startProcess("ssh -Nn -L60007:localhost:61617 localhost");
         super.setUp();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         super.tearDown();
-        for (Iterator iter = processes.iterator(); iter.hasNext();) {
-            Process p = (Process)iter.next();
+        for (Process p : processes) {
             p.destroy();
         }
     }
@@ -67,6 +65,7 @@ public class SSHTunnelNetworkReconnectTe
         final Process process = Runtime.getRuntime().exec(command);
         processes.add(process);
         new Thread("stdout: " + command) {
+            @Override
             public void run() {
                 try {
                     InputStream is = process.getInputStream();
@@ -79,6 +78,7 @@ public class SSHTunnelNetworkReconnectTe
             }
         }.start();
         new Thread("stderr: " + command) {
+            @Override
             public void run() {
                 try {
                     InputStream is = process.getErrorStream();

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/SimpleNetworkTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/SimpleNetworkTest.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/SimpleNetworkTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/SimpleNetworkTest.java Wed Feb  6 22:56:12 2013
@@ -16,9 +16,9 @@
  */
 package org.apache.activemq.network;
 
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 
 import java.net.URI;
 import java.util.Arrays;
@@ -103,6 +103,7 @@ public class SimpleNetworkTest {
         final MessageProducer remoteProducer = remoteSession.createProducer(null);
         MessageConsumer remoteConsumer = remoteSession.createConsumer(included);
         remoteConsumer.setMessageListener(new MessageListener() {
+            @Override
             public void onMessage(Message msg) {
                 try {
                     TextMessage textMsg = (TextMessage)msg;

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/jms/QueueBridgeStandaloneReconnectTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/jms/QueueBridgeStandaloneReconnectTest.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/jms/QueueBridgeStandaloneReconnectTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/jms/QueueBridgeStandaloneReconnectTest.java Wed Feb  6 22:56:12 2013
@@ -16,7 +16,19 @@
  */
 package org.apache.activemq.network.jms;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import javax.jms.Connection;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
 
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.broker.BrokerService;
@@ -25,17 +37,9 @@ import org.apache.activemq.util.Wait;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.*;
-import java.util.ArrayList;
-import java.util.Iterator;
 
 public class QueueBridgeStandaloneReconnectTest {
 
-    private static final Logger LOG = LoggerFactory.getLogger(QueueBridgeStandaloneReconnectTest.class);
-
     private SimpleJmsQueueConnector jmsQueueConnector;
 
     private BrokerService localBroker;
@@ -47,7 +51,7 @@ public class QueueBridgeStandaloneReconn
     private Destination outbound;
     private Destination inbound;
 
-    private ArrayList<Connection> connections = new ArrayList<Connection>();
+    private final ArrayList<Connection> connections = new ArrayList<Connection>();
 
     @Test
     public void testSendAndReceiveOverConnectedBridges() throws Exception {

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/jms/QueueOutboundBridgeReconnectTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/jms/QueueOutboundBridgeReconnectTest.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/jms/QueueOutboundBridgeReconnectTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/jms/QueueOutboundBridgeReconnectTest.java Wed Feb  6 22:56:12 2013
@@ -16,7 +16,23 @@
  */
 package org.apache.activemq.network.jms;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.concurrent.TimeUnit;
+
+import javax.jms.Connection;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
 
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.broker.BrokerService;
@@ -25,13 +41,6 @@ import org.apache.activemq.util.Wait;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.*;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.concurrent.TimeUnit;
 
 /**
  * These test cases are used to verify that queue outbound bridge connections get
@@ -40,14 +49,12 @@ import java.util.concurrent.TimeUnit;
  */
 public class QueueOutboundBridgeReconnectTest {
 
-    private static final Logger LOG = LoggerFactory.getLogger(QueueOutboundBridgeReconnectTest.class);
-
     private BrokerService producerBroker;
     private BrokerService consumerBroker;
     private ActiveMQConnectionFactory producerConnectionFactory;
     private ActiveMQConnectionFactory consumerConnectionFactory;
     private Destination destination;
-    private ArrayList<Connection> connections = new ArrayList<Connection>();
+    private final ArrayList<Connection> connections = new ArrayList<Connection>();
 
     @Test
     public void testMultipleProducerBrokerRestarts() throws Exception {

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/jms/TopicBridgeStandaloneReconnectTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/jms/TopicBridgeStandaloneReconnectTest.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/jms/TopicBridgeStandaloneReconnectTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/jms/TopicBridgeStandaloneReconnectTest.java Wed Feb  6 22:56:12 2013
@@ -16,7 +16,19 @@
  */
 package org.apache.activemq.network.jms;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import javax.jms.Connection;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
 
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.broker.BrokerService;
@@ -25,17 +37,9 @@ import org.apache.activemq.util.Wait;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.*;
-import java.util.ArrayList;
-import java.util.Iterator;
 
 public class TopicBridgeStandaloneReconnectTest {
 
-    private static final Logger LOG = LoggerFactory.getLogger(TopicBridgeStandaloneReconnectTest.class);
-
     private SimpleJmsTopicConnector jmsTopicConnector;
 
     private BrokerService localBroker;
@@ -47,7 +51,7 @@ public class TopicBridgeStandaloneReconn
     private Destination outbound;
     private Destination inbound;
 
-    private ArrayList<Connection> connections = new ArrayList<Connection>();
+    private final ArrayList<Connection> connections = new ArrayList<Connection>();
 
     @Test
     public void testSendAndReceiveOverConnectedBridges() throws Exception {

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/jms/TopicOutboundBridgeReconnectTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/jms/TopicOutboundBridgeReconnectTest.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/jms/TopicOutboundBridgeReconnectTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/jms/TopicOutboundBridgeReconnectTest.java Wed Feb  6 22:56:12 2013
@@ -16,7 +16,23 @@
  */
 package org.apache.activemq.network.jms;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.concurrent.TimeUnit;
+
+import javax.jms.Connection;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
 
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.broker.BrokerService;
@@ -25,14 +41,6 @@ import org.apache.activemq.util.Wait;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.*;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.concurrent.TimeUnit;
 
 /**
  * These test cases are used to verify that queue outbound bridge connections get
@@ -41,14 +49,12 @@ import java.util.concurrent.TimeUnit;
  */
 public class TopicOutboundBridgeReconnectTest {
 
-    private static final Logger LOG = LoggerFactory.getLogger(TopicOutboundBridgeReconnectTest.class);
-
     private BrokerService producerBroker;
     private BrokerService consumerBroker;
     private ActiveMQConnectionFactory producerConnectionFactory;
     private ActiveMQConnectionFactory consumerConnectionFactory;
     private Destination destination;
-    private ArrayList<Connection> connections = new ArrayList<Connection>();
+    private final ArrayList<Connection> connections = new ArrayList<Connection>();
 
     @Test
     public void testMultipleProducerBrokerRestarts() throws Exception {

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/openwire/BooleanStreamTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/openwire/BooleanStreamTest.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/openwire/BooleanStreamTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/openwire/BooleanStreamTest.java Wed Feb  6 22:56:12 2013
@@ -26,7 +26,7 @@ import junit.framework.AssertionFailedEr
 import junit.framework.TestCase;
 
 /**
- * 
+ *
  */
 public class BooleanStreamTest extends TestCase {
 
@@ -40,6 +40,7 @@ public class BooleanStreamTest extends T
 
     public void testBooleanMarshallingUsingAllTrue() throws Exception {
         testBooleanStream(numberOfBytes, new BooleanValueSet() {
+            @Override
             public boolean getBooleanValueFor(int index, int count) {
                 return true;
             }
@@ -48,6 +49,7 @@ public class BooleanStreamTest extends T
 
     public void testBooleanMarshallingUsingAllFalse() throws Exception {
         testBooleanStream(numberOfBytes, new BooleanValueSet() {
+            @Override
             public boolean getBooleanValueFor(int index, int count) {
                 return false;
             }
@@ -56,6 +58,7 @@ public class BooleanStreamTest extends T
 
     public void testBooleanMarshallingUsingOddAlternateTrueFalse() throws Exception {
         testBooleanStream(numberOfBytes, new BooleanValueSet() {
+            @Override
             public boolean getBooleanValueFor(int index, int count) {
                 return (index & 1) == 0;
             }
@@ -64,6 +67,7 @@ public class BooleanStreamTest extends T
 
     public void testBooleanMarshallingUsingEvenAlternateTrueFalse() throws Exception {
         testBooleanStream(numberOfBytes, new BooleanValueSet() {
+            @Override
             public boolean getBooleanValueFor(int index, int count) {
                 return (index & 1) != 0;
             }
@@ -121,13 +125,14 @@ public class BooleanStreamTest extends T
 
         // lets try read and we should get an exception
         try {
-            byte value = dis.readByte();
+            dis.readByte();
             fail("Should have reached the end of the stream");
         } catch (IOException e) {
             // worked!
         }
     }
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         openWireformat = createOpenWireFormat();

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/openwire/DataFileGenerator.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/openwire/DataFileGenerator.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/openwire/DataFileGenerator.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/openwire/DataFileGenerator.java Wed Feb  6 22:56:12 2013
@@ -25,11 +25,8 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.ArrayList;
-import java.util.Iterator;
 
-import junit.framework.Assert;
-
-public abstract class DataFileGenerator extends Assert {
+public abstract class DataFileGenerator extends org.junit.Assert {
 
     static final File MODULE_BASE_DIR;
     static final File CONTROL_DIR;
@@ -52,16 +49,16 @@ public abstract class DataFileGenerator 
      * @throws InstantiationException
      * @throws IllegalAccessException
      */
-    public static ArrayList getAllDataFileGenerators() throws Exception {
+    public static ArrayList<DataFileGenerator> getAllDataFileGenerators() throws Exception {
         // System.out.println("Looking for generators in : "+classFileDir);
-        ArrayList l = new ArrayList();
+        ArrayList<DataFileGenerator> l = new ArrayList<DataFileGenerator>();
         File[] files = CLASS_FILE_DIR.listFiles();
         for (int i = 0; files != null && i < files.length; i++) {
             File file = files[i];
             if (file.getName().endsWith("Data.java")) {
                 String cn = file.getName();
                 cn = cn.substring(0, cn.length() - ".java".length());
-                Class clazz = DataFileGenerator.class.getClassLoader().loadClass("org.apache.activemq.openwire." + cn);
+                Class<?> clazz = DataFileGenerator.class.getClassLoader().loadClass("org.apache.activemq.openwire." + cn);
                 l.add((DataFileGenerator)clazz.newInstance());
             }
         }
@@ -69,12 +66,11 @@ public abstract class DataFileGenerator 
     }
 
     private static void generateControlFiles() throws Exception {
-        ArrayList generators = getAllDataFileGenerators();
-        for (Iterator iter = generators.iterator(); iter.hasNext();) {
-            DataFileGenerator object = (DataFileGenerator)iter.next();
+        ArrayList<DataFileGenerator> generators = getAllDataFileGenerators();
+        for (DataFileGenerator element : generators) {
             try {
                 // System.out.println("Processing: "+object.getClass());
-                object.generateControlFile();
+                element.generateControlFile();
             } catch (Exception e) {
                 // System.err.println("Error while processing:
                 // "+object.getClass() + ". Reason: " + e);
@@ -112,11 +108,10 @@ public abstract class DataFileGenerator 
     }
 
     public static void assertAllControlFileAreEqual() throws Exception {
-        ArrayList generators = getAllDataFileGenerators();
-        for (Iterator iter = generators.iterator(); iter.hasNext();) {
-            DataFileGenerator object = (DataFileGenerator)iter.next();
+        ArrayList<DataFileGenerator> generators = getAllDataFileGenerators();
+        for (DataFileGenerator element : generators) {
             // System.out.println("Processing: "+object.getClass());
-            object.assertControlFileIsEqual();
+            element.assertControlFileIsEqual();
         }
     }
 

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/openwire/DataFileGeneratorTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/openwire/DataFileGeneratorTestSupport.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/openwire/DataFileGeneratorTestSupport.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/openwire/DataFileGeneratorTestSupport.java Wed Feb  6 22:56:12 2013
@@ -152,7 +152,7 @@ public abstract class DataFileGeneratorT
             } else if (expectedValue instanceof DataStructure) {
                 assertBeansEqual(message + name, comparedObjects, expectedValue, actualValue);
             } else if (expectedValue instanceof Enumeration) {
-            	assertEnumerationEqual(message + name, comparedObjects, (Enumeration)expectedValue, (Enumeration)actualValue);
+                assertEnumerationEqual(message + name, comparedObjects, (Enumeration<?>)expectedValue, (Enumeration<?>)actualValue);
             } else {
                 assertEquals(message, expectedValue, actualValue);
             }
@@ -166,12 +166,12 @@ public abstract class DataFileGeneratorT
             assertPropertyValuesEqual(message + ". element: " + i, comparedObjects, expected[i], actual[i]);
         }
     }
-    
-    protected void assertEnumerationEqual(String message, Set<Object> comparedObjects, Enumeration expected, Enumeration actual) throws Exception {
+
+    protected void assertEnumerationEqual(String message, Set<Object> comparedObjects, Enumeration<?> expected, Enumeration<?> actual) throws Exception {
         while (expected.hasMoreElements()) {
-        	Object expectedElem = expected.nextElement();
-        	Object actualElem = actual.nextElement();
-        	assertPropertyValuesEqual(message + ". element: " + expectedElem, comparedObjects, expectedElem, actualElem);
+            Object expectedElem = expected.nextElement();
+            Object actualElem = actual.nextElement();
+            assertPropertyValuesEqual(message + ". element: " + expectedElem, comparedObjects, expectedElem, actualElem);
         }
     }
 
@@ -204,6 +204,7 @@ public abstract class DataFileGeneratorT
         assertEquals(message, expected.getMessage(), actual.getMessage());
     }
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         openWireformat = createOpenWireFormat();



Mime
View raw message