@Test public void testgetcssrecord() { CssRecord profile = new CssRecord(); boolean retValue = false; CssNode cssnode = new CssNode(); cssnode.setIdentity(TEST_IDENTITY); cssnode.setCssNodeMAC("aa:bb:cc:dd:ee"); cssnode.setInteractable("true"); cssnode.setType(0); cssnode.setStatus(0); List<CssNode> cssNodes = new ArrayList<CssNode>(); cssNodes.add(cssnode); profile.setCssIdentity(TEST_IDENTITY); profile.setEmailID(TEST_EMAIL); profile.setForeName(TEST_FORENAME); profile.setHomeLocation(TEST_HOME_LOCATION); profile.setCssNodes(cssNodes); assertEquals(TEST_IDENTITY, profile.getCssIdentity()); assertEquals(TEST_EMAIL, profile.getEmailID()); assertEquals(TEST_FORENAME, profile.getForeName()); assertEquals(TEST_HOME_LOCATION, profile.getHomeLocation()); CSSManager manager = new CSSManager(); manager.setCssRegistry(mockcssRegistry); manager.getCssRecord(); manager.setPubSubManager(pubSubManagerMock); Future<CssInterfaceResult> result = manager.getCssRecord(); assertNotNull(result); manager.setCssRegistry(mockcssRegistry); try { mockcssRegistry.registerCss(profile); } catch (CssRegistrationException e) { e.printStackTrace(); } try { when(mockcssRegistry.cssRecordExists()).thenReturn(true); } catch (CssRegistrationException e) { e.printStackTrace(); } result = manager.getCssRecord(); assertNotNull(result); manager.loginCSS(profile); manager.logoutCSS(profile); }
@Override public Future<CssInterfaceResult> getCssRecord() { CssInterfaceResult result = new CssInterfaceResult(); LOG.debug("CSS Manager getCssRecord Called"); try { if (this.cssRegistry.cssRecordExists()) { CssRecord currentCssRecord = this.cssRegistry.getCssRecord(); result.setProfile(currentCssRecord); LOG.debug("Number of Css nodes: " + currentCssRecord.getCssNodes().size()); result.setResultStatus(true); } else { LOG.error("Unable to find CssRecord"); } } catch (CssRegistrationException e) { LOG.error("Ops! Registration Exception", e); } return new AsyncResult<CssInterfaceResult>(result); }
CSSManager implements ICSSInternalManager, ICSSManager { @Override public Future<CssInterfaceResult> getCssRecord() { CssInterfaceResult result = new CssInterfaceResult(); LOG.debug("CSS Manager getCssRecord Called"); try { if (this.cssRegistry.cssRecordExists()) { CssRecord currentCssRecord = this.cssRegistry.getCssRecord(); result.setProfile(currentCssRecord); LOG.debug("Number of Css nodes: " + currentCssRecord.getCssNodes().size()); result.setResultStatus(true); } else { LOG.error("Unable to find CssRecord"); } } catch (CssRegistrationException e) { LOG.error("Ops! Registration Exception", e); } return new AsyncResult<CssInterfaceResult>(result); } }
CSSManager implements ICSSInternalManager, ICSSManager { @Override public Future<CssInterfaceResult> getCssRecord() { CssInterfaceResult result = new CssInterfaceResult(); LOG.debug("CSS Manager getCssRecord Called"); try { if (this.cssRegistry.cssRecordExists()) { CssRecord currentCssRecord = this.cssRegistry.getCssRecord(); result.setProfile(currentCssRecord); LOG.debug("Number of Css nodes: " + currentCssRecord.getCssNodes().size()); result.setResultStatus(true); } else { LOG.error("Unable to find CssRecord"); } } catch (CssRegistrationException e) { LOG.error("Ops! Registration Exception", e); } return new AsyncResult<CssInterfaceResult>(result); }  }
CSSManager implements ICSSInternalManager, ICSSManager { @Override public Future<CssInterfaceResult> getCssRecord() { CssInterfaceResult result = new CssInterfaceResult(); LOG.debug("CSS Manager getCssRecord Called"); try { if (this.cssRegistry.cssRecordExists()) { CssRecord currentCssRecord = this.cssRegistry.getCssRecord(); result.setProfile(currentCssRecord); LOG.debug("Number of Css nodes: " + currentCssRecord.getCssNodes().size()); result.setResultStatus(true); } else { LOG.error("Unable to find CssRecord"); } } catch (CssRegistrationException e) { LOG.error("Ops! Registration Exception", e); } return new AsyncResult<CssInterfaceResult>(result); }  void cssManagerInit(); Future<CssInterfaceResult> changeCSSNodeStatus(CssRecord profile); @Override Future<CssInterfaceResult> getCssRecord(); @Override /** * There is now no longer any validation of a node contacting a * cloud node of a CSS. Since the other node has logged into the * chosen XMPP Domain server only messages from this JID domain * can be routed to the cloud node. */ Future<CssInterfaceResult> loginCSS(CssRecord profile); Future<CssInterfaceResult> loginXMPPServer(CssRecord profile); @Override /** * Requires that CssRecord parameter has one node in its collection and that * the node corresponds to the node being logged out. */ Future<CssInterfaceResult> logoutCSS(CssRecord profile); Future<CssInterfaceResult> logoutXMPPServer(CssRecord profile); @Override Future<CssInterfaceResult> modifyCssRecord(CssRecord profile); @Override Future<CssInterfaceResult> registerCSS(CssRecord profile); @Override Future<CssInterfaceResult> registerCSSNode(CssRecord profile); @Override @Async Future<CssInterfaceResult> registerXMPPServer(CssRecord profile); Future<CssInterfaceResult> setPresenceStatus(CssRecord profile); Future<CssInterfaceResult> synchProfile(CssRecord profile); @Override Future<CssInterfaceResult> unregisterCSS(CssRecord profile); @Override Future<CssInterfaceResult> unregisterCSSNode(CssRecord profile); @Override Future<CssInterfaceResult> unregisterXMPPServer(CssRecord profile); @Override void addAdvertisementRecord(CssAdvertisementRecord record); @Override void deleteAdvertisementRecord(CssAdvertisementRecord record); @Override void updateAdvertisementRecord(CssAdvertisementRecord currentRecord,
			CssAdvertisementRecord updatedRecord); @Override Future<List<CssAdvertisementRecord>> findAllCssAdvertisementRecords(); @Override Future<List<Service>> findAllCssServiceDetails(
			List<CssAdvertisementRecord> listCssAds); ICtxBroker getCtxBroker(); void setCtxBroker(ICtxBroker ctxBroker); IActivityFeedManager getiActivityFeedManager(); void setiActivityFeedManager(IActivityFeedManager iActivityFeedManager); ISocialData getSocialData(); void setSocialData(ISocialData socialData); ICisManagerCallback getciscallback(); void setciscallback(ICisManagerCallback ciscallback); ICisManager getCisManager(); void setCisManager(ICisManager cisManager); ICssRegistry getCssRegistry(); void setCssRegistry(ICssRegistry cssRegistry); ICssDirectoryRemote getCssDirectoryRemote(); void setCssDirectoryRemote(ICssDirectoryRemote cssDirectoryRemote); IServiceDiscovery getServiceDiscovery(); void setServiceDiscovery(IServiceDiscovery serviceDiscovery); ICSSRemoteManager getCssManagerRemote(); PubsubClient getPubSubManager(); void setPubSubManager(PubsubClient pubSubManager); ICommManager getCommManager(); void setCommManager(ICommManager commManager); void setCssManagerRemote(ICSSRemoteManager cssManagerRemote); IEventMgr getEventMgr(); void setEventMgr(IEventMgr eventMgr); @Override Future<List<CssRequest>> findAllCssRequests(); @Override Future<List<CssRequest>> findAllCssFriendRequests(); @Override void updateCssRequest(CssRequest request); @Override void updateCssFriendRequest(CssRequest request); @Override void sendCssFriendRequest(String cssFriendId); @Override Future<List<CssAdvertisementRecordDetailed>> getCssAdvertisementRecordsFull(); @Override Future<List<CssAdvertisementRecord>> getCssFriends(); Future<String> getthisNodeType(String nodeId); void setNodeType(CssRecord cssrecord, String nodeId, int nodestatus, int nodetype, String cssnodemac, String interactable); void removeNode(CssRecord cssrecord, String nodeId ); @SuppressWarnings("unchecked") Future<List<CssAdvertisementRecord>> suggestedFriends( ); @Override Future<List<CssAdvertisementRecord>> getFriendRequests(); void acceptCssFriendRequest(CssRequest request); void declineCssFriendRequest(CssRequest request); @SuppressWarnings("unchecked") @Override Future<HashMap<IIdentity, Integer>> getSuggestedFriends(
			FriendFilter filter); @Override Future<HashMap<CssAdvertisementRecord, Integer>> getSuggestedFriendsDetails(
			FriendFilter filter); @Override void sendCSSFriendRequest(IIdentity identity, RequestorService service); @Override void handleExternalFriendRequest(IIdentity identity, CssRequestStatusType statusType); @Override void handleInternalFriendRequest(IIdentity identity, CssRequestStatusType statusType); @Override void handleExternalUpdateRequest(IIdentity identity, CssRequestStatusType statusType); void pushtoContext(CssRecord record); @Override FriendFilter getFriendfilter(); @Override void setFriendfilter(FriendFilter filter); @Override Future<List<MarshaledActivity>> getActivities(String timePeriod, int limitResults); }
