Package org.martinlaw.keyvalues

Examples of org.martinlaw.keyvalues.ScopedKeyValuesUif


      final int expectedEmptyScopeCount,
      final int expectedMatterScopeCount,
      final int expectedLandCaseScopeCount,
      final Class<? extends BusinessObject> scopedClass) {
    String commentTemplate = "expected %s %s with %s scope plus %s with empty scope";
    ScopedKeyValuesUif kv = new ScopedKeyValuesUif();
    kv.setScopedClass(scopedClass);
   
    MaintenanceDocumentForm form = createMockMaintenanceDocForm();
    Maintainable newMaintainableObject = form.getDocument().getNewMaintainableObject();
   
   
    when(newMaintainableObject.getDataObject()).thenReturn(new CourtCase());
    String comment = String.format(commentTemplate, expectedCourtCaseScopeCount, dataObjectName, "court case", expectedEmptyScopeCount);
    assertEquals(comment, expectedCourtCaseScopeCount + expectedEmptyScopeCount, kv.getKeyValues(form).size());
   
    when(newMaintainableObject.getDataObject()).thenReturn(new LandCase());
    comment = String.format(commentTemplate, expectedLandCaseScopeCount, dataObjectName, "land case", expectedEmptyScopeCount);
    assertEquals(comment, expectedLandCaseScopeCount + expectedEmptyScopeCount, kv.getKeyValues(form).size());
   
    comment = String.format(commentTemplate, expectedContractScopeCount, dataObjectName, "contract", expectedEmptyScopeCount);
    when(newMaintainableObject.getDataObject()).thenReturn(new Contract());
    assertEquals(comment, expectedContractScopeCount + expectedEmptyScopeCount, kv.getKeyValues(form).size());
   
    comment = String.format(commentTemplate, expectedMatterScopeCount, dataObjectName, "matter", expectedEmptyScopeCount);
    when(newMaintainableObject.getDataObject()).thenReturn(new Matter());
    assertEquals(comment, expectedMatterScopeCount + expectedEmptyScopeCount, kv.getKeyValues(form).size());
   
    comment = String.format(commentTemplate, expectedConveyanceScopeCount, dataObjectName, "Conveyance", expectedEmptyScopeCount);
    when(newMaintainableObject.getDataObject()).thenReturn(new Conveyance());
    assertEquals(comment, expectedConveyanceScopeCount + expectedEmptyScopeCount, kv.getKeyValues(form).size());
  }
View Full Code Here

TOP

Related Classes of org.martinlaw.keyvalues.ScopedKeyValuesUif

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.