Package no.hal.jex

Examples of no.hal.jex.Member


    if (javaElement instanceof JavaPack) {
      if (depth != 0) {
        createRequirementsFromJavaModel(((JavaPack)javaElement).getClasses(), reqParent, depth - 1);
      }
    } else if (javaElement instanceof Member) {
      Member member = (Member)javaElement;
      EClass reqClass = JexPackage.eINSTANCE.getJavaRequirement();
      if (member instanceof TestRunnable) {
        reqClass = JexPackage.eINSTANCE.getJUnitTest();
      }
      JavaRequirement req = (JavaRequirement)ensureRequirement(reqClass, member, reqParent.getRequirements());
View Full Code Here


//      ((JUnitTest)newReq).setTestRunnable((TestRunnable)javaElement);
//    }
    if (otherReqs != null) {
      for (int i = 0; i < otherReqs.size(); i++) {
        JavaRequirement otherReq = (JavaRequirement)otherReqs.get(i);
        Member otherJavaElement = (Member)otherReq.getJavaElement();
        if (otherJavaElement == javaElement) {
          return otherReq;
        }
      }
      otherReqs.add(newReq);
View Full Code Here

          if (newMethod.getSimpleName().equals(javaClass.getSimpleName())) {
            newMethod.setReturnType(null);
          }
          if (newMethod instanceof JavaMethodTester && parent instanceof JavaClassTester) {
            for (Member member : ((JavaClassTester) parent).getTestedElements()) {
              Member testedMethod = findTestedMethod(newMethod.getSimpleName(), ((JavaClass) member).getMembers());
              if (testedMethod != null) {
                ((JavaMethodTester) newMethod).getTestedElements().add(testedMethod);
              }
            }
          }
View Full Code Here

    T newMember = (T) eClass.getEPackage().getEFactoryInstance().create(eClass);
    initFrom(newMember, member);
    // reuse existing element, if it exists
    if (otherMembers != null) {
      for (int i = 0; i < otherMembers.size(); i++) {
        Member otherMember = (Member)otherMembers.get(i);
        if (newMember.overrides(otherMember)) {
          initFrom(otherMember, member);
          return otherMember;
        }
      }
View Full Code Here

        returnType = testedElementName.substring(0, pos);
        pos1 -= pos + 1;
        testedElementName = testedElementName.substring(pos + 1);
      }
      int pos2 = testedElementName.lastIndexOf(')');
      Member testedElement = null;
      if (pos1 >= 0 && pos2 >= 0) {
        String[] params = {}, exceptions = {};
        if (pos2 > pos1 + 2) {
          params = parseTypeList(testedElementName.substring(pos1 + 1, pos2));
        }
        String THROWS_KEYWORD = "throws ";
        int pos3 = testedElementName.indexOf(THROWS_KEYWORD, pos2);
        if (pos3 >= pos2) {
          exceptions = parseTypeList(testedElementName.substring(pos3 + THROWS_KEYWORD.length()));
        }
        testedElementName = testedElementName.substring(0, pos1);
        if (methodParent == null) {
          continue;
        }
        if (testedElementName != methodParent.getName() && returnType == null) {
          returnType = "void";
        }
        JavaMethod javaMethod = (JavaMethod) ensureJavaMethod(testedElementName, returnType, params, exceptions, methodParent.getMembers());
        testedElement = javaMethod;
      } else {
        JavaField javaField = (JavaField) ensureJavaElement(testedElementName, methodParent.getMembers(), JexPackage.eINSTANCE.getJavaField());
        javaField.setType(returnType);
        testedElement = javaField;
      }
      javaMethodTester.getTestedElements().add(testedElement);
      JavaRequirement javaReq = JexFactory.eINSTANCE.createJavaRequirement();
      javaReq.setText("Requires " + testedElements[i].trim());
      javaReq.setJavaElement(testedElement);

      if (modifiers != null) {
        testedElement.setModifiers((Integer) JexFactory.eINSTANCE.createFromString(JexPackage.eINSTANCE.getModifiers(), modifiers));
      } else {
        javaReq.setRequiredFeatures("!modifiers");
      }
      testReq.getRequirements().add(javaReq);
    }
View Full Code Here

            javaElement = ((JavaRequirement)eo).getJavaElement();
          } else if (eo instanceof JavaElement) {
            javaElement = (JavaElement)eo;
          }
          if (javaElement instanceof Member) {
            Member member = (Member)javaElement;
            if (member.getName().equals(featureValue) || member.getFullName().equals(featureValue)) {
              return eo;
            }
          }
        }
      }
View Full Code Here

TOP

Related Classes of no.hal.jex.Member

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.