Package no.hal.jex

Examples of no.hal.jex.Exercise


  public Image getImage(Object obj) {
    String imageKey = ISharedImages.IMG_OBJ_ELEMENT;
    Boolean childrenSatisfied = (obj instanceof AbstractRequirement ? ((AbstractRequirement)obj).getChildrenSatisfied() : null);
    if (obj instanceof JexResource) {
      JexResource res = (JexResource)obj;
      Exercise ex = res.getExercise();
      if (ex != null) {
        return getImage(ex);
      }
      imageKey = ISharedImages.IMG_OBJ_FOLDER;
    } else if (obj instanceof Exercise || obj instanceof ExercisePart) {
View Full Code Here


  private String getBrowserText(Object obj) {
    String text = (obj instanceof AbstractRequirement ? ((AbstractRequirement)obj).getText() : null);
    if (obj instanceof JexResource) {
      JexResource res = (JexResource)obj;
      Exercise ex = res.getExercise();
      text = (ex != null ? getBrowserText(ex) : res.getURI().toString());
    } else if (obj instanceof ExercisePart) {
      String partText = "Part " + (((ExercisePart)obj).getParent().getRequirements().indexOf(obj) + 1);
      if (text != null) {
        partText = text + ": " + text;
View Full Code Here

//  }

  //

  public void validateRequirements(JexResource res, List<AbstractRequirement> changes) {
    Exercise ex = res.getExercise();
    if (ex != null) {
      validateChildrenRequirements(ex, changes);
    }
  }
View Full Code Here

    URI testsResourceUri = URI.createPlatformResourceURI(resource.getFullPath() + "." + JexResource.JEX_EXTENSION, true);
    IJavaElement javaElement = JdtHelper.findIJavaElement(javaProject, segments, 1);
    if (javaElement != null) {
      JdtTestAnnotationsToModelConverter testAnnotationsToModelConverter = new JdtTestAnnotationsToModelConverter(JexFactory.eINSTANCE.createExercise(), javaElement);
      if (testAnnotationsToModelConverter.canConvert()) {
        Exercise exercise = testAnnotationsToModelConverter.convert();
        Resource jexResource = resourceSet.createResource(testsResourceUri);
        jexResource.getContents().add(exercise);
        return true;
      }
    }
View Full Code Here

    return 0;
  }

  public Object[] getChildren(Object parent) {
    if (parent instanceof Resource) {
      Exercise exercise = ((JexResource) parent).getExercise();
      return (exercise != null ? getChildren(exercise) : new Object[0]);
    } else if (parent instanceof AbstractRequirement) {
      return ((AbstractRequirement) parent).getRequirements().toArray();
    }
    return null;
View Full Code Here

 
  protected String getText(Object obj) {
    String text = (obj instanceof AbstractRequirement ? ((AbstractRequirement)obj).getText() : null);
    if (obj instanceof JexResource) {
      JexResource res = (JexResource)obj;
      Exercise ex = res.getExercise();
      text = (ex != null ? getText(ex) : res.getURI().toString());
    } else if (obj instanceof Exercise) {
      Resource res = ((Exercise) obj).eResource();
      String exText = (res != null ? res.getURI().toString() : null);
      if (text != null && exText != null) {
View Full Code Here

  protected Icon getImage(Object obj) {
    String imageKey = null; // ISharedImages.IMG_OBJ_ELEMENT;
    Boolean childrenSatisfied = (obj instanceof AbstractRequirement ? ((AbstractRequirement)obj).getChildrenSatisfied() : null);
    if (obj instanceof JexResource) {
      JexResource res = (JexResource)obj;
      Exercise ex = res.getExercise();
      if (ex != null) {
        return getImage(ex);
      }
      imageKey = FOLDER_IMAGE;
    } else if (obj instanceof Exercise || obj instanceof ExercisePart) {
View Full Code Here

      setReflectionClassLoader(requirementChecker.getReflectionHelper());
      Test suite = requirementChecker.createTest(name, null);
      if (suite instanceof TestSuite) {
        ReflectiveTestAnnotationsToModelConverter converter = new ReflectiveTestAnnotationsToModelConverter(JexFactory.eINSTANCE.createExercise(), (TestSuite) suite);
        setReflectionClassLoader(converter.getReflectionHelper());
        Exercise ex = converter.convert();
        openExercise(ex);
      } else {
        throw new IllegalArgumentException("Couldn't find class " + name + ", are you sure the classpath is correctly set?");
      }
    }
View Full Code Here

TOP

Related Classes of no.hal.jex.Exercise

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.