aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2013-05-23 18:24:28 +0200
committerBananeweizen <bananeweizen@gmx.de>2013-05-23 18:24:28 +0200
commit4efc1b2f6ee0d4fb5a32ad74774d5a29515168eb (patch)
treef6faab2f9d24772e7c17eae4584e4c02f124c27e /tests
parentf824def217f651d6400aea9c0cd4b25f76b3c40d (diff)
downloadcgeo-4efc1b2f6ee0d4fb5a32ad74774d5a29515168eb.zip
cgeo-4efc1b2f6ee0d4fb5a32ad74774d5a29515168eb.tar.gz
cgeo-4efc1b2f6ee0d4fb5a32ad74774d5a29515168eb.tar.bz2
refactoring: get more debug output from tests
Diffstat (limited to 'tests')
-rw-r--r--tests/src/cgeo/geocaching/SettingsTest.java1
-rw-r--r--tests/src/cgeo/geocaching/files/GPXImporterTest.java8
2 files changed, 8 insertions, 1 deletions
diff --git a/tests/src/cgeo/geocaching/SettingsTest.java b/tests/src/cgeo/geocaching/SettingsTest.java
index 85e5115..6a1eefa 100644
--- a/tests/src/cgeo/geocaching/SettingsTest.java
+++ b/tests/src/cgeo/geocaching/SettingsTest.java
@@ -25,6 +25,7 @@ public class SettingsTest extends ActivityInstrumentationTestCase2<MainActivity>
}
public static void testSettings() {
+ // unfortunately, several other tests depend on being a premium member and will fail if run by a basic member
assertEquals(GCConstants.MEMBER_STATUS_PM, Settings.getMemberStatus());
}
diff --git a/tests/src/cgeo/geocaching/files/GPXImporterTest.java b/tests/src/cgeo/geocaching/files/GPXImporterTest.java
index 86369a3..c064935 100644
--- a/tests/src/cgeo/geocaching/files/GPXImporterTest.java
+++ b/tests/src/cgeo/geocaching/files/GPXImporterTest.java
@@ -11,6 +11,8 @@ import cgeo.geocaching.test.R;
import cgeo.geocaching.utils.CancellableHandler;
import cgeo.geocaching.utils.Log;
+import org.apache.commons.lang3.StringUtils;
+
import android.net.Uri;
import android.os.Message;
@@ -257,8 +259,12 @@ public class GPXImporterTest extends AbstractResourceInstrumentationTestCase {
protected void setUp() throws Exception {
super.setUp();
- tempDir = new File(System.getProperty("java.io.tmpdir"), "cgeogpxesTest");
+ final String globalTempDir = System.getProperty("java.io.tmpdir");
+ assertTrue("java.io.tmpdir is not defined", StringUtils.isNotBlank(globalTempDir));
+
+ tempDir = new File(globalTempDir, "cgeogpxesTest");
tempDir.mkdir();
+ assertTrue("Could not create directory " + tempDir.getPath(), tempDir.exists());
// workaround to get storage initialized
cgData.getAllHistoryCachesCount();
listId = cgData.createList("cgeogpxesTest");