package gseproject.passive;

import static org.junit.Assert.*;

import org.junit.Test;

import gseproject.ServiceType;
import jade.lang.acl.ACLMessage;

public class SourcePalleteCommunicatorTest {
	/*
	@Test
	public void testSetup() {
		//PalleteCommunicator pcom = new PalleteCommunicator();
		//pcom.setup();
		fail("Not yet implemented");
	}
	*/

	@SuppressWarnings("deprecation")
	@Test
	public void testReceiveFINISH_BLOCKMessage() {
		SourcePalleteCommunicator pcom = new SourcePalleteCommunicator();
		pcom.requestFromRobot = new ACLMessage();
		pcom.reply(ServiceType.FINISH_BLOCK);
		assertEquals("Content should be NOPE!", "NOPE", pcom.aclMsgJustForUnittests.getContent());
	}
	@SuppressWarnings("deprecation")
	@Test
	public void testReceiveGIVE_BLOCK_CLEANEDMessage() {
		SourcePalleteCommunicator pcom = new SourcePalleteCommunicator();
		pcom.requestFromRobot = new ACLMessage();
		pcom.reply(ServiceType.GIVE_BLOCK_CLEANED);
		assertEquals("Content should be false!", "false", pcom.aclMsgJustForUnittests.getContent());
	}
	@SuppressWarnings("deprecation")
	@Test
	public void testReceiveGIVE_BLOCK_DIRTYMessage() {
		SourcePalleteCommunicator pcom = new SourcePalleteCommunicator();
		pcom.requestFromRobot = new ACLMessage();
		pcom.reply(ServiceType.GIVE_BLOCK_DIRTY);
		assertEquals("Content should be false!", "false", pcom.aclMsgJustForUnittests.getContent());
	}
	@SuppressWarnings("deprecation")
	@Test
	public void testReceiveGIVE_BLOCK_PAINTEDMessage() {
		SourcePalleteCommunicator pcom = new SourcePalleteCommunicator();
		pcom.requestFromRobot = new ACLMessage();
		pcom.reply(ServiceType.GIVE_BLOCK_PAINTED);
		assertEquals("Content should be false!", "false", pcom.aclMsgJustForUnittests.getContent());
	}
	@SuppressWarnings("deprecation")
	@Test
	public void testReceiveHAS_BLOCKMessage() {
		SourcePalleteCommunicator pcom = new SourcePalleteCommunicator();
		pcom.requestFromRobot = new ACLMessage();
		pcom.reply(ServiceType.HAS_BLOCK);
		assertEquals("Content should be true!", "true", pcom.aclMsgJustForUnittests.getContent());
	}
	@SuppressWarnings("deprecation")
	@Test
	public void testReceiveHAS_FINISHED_BLOCKMessage() {
		SourcePalleteCommunicator pcom = new SourcePalleteCommunicator();
		pcom.requestFromRobot = new ACLMessage();
		pcom.reply(ServiceType.HAS_FINISHED_BLOCK);
		assertEquals("Content should be NOPE!", "NOPE", pcom.aclMsgJustForUnittests.getContent());
	}
	@SuppressWarnings("deprecation")
	@Test
	public void testReceiveI_LEAVEMessage() {
		SourcePalleteCommunicator pcom = new SourcePalleteCommunicator();
		pcom.requestFromRobot = new ACLMessage();
		pcom.reply(ServiceType.I_LEAVE);
		assertEquals("Content should be true!", "true", pcom.aclMsgJustForUnittests.getContent());
	}
	@SuppressWarnings("deprecation")
	@Test
	public void testReceiveI_OCCUPYMessage() {
		SourcePalleteCommunicator pcom = new SourcePalleteCommunicator();
		pcom.requestFromRobot = new ACLMessage();
		pcom.reply(ServiceType.I_OCCUPY);
		assertEquals("Content should be true!", "true", pcom.aclMsgJustForUnittests.getContent());
	}
	@SuppressWarnings("deprecation")
	@Test
	public void testReceiveIS_OCCUPIEDMessage() {
		SourcePalleteCommunicator pcom = new SourcePalleteCommunicator();
		pcom.requestFromRobot = new ACLMessage();
		pcom.reply(ServiceType.IS_OCCUPIED);
		assertEquals("Content should be false!", "false", pcom.aclMsgJustForUnittests.getContent());
	}
	@SuppressWarnings("deprecation")
	@Test
	public void testReceiveNOPEMessage() {
		SourcePalleteCommunicator pcom = new SourcePalleteCommunicator();
		pcom.requestFromRobot = new ACLMessage();
		pcom.reply(ServiceType.NOPE);
		assertEquals("aclMsgJustForUnittests should be null!", null, pcom.aclMsgJustForUnittests);
	}
	@SuppressWarnings("deprecation")
	@Test
	public void testReceiveTAKE_BLOCKMessage() {
		SourcePalleteCommunicator pcom = new SourcePalleteCommunicator();
		pcom.requestFromRobot = new ACLMessage();
		pcom.reply(ServiceType.TAKE_BLOCK);
		assertEquals("Content should be DIRTY!", "DIRTY", pcom.aclMsgJustForUnittests.getContent());
	}

	/*
	@Test
	public void testReply() {
		fail("Not yet implemented");
	}

	@Test
	public void testReceiveInform() {
		fail("Not yet implemented");
	}
	*/
}

@@ -343,16 +343,123 @@
 %0A%09%7D%0A%09*/%0A
+%09@Test%0A%09public void failureTestForTravisToSeeIfItRunsOrNot() %7B%0A%09%09assertTrue(%22This will fail!%22, false);%0A%09%7D%0A%09
 %0A%09@Suppr

Update SourcePalleteCommunicatorTest.java