Examples of Hypertext


Examples of org.emftrace.metamodel.EMFfitModel.Hypertext

    assertEquals("link", result.getVisibleContent());
  }

  @Test
  public void testFindTextElementOffsetAtTextOffset(){
    Hypertext hypertext = createTestHypertext();
    int result = HypertextHelpers.findTextElementOffsetAtTextOffset(hypertext, 2, hypertext.getContent().get(0));
    assertEquals(2, result);

    result = HypertextHelpers.findTextElementOffsetAtTextOffset(hypertext, 4, hypertext.getContent().get(1));
    assertEquals(0, result);
   
    result = HypertextHelpers.findTextElementOffsetAtTextOffset(hypertext, 7, hypertext.getContent().get(2));
    assertEquals(2, result);
  }
View Full Code Here

Examples of org.emftrace.metamodel.EMFfitModel.Hypertext

    assertEquals(2, result);
  }

  @Test
  public void testStrToHypertext(){
    Hypertext result = HypertextHelpers.strToHypertext("foo");
    assertEquals(1, result.getContent().size());
    assertEquals("foo", result.getContent().get(0).getVisibleContent());
  }
View Full Code Here

Examples of org.emftrace.metamodel.EMFfitModel.Hypertext

    assertEquals("foo", result.getContent().get(0).getVisibleContent());
  }
 
  @Test
  public void testHypertextToString(){
    Hypertext hypertext = createTestHypertext();
    String result = HypertextHelpers.HypertextToString(hypertext);
    assertEquals("foo link bar", result);
  }
View Full Code Here

Examples of org.emftrace.metamodel.EMFfitModel.Hypertext

  protected AccessLayer accessLayer;
  protected FTICPackage fTICPackage;


  protected Hypertext createTestHypertext(){
    Hypertext hypertext = EMFfitModelFactory.eINSTANCE.createHypertext();
    Term term1 = EMFfitModelFactory.eINSTANCE.createTerm();
    Link link1 = EMFfitModelFactory.eINSTANCE.createLink();
    Term term2 = EMFfitModelFactory.eINSTANCE.createTerm();
   
    term1.setVisibleContent("foo ");
    link1.setVisibleContent("link");
    term2.setVisibleContent(" bar");
   
   
   
     hypertext.getContent().add(term1);
     hypertext.getContent().add(link1);
     hypertext.getContent().add(term2);
     project.addModelElement(hypertext);
     return hypertext;
  }
View Full Code Here

