package com.jxml.quick.tests;
import com.jxml.quick.ocm.*;
import net.sourceforge.jxunit.*;
import com.jxml.protocol.*;

public class OcmStep implements JXTestStep
{
	public void eval(JXTestCase testCase)
		throws Throwable
	{
		Protocol.addJXMLProtocolPackage();
		JXProperties properties=testCase.getProperties();
		String schema=properties.getString("schema");
		String config=properties.getString("config");
		String file=properties.getString("file");
		String toFile=properties.getString("toFile");
		// Create the context
		OCMsinkSupport.SubSinkSupport subSink=OCMsinkSupport.createSink(schema,config,null);
		// Set the input
		subSink.setInputDocName(file);
		String output="";
		if ("".equals(toFile))
			output=subSink.express();
		else
		{
			subSink.setDocName(toFile);
			subSink.expressFile();
		}
		properties.put("output",output);
	}
}
