<commit_before>package com.ociweb.iot.track1;

import org.junit.Test;

import com.ociweb.iot.hardware.impl.test.TestHardware;
import com.ociweb.iot.hardware.impl.test.TestI2CBacking;
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 IoTApp());
	    	    	

	    	TestHardware hardware = (TestHardware)runtime.getHardware();
	    
	    	TestI2CBacking backing = (TestI2CBacking)hardware.i2cBacking;
	    	
	    	NonThreadScheduler scheduler = (NonThreadScheduler)runtime.getScheduler();    	
	    	scheduler.startup();
	    	
	    	hardware.clearI2CWriteCount();
	    	
	    	hardware.write(IoTApp.ANGLE_SENSOR_PORT, 512);
	    	hardware.write(IoTApp.LIGHT_SENSOR_PORT, 300);
	    	
	    	
	    	
	    	
	 
//	    	scheduler.run();
//	    	
//	    	int i = hardware.getI2CWriteCount();
//	    	while (i>0) {
//	    		
//	    		hardware.outputLastI2CWrite(System.out,i--);<commit_msg>used method instead of direct field access<commit_after>package com.ociweb.iot.track1;

import org.junit.Test;

import com.ociweb.iot.hardware.impl.test.TestHardware;
import com.ociweb.iot.hardware.impl.test.TestI2CBacking;
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 IoTApp());
	    	    	

	    	TestHardware hardware = (TestHardware)runtime.getHardware();
	    
	    	TestI2CBacking backing = (TestI2CBacking)hardware.getI2CBacking();
	    	
	    	NonThreadScheduler scheduler = (NonThreadScheduler)runtime.getScheduler();    	
	    	scheduler.startup();
	    	
	    	hardware.clearI2CWriteCount();
	    	
	    	hardware.write(IoTApp.ANGLE_SENSOR_PORT, 512);
	    	hardware.write(IoTApp.LIGHT_SENSOR_PORT, 300);
	    	
	    	
	    	
	    	
	 
//	    	scheduler.run();
//	    	
//	    	int i = hardware.getI2CWriteCount();
//	    	while (i>0) {
//	    		
//	    		hardware.outputLastI2CWrite(System.out,i--);
{'fraction_non_alphanumeric': 0.11566484517304189, 'fraction_numerical': 0.01366120218579235, 'mean_word_length': 2.7174280879864634, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3521612', 'n_tokens_mistral': 868, 'n_tokens_neox': 805, 'n_words': 105}