public void testHalfPackets() throws Exception {
		clientEngine.beginHandshake();
		
		CalledMethod m = clientList.expect("packetEncrypted");
		ByteBuffer b = (ByteBuffer)m.getAllParams()[0];

		feedPacket(serverEngine, b);
		
		m = serverList.expect("runTask");		
		Runnable r = (Runnable)m.getAllParams()[0];
		r.run();
		
		m = serverList.expect("packetEncrypted");
		b = (ByteBuffer)m.getAllParams()[0];
		log.fine("remain1="+b.remaining());
		
		feedPacket(clientEngine, b);
		
		m = clientList.expect("runTask");		
		r = (Runnable)m.getAllParams()[0];
		r.run();
		
		String[] methodNames = new String[3];
		methodNames[0] = "packetEncrypted";
		methodNames[1] = "packetEncrypted";
		methodNames[2] = "packetEncrypted";
		CalledMethod[] methods = clientList.expect(methodNames);
		
		ByteBuffer b0 = (ByteBuffer)methods[0].getAllParams()[0];
		feedPacket(serverEngine, b0);
		
		m = serverList.expect("runTask");		
		r = (Runnable)m.getAllParams()[0];
		r.run();
		
		ByteBuffer b1 = (ByteBuffer)methods[1].getAllParams()[0];
		feedPacket(serverEngine, b1);
		
		ByteBuffer b2 = (ByteBuffer)methods[2].getAllParams()[0];
		feedPacket(serverEngine, b2);		
		
		methodNames = new String[3];
		methodNames[0] = "packetEncrypted";
		methodNames[1] = "packetEncrypted";
		methodNames[2] = "encryptedLinkEstablished";
		methods = serverList.expect(methodNames);
		
		b0 = (ByteBuffer)methods[0].getAllParams()[0];
		feedPacket(clientEngine, b0);
		
		b1 = (ByteBuffer)methods[1].getAllParams()[0];
		feedPacket(clientEngine, b1);
		
		clientList.expect("encryptedLinkEstablished");		
	}