@Test
	public void testVoterVote()
	{
		String pollId = null;
		Socket socket = null;
		try {
			socket = connectToServer();
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		// send a connection message indicating email address
		this.writer.println(MessageFactory.getConnectMessage("test@email.ca"));
		
		// send a createPoll message
		this.writer.println(MessageFactory.getCreatePollMessage(0));
		
		// wait for validation
		boolean recCreatePollReply = false;
		int messagesReceived = 0;
		String input = null;
		try {
			while(!recCreatePollReply && (input=this.reader.readLine()) != null)
			{
				messagesReceived++;
				System.out.println("Client: Received: " + input);
				
				Document doc = MessageFactory.stringToXmlDoc(input);
				
				assertNotNull(doc);
				
				if(doc != null && messagesReceived==2)
				{
					String messageType = doc.getDocumentElement().getNodeName();
					assertEquals(messageType, "createPollReply");
					recCreatePollReply = true;
					pollId = doc.getElementsByTagName("pollId").item(0).getTextContent();
				}
			}
		} catch (IOException e1) {
			e1.printStackTrace();
		}
		
		// poll is now created - attempt to vote on it
		DatagramSocket sendSocket = null;
		try {
			sendSocket = new DatagramSocket();
		} catch (SocketException e1) {
			e1.printStackTrace();
		}
		
		try {
			sendSocket.send(getVoteDatagramPacket(MessageFactory.getVoteMessage(pollId, "a")));
		} catch (IOException e1) {
			e1.printStackTrace();
		}
		
		sendSocket.close();
		
		try {
			socket.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}