Package org.emftrace.metamodel.EMFfitModel

Examples of org.emftrace.metamodel.EMFfitModel.Factor


  }
 
  @Test
  public void testDisplay(){
   
    Factor f = EMFfitModelFactory.eINSTANCE.createFactor();
    f.setName("foo fuu bar");
    modelElement = f;
    id = f.getIdentifier();
    label = "P1.2 "+f.getName();
    HashMap<String, String> content = new HashMap<String, String>();
    content.put("Name", f.getName());
   
    HashMap<String, List<String> > hits = new HashMap<String, List<String> > ();
    List<String> nameHits = new ArrayList<String>();
    nameHits.add("foo");
    nameHits.add("fuu");
View Full Code Here


  }
 
  @Test
  public void testDisplayForUpperAndLowercase(){
   
    Factor f = EMFfitModelFactory.eINSTANCE.createFactor();
    f.setName("test");
    String testString = "foo Foo fOo foO FOo FoO fOO";
    f.setDescription(HypertextHelpers.strToHypertext(testString));
    modelElement = f;
    id = f.getIdentifier();
    label = "P1.2 "+f.getName();
    HashMap<String, String> content = new HashMap<String, String>();
    content.put("Description", testString);
   
    HashMap<String, List<String> > hits = new HashMap<String, List<String> > ();
    List<String> descriptionHits = new ArrayList<String>();
View Full Code Here

  public void setUp() throws Exception {
    super.setUp();
    unfilteredList = new LinkedList<ContentProviderResultItem>();

    Factor f1 = EMFfitModelFactory.eINSTANCE.createFactor();
    f1.setName("foo");
    HashMap<String, String> f1Content = new HashMap<String, String>();
    f1Content.put("name", f1.getName());
    Factor f2 = EMFfitModelFactory.eINSTANCE.createFactor();
    f2.setName("bar");
    HashMap<String, String> f2Content = new HashMap<String, String>();
    f2Content.put("name", f2.getName());
    Factor f3 = EMFfitModelFactory.eINSTANCE.createFactor();
    f3.setName("fubar");
    HashMap<String, String> f3Content = new HashMap<String, String>();
    f3Content.put("name", f3.getName());
    Factor f4 = EMFfitModelFactory.eINSTANCE.createFactor();
    f4.setName("fou");
    HashMap<String, String> f4Content = new HashMap<String, String>();
    f4Content.put("name", f4.getName());
    unfilteredList.add(new ContentProviderResultItem(f1.getIdentifier(),
        f1, "P1 " + f1.getName(), null, f1Content, project));
    unfilteredList.add(new ContentProviderResultItem(f2.getIdentifier(),
        f2, "P2 " + f2.getName(), null, f2Content, project));
    unfilteredList.add(new ContentProviderResultItem(f3.getIdentifier(),
        f3, "P3 " + f3.getName(), null, f3Content, project));
    unfilteredList.add(new ContentProviderResultItem(f4.getIdentifier(),
        f4, "P4 " + f4.getName(), null, f4Content, project));

  }
View Full Code Here

  }

  // must no raise exception
  @Test
  public void testFilterForWordWithOneChar() {
    Factor f5 = EMFfitModelFactory.eINSTANCE.createFactor();
    f5.setName("x");
    HashMap<String, String> f5Content = new HashMap<String, String>();
    f5Content.put("name", f5.getName());
    unfilteredList.add(new ContentProviderResultItem(f5.getIdentifier(),
        f5, "P5 " + f5.getName(), null, f5Content, project));

    List<FilteredContentProviderResultItem> filteredList = NGramResultFilter
        .filter(unfilteredList, "x"3, 0.8f);
    assertEquals(1, filteredList.size());
    assertNotNull(filteredList.get(0).getHits().get("name"));
View Full Code Here

  }
 
  // must no raise exception
  @Test
  public void testFilterForWordWithOneCharAndCorrelationEqualsZero() {
    Factor f5 = EMFfitModelFactory.eINSTANCE.createFactor();
    f5.setName("z");
    HashMap<String, String> f5Content = new HashMap<String, String>();
    f5Content.put("name", f5.getName());
    unfilteredList.add(new ContentProviderResultItem(f5.getIdentifier(),
        f5, "P5 " + f5.getName(), null, f5Content, project));

    List<FilteredContentProviderResultItem> filteredList = NGramResultFilter
        .filter(unfilteredList, "x"3, 0.0f);
    assertEquals(5, filteredList.size());
    assertNotNull(filteredList.get(4).getHits().get("name"));
View Full Code Here

  }

  // must not raise exception
  @Test
  public void testFilterForWordWithTwoChars() {
    Factor f5 = EMFfitModelFactory.eINSTANCE.createFactor();
    f5.setName("xy");
    HashMap<String, String> f5Content = new HashMap<String, String>();
    f5Content.put("name", f5.getName());
    unfilteredList.add(new ContentProviderResultItem(f5.getIdentifier(),
        f5, "P5 " + f5.getName(), null, f5Content, project));

    List<FilteredContentProviderResultItem> filteredList = NGramResultFilter
        .filter(unfilteredList, "xy"3, 0.8f);

    assertEquals(1, filteredList.size());
View Full Code Here

    assertEquals(5, unfilteredList.size());
  }

  @Test
  public void testSplit() {
    Factor f5 = EMFfitModelFactory.eINSTANCE.createFactor();
    f5.setName("thing for split");
    HashMap<String, String> f5Content = new HashMap<String, String>();
    f5Content.put("name", f5.getName());
    unfilteredList.add(new ContentProviderResultItem(f5.getIdentifier(),
        f5, "P5 " + f5.getName(), null, f5Content, project));
    List<FilteredContentProviderResultItem> filteredList = NGramResultFilter
        .filter(unfilteredList, "thing"3, 0.8f);
    assertEquals(2, filteredList.get(0).getHits().size());
    assertEquals(1, filteredList.get(0).getHits().get("name").size());
    assertEquals("thing", filteredList.get(0).getHits().get("name").get(0));
View Full Code Here

  }

  @Test
  public void testSplitForEmtpyString() {
    Factor f5 = EMFfitModelFactory.eINSTANCE.createFactor();
    f5.setName("");
    HashMap<String, String> f5Content = new HashMap<String, String>();
    f5Content.put("name", f5.getName());
    unfilteredList.add(new ContentProviderResultItem(f5.getIdentifier(),
        f5, "P5 " + f5.getName(), null, f5Content, project));
    List<FilteredContentProviderResultItem> filteredList = NGramResultFilter
        .filter(unfilteredList, "test"3, 0.8f);
    assertEquals(0, filteredList.size());

    // original list must be unchanged
View Full Code Here

    assertEquals(5, unfilteredList.size());
  }

  @Test
  public void testSplitForNullString() {
    Factor f5 = EMFfitModelFactory.eINSTANCE.createFactor();
    f5.setName(null);
    HashMap<String, String> f5Content = new HashMap<String, String>();
    f5Content.put("name", f5.getName());
    unfilteredList.add(new ContentProviderResultItem(f5.getIdentifier(),
        f5, "P5 " + f5.getName(), null, f5Content, project));
    List<FilteredContentProviderResultItem> filteredList = NGramResultFilter
        .filter(unfilteredList, "test"3, 0.8f);
    assertEquals(0, filteredList.size());

    // original list must be unchanged
View Full Code Here

  public void setUp() throws Exception {
    super.setUp();
    project.getAllModelElements().clear();
    unsortedList = new LinkedList<ContentProviderResultItem>();
   
    Factor f1 = EMFfitModelFactory.eINSTANCE.createFactor();
    f1.setName("1");
    Factor f2 = EMFfitModelFactory.eINSTANCE.createFactor();
    f2.setName("2");
    Factor f3 = EMFfitModelFactory.eINSTANCE.createFactor();
    f3.setName("3");
    Factor f4 = EMFfitModelFactory.eINSTANCE.createFactor();
    f4.setName("4");
   
    Factor f5 = EMFfitModelFactory.eINSTANCE.createFactor();
   
    unsortedList.add(new ContentProviderResultItem(f2.getIdentifier(), f2, f2.getName(), null, null,project));
    unsortedList.add(new ContentProviderResultItem(f1.getIdentifier(), f1, f1.getName(), null, null,project));
    unsortedList.add(new ContentProviderResultItem(f4.getIdentifier(), f4, f4.getName(), null, null,project));
    unsortedList.add(new ContentProviderResultItem(f3.getIdentifier(), f3, f3.getName(), null, null,project));
    unsortedList.add(new ContentProviderResultItem(f5.getIdentifier(), f5, f5.getName(), null, null,project));
  }
View Full Code Here

TOP

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

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.