Package org.elevenbits.westvleteren.model.item

Examples of org.elevenbits.westvleteren.model.item.Thickness


        }
    }

    public void testCreateAndGetAndRemoveThickness() throws Exception {
      log.warn("Creating a thickness");
      Thickness thickness = new Thickness(new BigDecimal("10.01"));
      dao.saveThickness(thickness);
      Integer id = thickness.getId();
      thickness = dao.getThickness(id);
      assertEquals(thickness, new Thickness(new BigDecimal("10.01")));
      log.warn("Thickness created: " + thickness);
      dao.removeThickness(thickness);
      log.warn("Thickness removed");
      try {
        thickness = dao.getThickness(id);
View Full Code Here


        }
    }

    public void testCreateAndUpdateAndRemoveThickness() throws Exception {
      log.warn("Creating a thickness");
      Thickness thickness = new Thickness(new BigDecimal("10.01"));
      dao.saveThickness(thickness);
      Integer id = thickness.getId();
      thickness = dao.getThickness(id);
      assertEquals(thickness, new Thickness(new BigDecimal("10.01")));
      log.warn("Thickness created: " + thickness);
      thickness.setValue(new BigDecimal("3.14"));
      dao.saveThickness(thickness);
      log.warn("Thickness updated");
      thickness = dao.getThickness(id);
      assertEquals(thickness, new Thickness(new BigDecimal("3.14")));
      log.warn("Thickness: " + thickness);     
         dao.removeThickness(thickness);
         log.warn("Thickness removed");
     }
View Full Code Here

         log.warn("Thickness removed");
     }

    public void testAddAndRemoveThickness() throws Exception {
      log.warn("Add and remove!");
        Thickness thickness = new Thickness(new BigDecimal("3.14"));       
        dao.saveThickness(thickness);
        assertNotNull(thickness.getId());
      assertTrue(thickness.getValue().compareTo(new BigDecimal("3.14")) == 0);
        dao.removeThickness(thickness.getId());
        try {
            thickness = dao.getThickness(thickness.getId());
            fail("getThickness didn't throw DataAccessException");
        } catch (DataAccessException d) {
          log.warn("Needed to catch exception since the thickness did not exist");
            assertNotNull(d);
        }
View Full Code Here

    protected void tearDown() throws Exception {
      manager = null;
    }

    public void testAddAndRemoveThickness() throws Exception {
      Thickness thickness = new Thickness(new BigDecimal("3.14"));
      thickness = manager.saveThickness(thickness);
      assertNotNull(thickness.getId());
      if (log.isDebugEnabled()) {
        log.debug("Thickness created: " + thickness);
      }
      Integer id = thickness.getId();
      manager.removeThickness(thickness);
      try {
        thickness = manager.getThickness(id);
            fail("'badthicknessname' found in database, failing test...");
      } catch (ObjectRetrievalFailureException orfe) {
View Full Code Here

public class ThicknessDaoHibernate extends HibernateDaoSupport implements
    ThicknessDao {

  public Thickness getThickness(Integer id) {
    Thickness thickness = (Thickness) getHibernateTemplate().get(
        Thickness.class, id);
    if (thickness == null) {
      throw new ObjectRetrievalFailureException(Thickness.class, id);
    }
    return thickness;
View Full Code Here

  public List getThicknesses() {
    return getHibernateTemplate().find("from Thickness");
  }

  public void removeThickness(Integer id) {
    Thickness thickness = (Thickness) getHibernateTemplate().load(
        Thickness.class, id);
    getHibernateTemplate().delete(thickness);
  }
View Full Code Here

    dao.saveThickness(thickness);
    return thickness;
  }

  public Thickness getThickness(Integer id) {
    Thickness thickness = dao.getThickness(id);
    if (thickness == null) {
      log.warn("No role with id '" + id + "' found.");
    }
    return thickness;
  }
View Full Code Here

TOP

Related Classes of org.elevenbits.westvleteren.model.item.Thickness

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.