Search in sources :

Example 36 with ListPrologTerm

use of de.prob.prolog.term.ListPrologTerm in project prob2 by bendisposto.

the class GetStateBasedErrorsCommandTest method testErrorProcessResult1.

@Test(expected = ResultParserException.class)
public void testErrorProcessResult1() {
    @SuppressWarnings("unchecked") ISimplifiedROMap<String, PrologTerm> map = mock(ISimplifiedROMap.class);
    when(map.get("Errors")).thenReturn(new ListPrologTerm(new CompoundPrologTerm("foobar")));
    GetStateBasedErrorsCommand command = new GetStateBasedErrorsCommand("state");
    command.processResult(map);
}
Also used : ListPrologTerm(de.prob.prolog.term.ListPrologTerm) CompoundPrologTerm(de.prob.prolog.term.CompoundPrologTerm) CompoundPrologTerm(de.prob.prolog.term.CompoundPrologTerm) PrologTerm(de.prob.prolog.term.PrologTerm) ListPrologTerm(de.prob.prolog.term.ListPrologTerm) Test(org.junit.Test)

Example 37 with ListPrologTerm

use of de.prob.prolog.term.ListPrologTerm in project prob2 by bendisposto.

the class GetErrorsCommandTest method testProcessResults.

@Test
public void testProcessResults() {
    @SuppressWarnings("unchecked") ISimplifiedROMap<String, PrologTerm> map = mock(ISimplifiedROMap.class);
    when(map.get(anyString())).thenReturn(new ListPrologTerm(new CompoundPrologTerm("foobar")));
    GetErrorsCommand command = new GetErrorsCommand();
    command.processResult(map);
    List<String> errors = command.getErrors();
    assertEquals("foobar", errors.get(0));
}
Also used : ListPrologTerm(de.prob.prolog.term.ListPrologTerm) CompoundPrologTerm(de.prob.prolog.term.CompoundPrologTerm) Matchers.anyString(org.mockito.Matchers.anyString) CompoundPrologTerm(de.prob.prolog.term.CompoundPrologTerm) ListPrologTerm(de.prob.prolog.term.ListPrologTerm) PrologTerm(de.prob.prolog.term.PrologTerm) Test(org.junit.Test)

Example 38 with ListPrologTerm

use of de.prob.prolog.term.ListPrologTerm in project prob2 by bendisposto.

the class GetPreferencesCommandTest method testProcessResultsFail.

@Test(expected = ResultParserException.class)
public void testProcessResultsFail() {
    @SuppressWarnings("unchecked") ISimplifiedROMap<String, PrologTerm> map = mock(ISimplifiedROMap.class);
    when(map.get(anyString())).thenReturn(new ListPrologTerm(new CompoundPrologTerm("blah blah blah")));
    GetDefaultPreferencesCommand command = new GetDefaultPreferencesCommand();
    command.processResult(map);
}
Also used : ListPrologTerm(de.prob.prolog.term.ListPrologTerm) CompoundPrologTerm(de.prob.prolog.term.CompoundPrologTerm) CompoundPrologTerm(de.prob.prolog.term.CompoundPrologTerm) ListPrologTerm(de.prob.prolog.term.ListPrologTerm) PrologTerm(de.prob.prolog.term.PrologTerm) Test(org.junit.Test)

Aggregations

ListPrologTerm (de.prob.prolog.term.ListPrologTerm)38 PrologTerm (de.prob.prolog.term.PrologTerm)33 CompoundPrologTerm (de.prob.prolog.term.CompoundPrologTerm)27 Test (org.junit.Test)11 IntegerPrologTerm (de.prob.prolog.term.IntegerPrologTerm)6 VariablePrologTerm (de.prob.prolog.term.VariablePrologTerm)4 ArrayList (java.util.ArrayList)4 Transition (de.prob.statespace.Transition)3 AbstractEvalResult (de.prob.animator.domainobjects.AbstractEvalResult)2 ComputationNotCompletedResult (de.prob.animator.domainobjects.ComputationNotCompletedResult)2 EvalResult (de.prob.animator.domainobjects.EvalResult)2 IEvalElement (de.prob.animator.domainobjects.IEvalElement)2 StateError (de.prob.animator.domainobjects.StateError)2 HashMap (java.util.HashMap)2 List (java.util.List)2 DotEdge (de.prob.animator.domainobjects.DotEdge)1 DotNode (de.prob.animator.domainobjects.DotNode)1 ProBPreference (de.prob.animator.domainobjects.ProBPreference)1 ASTCategory (de.prob.animator.prologast.ASTCategory)1 ASTFormula (de.prob.animator.prologast.ASTFormula)1