コード例 #1
0
ファイル: TestCaseTableValidator.java プロジェクト: nokia/RED
 void reportKeywordUsageProblems(final List<RobotCase> cases) {
   for (final RobotCase testCase : cases) {
     reportKeywordUsageProblemsInTestCaseSettings(testCase);
     reportKeywordUsageProblems(
         validationContext,
         reporter,
         testCase.getLinkedElement().getTestExecutionRows(),
         testCase.getTemplateInUse());
   }
 }
コード例 #2
0
  @Inject
  @Optional
  private void whenKeywordCallIsConverted(
      @UIEventTopic(RobotModelEvents.ROBOT_KEYWORD_CALL_CONVERTED) final Event event) {

    final RobotCase testCase = Events.get(event, IEventBroker.DATA, RobotCase.class);
    final RobotKeywordCall call =
        Events.get(event, RobotModelEvents.ADDITIONAL_DATA, RobotKeywordCall.class);

    if (testCase != null && testCase.getSuiteFile() == fileModel) {
      sortModel.clear();
      selectionLayerAccessor.selectElementPreservingSelectedColumnsAfterOperation(
          call, tableInputIsReplaced());
    }
  }
コード例 #3
0
  @Inject
  @Optional
  private void whenKeywordCallIsRemoved(
      @UIEventTopic(RobotModelEvents.ROBOT_KEYWORD_CALL_REMOVED) final RobotCase testCase) {
    if (testCase.getSuiteFile() == fileModel) {
      selectionLayerAccessor.preserveSelectionWhen(
          tableInputIsReplaced(),
          new Function<PositionCoordinate, PositionCoordinate>() {

            @Override
            public PositionCoordinate apply(final PositionCoordinate coordinate) {
              if (testCase.getChildren().isEmpty()) {
                return new PositionCoordinate(
                    coordinate.getLayer(),
                    coordinate.getColumnPosition(),
                    dataProvider.indexOfRowObject(testCase));
              } else if (dataProvider.getRowObject(coordinate.getRowPosition())
                  instanceof AddingToken) {
                return new PositionCoordinate(
                    coordinate.getLayer(),
                    coordinate.getColumnPosition(),
                    coordinate.getRowPosition() - 1);
              }
              return coordinate;
            }
          });
    }
  }
コード例 #4
0
 @Inject
 @Optional
 private void whenCaseNameChanges(
     @UIEventTopic(RobotModelEvents.ROBOT_CASE_NAME_CHANGE) final RobotCase testCase) {
   if (viewer != null) {
     viewer.refresh(testCase.getParent());
   }
 }
コード例 #5
0
 @Inject
 @Optional
 private void whenKeywordCallIsMoved(
     @UIEventTopic(RobotModelEvents.ROBOT_KEYWORD_CALL_MOVED) final RobotCase testCase) {
   if (testCase.getSuiteFile() == fileModel) {
     sortModel.clear();
     selectionLayerAccessor.preserveElementSelectionWhen(tableInputIsReplaced());
   }
 }
コード例 #6
0
 @Inject
 @Optional
 private void whenCaseDetailIsChanged(
     @UIEventTopic(RobotModelEvents.ROBOT_CASE_DETAIL_CHANGE_ALL) final RobotCase testCase) {
   if (testCase.getSuiteFile() == fileModel) {
     table.update();
     table.refresh();
     setDirty();
   }
 }
コード例 #7
0
 @Inject
 @Optional
 private void whenKeywordCallIsAdded(
     @UIEventTopic(RobotModelEvents.ROBOT_KEYWORD_CALL_ADDED) final Event event) {
   final RobotCase testCase = Events.get(event, IEventBroker.DATA, RobotCase.class);
   final RobotKeywordCall keywordCall =
       Events.get(event, RobotModelEvents.ADDITIONAL_DATA, RobotKeywordCall.class);
   if (testCase != null && testCase.getSuiteFile() == fileModel) {
     sortModel.clear();
     if (keywordCall != null) {
       selectionLayerAccessor.selectElementInFirstCellAfterOperation(
           keywordCall, tableInputIsReplaced());
     } else {
       final List<?> calls = Events.get(event, RobotModelEvents.ADDITIONAL_DATA, List.class);
       final RobotKeywordCall lastCall = (RobotKeywordCall) calls.get(calls.size() - 1);
       selectionLayerAccessor.selectElementInFirstCellAfterOperation(
           lastCall, tableInputIsReplaced());
     }
   }
 }
コード例 #8
0
ファイル: TestCaseTableValidator.java プロジェクト: nokia/RED
 private void reportKeywordUsageProblemsInTestCaseSettings(final RobotCase testCase) {
   final RobotToken templateKeywordToken =
       testCase.getLinkedElement().getTemplateKeywordLocation();
   if (templateKeywordToken != null
       && !templateKeywordToken.getFilePosition().isNotSet()
       && isTemplateFromTestCasesTable(testCase)
       && !templateKeywordToken.getText().toLowerCase().equals("none")) {
     validateExistingKeywordCall(
         validationContext, reporter, templateKeywordToken, Optional.<List<RobotToken>>absent());
   }
 }
コード例 #9
0
ファイル: TestCaseTableValidator.java プロジェクト: nokia/RED
 private boolean isTemplateFromTestCasesTable(final RobotCase testCase) {
   return testCase.getLinkedElement().getRobotViewAboutTestTemplate() != null;
 }