Examples of BasicPropertiesImpl


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

    props.setIndication(sIndication);
    assertEquals(sIndication, props.getIndication());
  }
 
  public void testSummary(){
    BasicProperties props = new BasicPropertiesImpl();
    String sSummary = "Summary of the experiment";
    props.setSummary(sSummary);
    assertEquals(sSummary, props.getSummary());
  }
View Full Code Here

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

    props.setSummary(sSummary);
    assertEquals(sSummary, props.getSummary());
  }
 
  public void testExperimentStructureReference(){
    BasicProperties props = new BasicPropertiesImpl();
    TestbedManager tbmanager = TestbedManagerImpl.getInstance();
    //Test1:
    Experiment exp1 = tbmanager.createNewExperiment();
    try {
      props.setExperimentStructureReference(exp1.getEntityID());
    } catch (ExperimentNotFoundException e2) {
      assertEquals(true,false);
    }
   
    try {
      assertEquals(exp1.getEntityID(),props.getExperimentStructureReference().getEntityID());
    } catch (ExperimentNotFoundException e1) {
      assertEquals(true,false);
    }

    //Test2:
    props.removeExperimentStructureReference();
    try {
      assertEquals(null,props.getExperimentStructureReference());
    } catch (ExperimentNotFoundException e1) {
      assertEquals(true,false);
    }
   
    //Test3:
    try {
      props.setExperimentStructureReference(exp1);
      assertEquals(exp1.getEntityID(),props.getExperimentStructureReference().getEntityID());
    } catch (InvalidInputException e) {
      assertEquals(true,false);
    } catch (ExperimentNotFoundException e) {
      assertEquals(true,false);
    }
   
    //Test4:
    try {
      props.setExperimentStructureReference(new ExperimentImpl());
      assertEquals(true,false);
    } catch (InvalidInputException e) {
      assertEquals(true,true);
    }
  }
View Full Code Here

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

    }
  }
 

  public void testExperimentFormal(){
    BasicProperties props = new BasicPropertiesImpl();
    boolean bFormal = true;
    props.setExperimentFormal(bFormal);
   
    assertEquals(bFormal,props.isExperimentFormal());
    assertEquals(bFormal,!props.isExperimentInformal());
   
    bFormal = false;
    props.setExperimentFormal(bFormal);
   
    assertEquals(bFormal,props.isExperimentFormal());
    assertEquals(bFormal,!props.isExperimentInformal());
  }
View Full Code Here

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

    assertEquals(bFormal,!props.isExperimentInformal());
  }
 
 
  public void testLiteratureReference(){
    BasicProperties props = new BasicPropertiesImpl();

    //Test1:
    assertEquals(0,props.getAllLiteratureReferences().size());

    //Test2:
    String sTitle = "Digital Long Term Preservation";
    String sURI = "ISBN: 20-323-3233";
    props.addLiteratureReference(sTitle, sURI);
    List<String[]> refs = props.getAllLiteratureReferences();

    Iterator<String[]> itElement = refs.iterator();
    while(itElement.hasNext()){
      String[] element = itElement.next();
      assertEquals(1,refs.size());
      assertEquals(sTitle,element[0]);
      assertEquals(sURI,element[1]);
    }

    //Test3:
    String sTitle2 = "Digital Long Term Preservation2";
    String sURI2 = "ISBN: 20-323-3233";
    props.addLiteratureReference(sTitle2, sURI2);
    //Element should have been added:
    assertEquals(2,props.getAllLiteratureReferences().size());
   
    props.addLiteratureReference(sTitle2, sURI2);
    //Duplicate element should not have been added:
    assertEquals(2,props.getAllLiteratureReferences().size());

    //Test4:
    String sTitle3 = "Comic Book";
    String sURI3 = "ISBN: 111111";
    props.addLiteratureReference(sTitle3, sURI3);
    //Element should not have been added:
    assertEquals(3,props.getAllLiteratureReferences().size());
   
    props.removeLiteratureReference(sTitle,sURI);
    assertEquals(2,props.getAllLiteratureReferences().size());
   
    String sTitle4 = "Title Website1";
    String sURI4 = "http://localhost:8080";
    Vector<String[]> vAdd = new Vector<String[]>();
    vAdd.add(new String[]{sTitle4,sURI4});
    try {
      props.setLiteratureReferences(vAdd);
    } catch (InvalidInputException e) {
      assertEquals(true,false);
    }
    //Element should not have been added:
    assertEquals(1,props.getAllLiteratureReferences().size());

    String sTitle5 = "Title Website2";
    String sURI5 = "http://localhost:8080/jsf";
    vAdd.add(new String[]{sTitle5,sURI5});
    try {
      props.setLiteratureReferences(vAdd);
    } catch (InvalidInputException e) {
      assertEquals(true,false);
    }
    assertEquals(2,props.getAllLiteratureReferences().size());
  }
