assertEquals(1, watcherinfo.getWatcherListArray().length);
WatcherList watcherList = watcherinfo.getWatcherListArray(0);
assertEquals(getBobUri(), watcherList.getResource());
assertEquals(PresenceEventPackage.NAME, watcherList.getPackage());
assertEquals(1, watcherList.getWatcherArray().length);
Watcher watcher = watcherList.getWatcherArray(0);
assertEquals(Event.SUBSCRIBE, watcher.getEvent());
assertEquals(getAliceUri(), watcher.getStringValue());
assertEquals(Status.ACTIVE, watcher.getStatus());
HttpClient httpClient = new HttpClient();
PutMethod put = new PutMethod(getHttpXcapUri() + BOB_PRES_RULES_URI); // 11
InputStream is = WatcherInfoTest.class.getResourceAsStream("/xcap-root/pres-rules/users/put/elementPoliteBlock.xml");
RequestEntity entity = new InputStreamRequestEntity(is, "application/xcap-el+xml");
put.setRequestEntity(entity);
int result = httpClient.executeMethod(put);
assertEquals(200, result); // 12
put.releaseConnection();
tx = presenceSession.waitForNotify(); // 13
//System.out.println("11:\n" + tx.getRequest());
presenceSession.sendResponse(Response.OK, tx); // 14
presence = getPresence(tx.getRequest());
assertEquals(Basic.CLOSED, presence.getTupleArray()[0].getStatus().getBasic());
tx = winfoSession.waitForNotify(); // 15
notify = tx.getRequest();
winfoSession.sendResponse(Response.OK, tx); // 16
System.out.println(notify);
subState = (SubscriptionStateHeader) notify.getHeader(SubscriptionStateHeader.NAME);
assertEquals(SubscriptionStateHeader.ACTIVE.toLowerCase(), subState.getState().toLowerCase());
assertEquals(WatcherInfoEventPackage.NAME, ((EventHeader) notify.getHeader(EventHeader.NAME)).getEventType());
watcherinfo = getWatcherinfo(notify);
assertEquals(1, watcherinfo.getVersion().intValue());
assertEquals(Watcherinfo.State.FULL, watcherinfo.getState());
assertEquals(1, watcherinfo.getWatcherListArray().length);
watcherList = watcherinfo.getWatcherListArray(0);
assertEquals(getBobUri(), watcherList.getResource());
assertEquals(PresenceEventPackage.NAME, watcherList.getPackage());
assertEquals(1, watcherList.getWatcherArray().length);
watcher = watcherList.getWatcherArray(0);
assertEquals(Event.SUBSCRIBE, watcher.getEvent());
assertEquals(getAliceUri(), watcher.getStringValue());
assertEquals(Status.ACTIVE, watcher.getStatus());
subscribe = winfoSession.newSubsequentSubscribe(0); // 17
winfoSession.sendRequest(subscribe, Response.OK); // 18