DecisionTableColumnViewUtils { public static String getColumnManagementGroupTitle(final BaseColumn column) { String managementSectionHeader = null; if (column instanceof ActionInsertFactCol52) { managementSectionHeader = concatenateFactTypeAndBoundName(((ActionInsertFactCol52) column).getFactType(), ((ActionInsertFactCol52) column).getBoundName()); } else if (column instanceof ActionSetFieldCol52) { managementSectionHeader = concatenateFactTypeAndBoundName(null, ((ActionSetFieldCol52) column).getBoundName()); } else if (column instanceof Pattern52) { managementSectionHeader = concatenateFactTypeAndBoundName(((Pattern52) column).getFactType(), ((Pattern52) column).getBoundName()); if (((Pattern52) column).isNegated()) { managementSectionHeader = GuidedDecisionTableConstants.INSTANCE.negatedPattern() + " " + managementSectionHeader; } } else if (column instanceof ActionRetractFactCol52) { managementSectionHeader = GuidedDecisionTableConstants.INSTANCE.RetractActions(); } else if (column instanceof ActionWorkItemCol52) { managementSectionHeader = GuidedDecisionTableConstants.INSTANCE.ExecuteWorkItemActions(); } else if (column instanceof BRLActionColumn) { managementSectionHeader = GuidedDecisionTableConstants.INSTANCE.BrlActions(); } else if (column instanceof BRLConditionColumn) { managementSectionHeader = GuidedDecisionTableConstants.INSTANCE.BrlConditions(); } if (managementSectionHeader == null || managementSectionHeader.isEmpty()) { return column.getHeader(); } else { return managementSectionHeader; } }  static int getCurrentIndexFromList(final String currentValue,
                                              final ListBox list); static int getCurrentIndexFromListWithoutDefaultSelect(final String currentValue,
                                                                  final ListBox list); static boolean nil(String s); static void addWidgetToContainer(final IsWidget widget,
                                            final Div container); static String getColumnManagementGroupTitle(final BaseColumn column);  }
