Package org.drools.workbench.models.datamodel.imports

Examples of org.drools.workbench.models.datamodel.imports.Imports


        //Check external imports are available. These are loaded when a DMO is requested, but it's better to report them early
        final org.uberfire.java.nio.file.Path nioExternalImportsPath = moduleDirectory.resolve( "project.imports" );
        if ( Files.exists( nioExternalImportsPath ) ) {
            final org.uberfire.backend.vfs.Path externalImportsPath = Paths.convert( nioExternalImportsPath );
            final ProjectImports projectImports = projectService.load( externalImportsPath );
            final Imports imports = projectImports.getImports();
            for ( final Import item : imports.getImports() ) {
                try {
                    Class clazz = this.getClass().getClassLoader().loadClass( item.getType() );
                } catch ( ClassNotFoundException cnfe ) {
                    results.addBuildMessage( makeMessage( ERROR_CLASS_NOT_FOUND,
                                                          cnfe ) );
View Full Code Here


    @Test
    public void testEmptyModel() {
        final HasImports model = new HasImports() {

            private Imports imports = new Imports();

            @Override
            public Imports getImports() {
                return imports;
            }
View Full Code Here

    public void testSingleImportModel() {
        final String expectedDrl = "import java.lang.String;\n\n";

        final HasImports model = new HasImports() {

            private Imports imports = new Imports();

            {
                imports.addImport( new Import( "java.lang.String" ) );
            }

            @Override
            public Imports getImports() {
                return imports;
View Full Code Here

                + "import java.lang.String;\n"
                + "import java.lang.Double;\n\n";

        final HasImports model = new HasImports() {

            private Imports imports = new Imports();

            {
                imports.addImport( new Import( "java.lang.String" ) );
                imports.addImport( new Import( "java.lang.Double" ) );
            }

            @Override
            public Imports getImports() {
                return imports;
View Full Code Here

    @Test
    public void testNullContent() {
        final String content = null;

        final Imports imports = ImportsParser.parseImports( content );
        assertNotNull( imports );
        assertTrue( imports.getImports().isEmpty() );
    }
View Full Code Here

    @Test
    public void testEmptyContent() {
        final String content = "";

        final Imports imports = ImportsParser.parseImports( content );
        assertNotNull( imports );
        assertTrue( imports.getImports().isEmpty() );
    }
View Full Code Here

    @Test
    public void testCommentedContent() {
        final String content = "#This is a comment";

        final Imports imports = ImportsParser.parseImports( content );
        assertNotNull( imports );
        assertTrue( imports.getImports().isEmpty() );
    }
View Full Code Here

    @Test
    public void testSingleImportContent() {
        final String content = "import java.lang.String;";

        final Imports imports = ImportsParser.parseImports( content );
        assertNotNull( imports );
        assertEquals( 1,
                      imports.getImports().size() );
        assertEquals( "java.lang.String",
                      imports.getImports().get( 0 ).getType() );
    }
View Full Code Here

    public void testMultipleImportsContent() {
        final String content = ""
                + "import java.lang.String;\n"
                + "import java.lang.Double;\n";

        final Imports imports = ImportsParser.parseImports( content );
        assertNotNull( imports );
        assertEquals( 2,
                      imports.getImports().size() );
        assertEquals( "java.lang.String",
                      imports.getImports().get( 0 ).getType() );
        assertEquals( "java.lang.Double",
                      imports.getImports().get( 1 ).getType() );
    }
View Full Code Here

                + "#This is a comment\n"
                + "import java.lang.Double;\n"
                + "\n"
                + "import java.lang.Byte;\n";

        final Imports imports = ImportsParser.parseImports( content );
        assertNotNull( imports );
        assertEquals( 3,
                      imports.getImports().size() );
        assertEquals( "java.lang.String",
                      imports.getImports().get( 0 ).getType() );
        assertEquals( "java.lang.Double",
                      imports.getImports().get( 1 ).getType() );
        assertEquals( "java.lang.Byte",
                      imports.getImports().get( 2 ).getType() );
    }
View Full Code Here

TOP

Related Classes of org.drools.workbench.models.datamodel.imports.Imports

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.