Package org.martinlaw.bo

Examples of org.martinlaw.bo.ConsiderationType


  /**
   *
   */
  public ConsiderationTypeBOTest() {
    considerationType = new ConsiderationType();
    considerationType.setId(10015l);
    considerationType.setName("purchase price");
    considerationType.setDescription("the purchase price");
  }
View Full Code Here


  /**
   * test that the scope is populated from the db ok
   */
  @Test
  public void testScopeRetrieve() {
    ConsiderationType cnType = getBoSvc().findBySinglePrimaryKey(
        ConsiderationType.class, getExpectedOnRetrieve().getId());
    assertNotNull("scope should not be null", cnType.getScope());
    assertFalse("scope should not be empty", cnType.getScope().isEmpty());
    assertEquals("simple class name differs", Conveyance.class.getSimpleName(), cnType.getScope().get(0).getSimpleClassName());
   
  }
View Full Code Here

  @Override
  @Test
  public void testTypeCRUD() throws InstantiationException,
      IllegalAccessException {
    // C
    ConsiderationType type = new ConsiderationType();
    String name = "test type";
    type.setName(name);
    Scope scope1 = new Scope();
    scope1.setQualifiedClassName(Matter.class.getCanonicalName());
    type.getScope().add(scope1);
    Scope scope2 = new Scope();
    scope2.setQualifiedClassName(CourtCase.class.getCanonicalName());
    type.getScope().add(scope2);
    getBoSvc().save(type);
    // R
    type.refresh();
    assertEquals("name does not match", name, type.getName());
    assertNotNull("scope should not be null", type.getScope());
    assertEquals("scope size differs", 2, type.getScope().size());
    // U
    type.setDescription("test description");
    type.getScope().remove(0);
    getBoSvc().save(type);
    assertNotNull("description should not be null", type.getDescription());
    assertEquals("scope size differs", 1, type.getScope().size());
    // D
    getBoSvc().delete(type);
    assertNull(getBoSvc().findBySinglePrimaryKey(getDataObjectClass(),  type.getId()));
    Map<String, String> criteria = new HashMap<String, String>();
    criteria.put("typeId", String.valueOf(type.getId()));
    assertTrue("scopes should have been deleted", getBoSvc().findMatching(Scope.class, criteria).isEmpty());
  }
View Full Code Here

TOP

Related Classes of org.martinlaw.bo.ConsiderationType

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.