Examples of BasicPropertiesImpl


Examples of eu.planets_project.tb.impl.model.BasicPropertiesImpl

    assertEquals("+431585", props.getContactTel());
  }
 
 
  public void testExperimentApproach(){
    BasicProperties props = new BasicPropertiesImpl();
    AdminManager adminManager = AdminManagerImpl.getInstance();
    try {
      props.setExperimentApproach(
          adminManager.getExperimentTypeID("simple migration"));
    } catch (InvalidInputException e) {
      assertEquals(true,false);
    }
    assertEquals(adminManager.getExperimentTypeID("simple migration"), props.getExperimentApproach());
 
    //Test2:
    String sTypeID = adminManager.getExperimentTypeID("complex workflow");
    try {
      props.setExperimentApproach(sTypeID);
    } catch (InvalidInputException e) {
      assertEquals(true,false);
    }
    assertEquals("complex workflow", props.getExperimentApproachName(sTypeID));
   
   
    //Test3:
    sTypeID = adminManager.getExperimentTypeID("novalidtypename");
    try {
      props.setExperimentApproach(sTypeID);
      assertEquals(false,true);
    } catch (InvalidInputException e) {
      assertEquals(true,true);
    }   
  }
View Full Code Here

Examples of eu.planets_project.tb.impl.model.BasicPropertiesImpl

    }   
  }
 
 
  public void testExperimenter(){
    BasicProperties props = new BasicPropertiesImpl();
    props.setExperimenter("TestUser1");
   
    assertEquals("TestUser1",props.getExperimenter());
   
  }
View Full Code Here

