use of org.whole.lang.builders.ModelBuilderOperation in project whole by wholeplatform.
the class PersistenceTest method testSingleBuilder2Java.
@Test
public void testSingleBuilder2Java() {
ModelBuilderOperation op = new ModelBuilderOperation();
JavaStoreProducerBuilderOperation javaOp = new JavaStoreProducerBuilderOperation(op);
((JavaStoreProducerBuilder) javaOp.wGetBuilder()).buildStartCompilationUnit("test", "Test");
try {
Properties props = PropertiesUtils.translate(System.getProperties());
props.getEntries().wAdd(0, createResolver(PropertiesEntityDescriptorEnum.Property));
new ModelTemplate(props).apply(javaOp);
} catch (IOException e) {
e.printStackTrace();
}
// new TopDownTraversal(new ModelsModel().create()).apply(javaOp);
((JavaStoreProducerBuilder) javaOp.wGetBuilder()).buildEndCompilationUnit();
// new ModelsModel().apply(new JavaStoreProducerBuilderOperation(op));
IEntity model = op.wGetResult();
PrettyPrinterOperation.prettyPrint(model);
}
use of org.whole.lang.builders.ModelBuilderOperation in project whole by wholeplatform.
the class PersistenceTest method testSingleModel2Xml.
@Test
public void testSingleModel2Xml() {
ModelBuilderOperation op = new ModelBuilderOperation();
IEntity model = new ModelsModel().create();
new ModelTemplate(model).apply(new XmlStoreProducerBuilderOperation(op));
IEntity xmlModel = op.wGetResult();
PrettyPrinterOperation.prettyPrint(xmlModel);
}
use of org.whole.lang.builders.ModelBuilderOperation 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);
}
use of org.whole.lang.builders.ModelBuilderOperation in project whole by wholeplatform.
the class PersistenceTest method _testXml2Builder.
public void _testXml2Builder() throws ParserConfigurationException, SAXException, IOException {
ModelBuilderOperation op = new ModelBuilderOperation();
SaxConsumerHandler.parse(this.getClass().getResourceAsStream("persistenceTest.xwl"), "UTF-8", true, new XmlStoreConsumerBuilderOperation(op));
}
use of org.whole.lang.builders.ModelBuilderOperation in project whole by wholeplatform.
the class ArtifactsGeneratorTest method getMetadataPattern.
private IEntity getMetadataPattern() {
ModelBuilderOperation op = new ModelBuilderOperation();
IArtifactsBuilder b0 = (IArtifactsBuilder) op.wGetBuilder(ArtifactsLanguageKit.URI);
ICommonsBuilder cb = (ICommonsBuilder) op.wGetBuilder(CommonsLanguageKit.URI);
b0.Workspace_();
cb.Resolver();
b0.Projects_(1);
b0.Project_();
b0.Name("test.java.project2");
b0.Natures_(1);
b0.Nature("org.eclipse.jdt.core.javanature");
b0._Natures();
cb.Resolver();
b0.Artifacts_(1);
b0.FolderArtifact_();
b0.Name("src/org.whole.lang");
b0.Metadata_();
b0.Copyright("Copyright 2004-2013 _name_.");
b0.License("* All rights reserved. This program and the accompanying materials\n* are made available under the terms of the GNU Lesser General Public License\n* which accompanies this distribution, and is available at\n* http://www.gnu.org/copyleft/lesser.html");
b0.Author("_name_");
b0.Attributes_(1);
b0.Attribute("source");
b0._Attributes();
b0._Metadata();
b0.Artifacts_(1);
b0.PackageArtifact_();
b0.Name("org.whole.lang");
cb.Resolver();
b0.Artifacts();
b0._PackageArtifact();
b0._Artifacts();
b0._FolderArtifact();
b0._Artifacts();
b0._Project();
b0._Projects();
b0._Workspace();
return op.wGetResult();
}
Aggregations