@Test public void testThatLoadSucceedsForNativeModule() throws IOException, LazyLoadingException, ClassNotFoundException { Mockito.when(mModulePathsNo1Mock.containsNativeLib()).thenReturn(true); Mockito.when(mModulePathsNo1Mock.getNativeLibsDirectory()).thenReturn(mNativeLibsDirectoryMock); Class returnedClass = mObjectUnderTest.loadModule(MODULE_NAME_NO1, LazyModule.class.getName()); Assert.assertEquals(returnedClass, LazyModule.class); Mockito.verify(mLazyLoadListenerMock) .moduleLazilyLoaded(Mockito.eq(MODULE_NAME_NO1), Mockito.anyLong()); Mockito.verify(mNativeModuleLoaderMock).load(Mockito.eq(mModulePathsNo1Mock)); Mockito.verifyZeroInteractions(mCustomClassLoaderMock); }
public synchronized Class loadModule(String moduleName, String className) throws LazyLoadingException { try { return mLoaderAlgorithm.loadModule(moduleName, className); } catch (Throwable t) { throw new LazyLoadingException(t); } }
LazyModuleLoader { public synchronized Class loadModule(String moduleName, String className) throws LazyLoadingException { try { return mLoaderAlgorithm.loadModule(moduleName, className); } catch (Throwable t) { throw new LazyLoadingException(t); } } }
LazyModuleLoader { public synchronized Class loadModule(String moduleName, String className) throws LazyLoadingException { try { return mLoaderAlgorithm.loadModule(moduleName, className); } catch (Throwable t) { throw new LazyLoadingException(t); } } LazyModuleLoader(Context context, LoaderAlgorithm loaderAlgorithm); }
LazyModuleLoader { public synchronized Class loadModule(String moduleName, String className) throws LazyLoadingException { try { return mLoaderAlgorithm.loadModule(moduleName, className); } catch (Throwable t) { throw new LazyLoadingException(t); } } LazyModuleLoader(Context context, LoaderAlgorithm loaderAlgorithm); synchronized ServiceLike loadServiceModule(String moduleName, String className); synchronized SupportFragmentLike loadSupportFragmentModule(
      Fragment hostingFragment, String moduleName, String className); synchronized FragmentLike loadFragmentModule(
      android.app.Fragment hostingFragment, String moduleName, String className); synchronized ActivityLike loadActivityModule(
      Activity activity, String moduleName, String className); synchronized Class loadModule(String moduleName, String className); synchronized void installModule(String moduleName); }
LazyModuleLoader { public synchronized Class loadModule(String moduleName, String className) throws LazyLoadingException { try { return mLoaderAlgorithm.loadModule(moduleName, className); } catch (Throwable t) { throw new LazyLoadingException(t); } } LazyModuleLoader(Context context, LoaderAlgorithm loaderAlgorithm); synchronized ServiceLike loadServiceModule(String moduleName, String className); synchronized SupportFragmentLike loadSupportFragmentModule(
      Fragment hostingFragment, String moduleName, String className); synchronized FragmentLike loadFragmentModule(
      android.app.Fragment hostingFragment, String moduleName, String className); synchronized ActivityLike loadActivityModule(
      Activity activity, String moduleName, String className); synchronized Class loadModule(String moduleName, String className); synchronized void installModule(String moduleName);  }