Skip to content

Commit

Permalink
make eclipse tests compile again
Browse files Browse the repository at this point in the history
remove the non instrumentation tests from the build path
  • Loading branch information
Bananeweizen committed Nov 29, 2015
1 parent 1bebc5d commit 4e653d8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
1 change: 0 additions & 1 deletion tests/.classpath
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen">
<attributes>
<attribute name="ignore_optional_problems" value="true"/>
Expand Down
17 changes: 5 additions & 12 deletions tests/src/cgeo/geocaching/utils/RxUtilsTest.java
Expand Up @@ -2,23 +2,20 @@

import static org.assertj.core.api.Assertions.assertThat;

import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;

import junit.framework.TestCase;
import org.junit.Test;
import rx.Observable;
import rx.Subscription;
import rx.functions.Action0;
import rx.functions.Func0;
import rx.functions.Func1;
import rx.subjects.PublishSubject;
import rx.subjects.ReplaySubject;

import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;

public class RxUtilsTest extends TestCase {

@Test
public static void testRememberLast() {
final PublishSubject<String> rawObservable = PublishSubject.create();
final Observable<String> observable = RxUtils.rememberLast(rawObservable, "initial");
Expand All @@ -40,7 +37,6 @@ public static void testRememberLast() {
assertThat(observable.toBlocking().first()).isEqualTo("first");
}

@Test
public static void testFromNullable() {
final Observable<String> fromNull = RxUtils.fromNullable(null);
assertThat(fromNull.toBlocking().getIterator().hasNext()).isFalse();
Expand All @@ -49,7 +45,6 @@ public static void testFromNullable() {
assertThat(fromNonNull.toBlocking().single()).isEqualTo("foo");
}

@Test
public static void testDeferredNullable() {
final Observable<String> fromNull = RxUtils.deferredNullable(new Func0<String>() {
@Override
Expand All @@ -68,7 +63,6 @@ public String call() {
assertThat(fromNonNull.toBlocking().single()).isEqualTo("foo");
}

@Test
public static void testWaitForCompletion() {
final PublishSubject<String> observable = PublishSubject.create();
final AtomicBoolean terminated = new AtomicBoolean(false);
Expand All @@ -91,7 +85,6 @@ public void run() {
assertThat(terminated.get()).isTrue();
}

@Test
public static void testObservableCache() {
final AtomicInteger counter = new AtomicInteger(0);
final RxUtils.ObservableCache<String, Integer> cache = new RxUtils.ObservableCache<String, Integer>(new Func1<String, Observable<Integer>>() {
Expand All @@ -113,7 +106,6 @@ public Observable<Integer> call(final String s) {
assertThat(counter.get()).isEqualTo(2);
}

@Test
public static void testDelayedUnsubscription() {
final AtomicBoolean unsubscribed = new AtomicBoolean(false);
Observable.never().doOnUnsubscribe(new Action0() {
Expand All @@ -126,6 +118,7 @@ public void call() {
try {
Thread.sleep(200);
} catch (final InterruptedException ignored) {
// ignore for tests
}
assertThat(unsubscribed.get()).isTrue();
}
Expand Down
4 changes: 1 addition & 3 deletions tests/src/cgeo/geocaching/utils/TextUtilsTest.java
Expand Up @@ -5,12 +5,10 @@
import cgeo.geocaching.connector.gc.GCConstants;
import cgeo.geocaching.test.mock.MockedCache;

import android.test.AndroidTestCase;
import java.util.regex.Pattern;

import junit.framework.TestCase;

import java.util.regex.Pattern;

public class TextUtilsTest extends TestCase {
public static void testRegEx() {
final String page = MockedCache.readCachePage("GC2CJPF");
Expand Down

0 comments on commit 4e653d8

Please sign in to comment.