Examples of Xpp3Dom


Examples of com.thoughtworks.xstream.io.xml.xppdom.Xpp3Dom

    public Xpp3Dom getConfiguration() {
        return configuration;
    }

    public void startNode(String name) {
        Xpp3Dom configuration = new Xpp3Dom(escapeXmlName(name));

        if (this.configuration == null) {
            this.configuration = configuration;
        } else {
            top().addChild(configuration);
View Full Code Here

Examples of org.apache.maven.shared.utils.xml.Xpp3Dom

        StatelessXmlReporter reporter = new StatelessXmlReporter( new File( "." ), null, false );
        reporter.testSetCompleted( testSetReportEntry, stats );

        FileInputStream fileInputStream = new FileInputStream( expectedReportFile );

        Xpp3Dom testSuite = Xpp3DomBuilder.build( new InputStreamReader( fileInputStream, "UTF-8") );
        assertEquals( "testsuite", testSuite.getName() );
        Xpp3Dom properties = testSuite.getChild( "properties" );
        assertEquals( System.getProperties().size(), properties.getChildCount() );
        Xpp3Dom child = properties.getChild( 1 );
        assertFalse( StringUtils.isEmpty( child.getAttribute( "value" ) ) );
        assertFalse( StringUtils.isEmpty( child.getAttribute( "name" ) ) );

        Xpp3Dom[] testcase = testSuite.getChildren( "testcase" );
        Xpp3Dom tca = testcase[0];
        assertEquals( testName, tca.getAttribute( "name" ) ); // Hopefully same order on jdk5
        assertEquals( "0.012", tca.getAttribute( "time" ) );
        assertEquals( this.getClass().getName(), tca.getAttribute( "classname" ) );

        Xpp3Dom tcb = testcase[1];
        assertEquals( testName2, tcb.getAttribute( "name" ) );
        assertEquals( "0.013", tcb.getAttribute( "time" ) );
        assertEquals( Inner.class.getName(), tcb.getAttribute( "classname" ) );
        Xpp3Dom errorNode = tcb.getChild( "error" );
        assertNotNull( errorNode );
        assertEquals( "A fud msg", errorNode.getAttribute( "message" ) );
        assertEquals( "fail at foo", errorNode.getAttribute( "type" ) );
        assertEquals( stdOutPrefix + "<null>! &amp#0;&amp#31;", tcb.getChild( "system-out" ).getValue() );


        assertEquals( stdErrPrefix + "?&-&amp;&#163; &amp#0;&amp#31;", tcb.getChild( "system-err" ).getValue() );
    }
View Full Code Here

Examples of org.apache.maven.shared.utils.xml.Xpp3Dom

        return new RunResult( 0, 0, 0, 0 );
    }

    private Xpp3Dom create( String node, String value )
    {
        Xpp3Dom dom = new Xpp3Dom( node );
        dom.setValue( value );
        return dom;
    }
View Full Code Here

Examples of org.apache.maven.shared.utils.xml.Xpp3Dom

        return create( node, Integer.toString( value ) );
    }

    Xpp3Dom asXpp3Dom()
    {
        Xpp3Dom dom = new Xpp3Dom( "failsafe-summary" );
        Integer failsafeCode = getFailsafeCode();
        if ( failsafeCode != null )
        {
            dom.setAttribute( "result", Integer.toString( failsafeCode ) );
        }
        dom.setAttribute( "timeout", Boolean.toString( this.timeout ) );
        dom.addChild( create( "completed", this.completedCount ) );
        dom.addChild( create( "errors", this.errors ) );
        dom.addChild( create( "failures", this.failures ) );
        dom.addChild( create( "skipped", this.skipped ) );
        dom.addChild( create( "failureMessage", this.failure ) );
        return dom;
    }
View Full Code Here

Examples of org.apache.maven.shared.utils.xml.Xpp3Dom

    }

    public static RunResult fromInputStream( InputStream inputStream, String encoding )
        throws FileNotFoundException
    {
        Xpp3Dom dom = Xpp3DomBuilder.build( inputStream, encoding );
        boolean timeout = Boolean.parseBoolean( dom.getAttribute( "timeout" ) );
        int completed = Integer.parseInt( dom.getChild( "completed" ).getValue() );
        int errors = Integer.parseInt( dom.getChild( "errors" ).getValue() );
        int failures = Integer.parseInt( dom.getChild( "failures" ).getValue() );
        int skipped = Integer.parseInt( dom.getChild( "skipped" ).getValue() );
        String failureMessage1 = dom.getChild( "failureMessage" ).getValue();
        String failureMessage = StringUtils.isEmpty( failureMessage1 ) ? null : failureMessage1;
        return new RunResult( completed, errors, failures, skipped, failureMessage, timeout );
    }
View Full Code Here

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

                    {
                        multiSourcePlugin = plugin;
                        break;
                    }
                }
                final Xpp3Dom configuration = this.getConfiguration(multiSourcePlugin);
                if (configuration != null && configuration.getChildCount() > 0)
                {
                    final Xpp3Dom directories = configuration.getChild(0);
                    if (directories != null)
                    {
                        final int childCount = directories.getChildCount();
                        if (childCount > 0)
                        {
                            final String baseDirectory =
                                ResourceUtils.normalizePath(ObjectUtils.toString(project.getBasedir()) + '/');
                            final Xpp3Dom[] children = directories.getChildren();
                            for (int ctr = 0; ctr < childCount; ctr++)
                            {
                                final Xpp3Dom child = children[ctr];
                                if (child != null)
                                {
                                    String directoryValue = ResourceUtils.normalizePath(child.getValue());
                                    if (directoryValue != null)
                                    {
                                        if (!directoryValue.startsWith(baseDirectory))
                                        {
                                            directoryValue =
View Full Code Here

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

     * @param plugin the plugin from which the retrieve the configuration.
     * @return the plugin's configuration, or null if not found.
     */
    private Xpp3Dom getConfiguration(final Plugin plugin)
    {
        Xpp3Dom configuration = null;
        if (plugin != null)
        {
            if (plugin.getConfiguration() != null)
            {
                configuration = (Xpp3Dom)plugin.getConfiguration();
View Full Code Here

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

    private String getBundlePluginConfiguration(final String key) {
        String value = null;
        Plugin bundlePlugin = this.getBundlePlugin();
        if ( bundlePlugin != null ) {
            final Xpp3Dom config = (Xpp3Dom) bundlePlugin.getConfiguration();
            if ( config != null) {
                final Xpp3Dom instructionsConfig = config.getChild(BUNDLE_PLUGIN_INSTRUCTIONS);
                if ( instructionsConfig != null) {
                    final Xpp3Dom keyConfig = instructionsConfig.getChild(key);
                    if ( keyConfig != null ) {
                        return keyConfig.getValue();
                    }
                }
            }
        }
        return value;
View Full Code Here

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

                                    server.getPassphrase() );
            authSelector.add( server.getId(), auth );

            if ( server.getConfiguration() != null )
            {
                Xpp3Dom dom = (Xpp3Dom) server.getConfiguration();
                for ( int i = dom.getChildCount() - 1; i >= 0; i-- )
                {
                    Xpp3Dom child = dom.getChild( i );
                    if ( "wagonProvider".equals( child.getName() ) )
                    {
                        dom.removeChild( i );
                    }
                }
View Full Code Here

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

    private void filterChildren( int position )
    {
        for ( ; position > filteredChildren.size() && filteredIndex < children.length; filteredIndex++ )
        {
            Xpp3Dom child = children[filteredIndex];
            if ( testNode( child ) )
            {
                filteredChildren.add( child );
            }
        }
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.