Package org.emftrace.metamodel.EMFfitModel

Examples of org.emftrace.metamodel.EMFfitModel.Hypertext


  public void testDoRunForEmtpyNewHypertext() {
   
     //setup
    String newTermContent = "foo";

    Hypertext oldHypertext = EMFfitModelFactory.eINSTANCE.createHypertext();
    String oldHypertextIdentifier = oldHypertext.getIdentifier();
    Term term = EMFfitModelFactory.eINSTANCE.createTerm();
    term.setVisibleContent(newTermContent);
    oldHypertext.getContent().add(term);
   
    Hypertext newEmptyHypertext = EMFfitModelFactory.eINSTANCE.createHypertext();

        //run command
    new UpdateHypertextContentsCommand(oldHypertext, newEmptyHypertext)
        .runWithoutUnicaseCommand();
View Full Code Here


  public void testDoRunForNullNewHypertext() {
   
     //setup
    String newTermContent = "foo";

    Hypertext oldHypertext = EMFfitModelFactory.eINSTANCE.createHypertext();
    String oldHypertextIdentifier = oldHypertext.getIdentifier();
    Term term = EMFfitModelFactory.eINSTANCE.createTerm();
    term.setVisibleContent(newTermContent);
    oldHypertext.getContent().add(term);
   
    Hypertext newNullHypertext = null;

        //run command
    new UpdateHypertextContentsCommand(oldHypertext, newNullHypertext)
        .runWithoutUnicaseCommand();
View Full Code Here

   * @return the Hypertext
   */
  public static Hypertext strToHypertext(String str){
    Term term = EMFfitModelFactory.eINSTANCE.createTerm();
    term.setVisibleContent(str);
    Hypertext hypertext = EMFfitModelFactory.eINSTANCE.createHypertext();
    hypertext.getContent().add(term);
    return hypertext;
 
View Full Code Here

  /* (non-Javadoc)
   * @see emffit_commands.EMFfitCommand#doRun()
   */
  @Override
  protected void doRun() {
    Hypertext currentSolution = issueCard.getSolution();
    if (currentSolution== null){
      currentSolution = EMFfitModelFactory.eINSTANCE.createHypertext();
      issueCard.setSolution(currentSolution);
    }
    new UpdateHypertextContentsCommand(currentSolution, newSolution).runWithoutUnicaseCommand();
View Full Code Here

  /* (non-Javadoc)
   * @see emffit_commands.EMFfitCommand#doRun()
   */
  @Override
  protected void doRun() {
    Hypertext currentDescription = issueCard.getDescription();
    if (currentDescription== null){
      currentDescription = EMFfitModelFactory.eINSTANCE.createHypertext();
      issueCard.setDescription(currentDescription);
    }
    new UpdateHypertextContentsCommand(currentDescription, newDescription).runWithoutUnicaseCommand();
View Full Code Here

public class DeleteHypertextEmptyTermsCommandTest extends EMFfitTestCase{
 
  @Test
  public void testDoRunForTermLinkTermLinkTerm() {
   
    Hypertext hypertext = EMFfitModelFactory.eINSTANCE.createHypertext();
    Term term1 = EMFfitModelFactory.eINSTANCE.createTerm();
    Link link1 = EMFfitModelFactory.eINSTANCE.createLink();
    Term term2 = EMFfitModelFactory.eINSTANCE.createTerm();
    Link link2 = EMFfitModelFactory.eINSTANCE.createLink();
    Term term3 = EMFfitModelFactory.eINSTANCE.createTerm();
   
    term1.setVisibleContent("foo ");
    link1.setVisibleContent("link1");
    term2.setVisibleContent("");
    link2.setVisibleContent("link2");
    term3.setVisibleContent(" bar");
   
    hypertext.getContent().add(term1);
    hypertext.getContent().add(link1);
    hypertext.getContent().add(term2);
    hypertext.getContent().add(link2);
    hypertext.getContent().add(term3);
   
    project.addModelElement(hypertext);
   
   
    new DeleteHypertextEmptyTermsCommand(hypertext).runWithoutUnicaseCommand();
    assertEquals(4, hypertext.getContent().size());
    assertEquals("foo ", hypertext.getContent().get(0).getVisibleContent());
    assertEquals("link1", hypertext.getContent().get(1).getVisibleContent());
    assertEquals("link2", hypertext.getContent().get(2).getVisibleContent());
    assertEquals(" bar", hypertext.getContent().get(3).getVisibleContent());
  }
View Full Code Here

  }
 
  @Test
  public void testDoRunForEmtpyLink() {
   
    Hypertext hypertext = EMFfitModelFactory.eINSTANCE.createHypertext();
    Link link1 = EMFfitModelFactory.eINSTANCE.createLink();
    hypertext.getContent().add(link1);
    project.addModelElement(hypertext);
   
    new DeleteHypertextEmptyTermsCommand(hypertext).runWithoutUnicaseCommand();
    assertEquals(1, hypertext.getContent().size()); //don't delete link
  }
View Full Code Here

TOP

Related Classes of org.emftrace.metamodel.EMFfitModel.Hypertext

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.