@Test public void testCreateCIS() { System.out.println("testing create CIS"); cisManagerUnderTest = new CisManager(); this.setMockingOnCISManager(cisManagerUnderTest); cisManagerUnderTestInterface = cisManagerUnderTest; Hashtable<String, MembershipCriteria> cisCriteria = new Hashtable<String, MembershipCriteria> (); MembershipCriteria m = new MembershipCriteria(); try{ Rule r = new Rule("equals",new ArrayList<String>(Arrays.asList("married"))); m.setRule(r); cisCriteria.put(CtxAttributeTypes.STATUS, m); r = new Rule("equals",new ArrayList<String>(Arrays.asList("Brazil"))); m.setRule(r); cisCriteria.put(CtxAttributeTypes.ADDRESS_HOME_COUNTRY, m); }catch(InvalidParameterException e){ e.printStackTrace(); } Future<ICisOwned> testCIS = cisManagerUnderTestInterface.createCis( TEST_CIS_NAME_1, TEST_CIS_TYPW , cisCriteria,"description"); try { Cis dierctCisHandler = (Cis)(testCIS.get()); assertFalse(dierctCisHandler.equals(null)); assertFalse(dierctCisHandler.equals(m)); assertNotNull(dierctCisHandler.getMembershipCriteria()); assertNotNull(testCIS.get()); assertNotNull(testCIS.get().getCisId()); assertEquals(testCIS.get().getName(), TEST_CIS_NAME_1); assertEquals(testCIS.get().getCisType(), TEST_CIS_TYPW); assertEquals(testCIS.get().getDescription(), "description"); cisManagerUnderTest.deleteCis(testCIS.get().getCisId()); } catch (InterruptedException e) { e.printStackTrace(); } catch (ExecutionException e) { e.printStackTrace(); } System.out.println("end of testing create CIS"); assertEquals(cisManagerUnderTest.getCisList().size(),0); }
@Override public Future<ICisOwned> createCis(String cisName, String cisType, Hashtable<String, MembershipCriteria> cisCriteria, String description) { String pPolicy = "<RequestPolicy></RequestPolicy>"; ICisOwned i = this.localCreateCis(cisName, cisType, description,cisCriteria ,pPolicy); return new AsyncResult<ICisOwned>(i); }
CisManager implements ICisManager, IFeatureServer { @Override public Future<ICisOwned> createCis(String cisName, String cisType, Hashtable<String, MembershipCriteria> cisCriteria, String description) { String pPolicy = "<RequestPolicy></RequestPolicy>"; ICisOwned i = this.localCreateCis(cisName, cisType, description,cisCriteria ,pPolicy); return new AsyncResult<ICisOwned>(i); } }
CisManager implements ICisManager, IFeatureServer { @Override public Future<ICisOwned> createCis(String cisName, String cisType, Hashtable<String, MembershipCriteria> cisCriteria, String description) { String pPolicy = "<RequestPolicy></RequestPolicy>"; ICisOwned i = this.localCreateCis(cisName, cisType, description,cisCriteria ,pPolicy); return new AsyncResult<ICisOwned>(i); } CisManager(); }
CisManager implements ICisManager, IFeatureServer { @Override public Future<ICisOwned> createCis(String cisName, String cisType, Hashtable<String, MembershipCriteria> cisCriteria, String description) { String pPolicy = "<RequestPolicy></RequestPolicy>"; ICisOwned i = this.localCreateCis(cisName, cisType, description,cisCriteria ,pPolicy); return new AsyncResult<ICisOwned>(i); } CisManager(); ICssDirectoryRemote getCssDirectoryRemote(); void setCssDirectoryRemote(ICssDirectoryRemote cssDirectoryRemote); IActivityFeedManager getiActivityFeedManager(); void setiActivityFeedManager(IActivityFeedManager iActivityFeedManager); IUserFeedback getiUsrFeedback(); void setiUsrFeedback(IUserFeedback iUsrFeedback); INegotiation getNegotiator(); IPrivacyDataManager getPrivacyDataManager(); void setNegotiator(INegotiation negotiator); IPrivacyPolicyManager getPrivacyPolicyManager(); ICtxBroker getInternalCtxBroker(); void setInternalCtxBroker(ICtxBroker internalCtxBroker); IEventMgr getEventMgr(); void setEventMgr(IEventMgr eventMgr); ICISCommunicationMgrFactory getCcmFactory(); void setCcmFactory(ICISCommunicationMgrFactory ccmFactory); ICommManager getICommMgr(); void setICommMgr(ICommManager cSSendpoint); ICisDirectoryRemote getiCisDirRemote(); void setiCisDirRemote(ICisDirectoryRemote iCisDirRemote); void startup(); void init(); @Override Future<ICisOwned> createCis(String cisName, String cisType,
			Hashtable<String, MembershipCriteria> cisCriteria,
			String description); @Override Future<ICisOwned> createCis(String cisName, String cisType,
			Hashtable<String, MembershipCriteria> cisCriteria,
			String description, String privacyPolicy); boolean subscribeToCis(CisRecord record); boolean unsubscribeToCis(String cisjid); @Override List<String> getJavaPackages(); @Override Object getQuery(Stanza stanza, Object payload); ICommManager getiCommMgr(); void setiCommMgr(ICommManager iCommMgr); @Override List<String> getXMLNamespaces(); @Override void receiveMessage(Stanza stanza, Object payload); @Override Object setQuery(Stanza arg0, Object arg1); @Override boolean deleteCis(String cisId); @Override List<ICis> getCisList(); @Override List<ICis> searchCisByName(String name); @Override List<ICisOwned> getListOfOwnedCis(); @Override List<ICis> getRemoteCis(); @Override List<ICisOwned> searchCisByMember(IIdentity css); @Override ICis getCis(String cisId); @Override ICisOwned getOwnedCis(String cisId); SessionFactory getSessionFactory(); void setSessionFactory(SessionFactory sessionFactory); List<Cis> getOwnedCISs(); List<CisSubscribedImp> getSubscribedCISs(); @Override void getListOfMembers(Requestor req, IIdentity targetcis,
			ICisManagerCallback callback); ICisRemote getHandlerToRemoteCis(String cisId); @Override void joinRemoteCIS(CisAdvertisementRecord adv, ICisManagerCallback callback); @Override void leaveRemoteCIS(String cisId, ICisManagerCallback callback); void UnRegisterCisManager(); void setPrivacyPolicyManager(IPrivacyPolicyManager privacyPolicyManager); void setPrivacyDataManager(IPrivacyDataManager privacyDataManager); boolean isPrivacyPolicyNegotiationIncluded(); void setPrivacyPolicyNegotiationIncluded(
			boolean privacyPolicyNegotiationIncluded); }
