Examples of Abbreviations


Examples of gov.nasa.arc.mct.abbreviation.Abbreviations

      }
    });
  }
 
  private static AbbreviationSettings getAbbreviationSettings(String label) {
    Abbreviations abbrevs = manager.getAbbreviations(label);
    LabelAbbreviations currentAbbrevs = new LabelAbbreviations();
    AbbreviationSettings settings = new AbbreviationSettings(label, abbrevs, currentAbbrevs);
    return settings;
   
   
View Full Code Here

Examples of gov.nasa.arc.mct.abbreviation.Abbreviations

  @Test
  public void testActivateGoodFile() {
    properties.put("abbreviations-file", "/default-abbreviations.properties");
    abbrev.activate(context);

    Abbreviations abbreviations = abbrev.getAbbreviations("Fiber Optic MDM System");
    assertEquals(abbreviations.getPhrases().size(), 3);
    assertEquals(abbreviations.getPhrases().get(0), "Fiber Optic");
    assertEquals(abbreviations.getPhrases().get(1), "MDM");
    assertEquals(abbreviations.getPhrases().get(2), "System");
  }
View Full Code Here

Examples of gov.nasa.arc.mct.abbreviation.Abbreviations

 
  @Test
  public void testActivateNoFileProperty() {
    abbrev.activate(context);

    Abbreviations abbreviations = abbrev.getAbbreviations("Fiber Optic MDM System");
    assertEquals(abbreviations.getPhrases().size(), 4);
    assertEquals(abbreviations.getPhrases().get(0), "Fiber");
    assertEquals(abbreviations.getPhrases().get(1), "Optic");
    assertEquals(abbreviations.getPhrases().get(2), "MDM");
    assertEquals(abbreviations.getPhrases().get(3), "System");
  }
View Full Code Here

Examples of gov.nasa.arc.mct.abbreviation.Abbreviations

  @Test
  public void testActivateNonexistentAbbreviationsFile() {
    properties.put("abbreviations-file", "/file-does-not-exist.properties");
    abbrev.activate(context);

    Abbreviations abbreviations = abbrev.getAbbreviations("Fiber Optic MDM System");
    assertEquals(abbreviations.getPhrases().size(), 4);
    assertEquals(abbreviations.getPhrases().get(0), "Fiber");
    assertEquals(abbreviations.getPhrases().get(1), "Optic");
    assertEquals(abbreviations.getPhrases().get(2), "MDM");
    assertEquals(abbreviations.getPhrases().get(3), "System");
  }
View Full Code Here

Examples of gov.nasa.arc.mct.abbreviation.Abbreviations

  }
 
  @Test(dataProvider="getAbbreviationsTests")
  public void testGetAbbreviations(String s, String[] expectedPhrases) {
    AbbreviationsManager manager = new AbbreviationsManager(defaultProperties);
    Abbreviations abbrev = manager.getAbbreviations(s);
   
    assertEquals(abbrev.getValue(), s);
    assertEquals(abbrev.getPhrases().size(), expectedPhrases.length);
    for (int i=0; i<abbrev.getPhrases().size(); ++i) {
      String phrase = abbrev.getPhrases().get(i);
      assertEquals(phrase, expectedPhrases[i]);
     
      List<String> alternatives = abbrev.getAbbreviations(phrase);
      List<String> expectedAlternatives = manager.getAlternatives(abbrev.getPhrases().get(i));
      assertTrue(alternatives.size() >= 1);
      assertEquals(alternatives.size(), expectedAlternatives.size());
      assertEquals(alternatives.get(0), abbrev.getPhrases().get(i));
    }
  }
View Full Code Here

Examples of gov.nasa.arc.mct.abbreviation.Abbreviations

      return null;
    } else {
      ComponentTableModel tableModel = ComponentTableModel.class.cast(model);
      String fullLabel = tableModel.getFullRowName(table.getSelectedRows()[0]);
      LabelAbbreviations currentAbbrevs = tableModel.getRowLabelAbbreviations(table.getSelectedRows()[0]);
      Abbreviations availableAbbrevs = ServiceAccess.getService(AbbreviationService.class).getAbbreviations(fullLabel);
      return new AbbreviationSettings(fullLabel, availableAbbrevs, currentAbbrevs);
    }
  }
View Full Code Here

Examples of gov.nasa.arc.mct.abbreviation.Abbreviations

      return null;
    } else {
      ComponentTableModel tableModel = ComponentTableModel.class.cast(model);
      String fullLabel = tableModel.getFullColumnName(table.getSelectedColumns()[0]);
      LabelAbbreviations currentAbbrevs = tableModel.getColumnLabelAbbreviations(table.getSelectedColumns()[0]);
      Abbreviations availableAbbrevs = ServiceAccess.getService(AbbreviationService.class).getAbbreviations(fullLabel);
      return new AbbreviationSettings(fullLabel, availableAbbrevs, currentAbbrevs);
    }
  }
View Full Code Here

Examples of gov.nasa.arc.mct.abbreviation.Abbreviations

    } else {
      ComponentTableModel tableModel = ComponentTableModel.class.cast(model);
      AbstractComponent component = (AbstractComponent) model.getStoredValueAt(table.getSelectedRows()[0], table.getSelectedColumns()[0]);
      String fullLabel = tableModel.getFullCellName(table.getSelectedRows()[0], table.getSelectedColumns()[0]);
      LabelAbbreviations currentAbbrevs = tableModel.getCellLabelAbbreviations(tableModel.getKey(component));
      Abbreviations availableAbbrevs = ServiceAccess.getService(AbbreviationService.class).getAbbreviations(fullLabel);
      return new AbbreviationSettings(fullLabel, availableAbbrevs, currentAbbrevs);
    }
  }
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.