/** * Get a reference to the basic IM operation set. * * @throws Exception if this is not a good day. */ protected void setUp() throws Exception { super.setUp(); fixture.setUp(); Map supportedOperationSets = fixture.provider.getSupportedOperationSets(); if (supportedOperationSets == null || supportedOperationSets.size() < 1) throw new NullPointerException( "No OperationSet implementations are supported by " + "this ICQ implementation. "); // get the operation set presence here. opSetBasicIM = (OperationSetBasicInstantMessaging) supportedOperationSets.get(OperationSetBasicInstantMessaging.class.getName()); // if the op set is null then the implementation doesn't offer a typing. // operation set which is unacceptable for icq. if (opSetBasicIM == null) { throw new NullPointerException("No implementation for basic IM was found"); } // we also need the presence op set in order to retrieve contacts. opSetPresence = (OperationSetPresence) supportedOperationSets.get(OperationSetPresence.class.getName()); // if the op set is null show that we're not happy. if (opSetPresence == null) { throw new NullPointerException( "An implementation of the ICQ service must provide an " + "implementation of at least one of the PresenceOperationSets"); } }
protected void setUp() throws Exception { super.setUp(); fixture.setUp(); Map<String, OperationSet> supportedOperationSets = fixture.provider.getSupportedOperationSets(); if (supportedOperationSets == null || supportedOperationSets.size() < 1) throw new NullPointerException( "No OperationSet implementations are supported by " + "this ICQ implementation. "); // get the operation set presence here. operationSetPresence = (OperationSetPresence) supportedOperationSets.get(OperationSetPresence.class.getName()); // if the op set is null then the implementation doesn't offer a presence // operation set which is unacceptable for icq. if (operationSetPresence == null) { throw new NullPointerException( "An implementation of the ICQ service must provide an " + "implementation of at least the one of the Presence " + "Operation Sets"); } }
protected void tearDown() throws Exception { super.tearDown(); fixture.tearDown(); }