Package org.codehaus.plexus.util.xml

Examples of org.codehaus.plexus.util.xml.Xpp3Dom


            if (AbstractUsingBundleListMojo.JAR.equals(project.getPackaging())) {
                return true;
            } else {
                for (PluginExecution execution : plugin.getExecutions()) {
                    if (execution.getGoals().contains("prepare-package")) {
                        Xpp3Dom executionConfig = (Xpp3Dom) execution.getConfiguration();
                        if (executionConfig != null) {
                            Xpp3Dom packagingConfig = executionConfig.getChild("packaging");
                            if (packagingConfig != null
                                    && AbstractUsingBundleListMojo.JAR.equals(packagingConfig.getValue())) {
                                return true;
                            }
                        }
                    }
                }
View Full Code Here


            fis.close();
        }
    }
   
    public static int nodeValue(Xpp3Dom config, String name, int defaultValue) {
        Xpp3Dom node = config.getChild(name);
        if (node != null) {
            return Integer.parseInt(node.getValue());
        } else {
            return defaultValue;
        }
    }
View Full Code Here

            return defaultValue;
        }
    }
   
    public static boolean nodeValue(Xpp3Dom config, String name, boolean defaultValue) {
        Xpp3Dom node = config.getChild(name);
        if (node != null) {
            return Boolean.parseBoolean(node.getValue());
        } else {
            return defaultValue;
        }
    }
View Full Code Here

            return defaultValue;
        }
    }

    public static String nodeValue(Xpp3Dom config, String name, String defaultValue) {
        Xpp3Dom node = config.getChild(name);
        if (node != null) {
            return node.getValue();
        } else {
            return defaultValue;
        }
    }
View Full Code Here

    }


    private static PlexusConfiguration getPluginConfiguration( MavenProject project, String groupId, String artifactId )
    {
        Xpp3Dom pluginConfig = project.getGoalConfiguration( groupId, artifactId, null, null );

        return new XmlPlexusConfiguration( pluginConfig );
    }
View Full Code Here

                    if (build.getMavenBuildInformation().isMaven3OrLater()) {
                        String fieldName = "testFailureIgnore";
                        if (mojo.mojoExecution.getConfiguration().getChild( fieldName ) != null) {
                          mojo.mojoExecution.getConfiguration().getChild( fieldName ).setValue( Boolean.TRUE.toString() );
                        } else {
                            Xpp3Dom child = new Xpp3Dom( fieldName );
                            child.setValue( Boolean.TRUE.toString() );
                            mojo.mojoExecution.getConfiguration().addChild( child );
                        }
                       
                    } else {
                        c.setValue(Boolean.TRUE.toString());
View Full Code Here

    public void testSucceeded(Test test) {
        super.testSucceeded();

        long runTime = this.m_endTime - this.m_startTime;

        Xpp3Dom testCase = createTestElement(test, runTime);

        m_results.add(testCase);
    }
View Full Code Here

     */
    private void writeTestProblems(Test test, Throwable e, String name, String out, String err, String log) {

        long runTime = m_endTime - m_startTime;

        Xpp3Dom testCase = createTestElement(test, runTime);

        Xpp3Dom element = createElement(testCase, name);

        String stackTrace = getStackTrace(test, e);

        Throwable t = e;

        if (t != null) {

            String message = t.getMessage();

            if (message != null) {
                element.setAttribute("message", message);

                element.setAttribute("type",
                        stackTrace.indexOf(":") > -1 ? stackTrace.substring(0,
                                stackTrace.indexOf(":")) : stackTrace);
            } else {
                element.setAttribute("type", new StringTokenizer(stackTrace)
                        .nextToken());
            }
        }

        if (stackTrace != null) {
            element.setValue(stackTrace);
        }

        addOutputStreamElement(out, "system-out", testCase);

        addOutputStreamElement(err, "system-err", testCase);
View Full Code Here

     */
    public void generateReport(Test test, TestResult tr, File reportsDirectory,
            BundleContext bc, Map configuration) throws Exception {
        long runTime = this.m_endTime - this.m_startTime;

        Xpp3Dom testSuite = createTestSuiteElement(test, runTime);

        showProperties(testSuite, bc, configuration);

        testSuite.setAttribute("tests", String.valueOf(tr.runCount()));

        testSuite.setAttribute("errors", String.valueOf(tr.errorCount()));

        testSuite.setAttribute("failures", String.valueOf(tr.failureCount()));

        for (Iterator i = m_results.iterator(); i.hasNext();) {
            Xpp3Dom testcase = (Xpp3Dom) i.next();
            testSuite.addChild(testcase);
        }

        File reportFile = new File(reportsDirectory, "TEST-"
                + getReportName(test).replace(' ', '_') + ".xml");
View Full Code Here

     * @param test the test
     * @param runTime the elapsed time to execute the test.
     * @return the XML element describing the given test.
     */
    private Xpp3Dom createTestElement(Test test, long runTime) {
        Xpp3Dom testCase = new Xpp3Dom("testcase");
        testCase.setAttribute("name", getReportName(test));
        double time = (double) runTime / (double) 1000;
        testCase.setAttribute("time", Double.toString(time));
        testCase.setAttribute("classname", test.getClass().getName());
        return testCase;
    }
View Full Code Here

TOP

Related Classes of org.codehaus.plexus.util.xml.Xpp3Dom

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.