Package org.drools.decisiontable.parser

Source Code of org.drools.decisiontable.parser.ActionTypeTest

package org.drools.decisiontable.parser;

import java.util.HashMap;
import java.util.Map;

import junit.framework.TestCase;

import org.drools.decisiontable.parser.ActionType;

public class ActionTypeTest extends TestCase {

    public void testChooseActionType() {
        Map actionTypeMap = new HashMap();
        ActionType.addNewActionType( actionTypeMap, "C", 0, 1 );
       
        ActionType type = (ActionType) actionTypeMap.get( new Integer(0) );
        assertEquals(ActionType.CONDITION, type.type);
       
       
        actionTypeMap = new HashMap();
        ActionType.addNewActionType( actionTypeMap, "A", 0, 1 );
        type = (ActionType) actionTypeMap.get( new Integer(0) );
        assertEquals(ActionType.ACTION, type.type);
       
        actionTypeMap = new HashMap();
        ActionType.addNewActionType( actionTypeMap, "X", 0, 1 );
        type = (ActionType) actionTypeMap.get( new Integer(0) );
        assertEquals(ActionType.ACTIVATIONGROUP, type.type);
       
        actionTypeMap = new HashMap();
        ActionType.addNewActionType( actionTypeMap, "ACTIVATION-GROUP", 0, 1 );
        type = (ActionType) actionTypeMap.get( new Integer(0) );
        assertEquals(ActionType.ACTIVATIONGROUP, type.type);
       
        actionTypeMap = new HashMap();
        ActionType.addNewActionType( actionTypeMap, "NO-LOOP", 0, 1 );
        type = (ActionType) actionTypeMap.get( new Integer(0) );
        assertEquals(ActionType.NOLOOP, type.type);
       
        actionTypeMap = new HashMap();
        ActionType.addNewActionType( actionTypeMap, "RULEFLOW-GROUP", 0, 1 );
        type = (ActionType) actionTypeMap.get( new Integer(0) );
        assertEquals(ActionType.RULEFLOWGROUP, type.type);
    }
   
}
TOP

Related Classes of org.drools.decisiontable.parser.ActionTypeTest

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.