Examples of EasyAntReport


Examples of org.apache.easyant.core.report.EasyAntReport

        return pluginService.generateEasyAntReport(module, moduleAnt, null);
    }

    @Test
    public void testGenerateReport() throws Exception {
        EasyAntReport eaReport = generateReport();
        Assert.assertNotNull(eaReport);

        // the report should contain the run-java plugin
        boolean containsBuildType = false;
        boolean containsPlugin = true;
        for (ImportedModuleReport importedModule : eaReport.getImportedModuleReports()) {
            if (importedModule.getModuleMrid().equals("org.apache.easyant.buildtypes#build-std-java;0.9")) {
                containsBuildType = true;
            }
            if (importedModule.getModuleMrid().equals("org.apache.easyant.plugins#run-java;0.9")) {
                containsPlugin = true;
            }
        }
        Assert.assertTrue(containsBuildType);
        Assert.assertTrue(containsPlugin);

        // be sure that the property exist
        PropertyDescriptor property = eaReport.getPropertyDescriptors().get("run.main.classname");
        Assert.assertNotNull(property);
        // check the value of the property
        Assert.assertEquals("org.apache.easyant.example.Example", property.getValue());

        // be sure that the property exist
        PropertyDescriptor srcMainJava = eaReport.getAvailableProperties().get("src.main.java");
        Assert.assertNotNull(srcMainJava);
        // check the value of the property
        Assert.assertEquals("${basedir}/src/main/java", srcMainJava.getValue());

        // the property should also be contained in getAvailableProperties which
        // list all properties (those for the current module and those in
        // imported modules)
        property = eaReport.getAvailableProperties().get("run.main.classname");
        Assert.assertNotNull(property);
        // check the value of the property
        Assert.assertEquals("org.apache.easyant.example.Example", property.getValue());

        // check that package ExtensionPoint exists and that jar:jar target is bound to
        // this extension-point
        ExtensionPointReport packageEP = null;
        for (ExtensionPointReport extensionPoint : eaReport.getExtensionPointReports()) {
            if ("package".equals(extensionPoint.getName())) {
                packageEP = extensionPoint;
                break;
            }
        }
        Assert.assertNotNull(packageEP);
        Assert.assertEquals("compile,abstract-package:package,hello-world", packageEP.getDepends());

        List<TargetReport> targets = packageEP.getTargetReports();
        Set<String> expectedTargets = new HashSet<String>(Arrays.asList("hello-world"));
        Assert.assertEquals(expectedTargets.size(), targets.size());

        for (TargetReport target : packageEP.getTargetReports()) {
            Assert.assertTrue("expected to find " + target.getName(), expectedTargets.remove(target.getName()));
        }

        TargetReport helloWorld = eaReport.getTargetReport("hello-world");
        Assert.assertNotNull(helloWorld);
        Assert.assertTrue("package".equals(helloWorld.getExtensionPoint()));
    }
View Full Code Here

Examples of org.apache.easyant.core.report.EasyAntReport

        PluginService pluginService = (PluginService) getProject().getReference(
                EasyAntMagicNames.PLUGIN_SERVICE_INSTANCE);

        try {
            EasyAntReport easyantReport = pluginService.getPluginInfo(moduleIvy, sourceDirectory, conf);
            ModuleRevisionId moduleRevisionId = easyantReport.getModuleDescriptor().getModuleRevisionId();
            File reportFile = new File(todir, getOutputPattern(moduleRevisionId, conf, "xml"));
            todir.mkdirs();
            OutputStream stream = new FileOutputStream(reportFile);
            XMLEasyAntReportWriter writer = new XMLEasyAntReportWriter();
            writer.output(easyantReport, stream);
View Full Code Here

Examples of org.apache.easyant.core.report.EasyAntReport

            throw new BuildException("easyantResolverName is mandatory !");
        }

        PluginService pluginService = (PluginService) getProject().getReference(
                EasyAntMagicNames.PLUGIN_SERVICE_INSTANCE);
        EasyAntReport easyAntReport = null;
        try {
            easyAntReport = pluginService.generateEasyAntReport(moduleIvy);
            installBuildTypeAndPlugins(easyAntReport);
            installProjectDependencies(easyAntReport);
        } catch (Exception e) {
View Full Code Here

Examples of org.apache.easyant.core.report.EasyAntReport

        ModuleDescriptorParserRegistry.getInstance().addParser(parser);
    }

    public EasyAntReport getPluginInfo(File pluginIvyFile, File sourceDirectory, String conf) throws Exception {
        IvyContext.pushNewContext().setIvy(ivyInstance);
        EasyAntReport eaReport = null;
        try {

            ResolveOptions resolveOptions = new ResolveOptions();
            resolveOptions.setLog(ResolveOptions.LOG_QUIET);
            resolveOptions.setConfs(conf.split(","));
            ResolveReport report = IvyContext.getContext().getIvy().getResolveEngine()
                    .resolve(pluginIvyFile.toURI().toURL(), resolveOptions);
            eaReport = new EasyAntReport();
            eaReport.setResolveReport(report);
            eaReport.setModuleDescriptor(report.getModuleDescriptor());

            Project project = buildProject(null);

            // emulate top level project
            ImportTestModule importTestModule = new ImportTestModule();
View Full Code Here

Examples of org.apache.easyant.core.report.EasyAntReport

    }

    public EasyAntReport getPluginInfo(final ModuleRevisionId moduleRevisionId, String conf) throws Exception {

        IvyContext.pushNewContext().setIvy(ivyInstance);
        EasyAntReport eaReport = null;
        try {

            ResolveOptions resolveOptions = new ResolveOptions();
            resolveOptions.setLog(ResolveOptions.LOG_QUIET);
            resolveOptions.setConfs(conf.split(","));
            final ResolveReport report = IvyContext.getContext().getIvy().getResolveEngine()
                    .resolve(moduleRevisionId, resolveOptions, true);
            eaReport = new EasyAntReport();
            eaReport.setResolveReport(report);
            eaReport.setModuleDescriptor(report.getModuleDescriptor());

            Project project = buildProject(null);

            AbstractImport abstractImport = new AbstractImport() {
                @Override
View Full Code Here

Examples of org.apache.easyant.core.report.EasyAntReport

        return md;
    }

    public EasyAntReport generateEasyAntReport(File moduleDescriptor, File optionalAntModule, File overrideAntModule)
            throws Exception {
        EasyAntReport eaReport = new EasyAntReport();
        EasyAntModuleDescriptor md = getEasyAntModuleDescriptor(moduleDescriptor);
        eaReport.setModuleDescriptor(md.getIvyModuleDescriptor());

        Project p = buildProject(null);
        Target implicitTarget = ProjectUtils.createTopLevelTarget();
        p.addTarget("", implicitTarget);
        LoadModule loadModule = new LoadModule();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.