Package org.emftrace.emffit.ui.controls.tests.testclasses

Examples of org.emftrace.emffit.ui.controls.tests.testclasses.TestResultItemViewText


    nameHits.add("fuu");

    hits.put("name", nameHits);
    item = new FilteredContentProviderResultItem(id, modelElement,  label, null, content,  project, hits);
   
    TestResultItemViewText text = new TestResultItemViewText(shell, SWT.NONE);
    assertFalse(text.getStyledText().getEditable()); //must be non editable by default
    text.setItemToDisplay(item);
    StyleRange[] styleRanges = text.getStyledText().getStyleRanges();
   
    assertEquals(6, styleRanges.length);

    assertEquals(30, styleRanges[0].start );
    assertEquals(3, styleRanges[0].length );
   
    assertEquals(35, styleRanges[1].start );
    assertEquals(3, styleRanges[1].length );
   
    assertEquals(40, styleRanges[2].start );
    assertEquals(11, styleRanges[2].length );
   
    assertEquals(51, styleRanges[3].start );
    assertEquals(4, styleRanges[3].length );
   
    assertEquals(56, styleRanges[4].start );
    assertEquals(3, styleRanges[4].length );
   
    assertEquals(60, styleRanges[5].start );
    assertEquals(3, styleRanges[5].length );
   
      assertEquals(null, text.getStyledText().getLineBackground(0));
      assertEquals(null, text.getStyledText().getLineBackground(1));
      assertEquals(null, text.getStyledText().getLineBackground(2));
      assertEquals(null, text.getStyledText().getLineBackground(3));
      assertEquals(Display.getDefault().getSystemColor(SWT.COLOR_GRAY), text.getStyledText().getLineBackground(4));
      assertEquals(null, text.getStyledText().getLineBackground(5));
   
  }
View Full Code Here


    List<String> descriptionHits = new ArrayList<String>();
    descriptionHits.add("foo");
    hits.put("description", descriptionHits);
    item = new FilteredContentProviderResultItem(id, modelElement,  label, null, content,  project, hits);
   
    TestResultItemViewText text = new TestResultItemViewText(shell, SWT.NONE);
    assertFalse(text.getStyledText().getEditable()); //must be non editable by default
    text.setItemToDisplay(item);
    StyleRange[] styleRanges = text.getStyledText().getStyleRanges();
   
    assertEquals(10, styleRanges.length);

    assertEquals(30, styleRanges[0].start );
    assertEquals(3, styleRanges[0].length ); // foo
   
    assertEquals(35, styleRanges[1].start );
    assertEquals(11, styleRanges[1].length );
   
    assertEquals(46, styleRanges[2].start );
    assertEquals(11, styleRanges[2].length );
   

    assertEquals(58, styleRanges[3].start );//foo
    assertEquals(3, styleRanges[3].length );
   
    assertEquals(62, styleRanges[4].start );//Foo
    assertEquals(3, styleRanges[4].length );
   
    assertEquals(66, styleRanges[5].start );//fOo
    assertEquals(3, styleRanges[5].length );
   
    assertEquals(70, styleRanges[6].start );//foO
    assertEquals(3, styleRanges[6].length );
   
    assertEquals(74, styleRanges[7].start );//FOo
    assertEquals(3, styleRanges[7].length );
   
    assertEquals(78, styleRanges[8].start );//FoO
    assertEquals(3, styleRanges[8].length );
   
    assertEquals(82, styleRanges[9].start );//fOO
    assertEquals(3, styleRanges[9].length );
   
      assertEquals(null, text.getStyledText().getLineBackground(0));
      assertEquals(null, text.getStyledText().getLineBackground(1));
      assertEquals(null, text.getStyledText().getLineBackground(2));
      assertEquals(Display.getDefault().getSystemColor(SWT.COLOR_GRAY), text.getStyledText().getLineBackground(3));
      assertEquals(null, text.getStyledText().getLineBackground(4));
   
  }
View Full Code Here

TOP

Related Classes of org.emftrace.emffit.ui.controls.tests.testclasses.TestResultItemViewText

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.