/*
* (c) Rob Gordon 2005.
*/
package org.oddjob.designer.components;
import junit.framework.TestCase;
import org.apache.log4j.Logger;
import org.oddjob.OddjobDescriptorFactory;
import org.oddjob.arooa.ArooaDescriptor;
import org.oddjob.arooa.ArooaParseException;
import org.oddjob.arooa.ArooaType;
import org.oddjob.arooa.design.DesignInstance;
import org.oddjob.arooa.design.DesignParser;
import org.oddjob.arooa.design.view.ViewMainHelper;
import org.oddjob.arooa.standard.StandardArooaSession;
import org.oddjob.arooa.xml.XMLConfiguration;
/**
*
*/
public class ForEachDCTest extends TestCase {
private static final Logger logger = Logger.getLogger(ForEachDCTest.class);
public void setUp() {
logger.debug("========================== " + getName() + "===================" );
}
DesignInstance design;
public void testCreate() throws ArooaParseException {
String xml =
"<foreach name=\"Each of Something\" preLoad=\"6\" purgeAfter=\"4\">" +
" <values>" +
" <files files=\"*\"/>" +
" </values>" +
"</foreach>";
ArooaDescriptor descriptor =
new OddjobDescriptorFactory().createDescriptor(null);
DesignParser parser = new DesignParser(
new StandardArooaSession(descriptor));
parser.setArooaType(ArooaType.COMPONENT);
parser.parse(new XMLConfiguration("TEST", xml));
design = parser.getDesign();
assertEquals(ForEachDesign.class, design.getClass());
}
public static void main(String args[]) throws ArooaParseException {
ForEachDCTest test = new ForEachDCTest();
test.testCreate();
ViewMainHelper view = new ViewMainHelper(test.design);
view.run();
}
}