use of org.nhindirect.policy.impl.machine.StackMachineEntry in project nhin-d by DirectProject.
the class StackMachine_evaluateTest method testEvaluate_notEqualsDifferentStringValues_assertTrue.
public void testEvaluate_notEqualsDifferentStringValues_assertTrue() throws Exception {
final Vector<Opcode> stuffToProcess = new Vector<Opcode>();
stuffToProcess.add(new StackMachineEntry(PolicyValueFactory.getInstance("12345")));
stuffToProcess.add(new StackMachineEntry(PolicyValueFactory.getInstance("22345")));
stuffToProcess.add(new StackMachineEntry(PolicyOperator.NOT_EQUALS));
final StackMachine stMachine = new StackMachine();
assertTrue(stMachine.evaluate(stuffToProcess));
}
use of org.nhindirect.policy.impl.machine.StackMachineEntry in project nhin-d by DirectProject.
the class StackMachine_evaluateTest method testEvaluate_singleBooleanEntry_assertFalse.
public void testEvaluate_singleBooleanEntry_assertFalse() throws Exception {
final Vector<Opcode> stuffToProcess = new Vector<Opcode>();
stuffToProcess.add(new StackMachineEntry(PolicyValueFactory.getInstance(false)));
final StackMachine stMachine = new StackMachine();
assertFalse(stMachine.evaluate(stuffToProcess));
}
use of org.nhindirect.policy.impl.machine.StackMachineEntry in project nhin-d by DirectProject.
the class StackMachine_evaluateTest method testEvaluate_equalsSameStringValues_assertTrue.
public void testEvaluate_equalsSameStringValues_assertTrue() throws Exception {
final Vector<Opcode> stuffToProcess = new Vector<Opcode>();
stuffToProcess.add(new StackMachineEntry(PolicyValueFactory.getInstance("12345")));
stuffToProcess.add(new StackMachineEntry(PolicyValueFactory.getInstance("12345")));
stuffToProcess.add(new StackMachineEntry(PolicyOperator.EQUALS));
final StackMachine stMachine = new StackMachine();
assertTrue(stMachine.evaluate(stuffToProcess));
}
use of org.nhindirect.policy.impl.machine.StackMachineEntry in project nhin-d by DirectProject.
the class StackMachine_evaluateTest method testEvaluate_less_bottomOfStockIsLess_assertTrue.
public void testEvaluate_less_bottomOfStockIsLess_assertTrue() throws Exception {
final Vector<Opcode> stuffToProcess = new Vector<Opcode>();
stuffToProcess.add(new StackMachineEntry(PolicyValueFactory.getInstance(0)));
stuffToProcess.add(new StackMachineEntry(PolicyValueFactory.getInstance(1)));
stuffToProcess.add(new StackMachineEntry(PolicyOperator.LESS));
final StackMachine stMachine = new StackMachine();
assertTrue(stMachine.evaluate(stuffToProcess));
}
use of org.nhindirect.policy.impl.machine.StackMachineEntry in project nhin-d by DirectProject.
the class StackMachine_evaluateTest method testEvaluate_notEqualsSameStringValues_assertFalse.
public void testEvaluate_notEqualsSameStringValues_assertFalse() throws Exception {
final Vector<Opcode> stuffToProcess = new Vector<Opcode>();
stuffToProcess.add(new StackMachineEntry(PolicyValueFactory.getInstance("12345")));
stuffToProcess.add(new StackMachineEntry(PolicyValueFactory.getInstance("12345")));
stuffToProcess.add(new StackMachineEntry(PolicyOperator.NOT_EQUALS));
final StackMachine stMachine = new StackMachine();
assertFalse(stMachine.evaluate(stuffToProcess));
}
Aggregations