CisManager implements ICisManager, IFeatureServer { @Override public Future<ICisOwned> createCis(String cisName, String cisType, Hashtable<String, MembershipCriteria> cisCriteria, String description) { String pPolicy = "<RequestPolicy></RequestPolicy>"; ICisOwned i = this.localCreateCis(cisName, cisType, description,cisCriteria ,pPolicy); return new AsyncResult<ICisOwned>(i); } CisManager(); ICssDirectoryRemote getCssDirectoryRemote(); void setCssDirectoryRemote(ICssDirectoryRemote cssDirectoryRemote); IActivityFeedManager getiActivityFeedManager(); void setiActivityFeedManager(IActivityFeedManager iActivityFeedManager); IUserFeedback getiUsrFeedback(); void setiUsrFeedback(IUserFeedback iUsrFeedback); INegotiation getNegotiator(); IPrivacyDataManager getPrivacyDataManager(); void setNegotiator(INegotiation negotiator); IPrivacyPolicyManager getPrivacyPolicyManager(); ICtxBroker getInternalCtxBroker(); void setInternalCtxBroker(ICtxBroker internalCtxBroker); IEventMgr getEventMgr(); void setEventMgr(IEventMgr eventMgr); ICISCommunicationMgrFactory getCcmFactory(); void setCcmFactory(ICISCommunicationMgrFactory ccmFactory); ICommManager getICommMgr(); void setICommMgr(ICommManager cSSendpoint); ICisDirectoryRemote getiCisDirRemote(); void setiCisDirRemote(ICisDirectoryRemote iCisDirRemote); void startup(); void init(); @Override Future<ICisOwned> createCis(String cisName, String cisType,
			Hashtable<String, MembershipCriteria> cisCriteria,
			String description); @Override Future<ICisOwned> createCis(String cisName, String cisType,
			Hashtable<String, MembershipCriteria> cisCriteria,
			String description, String privacyPolicy); boolean subscribeToCis(CisRecord record); boolean unsubscribeToCis(String cisjid); @Override List<String> getJavaPackages(); @Override Object getQuery(Stanza stanza, Object payload); ICommManager getiCommMgr(); void setiCommMgr(ICommManager iCommMgr); @Override List<String> getXMLNamespaces(); @Override void receiveMessage(Stanza stanza, Object payload); @Override Object setQuery(Stanza arg0, Object arg1); @Override boolean deleteCis(String cisId); @Override List<ICis> getCisList(); @Override List<ICis> searchCisByName(String name); @Override List<ICisOwned> getListOfOwnedCis(); @Override List<ICis> getRemoteCis(); @Override List<ICisOwned> searchCisByMember(IIdentity css); @Override ICis getCis(String cisId); @Override ICisOwned getOwnedCis(String cisId); SessionFactory getSessionFactory(); void setSessionFactory(SessionFactory sessionFactory); List<Cis> getOwnedCISs(); List<CisSubscribedImp> getSubscribedCISs(); @Override void getListOfMembers(Requestor req, IIdentity targetcis,
			ICisManagerCallback callback); ICisRemote getHandlerToRemoteCis(String cisId); @Override void joinRemoteCIS(CisAdvertisementRecord adv, ICisManagerCallback callback); @Override void leaveRemoteCIS(String cisId, ICisManagerCallback callback); void UnRegisterCisManager(); void setPrivacyPolicyManager(IPrivacyPolicyManager privacyPolicyManager); void setPrivacyDataManager(IPrivacyDataManager privacyDataManager); boolean isPrivacyPolicyNegotiationIncluded(); void setPrivacyPolicyNegotiationIncluded(
			boolean privacyPolicyNegotiationIncluded);  }