use of com.agiletec.aps.system.services.page.widget.NavigatorExpression in project entando-core by entando.
the class TestNavigatorExpression method testGetWrongExpression_2.
public void testGetWrongExpression_2() throws Throwable {
NavigatorExpression navExpr = new NavigatorExpression();
navExpr.setSpecId(NavigatorExpression.SPEC_PAGE_ID);
navExpr.setSpecCode(null);
navExpr.setOperatorId(NavigatorExpression.OPERATOR_PATH_ID);
String expression = null;
try {
expression = navExpr.toString();
} catch (RuntimeException e) {
// Messaggio di Pagina nulla
} catch (Throwable t) {
fail();
}
assertNull(expression);
}
use of com.agiletec.aps.system.services.page.widget.NavigatorExpression in project entando-core by entando.
the class TestNavigatorExpression method testSetExpression_2.
public void testSetExpression_2() throws Throwable {
NavigatorExpression navExpr = new NavigatorExpression("abs(1).subtree(2)");
assertEquals(NavigatorExpression.SPEC_ABS_ID, navExpr.getSpecId());
assertEquals(1, navExpr.getSpecAbsLevel());
assertEquals(NavigatorExpression.OPERATOR_SUBTREE_ID, navExpr.getOperatorId());
assertEquals(2, navExpr.getOperatorSubtreeLevel());
}
use of com.agiletec.aps.system.services.page.widget.NavigatorExpression in project entando-core by entando.
the class TestNavigatorExpression method testGetExpression_1.
public void testGetExpression_1() throws Throwable {
NavigatorExpression navExpr = new NavigatorExpression();
navExpr.setSpecId(NavigatorExpression.SPEC_SUPER_ID);
navExpr.setSpecSuperLevel(4);
String expression = navExpr.toString();
assertEquals("super(4)", expression);
}
use of com.agiletec.aps.system.services.page.widget.NavigatorExpression in project entando-core by entando.
the class TestNavigatorExpression method testGetWrongExpression_1.
public void testGetWrongExpression_1() throws Throwable {
NavigatorExpression navExpr = new NavigatorExpression();
navExpr.setSpecId(7);
navExpr.setOperatorId(NavigatorExpression.OPERATOR_PATH_ID);
String expression = null;
try {
expression = navExpr.toString();
} catch (RuntimeException e) {
assertTrue(e.getMessage().indexOf("7") > 0);
} catch (Throwable t) {
fail();
}
assertNull(expression);
}
use of com.agiletec.aps.system.services.page.widget.NavigatorExpression in project entando-core by entando.
the class TestNavigatorExpression method testGetExpression_2.
public void testGetExpression_2() throws Throwable {
NavigatorExpression navExpr = new NavigatorExpression();
navExpr.setSpecId(NavigatorExpression.SPEC_CURRENT_PAGE_ID);
navExpr.setOperatorId(NavigatorExpression.OPERATOR_CHILDREN_ID);
String expression = navExpr.toString();
assertEquals("current.children", expression);
}
Aggregations