View Full Code Here

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

    }
    assertEquals(2,props.getAllLiteratureReferences().size());
  }
 
  public void testToolTypes(){
    BasicProperties props = new BasicPropertiesImpl();
   
    //Test1:
    assertEquals(0,props.getToolTypes().size());
   
    //Test2:
    //Should be: ServiceRegistry.getToolTypes();
    props.addToolType("jpeg2pdf");
   
    assertEquals(1,props.getToolTypes().size());
    assertTrue(props.getToolTypes().contains("jpeg2pdf"));
   
    //Test3:
    //Should be: ServiceRegistry.getToolTypes();
    props.addToolType("jpeg2pdf");
   
    //should not add duplicates
    assertEquals(1,props.getToolTypes().size());
   
    //Test4:
    Vector<String> vAdd = new Vector<String>();
    vAdd.add("jpeg2pdf");
    vAdd.add("jpeg2tiff");
    props.setToolTypes(vAdd);
   
    assertEquals(2,props.getToolTypes().size());
   
    //Test5:
    props.removeToolType("jpeg2pdf");
   
    assertEquals(1,props.getToolTypes().size());
    assertTrue(!props.getToolTypes().contains("jpeg2pdf"));
  }
View Full Code Here

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

   * This method sets up and fills in a sample BasicProperties Object
   * @return
   */
  private BasicProperties fillInBasicProperties(){
   
    BasicPropertiesImpl props = new BasicPropertiesImpl();
   
    //addExperimentedObjectType:
    try {
      props.addExperimentedObjectType("image/gif");
      props.addExperimentedObjectType("text/html");
    } catch (InvalidInputException e) {
      assertEquals(true,false);
    }
   
     
View Full Code Here

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

   * This method sets up and fills in a sample ExperimentSetup Object
   * @return
   */
  private ExperimentSetup createExperimentSetup(){
   
    BasicPropertiesImpl props = (BasicPropertiesImpl)fillInBasicProperties();
    ExperimentSetupImpl expSetup = new ExperimentSetupImpl();
   
    //setBasicProperties
    expSetup.setBasicProperties(props);
   
View Full Code Here

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

    TestbedManagerImpl manager = TestbedManagerImpl.getInstance();
    long lExperimentID = createExperiment2();

    ExperimentImpl exp = (ExperimentImpl)manager.getExperiment(lExperimentID);
    ExperimentSetupImpl expSetup = (ExperimentSetupImpl)exp.getExperimentSetup();
    BasicPropertiesImpl props = (BasicPropertiesImpl)expSetup.getBasicProperties();
   
    //now test if everything worked out
    assertTrue(exp!=null);
    assertTrue(expSetup!=null);
    assertTrue(props!=null);
   
    assertEquals(2,props.getExperimentedObjectTypes().size());
    assertTrue(props.getExperimentedObjectTypes().contains("image/gif"));
    System.out.println("ExpSetup State: "+expSetup.getState());
    assertEquals(ExperimentSetup.STATE_NOT_STARTED, expSetup.getState());
    assertEquals(ExperimentSetup.STATE_COMPLETED, exp.getState());
  }
View Full Code Here

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

  protected void setUp(){

  }
 
  public void testConsiderations(){
    BasicProperties props = new BasicPropertiesImpl();
    String sConsiderations = "Consideration1";
    props.setConsiderations(sConsiderations);
   
    assertEquals(sConsiderations, props.getConsiderations());
  }
View Full Code Here

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

  }
 
 
  public void testContact(){
    //Test: setContact
    BasicProperties props = new BasicPropertiesImpl();
    props.setContact("Name", "Mail@yahoo.com", "+431585", "Thurngasse 8, 1090 Wien");
   
    assertEquals("Thurngasse 8, 1090 Wien", props.getContactAddress());
    assertEquals("Mail@yahoo.com", props.getContactMail());
    assertEquals("Name", props.getContactName());
    assertEquals("+431585", props.getContactTel());
  }
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.