import org.drools.ide.common.server.util.ScenarioXMLPersistence;
public class ScenarioXMLPersistenceTest extends TestCase {
public void testToXML() {
ScenarioXMLPersistence p = ScenarioXMLPersistence.getInstance();
Scenario sc = new Scenario();
String s = p.marshal(sc);
assertNotNull(s);
sc = getDemo();
s = p.marshal(sc);
assertTrue(s.indexOf("<ruleName>Life unverse and everything</ruleName>") > 0);
Scenario sc_ = p.unmarshal(s);
assertEquals(sc.globals.size(), sc_.globals.size());
assertEquals(sc.fixtures.size(), sc_.fixtures.size());
assertTrue(s.indexOf("org.drools") == -1); //check we have aliased all
}