Examples of eu.planets_project.tb.impl.model.BasicPropertiesImpl

   
  }
 
 
  public void testExperimentedObjectType(){
    BasicProperties props = new BasicPropertiesImpl();
  //Test1:
    try {
      props.setExperimentedObjectType("text/plain");
    } catch (InvalidInputException e) {
      assertEquals(true,false);
    }
    List<String> vTypes = new Vector<String>();
    vTypes = props.getExperimentedObjectTypes();
    assertEquals(1,vTypes.size());
    assertTrue(vTypes.contains("text/plain"));
 
  //Test2:
    vTypes = new Vector<String>();
    vTypes.add("text/plain");
    vTypes.add("text/plain");
    vTypes.add("text/html");
    vTypes.add("image/gif");
    try {
      props.setExperimentedObjectTypes(vTypes);
    } catch (InvalidInputException e) {
      assertEquals(true,false);
    }
    vTypes = props.getExperimentedObjectTypes();
    assertEquals(3,vTypes.size());
    assertTrue(vTypes.contains("text/html"));
    assertTrue(vTypes.contains("image/gif"));
   
  //Test3:
    vTypes = new Vector<String>();
    vTypes.add("text/html");
    vTypes.add("image\\gif");
    vTypes.add("image/gif");
    try {
      props.setExperimentedObjectTypes(vTypes);
      assertEquals(true,false);
    } catch (InvalidInputException e) {
      assertEquals(true,true);
    }
    vTypes = props.getExperimentedObjectTypes();
    assertEquals(1,vTypes.size());
    assertTrue(vTypes.contains("text/html"));
    assertTrue(!vTypes.contains("image\\gif"));
    assertTrue(!vTypes.contains("image/gif"));
   
View Full Code Here

Examples of eu.planets_project.tb.impl.model.BasicPropertiesImpl

    assertTrue(!vTypes.contains("image/gif"));
   
  }
 
  public void testExperimentReference(){
    BasicProperties props = new BasicPropertiesImpl();

    //Test1:
    long l1 = 123;
    props.addExperimentReference(l1);

    assertTrue(props.getExperimentReferences().contains(l1));
    assertEquals(1,props.getExperimentReferences().size());

    //Test2:
    long l2 = 234;
    props.addExperimentReference(l2);
    assertTrue(props.getExperimentReferences().contains(l1));
    assertTrue(props.getExperimentReferences().contains(l2));
    assertEquals(2,props.getExperimentReferences().size());

    //Test3: 1/4
    TestbedManager manager = TestbedManagerImpl.getInstance();
    Experiment exp = manager.createNewExperiment();
    props.setExperimentReference(exp);

    assertTrue(manager.containsExperiment(exp.getEntityID()));
    assertEquals(1, props.getExperimentReferences().size());
    assertTrue(props.getExperimentReferences().contains(exp.getEntityID()));
    manager.removeExperiment(exp.getEntityID());

    //Test3: 2/4
    Experiment exp2 = manager.createNewExperiment();
    props.setExperimentReference(exp2.getEntityID());

    assertTrue(manager.containsExperiment(exp2.getEntityID()));
    assertEquals(1, props.getExperimentReferences().size());
    assertTrue(props.getExperimentReferences().contains(exp2.getEntityID()));
    manager.removeExperiment(exp2.getEntityID());

    //Test3: 3/4
    Experiment exp3 = manager.createNewExperiment();
    Experiment exp4 = manager.createNewExperiment();
    Experiment[] exparray = {exp3, exp4};
    props.setExperimentReferences(exparray);

    assertTrue(manager.containsExperiment(exp3.getEntityID()));
    assertTrue(manager.containsExperiment(exp4.getEntityID()));
    assertEquals(2, props.getExperimentReferences().size());
    assertTrue(props.getExperimentReferences().contains(exp3.getEntityID()));
    assertTrue(props.getExperimentReferences().contains(exp4.getEntityID()));
    manager.removeExperiment(exp3.getEntityID());
    manager.removeExperiment(exp4.getEntityID());

    //Test: 4/4
    List<Long> refIDs = new Vector<Long>();
    Experiment exp5 = manager.createNewExperiment();
    Experiment exp6 = manager.createNewExperiment();
    refIDs.add(exp5.getEntityID());
    refIDs.add(exp6.getEntityID());
    props.setExperimentReferences(refIDs);

    assertTrue(manager.containsExperiment(exp5.getEntityID()));
    assertTrue(manager.containsExperiment(exp6.getEntityID()));
    assertEquals(2, props.getExperimentReferences().size());
    assertTrue(props.getExperimentReferences().contains(exp5.getEntityID()));
    assertTrue(props.getExperimentReferences().contains(exp6.getEntityID()));

    //Test: 5
    HashMap<Long,Experiment> refs = (HashMap<Long,Experiment>)props.getReferencedExperiments();
    assertEquals(2, props.getReferencedExperimentIDs().size());
    assertTrue(props.getReferencedExperimentIDs().contains(exp5.getEntityID()));
    assertTrue(refs.get(exp5.getEntityID()).getEntityID()== exp5.getEntityID());
    manager.removeExperiment(exp5.getEntityID());
    manager.removeExperiment(exp6.getEntityID());
   
  }
View Full Code Here

Examples of eu.planets_project.tb.impl.model.BasicPropertiesImpl

   
  }
 
 
  public void testInvolvedUsers(){
    BasicProperties props = new BasicPropertiesImpl();
    //Test1:
    props.addInvolvedUser("TestUser1");
    props.addInvolvedUser("TestUser2");
   
    assertEquals(2, props.getInvolvedUserIds().size());
    assertTrue(props.getInvolvedUserIds().contains("TestUser1"));
   
    //Test2:
    List<String> userIDs = new Vector<String>();
    userIDs.add("TestUser3");
    userIDs.add("TestUser4");
    userIDs.add("TestUser4");
    props.addInvolvedUsers(userIDs);

    assertEquals(4, props.getInvolvedUserIds().size());
    assertTrue(props.getInvolvedUserIds().contains("TestUser1"));
    assertTrue(props.getInvolvedUserIds().contains("TestUser3"));
   
    //Test3:
    props.removeInvolvedUser("TestUser1");
   
    assertEquals(3, props.getInvolvedUserIds().size());
    assertTrue(!props.getInvolvedUserIds().contains("TestUser1"));
    assertTrue(props.getInvolvedUserIds().contains("TestUser3"));

    //Test4:
    List<String> userIDs2 = new Vector<String>();
    userIDs2.add("TestUser3");
    userIDs2.add("TestUser3");
    props.removeInvolvedUsers(userIDs2);

    assertEquals(2, props.getInvolvedUserIds().size());
    assertTrue(props.getInvolvedUserIds().contains("TestUser2"));
    assertTrue(props.getInvolvedUserIds().contains("TestUser4"));
    assertTrue(!props.getInvolvedUserIds().contains("TestUser3"));
  }
