/**
 * The contents of this file are subject to the OpenMRS Public License
 * Version 1.0 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 * http://license.openmrs.org
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations
 * under the License.
 *
 * Copyright (C) OpenMRS, LLC.  All Rights Reserved.
 */
package org.openmrs.api.arden;

import org.junit.Test;
import org.openmrs.api.context.Context;
import org.openmrs.test.BaseContextSensitiveTest;

/**
 * TODO Finish this arden test class?  delete this test class?
 */
public class ArdenServiceTest extends BaseContextSensitiveTest {
	int MAX_MLM = 1000;
	
	@Test
	public void shouldClass() throws Exception {

	//	Integer pid = 1;
	//	Patient patient;
	//	ArdenDataSource dataSource;
		String [] mlmNames = {
			//	"directexphiriskcountry.mlm",
			//	"directtbcontact.mlm",
			//	"indirectexphiriskcountry.mlm",
			//	"indirecttbcontact.mlm",
			//	"HiRiskLeadScreen.mlm",
				"leadspecpws2.mlm"
		};
		String defaultPath = "asd fasdf asdf test/arden test/";
		
		for (int i = 0; i<mlmNames.length; i++) {
			Context.getArdenService().compileFile(defaultPath + mlmNames[i], "output");
		}
			
	//	Context.getArdenService().compileFile("test/arden test/directexphiriskcountry.mlm");
	

 /*		patient = Context.getPatientService().getPatient(pid);
		dataSource = new DefaultArdenDataSource(); 

 		
		ArdenRule [] mlms = {
				 new HiRiskLeadScreen(patient ,dataSource)
//				,new directtbcontact(patient, dataSource)
					
		};
		for (int i = 0; i < mlms.length; i++){
			
			ArdenRule mlm = mlms[i].getInstance();
			if(mlm != null) {
				if(mlm.evaluate()) {
					System.out.println(mlm.doAction());
					mlm.printDebug();
				}
				
			}
		}
*/	
	}
	
}
@@ -606,24 +606,46 @@
 unit.Test;%0D%0A
+import java.io.File;%0D%0A
 import org.o
@@ -952,93 +952,16 @@
 %0D%0A%0D%0A
-%09//%09Integer pid = 1;%0D%0A%09//%09Patient patient;%0D%0A%09//%09ArdenDataSource dataSource;%0D%0A
 %09%09String
  %5B%5D 
@@ -960,908 +960,485 @@
 ring
- %5B%5D
  mlm
-Names = %7B%0D%0A%09%09%09//%09%22directexphiriskcountry.mlm%22,%0D%0A%09%09%09//%09%22directtbcontact.mlm%22,%0D%0A%09%09%09//%09%22indirectexphiriskcountry.mlm%22,%0D%0A%09%09%09//%09%22indirecttbcontact.mlm%22,%0D%0A%09%09%09//%09%22HiRiskLeadScreen.mlm%22,%0D%0A%09%09%09%09%22leadspecpws2.mlm%22%0D%0A%09%09%7D;%0D%0A%09%09String defaultPath = %22asd fasdf asdf test/arden test/%22;%0D%0A%09%09%0D%0A%09%09for (int i = 0; i%3CmlmNames.length; i++) %7B%0D%0A%09%09%09Context.getArdenService().compileFile(defaultPath + mlmNames%5Bi%5D, %22output%22);%0D%0A%09%09%7D%0D%0A%09%09%09%0D%0A%09//%09Context.getArdenService().compileFile(%22test/arden test/directexphiriskcountry.mlm%22);%0D%0A%09%0D%0A%0D%0A /*%09%09patient = Context.getPatientService().getPatient(pid);%0D%0A%09%09dataSource = new DefaultArdenDataSource(); %0D%0A%0D%0A %09%09%0D%0A%09%09ArdenRule %5B%5D mlms = %7B%0D%0A%09%09%09%09 new HiRiskLeadScreen(patient ,dataSource)%0D%0A//%09%09%09%09,new directtbcontact(patient, dataSource)
+Directory = %22c:%5C%5Cmlm%5C%5C%22; //%22C:%5C%5CWORKSPACE%5C%5Cchica%5C%5CruleLibrary%5C%5C%22; //%22C:%5C%5CDocuments and Settings%5C%5Ctmdugan%5C%5Cworkspace%5C%5Cchica%5C%5CruleLibrary%5C%5Ctest%5C%5C%22;%0D%0A%09%09String javaDirectory = %22c:%5C%5Cmlm%5C%5C%22; //%22C:%5C%5CWORKSPACE%5C%5Cchica%5C%5CruleLibrary%5C%5CNew%5C%5C%22;  //%22C:%5C%5CDocuments and Settings%5C%5Ctmdugan%5C%5Cworkspace%5C%5Cchica%5C%5CruleLibrary%5C%5Ctest%5C%5C%22;%0D%0A%09%09%0D%0A%09%09File mlmDir = new File(mlmDirectory);
 %0D%0A%09%09
-%09%09%09
 %0D%0A%09%09
-%7D;%0D%0A%09%09for (int i = 0; i %3C mlms.length; i++)%7B
+String%5B%5D mlmFiles = mlmDir.list();
 %0D%0A%09%09
-%09
 %0D%0A%09%09
-%09ArdenRule mlm = mlms%5Bi%5D.getInstance();%0D%0A%09%09%09if(mlm != null) %7B%0D%0A%09%09%09%09if(mlm.evaluate(
+for (String mlmFile:mlmFiles) %7B%0D%0A%09%09%09if(mlmFile.endsWith(%22.mlm%22
 ))
- 
 %7B%0D%0A
-%09%09
 %09%09%09S
@@ -1459,77 +1459,115 @@
 tln(
-mlm.doAction());%0D%0A%09%09%09%09%09mlm.printDebug(
+%22Parsing: %22+mlmFile);%0D%0A%09%09%09Context.getArdenService().compileFile(mlmDirectory+mlmFile, javaDirectory
 );%0D%0A
-%09%09
 %09%09%7D
-%0D%0A%09%09%09%09%0D%0A%09%09%09%7D%0D%0A%09%09%7D%0D%0A*/%09
+%7D
 %0D%0A%09%7D

Fix shouldClass()