Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Commit

Permalink
Updated dependency versions to be up-to-date; bump library version to…
Browse files Browse the repository at this point in the history
… 0.3.2
  • Loading branch information
mannodermaus committed Nov 18, 2015
1 parent 1001e6f commit 6b0f187
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 6 deletions.
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@

# Compile configuration
COMPILE_SDK_VERSION=android-23
BUILD_TOOLS_VERSION=23.0.1
BUILD_TOOLS_VERSION=23.0.2
MIN_SDK_VERSION=9
TARGET_SDK_VERSION=23

# Library artifact & current version
GROUP_NAME=com.github.aurae
ARTIFACT_ID=rxbonjour
VERSION_NAME=0.3.1
VERSION_NAME=0.3.2

# Dependency versions (plugins)
GRADLE_PLUGIN_VERSION=1.3.0
GRADLE_PLUGIN_VERSION=1.5.0
BINTRAY_PLUGIN_VERSION=1.3.1
MAVEN_PLUGIN_VERSION=1.3

# Dependency versions (library)
SUPPORT_LIBRARY_VERSION=23.0.1
SUPPORT_LIBRARY_VERSION=23.1.1
RXANDROID_VERSION=1.0.1
JMDNS_JAR_VERSION=3.4.2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import rx.Observable;
import rx.Subscriber;
import rx.schedulers.Schedulers;
import rxbonjour.exc.DiscoveryFailed;
import rxbonjour.exc.StaleContextException;
import rxbonjour.model.BonjourEvent;
Expand Down Expand Up @@ -131,7 +130,7 @@ private JmDNS getJmdns(WifiManager wifiManager) throws IOException {

@Override public Observable<BonjourEvent> start(Context context, final String type) {
// Append ".local." suffix in order to have JmDNS pick up on the services
final String dnsType = type + SUFFIX;
final String dnsType = (type.endsWith(SUFFIX)) ? type : type + SUFFIX;

// Create a weak reference to the incoming Context
final WeakReference<Context> weakContext = new WeakReference<>(context);
Expand Down
1 change: 1 addition & 0 deletions rxbonjour/src/test/java/rxbonjour/RxBonjourTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class RxBonjourTest extends BaseTest {
assertEquals(true, RxBonjour.isBonjourType("_ssh._udp"));
assertEquals(true, RxBonjour.isBonjourType("_xmpp-server._tcp"));
assertEquals(true, RxBonjour.isBonjourType("_printer._tcp"));
assertEquals(true, RxBonjour.isBonjourType("_somelocalservice._tcp.local."));

assertEquals(false, RxBonjour.isBonjourType("_invalid§/(chars._tcp"));
assertEquals(false, RxBonjour.isBonjourType("_http._invalidprotocol"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ public class JBBonjourDiscoveryTest extends BaseTest {
verify(nsdManager, times(1)).stopServiceDiscovery(any(NsdManager.DiscoveryListener.class));
}

@Test public void testAddAndRemoveOneCycleWithLocalDomain() throws Exception {
BonjourDiscovery discovery = new JBBonjourDiscovery();
TestSubscriber<BonjourEvent> subscriber = new TestSubscriber<>();

discovery.start(context, "_http._tcp.local.").subscribe(subscriber);

subscriber.assertNoErrors();
verify(nsdManager, times(1)).discoverServices(eq("_http._tcp.local."), anyInt(), any(NsdManager.DiscoveryListener.class));
subscriber.unsubscribe();
verify(nsdManager, times(1)).stopServiceDiscovery(any(NsdManager.DiscoveryListener.class));
}

@Test public void testAddAndRemoveTwoCycle() throws Exception {
BonjourDiscovery discovery = new JBBonjourDiscovery();
TestSubscriber<BonjourEvent> subscriber1 = new TestSubscriber<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,19 @@ public class SupportBonjourDiscoveryTest extends BaseTest {
verify(jmdns, times(1)).close();
}

@Test public void testAddAndRemoveOneCycleWithLocalDomain() throws Exception {
BonjourDiscovery discovery = new SupportBonjourDiscovery();
TestSubscriber<BonjourEvent> subscriber = new TestSubscriber<>();

discovery.start(context, "_http._tcp.local.").subscribe(subscriber);

subscriber.assertNoErrors();
verify(jmdns, times(1)).addServiceListener(eq("_http._tcp.local."), any(ServiceListener.class));
subscriber.unsubscribe();
verify(jmdns, times(1)).removeServiceListener(eq("_http._tcp.local."), any(ServiceListener.class));
verify(jmdns, times(1)).close();
}

@Test public void testAddAndRemoveTwoCycle() throws Exception {
BonjourDiscovery discovery = new SupportBonjourDiscovery();
TestSubscriber<BonjourEvent> subscriber1 = new TestSubscriber<>();
Expand Down

0 comments on commit 6b0f187

Please sign in to comment.