AbstractStreamFeatureTest.java (798B)
1 package eu.siacs.compliance.tests; 2 3 import eu.siacs.compliance.Result; 4 import rocks.xmpp.core.session.XmppClient; 5 import rocks.xmpp.core.stream.StreamFeaturesManager; 6 import rocks.xmpp.core.stream.model.StreamFeature; 7 8 import java.util.Map; 9 10 public abstract class AbstractStreamFeatureTest extends AbstractTest { 11 12 public AbstractStreamFeatureTest(XmppClient client) { 13 super(client); 14 } 15 16 @Override 17 public Result run() { 18 Map<Class<? extends StreamFeature>, StreamFeature> features = client.getManager(StreamFeaturesManager.class).getFeatures(); 19 if (features.containsKey(getStreamFeature())) { 20 return Result.PASSED; 21 } else { 22 return Result.FAILED; 23 } 24 } 25 26 abstract Class<? extends StreamFeature> getStreamFeature(); 27 }