Examples of TypeResolver


Examples of org.drools.core.base.TypeResolver

    }

    @Test
    public void testCollectionFieldInFacts() throws Exception {

        TypeResolver typeResolver = getTypeResolver();

        FactData fd1 = new FactData( "Cheese",
                                     "f1",
                                     Arrays.<Field>asList(
                                             new FieldData( "type",
View Full Code Here

Examples of org.drools.core.base.TypeResolver

    }

    @Test
    public void testCollection() throws Exception {
        TypeResolver typeResolver = getTypeResolver();

        List<Field> fieldData = new ArrayList<Field>();
        CollectionFieldData collectionFieldData = new CollectionFieldData();
        collectionFieldData.setName( "cheeses" );
        fieldData.add( collectionFieldData );
View Full Code Here

Examples of org.drools.core.base.TypeResolver

        ksession = mock( KieSession.class );
    }

    @Test
    public void testVerifyAnonymousFacts() throws Exception {
        TypeResolver typeResolver = mock( TypeResolver.class );
        FactVerifier factVerifier = new FactVerifier( new HashMap<String, Object>(), typeResolver, ksession, new HashMap<String, Object>() );

        Cheese c = new Cheese();
        c.setPrice( 42 );
        c.setType( "stilton" );
View Full Code Here

Examples of org.drools.core.base.TypeResolver

        assertTrue( cheesery.getCheeses().get( 1 ) instanceof Cheese );
    }

    @Test
    public void testCollectionSums() throws Exception {
        TypeResolver typeResolver = getTypeResolver();

        List<Field> fieldData = new ArrayList<Field>();
        CollectionFieldData collectionFieldData = new CollectionFieldData();
        collectionFieldData.setName( "list" );
        fieldData.add( collectionFieldData );
View Full Code Here

Examples of org.drools.core.base.TypeResolver

    }

    @Test
    public void testVerifyFactsWithOperator() throws Exception {
        TypeResolver typeResolver = mock( TypeResolver.class );

        Cheese f1 = new Cheese( "cheddar",
                                42 );
        HashMap<String, Object> populatedData = new HashMap<String, Object>();
        populatedData.put( "f1", f1 );
View Full Code Here

Examples of org.drools.core.base.TypeResolver

        assertNotNull( wrapper.getList().get( 0 ) );
        assertEquals( 4, wrapper.getList().get( 0 ) );
    }

    private TypeResolver getTypeResolver() {
        TypeResolver resolver = new ClassTypeResolver( new HashSet<String>(), getClassLoader() );
        resolver.addImport( "org.drools.workbench.models.testscenarios.backend.MyCollectionWrapper" );
        resolver.addImport( "org.drools.workbench.models.testscenarios.backend.Cheesery" );
        resolver.addImport( "org.drools.workbench.models.testscenarios.backend.Cheese" );
        resolver.addImport( "org.drools.workbench.models.testscenarios.backend.SqlDateWrapper" );
        resolver.addImport( "org.drools.workbench.models.testscenarios.backend.CheeseType" );
        resolver.addImport( "org.drools.workbench.models.testscenarios.backend.Person" );
        resolver.addImport( "org.drools.workbench.models.testscenarios.backend.OuterFact" );
        return resolver;
    }
View Full Code Here

Examples of org.drools.core.base.TypeResolver

    }

    @Test
    public void testVerifyFactsWithExpression() throws Exception {
        TypeResolver typeResolver = mock( TypeResolver.class );

        Cheese f1 = new Cheese( "cheddar",
                                42 );
        f1.setPrice( 42 );
View Full Code Here

Examples of org.drools.core.base.TypeResolver

    @Test
    public void testVerifyFactExplanation() throws Exception {
        Cheese f1 = new Cheese();
        f1.setType( null );

        TypeResolver typeResolver = mock( TypeResolver.class );

        HashMap<String, Object> populatedData = new HashMap<String, Object>();
        populatedData.put( "f1", f1 );

        // configure the mock to return the value
View Full Code Here

Examples of org.hibernate.type.TypeResolver

      Map.Entry entry = (Map.Entry) iter.next();
      String typename = null;
      Type type = null;
      if(entry.getValue() instanceof String) {
        try {
          type = new TypeResolver().heuristicType((String) entry.getValue());
        } catch(Throwable t) {
          type = null;
          typename = (String) entry.getValue();
        }
      }
View Full Code Here

Examples of org.jboss.weld.util.reflection.TypeResolver

public class EventTypeResolutionTest {

    public static Type resolveType(Type selectedType, Class<?> eventObjectType) {
        HierarchyDiscovery selectedTypeHierarchy = new HierarchyDiscovery(selectedType);
        HierarchyDiscovery eventTypeHierarchy = HierarchyDiscovery.forNormalizedType(eventObjectType);
        TypeResolver resolver = new EventObjectTypeResolverBuilder(selectedTypeHierarchy.getResolver()
                .getResolvedTypeVariables(), eventTypeHierarchy.getResolver().getResolvedTypeVariables()).build();
        return resolver.resolveType(Types.getCanonicalType(eventObjectType));
    }
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.