@Test public final void testBuildSipSections() { this.testSetTargetInstanceManager(); this.testSetTargetManager(); try { String permissionSection = "<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 targetSection = "<wct:Target>\n <wct:ReferenceNumber>1234</wct:ReferenceNumber>\n <wct:Name>Test</wct:Name>\n <wct:Description></wct:Description>\n <wct:Seeds>\n <wct:Seed>\n <wct:SeedURL>www.oakleigh.co.uk</wct:SeedURL>\n <wct:SeedType>Primary</wct:SeedType>\n </wct:Seed>\n </wct:Seeds>\n</wct:Target>\n"; String profileNoteSection = "<wct:ProfileNote></wct:ProfileNote>"; TargetInstance ti = targetInstanceManager.getTargetInstance(5001L); Map<String, String> sipSections = testInstance.buildSipSections(ti); assertNotNull(sipSections); assertEquals(sipSections.size(), 3); assertTrue(sipSections.containsKey("permissionSection")); assertTrue(sipSections.containsKey("targetSection")); assertTrue(sipSections.containsKey("profileNoteSection")); assertEquals(permissionSection, sipSections.get("permissionSection")); assertEquals(targetSection, sipSections.get("targetSection")); assertEquals(profileNoteSection, sipSections.get("profileNoteSection")); } catch(Exception e) { fail(e.getMessage()); } }
public Map<String, String> buildSipSections(TargetInstance inst) { Map<String,String> sections = new HashMap<String,String>(); sections.put("permissionSection", getPermissionSection(inst)); sections.put("targetSection", getTargetSection(inst)); sections.put("profileNoteSection", getProfileNoteSection(inst)); return sections; }
SipBuilder { public Map<String, String> buildSipSections(TargetInstance inst) { Map<String,String> sections = new HashMap<String,String>(); sections.put("permissionSection", getPermissionSection(inst)); sections.put("targetSection", getTargetSection(inst)); sections.put("profileNoteSection", getProfileNoteSection(inst)); return sections; } }
SipBuilder { public Map<String, String> buildSipSections(TargetInstance inst) { Map<String,String> sections = new HashMap<String,String>(); sections.put("permissionSection", getPermissionSection(inst)); sections.put("targetSection", getTargetSection(inst)); sections.put("profileNoteSection", getProfileNoteSection(inst)); return sections; }  }
SipBuilder { public Map<String, String> buildSipSections(TargetInstance inst) { Map<String,String> sections = new HashMap<String,String>(); sections.put("permissionSection", getPermissionSection(inst)); sections.put("targetSection", getTargetSection(inst)); sections.put("profileNoteSection", getProfileNoteSection(inst)); return sections; }  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); }
SipBuilder { public Map<String, String> buildSipSections(TargetInstance inst) { Map<String,String> sections = new HashMap<String,String>(); sections.put("permissionSection", getPermissionSection(inst)); sections.put("targetSection", getTargetSection(inst)); sections.put("profileNoteSection", getProfileNoteSection(inst)); return sections; }  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);  }