Search in sources :

Example 11 with NavigatorExpression

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);
}
Also used : NavigatorExpression(com.agiletec.aps.system.services.page.widget.NavigatorExpression)

Example 12 with NavigatorExpression

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());
}
Also used : NavigatorExpression(com.agiletec.aps.system.services.page.widget.NavigatorExpression)

Example 13 with NavigatorExpression

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);
}
Also used : NavigatorExpression(com.agiletec.aps.system.services.page.widget.NavigatorExpression)

Example 14 with NavigatorExpression

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);
}
Also used : NavigatorExpression(com.agiletec.aps.system.services.page.widget.NavigatorExpression)

Example 15 with NavigatorExpression

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);
}
Also used : NavigatorExpression(com.agiletec.aps.system.services.page.widget.NavigatorExpression)

Aggregations

NavigatorExpression (com.agiletec.aps.system.services.page.widget.NavigatorExpression)20 Widget (com.agiletec.aps.system.services.page.Widget)6 ApsProperties (com.agiletec.aps.util.ApsProperties)6 HashMap (java.util.HashMap)5