CSSManager implements ICSSInternalManager, ICSSManager { @Override public Future<CssInterfaceResult> getCssRecord() { CssInterfaceResult result = new CssInterfaceResult(); LOG.debug("CSS Manager getCssRecord Called"); try { if (this.cssRegistry.cssRecordExists()) { CssRecord currentCssRecord = this.cssRegistry.getCssRecord(); result.setProfile(currentCssRecord); LOG.debug("Number of Css nodes: " + currentCssRecord.getCssNodes().size()); result.setResultStatus(true); } else { LOG.error("Unable to find CssRecord"); } } catch (CssRegistrationException e) { LOG.error("Ops! Registration Exception", e); } return new AsyncResult<CssInterfaceResult>(result); }  void cssManagerInit(); Future<CssInterfaceResult> changeCSSNodeStatus(CssRecord profile); @Override Future<CssInterfaceResult> getCssRecord(); @Override /** * There is now no longer any validation of a node contacting a * cloud node of a CSS. Since the other node has logged into the * chosen XMPP Domain server only messages from this JID domain * can be routed to the cloud node. */ Future<CssInterfaceResult> loginCSS(CssRecord profile); Future<CssInterfaceResult> loginXMPPServer(CssRecord profile); @Override /** * Requires that CssRecord parameter has one node in its collection and that * the node corresponds to the node being logged out. */ Future<CssInterfaceResult> logoutCSS(CssRecord profile); Future<CssInterfaceResult> logoutXMPPServer(CssRecord profile); @Override Future<CssInterfaceResult> modifyCssRecord(CssRecord profile); @Override Future<CssInterfaceResult> registerCSS(CssRecord profile); @Override Future<CssInterfaceResult> registerCSSNode(CssRecord profile); @Override @Async Future<CssInterfaceResult> registerXMPPServer(CssRecord profile); Future<CssInterfaceResult> setPresenceStatus(CssRecord profile); Future<CssInterfaceResult> synchProfile(CssRecord profile); @Override Future<CssInterfaceResult> unregisterCSS(CssRecord profile); @Override Future<CssInterfaceResult> unregisterCSSNode(CssRecord profile); @Override Future<CssInterfaceResult> unregisterXMPPServer(CssRecord profile); @Override void addAdvertisementRecord(CssAdvertisementRecord record); @Override void deleteAdvertisementRecord(CssAdvertisementRecord record); @Override void updateAdvertisementRecord(CssAdvertisementRecord currentRecord,
			CssAdvertisementRecord updatedRecord); @Override Future<List<CssAdvertisementRecord>> findAllCssAdvertisementRecords(); @Override Future<List<Service>> findAllCssServiceDetails(
			List<CssAdvertisementRecord> listCssAds); ICtxBroker getCtxBroker(); void setCtxBroker(ICtxBroker ctxBroker); IActivityFeedManager getiActivityFeedManager(); void setiActivityFeedManager(IActivityFeedManager iActivityFeedManager); ISocialData getSocialData(); void setSocialData(ISocialData socialData); ICisManagerCallback getciscallback(); void setciscallback(ICisManagerCallback ciscallback); ICisManager getCisManager(); void setCisManager(ICisManager cisManager); ICssRegistry getCssRegistry(); void setCssRegistry(ICssRegistry cssRegistry); ICssDirectoryRemote getCssDirectoryRemote(); void setCssDirectoryRemote(ICssDirectoryRemote cssDirectoryRemote); IServiceDiscovery getServiceDiscovery(); void setServiceDiscovery(IServiceDiscovery serviceDiscovery); ICSSRemoteManager getCssManagerRemote(); PubsubClient getPubSubManager(); void setPubSubManager(PubsubClient pubSubManager); ICommManager getCommManager(); void setCommManager(ICommManager commManager); void setCssManagerRemote(ICSSRemoteManager cssManagerRemote); IEventMgr getEventMgr(); void setEventMgr(IEventMgr eventMgr); @Override Future<List<CssRequest>> findAllCssRequests(); @Override Future<List<CssRequest>> findAllCssFriendRequests(); @Override void updateCssRequest(CssRequest request); @Override void updateCssFriendRequest(CssRequest request); @Override void sendCssFriendRequest(String cssFriendId); @Override Future<List<CssAdvertisementRecordDetailed>> getCssAdvertisementRecordsFull(); @Override Future<List<CssAdvertisementRecord>> getCssFriends(); Future<String> getthisNodeType(String nodeId); void setNodeType(CssRecord cssrecord, String nodeId, int nodestatus, int nodetype, String cssnodemac, String interactable); void removeNode(CssRecord cssrecord, String nodeId ); @SuppressWarnings("unchecked") Future<List<CssAdvertisementRecord>> suggestedFriends( ); @Override Future<List<CssAdvertisementRecord>> getFriendRequests(); void acceptCssFriendRequest(CssRequest request); void declineCssFriendRequest(CssRequest request); @SuppressWarnings("unchecked") @Override Future<HashMap<IIdentity, Integer>> getSuggestedFriends(
			FriendFilter filter); @Override Future<HashMap<CssAdvertisementRecord, Integer>> getSuggestedFriendsDetails(
			FriendFilter filter); @Override void sendCSSFriendRequest(IIdentity identity, RequestorService service); @Override void handleExternalFriendRequest(IIdentity identity, CssRequestStatusType statusType); @Override void handleInternalFriendRequest(IIdentity identity, CssRequestStatusType statusType); @Override void handleExternalUpdateRequest(IIdentity identity, CssRequestStatusType statusType); void pushtoContext(CssRecord record); @Override FriendFilter getFriendfilter(); @Override void setFriendfilter(FriendFilter filter); @Override Future<List<MarshaledActivity>> getActivities(String timePeriod, int limitResults); static final String TEST_IDENTITY_1; static final String TEST_IDENTITY_2; static final String TEST_ARCHIVED_IDENTITY_1; static final String TEST_ARCHIVED_IDENTITY_2; static final String TEST_IDENTITY; static final String TEST_INACTIVE_DATE; static final String TEST_REGISTERED_DATE; static final int TEST_UPTIME; static final String TEST_EMAIL; static final String TEST_FORENAME; static final String TEST_HOME_LOCATION; static final String TEST_IDENTITY_NAME; static final String TEST_IM_ID; static final String TEST_NAME; static final String TEST_PASSWORD; static final String TEST_SOCIAL_URI; }