Package org.milyn.test.ant

Examples of org.milyn.test.ant.AntRunner


    private Archive buildBindingModel(String urn, String[] messages) throws IOException, SAXException, IllegalNameException, ClassNotFoundException {
        ClassLoader origTCCL = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(mappingModelClassLoader);
        try {
            AntRunner antRunner = new AntRunner("build.xml");
            EJCExecutor ejc = new EJCExecutor();
            File destDir = new File("target/ejc/src");

            antRunner.run("delete");

            if(messages != null && messages.length != 0) {
                ejc.setMessages(CollectionsUtil.toSet(messages));
            }
            ejc.setDestDir(destDir);
            ejc.setEdiMappingModel("urn:" + urn);
            ejc.setPackageName(EJCTestUtil.ORG_SMOOKS_EJC_TEST);

            // Build the source...
            ejc.execute();

            // Compile it...
            antRunner.run("compile");

            // Build and return an archive instance from the compiled sources...
            return new Archive(new ZipInputStream(new FileInputStream("./target/ejc/ejc.jar")));
        } finally {
            Thread.currentThread().setContextClassLoader(origTCCL);
View Full Code Here


    public static Archive buildModelArchive(InputStream mappingModel, String modelJavaPackage) throws EDIConfigurationException, ClassNotFoundException, IOException, SAXException, IllegalNameException {
        BeanWriter.setGenerateFromEDINR(true);

        try {
            AntRunner antRunner = new AntRunner("build.xml");
            EJC ejc = new EJC();

            antRunner.run("delete");
            ejc.compile(mappingModel, modelJavaPackage, "./target/ejc/src");
            antRunner.run("compile");

            return new Archive(new ZipInputStream(new FileInputStream("./target/ejc/ejc.jar")));
        } finally {
            BeanWriter.setGenerateFromEDINR(false);
        }
View Full Code Here

TOP

Related Classes of org.milyn.test.ant.AntRunner

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.