Search in sources :

Example 1 with MQTTSharedResource

use of edu.snu.mist.core.shared.MQTTSharedResource in project mist by snuspl.

the class MQTTSourceTest method setUp.

@Before
public void setUp() throws InjectionException, IOException {
    final JavaConfigurationBuilder jcb = Tang.Factory.getTang().newConfigurationBuilder();
    jcb.bindNamedParameter(TaskHostname.class, "127.0.0.1");
    final Injector injector = Tang.Factory.getTang().newInjector(jcb.build());
    mqttSharedResource = injector.getInstance(MQTTSharedResource.class);
    // create local mqtt broker
    mqttBroker = MqttUtils.createMqttBroker();
}
Also used : Injector(org.apache.reef.tang.Injector) MQTTSharedResource(edu.snu.mist.core.shared.MQTTSharedResource) JavaConfigurationBuilder(org.apache.reef.tang.JavaConfigurationBuilder) Before(org.junit.Before)

Example 2 with MQTTSharedResource

use of edu.snu.mist.core.shared.MQTTSharedResource in project mist by snuspl.

the class MqttSinkTest method setUp.

@Before
public void setUp() throws IOException, InjectionException, MqttException {
    final JavaConfigurationBuilder jcb = Tang.Factory.getTang().newConfigurationBuilder();
    jcb.bindNamedParameter(TaskHostname.class, "127.0.0.1");
    final Injector injector = Tang.Factory.getTang().newInjector(jcb.build());
    mqttSharedResource = injector.getInstance(MQTTSharedResource.class);
    broker = MqttUtils.createMqttBroker();
    subscriber = new MqttClient(MqttUtils.BROKER_URI, "mqttClient");
}
Also used : Injector(org.apache.reef.tang.Injector) MQTTSharedResource(edu.snu.mist.core.shared.MQTTSharedResource) JavaConfigurationBuilder(org.apache.reef.tang.JavaConfigurationBuilder) Before(org.junit.Before)

Aggregations

MQTTSharedResource (edu.snu.mist.core.shared.MQTTSharedResource)2 Injector (org.apache.reef.tang.Injector)2 JavaConfigurationBuilder (org.apache.reef.tang.JavaConfigurationBuilder)2 Before (org.junit.Before)2