Examples of clearModel()


Examples of de.hpi.eworld.core.ModelManager.clearModel()

   */
  private void testParseFileInputStream(String inputFilename) {
    Osm2Model converter = new Osm2Model();
    this.mmmu = ModelManagerMockUp.getInstance();
    ModelManager mm = ModelManager.getInstance();
    mm.clearModel();
    mm.addObserver(this.mmmu);
    try {
      converter.parseFile(new FileInputStream(inputFilename));
    }
    catch (Exception xcp) {
View Full Code Here

Examples of de.hpi.eworld.core.ModelManager.clearModel()

  private static final String RES_FILE_PREFIX = "gen_result";

  @Test
  public void testSumoImport() {
    ModelManager model = ModelManager.getInstance();
    model.clearModel();
    model.notifyObservers(new ObserverNotification(NotificationType.startBatchProcess));
    Sumo2ModelDOM s2m = new Sumo2ModelDOM("./resources/sumo_test/original/berlin_test.net.xml", model, false,
        false, "");
    s2m.run();
   
View Full Code Here

Examples of de.hpi.eworld.core.ModelManager.clearModel()

        EWorldConstants.getNetConvertFile(), "", true /* doDuarouter */,
        EWorldConstants.getDuaRouterFile(), "", true /* doTlsFile */, false, false,
        false, true, new Integer[]{10000}, false);
    ew2s.run();

    model.clearModel();
    model.notifyObservers(new ObserverNotification(NotificationType.startBatchProcess));
    Sumo2ModelDOM s2m = new Sumo2ModelDOM("./resources/sumo_test/original/berlin_test.net.xml", model, true,
        false, "");
    s2m.run();
    model.notifyObservers(new ObserverNotification(NotificationType.endBatchProcess, true, false));
View Full Code Here

Examples of de.hpi.eworld.core.ModelManager.clearModel()

   * check if all attributes are restored correctly
   */
  @Test
  public void testSaveAndRestore() {
    ModelManager modelManager = ModelManager.getInstance();
    modelManager.clearModel();

    // save
    modelManager.addModelElement(myWay1);

    PersistenceManager.getInstance().saveToFile(EWD_FILE);
View Full Code Here

Examples of de.hpi.eworld.core.ModelManager.clearModel()

    modelManager.addModelElement(myWay1);

    PersistenceManager.getInstance().saveToFile(EWD_FILE);

    // restore
    modelManager.clearModel();
    PersistenceManager.getInstance().loadFromFile(EWD_FILE);
    for (ModelElement modelElement : modelManager.getAllModelElements()) {
      WayModel restoredWay1 = (WayModel)modelElement;
      Assert.assertEquals(myWay1.getBackwardEdges().size(), restoredWay1.getBackwardEdges().size());
      Assert.assertEquals(myWay1.getForwardEdges().size(), restoredWay1.getForwardEdges().size());
View Full Code Here

Examples of de.hpi.eworld.core.ModelManager.clearModel()

    NodeModel helperNode = new NodeModel(2., 3.);
    EdgeModel usedByEdge = TestCaseUtil.createTestEdge(node, helperNode);
   
    ModelManager mm = ModelManager.getInstance();
    //make sure the model is empty before we add anything
    mm.clearModel();
   
    mm.addModelElement(node);
    mm.addModelElement(usedByEdge);
    //save it to an ewd file
    PersistenceManager.getInstance().saveToFile(EWD_FILE);
View Full Code Here

Examples of de.hpi.eworld.core.ModelManager.clearModel()

    mm.addModelElement(node);
    mm.addModelElement(usedByEdge);
    //save it to an ewd file
    PersistenceManager.getInstance().saveToFile(EWD_FILE);
    //fine, now lets restore the saved objects
    mm.clearModel();
    PersistenceManager.getInstance().loadFromFile(EWD_FILE);
   
    Collection<ModelElement> modelElements = mm.getAllModelElements();
    Iterator<ModelElement> iterator = modelElements.iterator();
    Assert.assertEquals(2, modelElements.size());
View Full Code Here

Examples of de.hpi.eworld.core.ModelManager.clearModel()

    // run restore test
   
    ModelManager mm = ModelManager.getInstance();
   
    //make sure the model is empty before we add anything
    mm.clearModel();
   
    mm.addModelElement(el1);
    mm.addModelElement(el2);
    mm.addModelElement(pl);
    mm.addModelElement(cl);
View Full Code Here

Examples of de.hpi.eworld.core.ModelManager.clearModel()

   
    //save it to an ewd file
    PersistenceManager.getInstance().saveToFile(EWD_FILE);
   
    //fine, now lets restore the saved objects
    mm.clearModel();
    PersistenceManager.getInstance().loadFromFile(EWD_FILE);
   
    Collection<ModelElement> modelElements = mm.getAllModelElements();
    Assert.assertEquals(4, modelElements.size());
View Full Code Here

Examples of de.hpi.eworld.core.ModelManager.clearModel()

   */
  private void init() {
    List<ModelElement> modelElements = TestCaseUtil.createSampleTestcase();

    ModelManager modelManager = ModelManager.getInstance();
    modelManager.clearModel();

    for (ModelElement modelElement : modelElements) {
      modelManager.addModelElement(modelElement);
    }

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.