Examples of org.emftrace.metamodel.EMFfitModel.Hypertext

  @Test
  public void testDoRun() {
    //setup
    String content = "foo bar";
   
    Hypertext newChangeability = EMFfitModelFactory.eINSTANCE.createHypertext();
    Term term = EMFfitModelFactory.eINSTANCE.createTerm();
    term.setVisibleContent(content);
    newChangeability.getContent().add(term);
   
    Factor factor = (Factor)((FactorCategory)factorTable.getEntries().get(1)).getChildren().get(0);
   
    //run command
    new UpdateFactorChangeabilityCommand(factor,newChangeability ).runWithoutUnicaseCommand();
View Full Code Here

Examples of org.emftrace.metamodel.EMFfitModel.Hypertext

  @Test
  public void testDoRunForNullChangeability() {
    //setup
    String content = "foo bar";
   
    Hypertext newChangeability = EMFfitModelFactory.eINSTANCE.createHypertext();
    Term term = EMFfitModelFactory.eINSTANCE.createTerm();
    term.setVisibleContent(content);
    newChangeability.getContent().add(term);
   
    Factor factor = (Factor)((FactorCategory)factorTable.getEntries().get(1)).getChildren().get(0);
    factor.setChangeability(null);
   
    //run command
View Full Code Here

Examples of org.emftrace.metamodel.EMFfitModel.Hypertext

public class UpdateHypertextContentsCommandTest extends TestCase {

  @Test
  public void testDoRun() {
    //setup for old hypertext element
    Hypertext oldHypertext = EMFfitModelFactory.eINSTANCE.createHypertext();
    String oldHypertextIdentifier = oldHypertext.getIdentifier();

    Term term1 = EMFfitModelFactory.eINSTANCE.createTerm();
    term1.setVisibleContent("term1 ");

    String term1Identifier = term1.getIdentifier();

    Link link = EMFfitModelFactory.eINSTANCE.createLink();
    link.setVisibleContent("link1");
    Factor linkedFactor = EMFfitModelFactory.eINSTANCE.createFactor();
    link.setTarget(linkedFactor);
    String linkIdentifier = link.getIdentifier();

    Term term2 = EMFfitModelFactory.eINSTANCE.createTerm();
    term2.setVisibleContent(" term2");
    String term2Identifier = term2.getIdentifier();

    oldHypertext.getContent().add(term1);
    oldHypertext.getContent().add(link);
    oldHypertext.getContent().add(term2);

    //setup for new changed hypertext element
    String newTerm1Content = "xxxterm1xxx xxx ";
    String newLinkContent = "newlink";
    String newTerm2Content = "xxxterm2xxx xxx";

    Hypertext newHypertext = EMFfitModelFactory.eINSTANCE.createHypertext();

    Term newTerm1 = EMFfitModelFactory.eINSTANCE.createTerm();
    newTerm1.setVisibleContent(newTerm1Content);

    Link newLink = EMFfitModelFactory.eINSTANCE.createLink();
    newLink.setVisibleContent(newLinkContent);
    Factor newLinkedFactor = EMFfitModelFactory.eINSTANCE.createFactor();
    newLink.setTarget(newLinkedFactor);

    Term newterm2 = EMFfitModelFactory.eINSTANCE.createTerm();
    newterm2.setVisibleContent(newTerm2Content);

    newHypertext.getContent().add(newTerm1);
    newHypertext.getContent().add(newLink);
    newHypertext.getContent().add(newterm2);
   
    //run command
    new UpdateHypertextContentsCommand(oldHypertext, newHypertext)
        .runWithoutUnicaseCommand();
View Full Code Here

Examples of org.emftrace.metamodel.EMFfitModel.Hypertext

  @Test
  public void testDoRunForEmtpyOldHypertext() {
     //setup
    String newTermContent = "foo";

    Hypertext oldEmptyHypertext = EMFfitModelFactory.eINSTANCE.createHypertext();
    String oldEmptyHypertextIdentifier = oldEmptyHypertext.getIdentifier();
    Hypertext newHypertext = EMFfitModelFactory.eINSTANCE.createHypertext();

   
    Term term = EMFfitModelFactory.eINSTANCE.createTerm();
    term.setVisibleContent(newTermContent);
   
    newHypertext.getContent().add(term);

    //run command
    new UpdateHypertextContentsCommand(oldEmptyHypertext, newHypertext)
        .runWithoutUnicaseCommand();
View Full Code Here

Examples of org.emftrace.metamodel.EMFfitModel.Hypertext

  @Test
  public void testDoRun() {
    //setup
    String content = "foo bar";
   
    Hypertext newDescription = EMFfitModelFactory.eINSTANCE.createHypertext();
    Term term = EMFfitModelFactory.eINSTANCE.createTerm();
    term.setVisibleContent(content);
    newDescription.getContent().add(term);
 
   
    //run command
    new UpdateIssueCardDescriptionCommand(issueCard, newDescription).runWithoutUnicaseCommand();
   
View Full Code Here

Examples of org.emftrace.metamodel.EMFfitModel.Hypertext

  @Test
  public void testDoRunForNullDescription() {
    //setup
    String content = "foo bar";
   
    Hypertext newDescription= EMFfitModelFactory.eINSTANCE.createHypertext();
    Term term = EMFfitModelFactory.eINSTANCE.createTerm();
    term.setVisibleContent(content);
    newDescription.getContent().add(term);
   
    issueCard.setDescription(null);
   
    //run command
    new UpdateIssueCardDescriptionCommand(issueCard, newDescription).runWithoutUnicaseCommand();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.