@Test	
	public void testStatusMessagesFromRealConnection_withTraceEvents() throws ConnectionTimeout, ConnectionException, BadCompletedRequestListener {
		/**
		 * InTrace will notify this test object with connection status updates.
		 */
		Callback tc = new Callback();
		IConnectionList cl = DefaultConnectionList.getSingleton();

		HostPort hostPort = new HostPort(ConnectionTestUtils.DEFAULT_HOST_1, ConnectionTestUtils.DEFAULT_PORT_1);

		ClassInstrumentationCommand cic = new ClassInstrumentationCommand();
		cic.setIncludeClassRegEx(ConnectionTestUtils.TEST_CLASS_TO_INSTRUMENT_1);
		IAgentCommand commandArray[] = { cic };
		
		cl.connect(tc, hostPort, commandArray);
		
		IConnection myConn = cl.locateConnection(hostPort);
		//System.out.println("################################### Messages [" + tc.getMessages() + "]");
		assertNotNull("locateConnection was unable to find the recently-added connection, even though 'CONNECTED' was the last status", myConn );
		boolean ynLocateMessage = ConnectionTestUtils.locateMessage( tc.getMessages(),ConnectState.CONNECTED.toString());
		Assert.assertTrue("did not receive a CONNECTED status message", ynLocateMessage );
		Assert.assertFalse(	
				"whoops...most recent message is DISCONNECTED...thought we were still connected.", 
				ConnectionTestUtils.mostRecentMessageIsDisconnect(tc.getMessages())
				);
		
		
		DefaultTraceEventWriterImpl traceWriter = new DefaultTraceEventWriterImpl();
		EventList<ITraceEvent> traceEvents = new BasicEventList<ITraceEvent>();
		traceWriter.setTraceEvents(traceEvents);
		NetworkDataReceiverThread2 ndrt2 = myConn.getNetworkTraceThread2();
		//System.out.println("ConnectionPartTwo [" + myConn.hashCode() + "] NetworkDataReceiver [" + ndrt2.hashCode() + "] TraceWriter [" +  traceWriter.hashCode() + "]");
		ndrt2.addTraceWriter(traceWriter);

		/**
		 * Pause to collect some trace events from the Agent running on 9123.
		 */
		try {
			Thread.sleep(ConnectionTestUtils.EVENT_COLLECTION_TIME_MS);			
		} catch (InterruptedException ie) {
			fail("ThreadInterruptedExcpetion while collecting event data");
		}
		
		long traceEventCount = traceEvents.size();
		//System.out.println("Found [" + traceEventCount + "] events.");
		assertTrue("Collected fewer than 50 trace events", traceEventCount > 50);
		
		if (myConn!=null) {
			//assertEquals("expected a single connection in the ConnectionList", 1, cl.size());
			//myConn.disconnect();
			cl.disconnect(myConn, tc);
			assertEquals("Didn't get the expected disconnect status", myConn.getMasterCallback().getConnectState(), ConnectState.DISCONNECTED);
			
			//System.out.println("All connection messages: [" + tc.getMessages() + "]");
			
		} else {
			Assert.fail("Simple connection test, unable to locate connection in list");
		}
	}