This repository has been archived by the owner on Feb 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
80 changed files
with
8,555 additions
and
8,072 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +0,0 @@ | ||
[submodule "app-sample"] | ||
path = app-sample | ||
url = git@github.com:bitstadium/HockeySDK-AndroidDemo.git | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule app-sample
deleted from
2d45f2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
hockeysdk/src/androidTest/java/net/hockeyapp/android/ApplicationTest.java
This file was deleted.
Oops, something went wrong.
73 changes: 73 additions & 0 deletions
73
hockeysdk/src/androidTest/java/net/hockeyapp/android/ExceptionHandlerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
package net.hockeyapp.android; | ||
|
||
import android.support.test.InstrumentationRegistry; | ||
import android.support.test.runner.AndroidJUnit4; | ||
import android.test.ActivityInstrumentationTestCase2; | ||
|
||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import java.io.File; | ||
import java.io.FilenameFilter; | ||
|
||
@RunWith(AndroidJUnit4.class) | ||
public class ExceptionHandlerTest extends ActivityInstrumentationTestCase2<UpdateActivity> { | ||
|
||
private File filesDirectory; | ||
|
||
public ExceptionHandlerTest() { | ||
super(UpdateActivity.class); | ||
} | ||
|
||
@Before | ||
public void setUp() throws Exception { | ||
super.setUp(); | ||
|
||
injectInstrumentation(InstrumentationRegistry.getInstrumentation()); | ||
|
||
if (Constants.FILES_PATH == null) { | ||
Constants.loadFromContext(getActivity()); | ||
} | ||
|
||
filesDirectory = new File(Constants.FILES_PATH); | ||
File[] stacktraceFiles = filesDirectory.listFiles(new StacktraceFilenameFilter()); | ||
for (File f : stacktraceFiles) { | ||
f.delete(); | ||
} | ||
} | ||
|
||
@SuppressWarnings("ThrowableInstanceNeverThrown") | ||
@Test | ||
public void saveExceptionTest() { | ||
|
||
Throwable tr = new RuntimeException("Just a test exception"); | ||
|
||
ExceptionHandler.saveException(tr, null, null); | ||
|
||
File[] files = filesDirectory.listFiles(new StacktraceFilenameFilter()); | ||
assertEquals(1, files.length); | ||
} | ||
|
||
@SuppressWarnings("ThrowableInstanceNeverThrown") | ||
@Test | ||
public void saveExceptionCustomListenerTest() { | ||
|
||
Throwable tr = new RuntimeException("Just a test exception"); | ||
|
||
ExceptionHandler.saveException(tr, null, new CrashManagerListener() { | ||
}); | ||
|
||
File[] files = filesDirectory.listFiles(new StacktraceFilenameFilter()); | ||
assertEquals(1, files.length); | ||
} | ||
|
||
static class StacktraceFilenameFilter implements FilenameFilter { | ||
|
||
@Override | ||
public boolean accept(File dir, String filename) { | ||
return filename.endsWith(".stacktrace"); | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.