Package org.drools.workbench.models.guided.dtable.shared.conversion

Examples of org.drools.workbench.models.guided.dtable.shared.conversion.ConversionResult


    }

    @Test
    public void testMultipleRuleTables() {

        final ConversionResult result = new ConversionResult();
        final List<DataListener> listeners = new ArrayList<DataListener>();
        final GuidedDecisionTableGeneratorListener listener = new GuidedDecisionTableGeneratorListener( result );
        listeners.add( listener );

        //Convert
        final ExcelParser parser = new ExcelParser( listeners );
        final InputStream is = this.getClass().getResourceAsStream( "MultipleRuleTables.xls" );

        try {
            parser.parseFile( is );
        } finally {
            try {
                is.close();
            } catch ( IOException ioe ) {
                fail( ioe.getMessage() );
            }
        }

        //Check conversion results
        assertEquals( 0,
                      result.getMessages().size() );

        //Check basics
        List<GuidedDecisionTable52> dtables = listener.getGuidedDecisionTables();

        assertNotNull( dtables );
View Full Code Here


    }

    @Test
    public void testMultipleSingleParameters() {

        final ConversionResult result = new ConversionResult();
        final List<DataListener> listeners = new ArrayList<DataListener>();
        final GuidedDecisionTableGeneratorListener listener = new GuidedDecisionTableGeneratorListener( result );
        listeners.add( listener );

        //Convert
        final ExcelParser parser = new ExcelParser( listeners );
        final InputStream is = this.getClass().getResourceAsStream( "MultipleSingleParameters.xls" );

        try {
            parser.parseFile( is );
        } finally {
            try {
                is.close();
            } catch ( IOException ioe ) {
                fail( ioe.getMessage() );
            }
        }

        //Check conversion results
        assertEquals( 0,
                      result.getMessages().size() );

        //Check basics
        List<GuidedDecisionTable52> dtables = listener.getGuidedDecisionTables();

        assertNotNull( dtables );
View Full Code Here

    }

    @Test
    public void testProperties() {

        final ConversionResult result = new ConversionResult();
        final List<DataListener> listeners = new ArrayList<DataListener>();
        final GuidedDecisionTableGeneratorListener listener = new GuidedDecisionTableGeneratorListener( result );
        listeners.add( listener );

        //Convert
        final ExcelParser parser = new ExcelParser( listeners );
        final InputStream is = this.getClass().getResourceAsStream( "Properties.xls" );

        try {
            parser.parseFile( is );
        } finally {
            try {
                is.close();
            } catch ( IOException ioe ) {
                fail( ioe.getMessage() );
            }
        }

        //Check conversion results
        assertEquals( 0,
                      result.getMessages().size() );

        //Check properties
        List<String> functions = listener.getFunctions();
        assertNotNull( functions );
        assertEquals( 1,
View Full Code Here

    }

    @Override
    public ConversionResult convert( final Path path ) {

        ConversionResult result = new ConversionResult();

        //Check Asset is of the correct format
        if ( !xlsDTableType.accept( path ) ) {
            result.addMessage( "Source Asset is not an XLS Decision Table.",
                               ConversionMessageType.ERROR );
            return result;
        }

        //Perform conversion!
View Full Code Here

    }

    @Override
    public ConversionResult convert( final Path path ) {

        ConversionResult result = new ConversionResult();

        //Check Asset is of the correct format
        if ( !xlsDTableType.accept( path ) ) {
            result.addMessage( "Source Asset is not an XLS Decision Table.",
                               ConversionMessageType.ERROR );
            return result;
        }

        //Perform conversion!
View Full Code Here

    }

    @Override
    public ConversionResult convert( final Path path ) {

        ConversionResult result = new ConversionResult();

        //Check Asset is of the correct format
        if ( !xlsDTableType.accept( path ) ) {
            result.addMessage( "Source Asset is not an XLS Decision Table.",
                               ConversionMessageType.ERROR );
            return result;
        }

        //Perform conversion!
View Full Code Here

    }

    @Test
    public void testMetadata() {

        final ConversionResult result = new ConversionResult();
        final List<DataListener> listeners = new ArrayList<DataListener>();
        final GuidedDecisionTableGeneratorListener listener = new GuidedDecisionTableGeneratorListener( result );
        listeners.add( listener );

        //Convert
        final ExcelParser parser = new ExcelParser( listeners );
        final InputStream is = this.getClass().getResourceAsStream( "Metadata.xls" );

        try {
            parser.parseFile( is );
        } finally {
            try {
                is.close();
            } catch ( IOException ioe ) {
                fail( ioe.getMessage() );
            }
        }

        //Check conversion results
        assertEquals( 0,
                      result.getMessages().size() );

        //Check basics
        List<GuidedDecisionTable52> dtables = listener.getGuidedDecisionTables();

        assertNotNull( dtables );
View Full Code Here

    }

    @Test
    public void testActions() {

        final ConversionResult result = new ConversionResult();
        final List<DataListener> listeners = new ArrayList<DataListener>();
        final GuidedDecisionTableGeneratorListener listener = new GuidedDecisionTableGeneratorListener( result );
        listeners.add( listener );

        //Convert
        final ExcelParser parser = new ExcelParser( listeners );
        final InputStream is = this.getClass().getResourceAsStream( "Actions.xls" );

        try {
            parser.parseFile( is );
        } finally {
            try {
                is.close();
            } catch ( IOException ioe ) {
                fail( ioe.getMessage() );
            }
        }

        //Check conversion results
        assertEquals( 0,
                      result.getMessages().size() );

        //Check basics
        List<GuidedDecisionTable52> dtables = listener.getGuidedDecisionTables();

        assertNotNull( dtables );
View Full Code Here

    }

    @Test
    public void testConditions() {

        final ConversionResult result = new ConversionResult();
        final List<DataListener> listeners = new ArrayList<DataListener>();
        final GuidedDecisionTableGeneratorListener listener = new GuidedDecisionTableGeneratorListener( result );
        listeners.add( listener );

        //Convert
        final ExcelParser parser = new ExcelParser( listeners );
        final InputStream is = this.getClass().getResourceAsStream( "Conditions.xls" );

        try {
            parser.parseFile( is );
        } finally {
            try {
                is.close();
            } catch ( IOException ioe ) {
                fail( ioe.getMessage() );
            }
        }

        //Check conversion results
        assertEquals( 0,
                      result.getMessages().size() );

        //Check basics
        List<GuidedDecisionTable52> dtables = listener.getGuidedDecisionTables();

        assertNotNull( dtables );
View Full Code Here

    }

    @Test
    public void testConditionsIndexedParameters() {

        final ConversionResult result = new ConversionResult();
        final List<DataListener> listeners = new ArrayList<DataListener>();
        final GuidedDecisionTableGeneratorListener listener = new GuidedDecisionTableGeneratorListener( result );
        listeners.add( listener );

        //Convert
        final ExcelParser parser = new ExcelParser( listeners );
        final InputStream is = this.getClass().getResourceAsStream( "Conditions-indexedParameters.xls" );

        try {
            parser.parseFile( is );
        } finally {
            try {
                is.close();
            } catch ( IOException ioe ) {
                fail( ioe.getMessage() );
            }
        }

        //Check conversion results
        assertEquals( 0,
                      result.getMessages().size() );

        //Check basics
        List<GuidedDecisionTable52> dtables = listener.getGuidedDecisionTables();

        assertNotNull( dtables );
View Full Code Here

TOP

Related Classes of org.drools.workbench.models.guided.dtable.shared.conversion.ConversionResult

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.