Examples of SuggestionCompletionLoader


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

    @Test
    public void testDataEnums3() {
        String pkg = "package org.test\n import org.drools.ide.common.client.modeldriven.SuggestionCompletionEngineTest.NestedClass";

        SuggestionCompletionLoader loader = new SuggestionCompletionLoader();

        List<String> enums = new ArrayList<String>();

        enums.add( "'Fact.f1' : ['a1', 'a2'] \n 'Fact.f2' : ['def1', 'def2', 'def3'] \n 'Fact.f2[f1=a2]' : ['c1', 'c2']" );

        SuggestionCompletionEngine engine = loader.getSuggestionEngine( pkg,
                                                                        new ArrayList<JarInputStream>(),
                                                                        new ArrayList<DSLTokenizedMappingFile>(),
                                                                        enums );
        assertEquals( "String",
                      engine.getFieldType( "SuggestionCompletionEngineTest$NestedClass",
View Full Code Here

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

    @Test
    public void testDataEnums2() {
        String pkg = "package org.test\n import org.drools.ide.common.client.modeldriven.SuggestionCompletionEngineTest.Fact";

        SuggestionCompletionLoader loader = new SuggestionCompletionLoader();

        List<String> enums = new ArrayList<String>();

        enums.add( "'Fact.field1' : ['val1', 'val2'], 'Fact.field2' : ['val3', 'val4'], 'Fact.field2[field1=val1]' : ['f1val1a', 'f1val1b'], 'Fact.field2[field1=val2]' : ['f1val2a', 'f1val2b']" );

        SuggestionCompletionEngine engine = loader.getSuggestionEngine( pkg,
                                                                        new ArrayList<JarInputStream>(),
                                                                        new ArrayList<DSLTokenizedMappingFile>(),
                                                                        enums );
        assertEquals( "String",
                      engine.getFieldType( "SuggestionCompletionEngineTest$Fact",
View Full Code Here

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

            if (packagePath != null) {
                packagePath = packagePath.append( "drools.package" );
                IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile( packagePath );
                IJavaProject javaProject = JavaCore.create( file.getProject() );
                ClassLoader classLoader = ProjectClassLoader.getProjectClassLoader( javaProject );
                loader = new SuggestionCompletionLoader( classLoader );
                if ( !file.exists() ) {
                    String defaultHeader = "//This is a package configuration file";
                    defaultHeader += "\n//Add imports, globals etc here which will be used by all the rule assets in this folder.";
                    InputStream is = new ByteArrayInputStream( defaultHeader.getBytes() );
                    try {
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.