use of com.microsoft.appcenter.AppCenter in project mobile-center-sdk-android by Microsoft.
the class CrashesAndroidTest method startFresh.
private void startFresh(CrashesListener listener) throws Exception {
/* Configure new instance. */
AppCenterPrivateHelper.unsetInstance();
Crashes.unsetInstance();
AppCenter.setLogLevel(android.util.Log.VERBOSE);
AppCenter.configure(sApplication, "a");
/* Clean logs. */
AppCenter.setEnabled(false);
AppCenter.setEnabled(true).get();
/* Replace channel. */
Method method = AppCenter.class.getDeclaredMethod("getInstance");
method.setAccessible(true);
AppCenter appCenter = (AppCenter) method.invoke(null);
method = AppCenter.class.getDeclaredMethod("setChannel", Channel.class);
method.setAccessible(true);
method.invoke(appCenter, mChannel);
/* Set listener. */
Crashes.setListener(listener);
/* Start crashes. */
AppCenter.start(Crashes.class);
/* Wait for start. */
assertTrue(Crashes.isEnabled().get());
}
use of com.microsoft.appcenter.AppCenter in project mobile-center-sdk-android by Microsoft.
the class WrapperSdkExceptionManagerAndroidTest method startFresh.
private void startFresh() throws java.lang.Exception {
/* Configure new instance. */
AppCenterPrivateHelper.unsetInstance();
Crashes.unsetInstance();
AppCenter.setLogLevel(android.util.Log.VERBOSE);
AppCenter.configure(sApplication, "a");
/* Replace channel. */
Method method = AppCenter.class.getDeclaredMethod("getInstance");
method.setAccessible(true);
AppCenter appCenter = (AppCenter) method.invoke(null);
method = AppCenter.class.getDeclaredMethod("setChannel", Channel.class);
method.setAccessible(true);
method.invoke(appCenter, mock(Channel.class));
/* Start crashes. */
AppCenter.start(Crashes.class);
/* Wait for start. */
Assert.assertTrue(Crashes.isEnabled().get());
}