Example #1
0
    @Override
    public Object[] getChildren(Object parentElement) {
      // Because of potentially large amount of children, MethodNode is special case
      // We filter out test suites with too many test cases
      if (parentElement instanceof MethodNode) {
        MethodNode method = (MethodNode) parentElement;
        ArrayList<Object> children = new ArrayList<Object>();
        children.addAll(method.getParameters());
        children.addAll(method.getConstraintNodes());
        for (String testSuite : method.getTestSuites()) {
          Collection<TestCaseNode> testCases = method.getTestCases(testSuite);
          if (testCases.size() <= Constants.MAX_DISPLAYED_TEST_CASES_PER_SUITE) {
            children.addAll(testCases);
          }
        }
        return children.toArray();
      }

      if (parentElement instanceof MethodParameterNode) {
        MethodParameterNode parameter = (MethodParameterNode) parentElement;
        if (parameter.isExpected() && AbstractParameterInterface.isPrimitive(parameter.getType())) {
          return EMPTY_ARRAY;
        }
        if (parameter.isLinked()) {
          return EMPTY_ARRAY;
        }
      }
      if (parentElement instanceof AbstractNode) {
        AbstractNode node = (AbstractNode) parentElement;
        if (node.getChildren().size() < Constants.MAX_DISPLAYED_CHILDREN_PER_NODE) {
          return node.getChildren().toArray();
        }
      }
      return EMPTY_ARRAY;
    }
Example #2
0
 @Override
 public Object visit(MethodParameterNode node) throws Exception {
   String result = JavaUtils.simplifiedToString(node);
   if (node.isLinked()) {
     result += "[LINKED]->" + node.getLink().getQualifiedName();
   }
   return result;
 }
Example #3
0
 @Override
 public Object visit(MethodParameterNode node) throws Exception {
   List<Image> decorations = new ArrayList<Image>();
   decorations.add(implementationStatusDecoration(node));
   if (node.isExpected()) {
     decorations.add(getImageFromFile("expected.png"));
   }
   if (node.isLinked()) {
     decorations.add(getImageFromFile("linked.png"));
   }
   return decorations;
 }