/** * 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<String, OperationSet> supportedOperationSets1 = fixture.provider1.getSupportedOperationSets(); if (supportedOperationSets1 == null || supportedOperationSets1.size() < 1) throw new NullPointerException( "No OperationSet implementations are supported by " + "this implementation. "); // get the operation set presence here. opSetBasicIM1 = (OperationSetBasicInstantMessaging) supportedOperationSets1.get(OperationSetBasicInstantMessaging.class.getName()); if (opSetBasicIM1 == null) { throw new NullPointerException("No implementation for basic IM was found"); } // we also need the presence op set in order to retrieve contacts. opSetPresence1 = (OperationSetPresence) supportedOperationSets1.get(OperationSetPresence.class.getName()); // if the op set is null show that we're not happy. if (opSetPresence1 == null) { throw new NullPointerException( "An implementation of the service must provide an " + "implementation of at least one of the PresenceOperationSets"); } Map<String, OperationSet> supportedOperationSets2 = fixture.provider2.getSupportedOperationSets(); if (supportedOperationSets2 == null || supportedOperationSets2.size() < 1) throw new NullPointerException( "No OperationSet implementations are supported by " + "this implementation. "); // get the operation set presence here. opSetBasicIM2 = (OperationSetBasicInstantMessaging) supportedOperationSets2.get(OperationSetBasicInstantMessaging.class.getName()); if (opSetBasicIM2 == null) { throw new NullPointerException("No implementation for basic IM was found"); } opSetPresence2 = (OperationSetPresence) supportedOperationSets2.get(OperationSetPresence.class.getName()); // if the op set is null show that we're not happy. if (opSetPresence2 == null) { throw new NullPointerException( "An implementation of the service must provide an " + "implementation of at least one of the PresenceOperationSets"); } }
@Override protected void setUp() throws Exception { super.setUp(); fixture.setUp(); Map<String, OperationSet> supportedOperationSets1 = fixture.provider1.getSupportedOperationSets(); if (supportedOperationSets1 == null || supportedOperationSets1.size() < 1) throw new NullPointerException( "No OperationSet implementations are supported by " + "this Gibberish implementation. "); // get the operation set presence here. opSetPersPresence1 = (OperationSetPersistentPresence) supportedOperationSets1.get(OperationSetPersistentPresence.class.getName()); // if still null then the implementation doesn't offer a presence // operation set which is unacceptable for gibberish. if (opSetPersPresence1 == null) throw new NullPointerException( "An implementation of the gibberish service must provide an " + "implementation of at least the one of the Presence " + "Operation Sets"); // lets do it once again for the second provider Map<String, OperationSet> supportedOperationSets2 = fixture.provider2.getSupportedOperationSets(); if (supportedOperationSets2 == null || supportedOperationSets2.size() < 1) throw new NullPointerException( "No OperationSet implementations are supported by " + "this Gibberish implementation. "); // get the operation set presence here. opSetPersPresence2 = (OperationSetPersistentPresence) supportedOperationSets2.get(OperationSetPersistentPresence.class.getName()); // if still null then the implementation doesn't offer a presence // operation set which is unacceptable for Gibberish. if (opSetPersPresence2 == null) throw new NullPointerException( "An implementation of the Gibberish service must provide an " + "implementation of at least the one of the Presence " + "Operation Sets"); }