@Test public void testColumnManagementGroupTitleInsertFact() throws Exception { final ActionInsertFactCol52 column = mock(ActionInsertFactCol52.class); doReturn(FACT_TYPE_APPLICANT).when(column).getFactType(); doReturn(APPLICANT_BOUND_NAME).when(column).getBoundName(); assertEquals(FACT_TYPE_APPLICANT + " [" + APPLICANT_BOUND_NAME + "]", DecisionTableColumnViewUtils.getColumnManagementGroupTitle(column)); }
@Test public void testColumnManagementGroupTitleInsertFactEmpty() throws Exception { final ActionInsertFactCol52 column = mock(ActionInsertFactCol52.class); doReturn(COLUMN_HEADER).when(column).getHeader(); assertEquals(COLUMN_HEADER, DecisionTableColumnViewUtils.getColumnManagementGroupTitle(column)); }
@Test public void testColumnManagementGroupTitleSetField() throws Exception { final ActionSetFieldCol52 column = mock(ActionSetFieldCol52.class); doReturn(APPLICANT_BOUND_NAME).when(column).getBoundName(); assertEquals("[" + APPLICANT_BOUND_NAME + "]", DecisionTableColumnViewUtils.getColumnManagementGroupTitle(column)); }
@Test public void testColumnManagementGroupTitleSetFieldEmpty() throws Exception { final ActionSetFieldCol52 column = mock(ActionSetFieldCol52.class); doReturn(COLUMN_HEADER).when(column).getHeader(); assertEquals(COLUMN_HEADER, DecisionTableColumnViewUtils.getColumnManagementGroupTitle(column)); }
@Test public void testColumnManagementGroupTitleWorkItemInsertFact() throws Exception { final ActionWorkItemInsertFactCol52 column = mock(ActionWorkItemInsertFactCol52.class); doReturn(FACT_TYPE_APPLICANT).when(column).getFactType(); doReturn(APPLICANT_BOUND_NAME).when(column).getBoundName(); assertEquals(FACT_TYPE_APPLICANT + " [" + APPLICANT_BOUND_NAME + "]", DecisionTableColumnViewUtils.getColumnManagementGroupTitle(column)); }
@Test public void testColumnManagementGroupTitleWorkItemInsertFactEmpty() throws Exception { final ActionWorkItemInsertFactCol52 column = mock(ActionWorkItemInsertFactCol52.class); doReturn(COLUMN_HEADER).when(column).getHeader(); assertEquals(COLUMN_HEADER, DecisionTableColumnViewUtils.getColumnManagementGroupTitle(column)); }
@Test public void testColumnManagementGroupTitleWorkItemSetField() throws Exception { final ActionWorkItemSetFieldCol52 column = mock(ActionWorkItemSetFieldCol52.class); doReturn(APPLICANT_BOUND_NAME).when(column).getBoundName(); assertEquals("[" + APPLICANT_BOUND_NAME + "]", DecisionTableColumnViewUtils.getColumnManagementGroupTitle(column)); }
@Test public void testColumnManagementGroupTitleWorkItemSetFieldEmpty() throws Exception { final ActionWorkItemSetFieldCol52 column = mock(ActionWorkItemSetFieldCol52.class); doReturn(COLUMN_HEADER).when(column).getHeader(); assertEquals(COLUMN_HEADER, DecisionTableColumnViewUtils.getColumnManagementGroupTitle(column)); }
@Test public void testColumnManagementGroupTitlePattern() throws Exception { final Pattern52 column = mock(Pattern52.class); doReturn(FACT_TYPE_APPLICANT).when(column).getFactType(); doReturn(APPLICANT_BOUND_NAME).when(column).getBoundName(); assertEquals(FACT_TYPE_APPLICANT + " [" + APPLICANT_BOUND_NAME + "]", DecisionTableColumnViewUtils.getColumnManagementGroupTitle(column)); }
@Test public void testColumnManagementGroupTitlePatternNegated() throws Exception { final Pattern52 column = mock(Pattern52.class); doReturn(FACT_TYPE_APPLICANT).when(column).getFactType(); doReturn(true).when(column).isNegated(); assertEquals(GuidedDecisionTableConstants.INSTANCE.negatedPattern() + " " + FACT_TYPE_APPLICANT, DecisionTableColumnViewUtils.getColumnManagementGroupTitle(column)); }
@Test public void testColumnManagementGroupTitlePatternEmpty() throws Exception { final Pattern52 column = mock(Pattern52.class); doReturn(COLUMN_HEADER).when(column).getHeader(); assertEquals(COLUMN_HEADER, DecisionTableColumnViewUtils.getColumnManagementGroupTitle(column)); }
@Test public void testColumnManagementGroupTitleRetractAction() throws Exception { final ActionRetractFactCol52 column = mock(ActionRetractFactCol52.class); assertEquals(GuidedDecisionTableConstants.INSTANCE.RetractActions(), DecisionTableColumnViewUtils.getColumnManagementGroupTitle(column)); }
@Test public void testColumnManagementGroupTitleWorkItemAction() throws Exception { final ActionWorkItemCol52 column = mock(ActionWorkItemCol52.class); assertEquals(GuidedDecisionTableConstants.INSTANCE.ExecuteWorkItemActions(), DecisionTableColumnViewUtils.getColumnManagementGroupTitle(column)); }
@Test public void testColumnManagementGroupTitleBrlAction() throws Exception { final BRLActionColumn column = mock(BRLActionColumn.class); assertEquals(GuidedDecisionTableConstants.INSTANCE.BrlActions(), DecisionTableColumnViewUtils.getColumnManagementGroupTitle(column)); }
@Test public void testColumnManagementGroupTitleBrlCondition() throws Exception { final BRLConditionColumn column = mock(BRLConditionColumn.class); assertEquals(GuidedDecisionTableConstants.INSTANCE.BrlConditions(), DecisionTableColumnViewUtils.getColumnManagementGroupTitle(column)); }
@Test public void testColumnManagementGroupTitle() throws Exception { final ActionCol52 column = mock(ActionCol52.class); doReturn(COLUMN_HEADER).when(column).getHeader(); assertEquals(COLUMN_HEADER, DecisionTableColumnViewUtils.getColumnManagementGroupTitle(column)); }