SipBuilder { public String getPermissionSection(Long targetInstanceOid) { TargetInstance inst = targetInstanceManager.getTargetInstance(targetInstanceOid); return getPermissionSection(inst); }  static String es(String str); static String dt(Date date); String getTargetSection(Long targetInstanceOid); Map<String, String> buildSipSections(TargetInstance inst); String getProfileNoteSection(TargetInstance inst); boolean updateTargetReference(AbstractTarget target, Map<String,String> sipSections); String getTargetSection(TargetInstance inst); String getPermissionSection(Long targetInstanceOid); String getPermissionSection(TargetInstance inst); void setTargetInstanceManager(TargetInstanceManager targetInstanceManager); void setTargetManager(TargetManager targetManager);  }
@Test public final void testGetPermissionSectionLong() { this.testSetTargetInstanceManager(); this.testSetTargetManager(); try { String expectedOutput = "<wct:Permissions>\n <wct:Permission>\n <wct:State>Granted</wct:State>\n <wct:StartDate>2009-02-01</wct:StartDate>\n <wct:EndDate></wct:EndDate>\n <wct:HarvestAuthorisation>\n <wct:Name>Oakleigh Web Site</wct:Name>\n <wct:Description></wct:Description>\n <wct:OrderNumber></wct:OrderNumber>\n <wct:IsPublished>true</wct:IsPublished>\n </wct:HarvestAuthorisation>\n <wct:AccessStatus></wct:AccessStatus>\n <wct:SpecialRequirements></wct:SpecialRequirements>\n <wct:OpenAccessDate></wct:OpenAccessDate>\n <wct:CopyrightStatement></wct:CopyrightStatement>\n <wct:CopyrightURL></wct:CopyrightURL>\n <wct:FileReference></wct:FileReference>\n <wct:AuthorisingAgent>\n <wct:Name>Oakleigh</wct:Name>\n <wct:Contact>Kev Urwin</wct:Contact>\n </wct:AuthorisingAgent>\n <wct:Paterns>\n <wct:Pattern>http: String permissionSection = testInstance.getPermissionSection(5001L); assertNotNull(permissionSection); assertEquals(expectedOutput, permissionSection); } catch(Exception e) { fail(e.getMessage()); } }
@Test public final void testGetPermissionSectionTargetInstance() { this.testSetTargetInstanceManager(); this.testSetTargetManager(); try { String expectedOutput = "<wct:Permissions>\n <wct:Permission>\n <wct:State>Granted</wct:State>\n <wct:StartDate>2009-02-01</wct:StartDate>\n <wct:EndDate></wct:EndDate>\n <wct:HarvestAuthorisation>\n <wct:Name>Oakleigh Web Site</wct:Name>\n <wct:Description></wct:Description>\n <wct:OrderNumber></wct:OrderNumber>\n <wct:IsPublished>true</wct:IsPublished>\n </wct:HarvestAuthorisation>\n <wct:AccessStatus></wct:AccessStatus>\n <wct:SpecialRequirements></wct:SpecialRequirements>\n <wct:OpenAccessDate></wct:OpenAccessDate>\n <wct:CopyrightStatement></wct:CopyrightStatement>\n <wct:CopyrightURL></wct:CopyrightURL>\n <wct:FileReference></wct:FileReference>\n <wct:AuthorisingAgent>\n <wct:Name>Oakleigh</wct:Name>\n <wct:Contact>Kev Urwin</wct:Contact>\n </wct:AuthorisingAgent>\n <wct:Paterns>\n <wct:Pattern>http: TargetInstance ti = targetInstanceManager.getTargetInstance(5001L); String permissionSection = testInstance.getPermissionSection(ti); assertNotNull(permissionSection); assertEquals(expectedOutput, permissionSection); } catch(Exception e) { fail(e.getMessage()); } }