Package org.drools.ide.common.server.rules

Examples of org.drools.ide.common.server.rules.SuggestionCompletionLoader$WildCardException


    }

    @Test
    public void testLoadDifferentFieldTypes() throws Exception {
        SuggestionCompletionLoader loader = new SuggestionCompletionLoader();
        SuggestionCompletionEngine eng = loader.getSuggestionEngine( "package foo \n import org.drools.ide.common.server.rules.SomeFact",
                                                                     new ArrayList(),
                                                                     new ArrayList() );
        assertNotNull( eng );

        assertEquals( SuggestionCompletionEngine.TYPE_NUMERIC,
View Full Code Here


                                                  "factListString" ) );
    }

    @Test
    public void testLoadDifferentMethodTypes() throws Exception {
        SuggestionCompletionLoader loader = new SuggestionCompletionLoader();
        SuggestionCompletionEngine eng = loader.getSuggestionEngine( "package foo \n import org.drools.ide.common.server.rules.SomeFact",
                                                                     new ArrayList(),
                                                                     new ArrayList() );
        assertNotNull( eng );

        assertEquals( List.class.getName(),
View Full Code Here

                                                  "aMethod(int)" ) );
    }

    @Test
    public void testGeneratedBeans() throws Exception {
        SuggestionCompletionLoader loader = new SuggestionCompletionLoader();
        SuggestionCompletionEngine eng = loader.getSuggestionEngine( "package foo \n declare GenBean \n   id: int \n name : String \n end \n declare GenBean2 \n list: java.util.List \n gb: GenBean \n end",
                                                                     new ArrayList(),
                                                                     new ArrayList() );
        assertFalse( loader.hasErrors() );
        assertNotNull( eng );

        assertEquals( 2,
                      eng.getFactTypes().length );
        assertEquals( "GenBean",
View Full Code Here

                            + "name : String \n"
                            + "end \n"
                            + "declare Bean2 extends Bean1\n"
                            + "cheese : String \n"
                            + "end";
        SuggestionCompletionLoader loader = new SuggestionCompletionLoader();
        SuggestionCompletionEngine eng = loader.getSuggestionEngine( packageDrl,
                                                                     new ArrayList(),
                                                                     new ArrayList() );
        assertFalse( loader.hasErrors() );
        assertNotNull( eng );

        assertEquals( 2,
                      eng.getFactTypes().length );
        assertEquals( "Bean1",
View Full Code Here

    public void testGeneratedBeansExtendsPOJOSimple() throws Exception {
        String packageDrl = "package foo \n"
                            + "import org.drools.Address\n"
                            + "declare Address \n"
                            + "end";
        SuggestionCompletionLoader loader = new SuggestionCompletionLoader();
        SuggestionCompletionEngine eng = loader.getSuggestionEngine( packageDrl,
                                                                     new ArrayList(),
                                                                     new ArrayList() );
        assertFalse( loader.hasErrors() );
        assertNotNull( eng );

        assertEquals( 1,
                      eng.getFactTypes().length );
        assertEquals( "Address",
View Full Code Here

                            + "declare Address \n"
                            + "end\n"
                            + "declare Address2 extends Address\n"
                            + "isNicePlace : Boolean \n"
                            + "end";
        SuggestionCompletionLoader loader = new SuggestionCompletionLoader();
        SuggestionCompletionEngine eng = loader.getSuggestionEngine( packageDrl,
                                                                     new ArrayList(),
                                                                     new ArrayList() );
        assertFalse( loader.hasErrors() );
        assertNotNull( eng );

        assertEquals( 2,
                      eng.getFactTypes().length );
        assertEquals( "Address",
View Full Code Here

                                        "isNicePlace" ) );
    }

    @Test
    public void testGlobal() throws Exception {
        SuggestionCompletionLoader loader = new SuggestionCompletionLoader();
        SuggestionCompletionEngine eng = loader.getSuggestionEngine( "package foo \n global org.drools.Person p",
                                                                     new ArrayList(),
                                                                     new ArrayList() );
        assertNotNull( eng );
        assertFalse( loader.hasErrors() );

        assertEquals( 1,
                      eng.getGlobalVariables().length );
        assertEquals( "p",
                      eng.getGlobalVariables()[0] );
View Full Code Here

                      eng.getGlobalCollections().length );
    }

    @Test
    public void testGlobalCollections() throws Exception {
        SuggestionCompletionLoader loader = new SuggestionCompletionLoader();
        SuggestionCompletionEngine eng = loader.getSuggestionEngine( "package foo \n global java.util.List ls",
                                                                     new ArrayList(),
                                                                     new ArrayList() );
        assertNotNull( eng );
        assertFalse( loader.hasErrors() );

        assertEquals( 1,
                      eng.getGlobalVariables().length );
        assertEquals( "ls",
                      eng.getGlobalVariables()[0] );
View Full Code Here

    }

    @Test
    public void testSortOrderOfFields() throws Exception {

        SuggestionCompletionLoader loader = new SuggestionCompletionLoader();
        SuggestionCompletionEngine eng = loader.getSuggestionEngine( "package foo \n import org.drools.ide.common.server.rules.SomeFact",
                                                                     new ArrayList(),
                                                                     new ArrayList() );
        assertNotNull( eng );

        String[] fields = eng.getFieldCompletions( "SomeFact" );
View Full Code Here

                      fields[4] );
    }

    @Test
    public void testEnumFields() throws Exception {
        SuggestionCompletionLoader loader = new SuggestionCompletionLoader();
        SuggestionCompletionEngine eng = loader.getSuggestionEngine( "package foo \n import org.drools.ide.common.server.rules.SomeFact",
                                                                     new ArrayList(),
                                                                     new ArrayList() );
        assertNotNull( eng );
        assertTrue( eng.hasDataEnumLists() );
        assertEquals( eng.getDataEnumList( "SomeFact.anEnum" ).length,
View Full Code Here

TOP

Related Classes of org.drools.ide.common.server.rules.SuggestionCompletionLoader$WildCardException

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.