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

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


    }

    @Test
    public void testImports() throws Exception {
        ProjectImports configuration = new ProjectImports();
        configuration.getImports().addImport( new Import( "java.util.List" ) );
        configuration.getImports().addImport( new Import( "org.test.Object" ) );
        String xml = handler.toString( configuration );
        assertTrue( xml.contains( "<import>" ) );
        assertTrue( xml.contains( "</import>" ) );
        assertTrue( xml.contains( "<type>java.util.List</type>" ) );
        assertTrue( xml.contains( "<type>org.test.Object</type>" ) );
View Full Code Here


            final Package pkg = projectService.resolvePackage( context );
            final String packageName = ( pkg == null ? null : pkg.getPackageName() );
            model.setPackageName(packageName);

            // Temporal fix for https://bugzilla.redhat.com/show_bug.cgi?id=998922
            model.getImports().addImport(new Import("java.lang.Number"));

            final org.uberfire.java.nio.file.Path nioPath = Paths.convert( context ).resolve( fileName );
            final Path newPath = Paths.convert( nioPath );

            ioService.createFile( nioPath );
View Full Code Here

        }
    }

    private ProjectImports createProjectImports() {
        ProjectImports imports = new ProjectImports();
        imports.getImports().addImport( new Import( "java.lang.Number" ) );
        return imports;
    }
View Full Code Here

    public void testIndexGuidedScoreCard() throws IOException, InterruptedException {
        //Add test files
        final Path path1 = basePath.resolve( "scorecard1.scgd" );
        final ScoreCardModel model1 = GuidedScoreCardFactory.makeScoreCardWithCharacteristics( "org.drools.workbench.screens.guided.scorecard.backend.server.indexing",
                                                                                               new ArrayList<Import>() {{
                                                                                                   add( new Import( "org.drools.workbench.screens.guided.scorecard.backend.server.indexing.classes.Applicant" ) );
                                                                                                   add( new Import( "org.drools.workbench.screens.guided.scorecard.backend.server.indexing.classes.Mortgage" ) );
                                                                                               }},
                                                                                               "scorecard1" );
        final String xml1 = GuidedScoreCardXMLPersistence.getInstance().marshal( model1 );
        ioService().write( path1,
                           xml1 );
        final Path path2 = basePath.resolve( "scorecard2.scgd" );
        final ScoreCardModel model2 = GuidedScoreCardFactory.makeScoreCardWithoutCharacteristics( "org.drools.workbench.screens.guided.scorecard.backend.server.indexing",
                                                                                                  new ArrayList<Import>() {{
                                                                                                      add( new Import( "org.drools.workbench.screens.guided.scorecard.backend.server.indexing.classes.Applicant" ) );
                                                                                                      add( new Import( "org.drools.workbench.screens.guided.scorecard.backend.server.indexing.classes.Mortgage" ) );
                                                                                                  }},
                                                                                                  "scorecard2" );
        final String xml2 = GuidedScoreCardXMLPersistence.getInstance().marshal( model2 );
        ioService().write( path2,
                           xml2 );
View Full Code Here

    @Test
    public void testModelWithImports() {
        final ScoreCardModel model = new ScoreCardModel();
        model.setName( "test" );
        model.setPackageName( "org.drools.workbench.models.guided.scorecard.backend" );
        model.getImports().addImport( new Import( "org.smurf.Pupa" ) );

        final String drl = GuidedScoreCardDRLPersistence.marshal( model );
        assertNotNull( drl );

        assertTrue( drl.contains( "package org.drools.workbench.models.guided.scorecard.backend" ) );
View Full Code Here

    @Test
    public void testModelWithImportsAndFactName() {
        final ScoreCardModel model = new ScoreCardModel();
        model.setName( "test" );
        model.setPackageName( "org.drools.workbench.models.guided.scorecard.backend" );
        model.getImports().addImport( new Import( "org.smurf.Pupa" ) );
        model.setFactName( "org.drools.MoreCheese" );

        final String drl = GuidedScoreCardDRLPersistence.marshal( model );
        assertNotNull( drl );
View Full Code Here

    @Test
    public void testModelWithImportsAndFactNameDuplicatingExplicitImport() {
        final ScoreCardModel model = new ScoreCardModel();
        model.setName( "test" );
        model.setPackageName( "org.drools.workbench.models.guided.scorecard.backend" );
        model.getImports().addImport( new Import( "org.smurf.Pupa" ) );
        model.setFactName( "org.smurf.Pupa" );

        final String drl = GuidedScoreCardDRLPersistence.marshal( model );
        assertNotNull( drl );
View Full Code Here

        final ScoreCardModel model = new ScoreCardModel();
        model.setName( "test" );

        model.setPackageName( "org.drools.workbench.models.guided.scorecard.backend" );
        model.getImports().addImport( new Import( "org.drools.workbench.models.guided.scorecard.backend.test1.Applicant" ) );
        model.setReasonCodesAlgorithm( "none" );
        model.setBaselineScore( 0.0 );
        model.setInitialScore( 0.0 );

        model.setFactName( "org.drools.workbench.models.guided.scorecard.backend.test1.Applicant" );
View Full Code Here

    public void testIndexGuidedScoreCard() throws IOException, InterruptedException {
        //Add test files
        final Path path1 = basePath.resolve( "scorecard1.scgd" );
        final ScoreCardModel model1 = GuidedScoreCardFactory.makeScoreCardWithCharacteristics( "org.drools.workbench.screens.guided.scorecard.backend.server.indexing",
                                                                                               new ArrayList<Import>() {{
                                                                                                   add( new Import( "org.drools.workbench.screens.guided.scorecard.backend.server.indexing.classes.Applicant" ) );
                                                                                                   add( new Import( "org.drools.workbench.screens.guided.scorecard.backend.server.indexing.classes.Mortgage" ) );
                                                                                               }},
                                                                                               "scorecard1" );
        final String xml1 = GuidedScoreCardXMLPersistence.getInstance().marshal( model1 );
        ioService().write( path1,
                           xml1 );
        final Path path2 = basePath.resolve( "scorecard2.scgd" );
        final ScoreCardModel model2 = GuidedScoreCardFactory.makeScoreCardWithoutCharacteristics( "org.drools.workbench.screens.guided.scorecard.backend.server.indexing",
                                                                                                  new ArrayList<Import>() {{
                                                                                                      add( new Import( "org.drools.workbench.screens.guided.scorecard.backend.server.indexing.classes.Applicant" ) );
                                                                                                      add( new Import( "org.drools.workbench.screens.guided.scorecard.backend.server.indexing.classes.Mortgage" ) );
                                                                                                  }},
                                                                                                  "scorecard2" );
        final String xml2 = GuidedScoreCardXMLPersistence.getInstance().marshal( model2 );
        ioService().write( path2,
                           xml2 );
View Full Code Here

    }

    @Test
    public void testPopulateFactsWithInterfaces() throws Exception {
        Scenario sc = new Scenario();
        sc.getImports().addImport(new Import("java.util.List"));
        List facts = ls(new FactData("List",
                "ls",
                new ArrayList(),
                false));
View Full Code Here

TOP

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

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.