Search in sources :

Example 1 with WholeLanguage

use of org.whole.lang.misc.codebase.WholeLanguage in project whole by wholeplatform.

the class PersistenceTest method testMultipleBuilders2Xml.

@Test
public void testMultipleBuilders2Xml() {
    ModelBuilderOperation op = new ModelBuilderOperation();
    XmlStoreProducerBuilderOperation xmlOp = new XmlStoreProducerBuilderOperation(op);
    ((XmlStoreProducerBuilder) xmlOp.wGetBuilder()).buildStartDocument();
    new WholeLanguage().apply(xmlOp);
    ((XmlStoreProducerBuilder) xmlOp.wGetBuilder()).buildEndDocument();
    IEntity xmlModel = op.wGetResult();
    PrettyPrinterOperation.prettyPrint(xmlModel);
}
Also used : ModelBuilderOperation(org.whole.lang.builders.ModelBuilderOperation) XmlStoreProducerBuilder(org.whole.lang.xml.util.XmlStoreProducerBuilder) IEntity(org.whole.lang.model.IEntity) XmlStoreProducerBuilderOperation(org.whole.lang.xml.util.XmlStoreProducerBuilderOperation) WholeLanguage(org.whole.lang.misc.codebase.WholeLanguage) Test(org.junit.Test)

Example 2 with WholeLanguage

use of org.whole.lang.misc.codebase.WholeLanguage in project whole by wholeplatform.

the class PersistenceTest method testXMLPersistence.

@Test
public void testXMLPersistence() {
    IEntity model1 = new TestEntities().create();
    IEntity model2 = xmlRoundtrip(model1);
    assertTrue(Matcher.match(model1, model2));
    model1 = new ModelsModel().create();
    model2 = xmlRoundtrip(model1);
    assertTrue(Matcher.match(model1, model2));
    model1 = new WholeLanguage().create();
    model2 = xmlRoundtrip(model1);
    assertTrue(Matcher.match(model1, model2));
}
Also used : TestEntities(org.whole.lang.models.codebase.TestEntities) IEntity(org.whole.lang.model.IEntity) WholeLanguage(org.whole.lang.misc.codebase.WholeLanguage) ModelsModel(org.whole.lang.models.codebase.ModelsModel) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 WholeLanguage (org.whole.lang.misc.codebase.WholeLanguage)2 IEntity (org.whole.lang.model.IEntity)2 ModelBuilderOperation (org.whole.lang.builders.ModelBuilderOperation)1 ModelsModel (org.whole.lang.models.codebase.ModelsModel)1 TestEntities (org.whole.lang.models.codebase.TestEntities)1 XmlStoreProducerBuilder (org.whole.lang.xml.util.XmlStoreProducerBuilder)1 XmlStoreProducerBuilderOperation (org.whole.lang.xml.util.XmlStoreProducerBuilderOperation)1