View Full Code Here

Examples of eu.planets_project.tb.impl.model.BasicPropertiesImpl

 
 
  public void testExperimentNameUnique(){
    TestbedManager manager = TestbedManagerImpl.getInstance();
   
    BasicProperties props = new BasicPropertiesImpl();
    ExperimentSetup expSetup = new ExperimentSetupImpl();
    Experiment exp1 = new ExperimentImpl();
   
  //Test1:
    long expID = manager.registerExperiment(exp1);
    exp1 = manager.getExperiment(expID);

    String sTestname= "TestName12334234445";
    boolean bUnique = manager.isExperimentNameUnique(sTestname);
    //check if the two methods deliver the same results
    assertEquals(bUnique, props.checkExperimentNameUnique(sTestname));
   
    try {
      props.setExperimentName(sTestname);
    } catch (InvalidInputException e) {
      assertEquals(true,false);
    }
    assertEquals(sTestname,props.getExperimentName());
    expSetup.setBasicProperties(props);
    exp1.setExperimentSetup(expSetup);
    manager.updateExperiment(exp1);
   
    assertEquals(false, props.checkExperimentNameUnique(sTestname));
    assertEquals(false, manager.isExperimentNameUnique(sTestname));
   
  //Test2:
    try {
      //although experimentname already exists, if the name stays the same no exception should be thrown
      props.setExperimentName(sTestname);
      assertEquals(true,true);
    } catch (InvalidInputException e) {
      assertEquals(true,false);
    }
   
View Full Code Here

Examples of eu.planets_project.tb.impl.model.BasicPropertiesImpl

  //temporary helper
  private int iSubstage;
 

  public ExperimentSetupImpl(){
    basicProperties = new BasicPropertiesImpl();
    //bBenchmarkGoalListFinal = false;
    hmBenchmarkGoals = new HashMap<String,BenchmarkGoalImpl>();
    experimentResources = new ExperimentResourcesImpl();
    iSubstage = -1;
    lExperimentIDRef = -1;
View Full Code Here

Examples of eu.planets_project.tb.impl.model.BasicPropertiesImpl

    manager.removeExperiment(exp1.getEntityID());
  }
 

  public void testExternalReferenceID(){
    BasicProperties props = new BasicPropertiesImpl();
    props.setExternalReferenceID("LocalSystem://refID1");
    assertEquals("LocalSystem://refID1", props.getExternalReferenceID());
  }
View Full Code Here

Examples of eu.planets_project.tb.impl.model.BasicPropertiesImpl

    props.setExternalReferenceID("LocalSystem://refID1");
    assertEquals("LocalSystem://refID1", props.getExternalReferenceID());
  }
 
  public void testFocus(){
    BasicProperties props = new BasicPropertiesImpl();
    String sFocus = "Focus is on testing speed of jpeg->tiff migration tool";
    props.setFocus(sFocus);
    assertEquals(sFocus, props.getFocus());
  }
View Full Code Here

Examples of eu.planets_project.tb.impl.model.BasicPropertiesImpl

    props.setFocus(sFocus);
    assertEquals(sFocus, props.getFocus());
  }
 
  public void testScope(){
    BasicProperties props = new BasicPropertiesImpl();
    String sScope = "Not tested is the outputquality";
    props.setScope(sScope);
    assertEquals(sScope, props.getScope());
  }
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.