*/
	@Test
	public void testNormConveyorThreeGlassThirdNeedDrilling() throws InterruptedException {
		
		Glass testGlass1 = new Glass(new Recipe());
		Glass testGlass2 = new Glass(new Recipe());
		Glass testGlass3 = new Glass(new Recipe(false, false, false, false, true, false, false, false, false, false));
		
		// Set initial state
		conveyor.setPopUpCleared(false);
		
		conveyor.msgGlassOnConveyor(testGlass1);
		conveyor.msgGlassOnConveyor(testGlass2);
		conveyor.msgGlassOnConveyor(testGlass3);
		
		conveyor.pickAndExecuteAnAction();
		
		assertTrue(
				"Mock Sensor should have the glass passed onto it. Event log: "
						+ getLogs(), popupSensor.log
						.containsString("Received message msgSenseGlass"));
		
		assertTrue("Sensor should have only received 1 message."
				+ getLogs(), popupSensor.log.size() == 1);

		conveyor.msgGlassApproachingPopup(testGlass1);
		
		conveyor.releasePopupSemaphore();
		
		conveyor.pickAndExecuteAnAction();
		
		assertTrue("Sensor should have only received 1 message."
				+ getLogs(), popupSensor.log.size() == 1);
		
		assertTrue(
				"Mock popup should have been asked if its clear. Event log: "
						+ getLogs(), popup.log
						.containsString("Received message msgIsPopupClear"));
		
		assertTrue("Popup should have only received 1 message."
						+ getLogs(), popup.log.size() == 1);
		
		Thread.sleep(100);
		
		assertTrue(
				"Transducer should have received a conveyor stop message. Event log: "
						+ getLogs(), transducerLog
						.containsString("Received fired event: CONVEYOR_DO_STOP"));
		
		assertTrue("Transducer should have only received 1 message."
						+ getLogs(), transducerLog.size() == 1);
		transducerLog.clear();
		
		assertTrue(
				"Previous Conveyor Family should have received a conveyor stop message. Event log: "
						+ getLogs(), previousConveyorFamily.log
						.containsString("Received message msgStopConveyor"));
		
		assertTrue("Previous Conveyor Family should have only received 1 message."
				+ getLogs(), previousConveyorFamily.log.size() == 1);
		previousConveyorFamily.log.clear();
		
		//run scheduler again to see if the conveyor reacts correctly to not receiving permission to place glass on popup
		
		conveyor.releasePopupSemaphore();
		
		conveyor.pickAndExecuteAnAction();
		
		assertTrue("Sensor should have only received 1 message."
				+ getLogs(), popupSensor.log.size() == 1);
		
		assertTrue(
				"Mock popup should have been asked if its clear. Event log: "
						+ getLogs(), popup.log
						.containsString("Received message msgIsPopupClear"));
		
		assertTrue("Popup should have only received 2 messages."
						+ getLogs(), popup.log.size() == 2);
		
		Thread.sleep(100);
		
		//Conveyor already stopped, shouldn't send the message to transducer again
		//or message previous conveyor family to stop
		assertFalse(
				"Transducer should have received a conveyor stop message. Event log: "
						+ getLogs(), transducerLog
						.containsString("Received fired event: CONVEYOR_DO_STOP"));
		
		assertTrue("Transducer should have only received 0 messages."
						+ getLogs(), transducerLog.size() == 0);
		transducerLog.clear();
		
		assertFalse(
				"Previous Conveyor Family should have received a conveyor stop message. Event log: "
						+ getLogs(), previousConveyorFamily.log
						.containsString("Received message msgStopConveyor"));
		
		assertTrue("Previous Conveyor Family should have only received 0 messages."
				+ getLogs(), previousConveyorFamily.log.size() == 0);
		previousConveyorFamily.log.clear();

		conveyor.msgPopupClear();
		
		conveyor.pickAndExecuteAnAction();

		Thread.sleep(100);
		
		assertTrue(
				"Previous Conveyor Family should have received a conveyor start message. Event log: "
						+ getLogs(), previousConveyorFamily.log
						.containsString("Received message msgStartConveyor"));
		
		assertTrue("Previous Conveyor Family should have only received 1 message."
				+ getLogs(), previousConveyorFamily.log.size() == 1);
		previousConveyorFamily.log.clear();
		assertTrue(
				"Transducer should have received a conveyor start message. Event log: "
						+ getLogs(), transducerLog
						.containsString("Received fired event: CONVEYOR_DO_START"));
		assertTrue("Transducer should have only received 1 message."
						+ getLogs(), transducerLog.size() == 1);
		transducerLog.clear();
		assertTrue(
				"Mock popup should have received the first glass. Event log: "
						+ getLogs(), popup.log
						.containsString("Received message msgGlassOnPopup"));
		assertTrue("Popup should have only received 3 messages."
						+ getLogs(), popup.log.size() == 3);
		assertTrue(
				"The glass should not need drilling according to recipe. Event log: "
						+ getLogs(), popup.log
						.containsString("needDrilling false"));
		popup.log.clear();
		
		conveyor.pickAndExecuteAnAction();
		
		assertTrue(
				"Mock Sensor should have the glass passed onto it. Event log: "
						+ getLogs(), popupSensor.log
						.containsString("Received message msgSenseGlass"));
		
		assertTrue("Sensor should have only received 2 messages."
				+ getLogs(), popupSensor.log.size() == 2);

		conveyor.msgGlassApproachingPopup(testGlass2);
		
		conveyor.releasePopupSemaphore();
		
		conveyor.pickAndExecuteAnAction();
		
		assertTrue("Sensor should have only received 2 messages."
				+ getLogs(), popupSensor.log.size() == 2);
		
		assertTrue(
				"Mock popup should have been asked if its clear. Event log: "
						+ getLogs(), popup.log
						.containsString("Received message msgIsPopupClear"));
		
		assertTrue("Popup should have only received 1 message."
						+ getLogs(), popup.log.size() == 1);
		
		Thread.sleep(100);
		
		assertTrue(
				"Transducer should have received a conveyor stop message. Event log: "
						+ getLogs(), transducerLog
						.containsString("Received fired event: CONVEYOR_DO_STOP"));
		
		assertTrue("Transducer should have only received 1 message."
						+ getLogs(), transducerLog.size() == 1);
		transducerLog.clear();
		
		assertTrue(
				"Previous Conveyor Family should have received a conveyor stop message. Event log: "
						+ getLogs(), previousConveyorFamily.log
						.containsString("Received message msgStopConveyor"));
		
		assertTrue("Previous Conveyor Family should have only received 1 message."
				+ getLogs(), previousConveyorFamily.log.size() == 1);
		previousConveyorFamily.log.clear();
		
		//run scheduler again to see if the conveyor reacts correctly to not receiving permission to place glass on popup
		
		conveyor.releasePopupSemaphore();
		
		conveyor.pickAndExecuteAnAction();
		
		assertTrue("Sensor should have only received 2 messages."
				+ getLogs(), popupSensor.log.size() == 2);
		
		assertTrue(
				"Mock popup should have been asked if its clear. Event log: "
						+ getLogs(), popup.log
						.containsString("Received message msgIsPopupClear"));
		
		assertTrue("Popup should have only received 2 messages."
						+ getLogs(), popup.log.size() == 2);
		
		Thread.sleep(100);
		
		//Conveyor already stopped, shouldn't send the message to transducer again
		//or message previous conveyor family to stop
		assertFalse(
				"Transducer should have received a conveyor stop message. Event log: "
						+ getLogs(), transducerLog
						.containsString("Received fired event: CONVEYOR_DO_STOP"));
		
		assertTrue("Transducer should have only received 0 messages."
						+ getLogs(), transducerLog.size() == 0);
		transducerLog.clear();
		
		assertFalse(
				"Previous Conveyor Family should have received a conveyor stop message. Event log: "
						+ getLogs(), previousConveyorFamily.log
						.containsString("Received message msgStopConveyor"));
		
		assertTrue("Previous Conveyor Family should have only received 0 messages."
				+ getLogs(), previousConveyorFamily.log.size() == 0);
		previousConveyorFamily.log.clear();

		conveyor.msgPopupClear();
		
		conveyor.pickAndExecuteAnAction();

		Thread.sleep(100);
		
		assertTrue(
				"Previous Conveyor Family should have received a conveyor start message. Event log: "
						+ getLogs(), previousConveyorFamily.log
						.containsString("Received message msgStartConveyor"));
		
		assertTrue("Previous Conveyor Family should have only received 1 message."
				+ getLogs(), previousConveyorFamily.log.size() == 1);
		previousConveyorFamily.log.clear();
		assertTrue(
				"Transducer should have received a conveyor start message. Event log: "
						+ getLogs(), transducerLog
						.containsString("Received fired event: CONVEYOR_DO_START"));
		assertTrue("Transducer should have only received 1 message."
						+ getLogs(), transducerLog.size() == 1);
		transducerLog.clear();
		assertTrue(
				"Mock popup should have received the second glass. Event log: "
						+ getLogs(), popup.log
						.containsString("Received message msgGlassOnPopup"));
		assertTrue("Popup should have only received 3 messages."
						+ getLogs(), popup.log.size() == 3);
		assertTrue(
				"The glass should not need drilling according to recipe. Event log: "
						+ getLogs(), popup.log
						.containsString("needDrilling false"));
		popup.log.clear();
		
		conveyor.pickAndExecuteAnAction();
		
		assertTrue(
				"Mock Sensor should have the glass passed onto it. Event log: "
						+ getLogs(), popupSensor.log
						.containsString("Received message msgSenseGlass"));
		
		assertTrue("Sensor should have only received 3 messages."
				+ getLogs(), popupSensor.log.size() == 3);

		conveyor.msgGlassApproachingPopup(testGlass3);
		
		conveyor.releasePopupSemaphore();
		
		conveyor.pickAndExecuteAnAction();
		
		assertTrue("Sensor should have only received 3 messages."
				+ getLogs(), popupSensor.log.size() == 3);
		
		assertTrue(
				"Mock popup should have been asked if its clear. Event log: "
						+ getLogs(), popup.log
						.containsString("Received message msgIsPopupClear"));
		
		assertTrue("Popup should have only received 1 message."
						+ getLogs(), popup.log.size() == 1);
		
		Thread.sleep(100);
		
		assertTrue(
				"Transducer should have received a conveyor stop message. Event log: "
						+ getLogs(), transducerLog
						.containsString("Received fired event: CONVEYOR_DO_STOP"));
		
		assertTrue("Transducer should have only received 1 message."
						+ getLogs(), transducerLog.size() == 1);
		transducerLog.clear();
		
		assertTrue(
				"Previous Conveyor Family should have received a conveyor stop message. Event log: "
						+ getLogs(), previousConveyorFamily.log
						.containsString("Received message msgStopConveyor"));
		
		assertTrue("Previous Conveyor Family should have only received 1 message."
				+ getLogs(), previousConveyorFamily.log.size() == 1);
		previousConveyorFamily.log.clear();
		
		//run scheduler again to see if the conveyor reacts correctly to not receiving permission to place glass on popup
		
		conveyor.releasePopupSemaphore();
		
		conveyor.pickAndExecuteAnAction();
		
		assertTrue("Sensor should have only received 3 messages."
				+ getLogs(), popupSensor.log.size() == 3);
		
		assertTrue(
				"Mock popup should have been asked if its clear. Event log: "
						+ getLogs(), popup.log
						.containsString("Received message msgIsPopupClear"));
		
		assertTrue("Popup should have only received 2 messages."
						+ getLogs(), popup.log.size() == 2);
		
		Thread.sleep(100);
		
		//Conveyor already stopped, shouldn't send the message to transducer again
		//or message previous conveyor family to stop
		assertFalse(
				"Transducer should have received a conveyor stop message. Event log: "
						+ getLogs(), transducerLog
						.containsString("Received fired event: CONVEYOR_DO_STOP"));
		
		assertTrue("Transducer should have only received 0 messages."
						+ getLogs(), transducerLog.size() == 0);
		transducerLog.clear();
		
		assertFalse(
				"Previous Conveyor Family should have received a conveyor stop message. Event log: "
						+ getLogs(), previousConveyorFamily.log
						.containsString("Received message msgStopConveyor"));
		
		assertTrue("Previous Conveyor Family should have only received 0 messages."
				+ getLogs(), previousConveyorFamily.log.size() == 0);
		previousConveyorFamily.log.clear();

		conveyor.msgPopupClear();
		
		conveyor.pickAndExecuteAnAction();

		Thread.sleep(100);
		
		assertTrue(
				"Previous Conveyor Family should have received a conveyor start message. Event log: "
						+ getLogs(), previousConveyorFamily.log
						.containsString("Received message msgStartConveyor"));
		
		assertTrue("Previous Conveyor Family should have only received 1 message."
				+ getLogs(), previousConveyorFamily.log.size() == 1);
		previousConveyorFamily.log.clear();
		assertTrue(
				"Transducer should have received a conveyor start message. Event log: "
						+ getLogs(), transducerLog
						.containsString("Received fired event: CONVEYOR_DO_START"));
		assertTrue("Transducer should have only received 1 message."
						+ getLogs(), transducerLog.size() == 1);
		transducerLog.clear();
		assertTrue(
				"Mock popup should have received the third glass. Event log: "
						+ getLogs(), popup.log
						.containsString("Received message msgGlassOnPopup"));
		assertTrue("Popup should have only received 3 messages."
						+ getLogs(), popup.log.size() == 3);
		assertTrue(
				"The glass should need drilling according to recipe. Event log: "
						+ getLogs(), popup.log
						.containsString("needDrilling true"));
		}