package com.ociweb.oe.foglight.api;

import org.junit.Test;

import com.ociweb.iot.hardware.impl.test.TestHardware;
import com.ociweb.iot.maker.FogRuntime;
import com.ociweb.pronghorn.stage.scheduling.NonThreadScheduler;

/**
 * Unit test for simple App.
 */
public class AppTest { 

	
	 @Test
	    public void testApp()
	    {
		    FogRuntime runtime = FogRuntime.test(new Shutdown());	    	
	    	NonThreadScheduler scheduler = (NonThreadScheduler)runtime.getScheduler();    	
	    	TestHardware hardware = (TestHardware)runtime.getHardware();
	    
	    	scheduler.startup();
	    	
	    	int iterations = 10;
			while (--iterations >= 0) {
				    		
					scheduler.run();
					
					//test application here
					
			}
			
			scheduler.shutdown();
			
	    }
}

@@ -328,31 +328,11 @@
 %0A%09%09 
-   FogRuntime runtime =
+%0A%09%09
  Fog
@@ -347,21 +347,21 @@
 test
-(new 
+Until
 Shutdown
 ());
@@ -360,377 +360,45 @@
 down
-());%09    %09%0A%09    %09NonThreadScheduler scheduler = (NonThreadScheduler)runtime.getScheduler();    %09%0A%09    %09TestHardware hardware = (TestHardware)runtime.getHardware();%0A%09    %0A%09    %09scheduler.startup();%0A%09    %09%0A%09    %09int iterations = 10;%0A%09%09%09while (--iterations %3E= 0) %7B%0A%09%09%09%09    %09%09%0A%09%09%09%09%09scheduler.run();%0A%09%09%09%09%09%0A%09%09%09%09%09//test application here%0A%09%09%09%09%09%0A%09%09%09%7D%0A%09%09%09%0A%09%09%09scheduler.shutdown();
+Requested(new Shutdown(), 1000);%0A%09%09 %0A
 %0A%09%09%09

switch to new test method.