Java 类com.facebook.react.bridge.ReactTestHelper 实例源码

项目:ReactNativeSignatureExample    文件:TextInputTest.java   
public UIManagerModule getUIManagerModule() {
  ReactApplicationContext reactContext = ReactTestHelper.createCatalystContextForTest();
  List<ViewManager> viewManagers = Arrays.asList(
      new ViewManager[] {
          new ReactTextInputManager(),
      });
  DisplayMetrics displayMetrics = reactContext.getResources().getDisplayMetrics();
  DisplayMetricsHolder.setWindowDisplayMetrics(displayMetrics);
  DisplayMetricsHolder.setScreenDisplayMetrics(displayMetrics);
  UIManagerModule uiManagerModule = new UIManagerModule(
      reactContext,
      viewManagers,
      new UIImplementation(reactContext, viewManagers));
  uiManagerModule.onHostResume();
  return uiManagerModule;
}
项目:ReactNativeSignatureExample    文件:ReactTextTest.java   
public UIManagerModule getUIManagerModule() {
  ReactApplicationContext reactContext = ReactTestHelper.createCatalystContextForTest();
  DisplayMetrics displayMetrics = reactContext.getResources().getDisplayMetrics();
  DisplayMetricsHolder.setWindowDisplayMetrics(displayMetrics);
  DisplayMetricsHolder.setScreenDisplayMetrics(displayMetrics);
  List<ViewManager> viewManagers = Arrays.asList(
      new ViewManager[] {
          new ReactTextViewManager(),
          new ReactRawTextManager(),
      });
  UIManagerModule uiManagerModule = new UIManagerModule(
      reactContext,
      viewManagers,
      new UIImplementation(reactContext, viewManagers));
  uiManagerModule.onHostResume();
  return uiManagerModule;
}
项目:react-native-ibeacon-android    文件:TextInputTest.java   
public UIManagerModule getUIManagerModule() {
  ReactApplicationContext reactContext = ReactTestHelper.createCatalystContextForTest();
  List<ViewManager> viewManagers = Arrays.asList(
      new ViewManager[] {
          new ReactTextInputManager(),
      });
  DisplayMetrics displayMetrics = reactContext.getResources().getDisplayMetrics();
  DisplayMetricsHolder.setWindowDisplayMetrics(displayMetrics);
  DisplayMetricsHolder.setScreenDisplayMetrics(displayMetrics);
  UIManagerModule uiManagerModule = new UIManagerModule(
      reactContext,
      viewManagers,
      new UIImplementation(reactContext, viewManagers));
  uiManagerModule.onHostResume();
  return uiManagerModule;
}
项目:react-native-ibeacon-android    文件:ReactTextTest.java   
public UIManagerModule getUIManagerModule() {
  ReactApplicationContext reactContext = ReactTestHelper.createCatalystContextForTest();
  DisplayMetrics displayMetrics = reactContext.getResources().getDisplayMetrics();
  DisplayMetricsHolder.setWindowDisplayMetrics(displayMetrics);
  DisplayMetricsHolder.setScreenDisplayMetrics(displayMetrics);
  List<ViewManager> viewManagers = Arrays.asList(
      new ViewManager[] {
          new ReactTextViewManager(),
          new ReactRawTextManager(),
      });
  UIManagerModule uiManagerModule = new UIManagerModule(
      reactContext,
      viewManagers,
      new UIImplementation(reactContext, viewManagers));
  uiManagerModule.onHostResume();
  return uiManagerModule;
}
项目:react-native-box-loaders    文件:TextInputTest.java   
public UIManagerModule getUIManagerModule() {
  ReactApplicationContext reactContext = ReactTestHelper.createCatalystContextForTest();
  List<ViewManager> viewManagers = Arrays.asList(
      new ViewManager[] {
          new ReactTextInputManager(),
      });
  DisplayMetrics displayMetrics = reactContext.getResources().getDisplayMetrics();
  DisplayMetricsHolder.setWindowDisplayMetrics(displayMetrics);
  DisplayMetricsHolder.setScreenDisplayMetrics(displayMetrics);
  UIManagerModule uiManagerModule = new UIManagerModule(
      reactContext,
      viewManagers,
      new UIImplementation(reactContext, viewManagers));
  uiManagerModule.onHostResume();
  return uiManagerModule;
}
项目:react-native-box-loaders    文件:ReactTextTest.java   
public UIManagerModule getUIManagerModule() {
  ReactApplicationContext reactContext = ReactTestHelper.createCatalystContextForTest();
  DisplayMetrics displayMetrics = reactContext.getResources().getDisplayMetrics();
  DisplayMetricsHolder.setWindowDisplayMetrics(displayMetrics);
  DisplayMetricsHolder.setScreenDisplayMetrics(displayMetrics);
  List<ViewManager> viewManagers = Arrays.asList(
      new ViewManager[] {
          new ReactTextViewManager(),
          new ReactRawTextManager(),
      });
  UIManagerModule uiManagerModule = new UIManagerModule(
      reactContext,
      viewManagers,
      new UIImplementation(reactContext, viewManagers));
  uiManagerModule.onHostResume();
  return uiManagerModule;
}
项目:RNLearn_Project1    文件:TextInputTest.java   
public UIManagerModule getUIManagerModule() {
  ReactApplicationContext reactContext = ReactTestHelper.createCatalystContextForTest();
  List<ViewManager> viewManagers = Arrays.asList(
      new ViewManager[] {
          new ReactTextInputManager(),
      });
  UIManagerModule uiManagerModule = new UIManagerModule(
      reactContext,
      viewManagers,
      new UIImplementationProvider(),
      false);
  uiManagerModule.onHostResume();
  return uiManagerModule;
}
项目:RNLearn_Project1    文件:ReactTextInputPropertyTest.java   
@Before
public void setup() {
  mContext = new ReactApplicationContext(RuntimeEnvironment.application);
  mCatalystInstanceMock = ReactTestHelper.createMockCatalystInstance();
  mContext.initializeWithInstance(mCatalystInstanceMock);
  mThemedContext = new ThemedReactContext(mContext, mContext);
  mManager = new ReactTextInputManager();
  DisplayMetricsHolder.setWindowDisplayMetrics(new DisplayMetrics());
}
项目:RNLearn_Project1    文件:ReactSliderPropertyTest.java   
@Before
public void setup() {
  ReactApplicationContext mContext = new ReactApplicationContext(RuntimeEnvironment.application);
  CatalystInstance mCatalystInstanceMock = ReactTestHelper.createMockCatalystInstance();
  mContext.initializeWithInstance(mCatalystInstanceMock);
  mThemedContext = new ThemedReactContext(mContext, mContext);
  mManager = new ReactSliderManager();
}
项目:RNLearn_Project1    文件:ReactTextTest.java   
public UIManagerModule getUIManagerModule() {
  ReactApplicationContext reactContext = ReactTestHelper.createCatalystContextForTest();
  List<ViewManager> viewManagers = Arrays.asList(
      new ViewManager[] {
          new ReactTextViewManager(),
          new ReactRawTextManager(),
      });
  UIManagerModule uiManagerModule = new UIManagerModule(
      reactContext,
      viewManagers,
      new UIImplementationProvider(),
      false);
  uiManagerModule.onHostResume();
  return uiManagerModule;
}
项目:RNLearn_Project1    文件:ReactImagePropertyTest.java   
@Before
public void setup() {
  mContext = new ReactApplicationContext(RuntimeEnvironment.application);
  mCatalystInstanceMock = ReactTestHelper.createMockCatalystInstance();
  mContext.initializeWithInstance(mCatalystInstanceMock);
  mThemeContext = new ThemedReactContext(mContext, mContext);
  Fresco.initialize(mContext);
  DisplayMetricsHolder.setWindowDisplayMetrics(new DisplayMetrics());
}
项目:RNLearn_Project1    文件:ShareModuleTest.java   
@Before
public void prepareModules() throws Exception {
  PowerMockito.mockStatic(Arguments.class);
  Mockito.when(Arguments.createMap()).thenAnswer(new Answer<Object>() {
    @Override
    public Object answer(InvocationOnMock invocation) throws Throwable {
      return new JavaOnlyMap();
    }
  });

  mShareModule = new ShareModule(ReactTestHelper.createCatalystContextForTest());
}
项目:RNLearn_Project1    文件:SimpleViewPropertyTest.java   
@Before
public void setup() {
  mContext = new ReactApplicationContext(RuntimeEnvironment.application);
  mCatalystInstanceMock = ReactTestHelper.createMockCatalystInstance();
  mContext.initializeWithInstance(mCatalystInstanceMock);
  mThemedContext = new ThemedReactContext(mContext, mContext);
  mManager = new ConcreteViewManager();
}
项目:RNLearn_Project1    文件:TextInputTest.java   
public UIManagerModule getUIManagerModule() {
  ReactApplicationContext reactContext = ReactTestHelper.createCatalystContextForTest();
  List<ViewManager> viewManagers = Arrays.asList(
      new ViewManager[] {
          new ReactTextInputManager(),
      });
  UIManagerModule uiManagerModule = new UIManagerModule(
      reactContext,
      viewManagers,
      new UIImplementationProvider(),
      false);
  uiManagerModule.onHostResume();
  return uiManagerModule;
}
项目:RNLearn_Project1    文件:ReactTextInputPropertyTest.java   
@Before
public void setup() {
  mContext = new ReactApplicationContext(RuntimeEnvironment.application);
  mCatalystInstanceMock = ReactTestHelper.createMockCatalystInstance();
  mContext.initializeWithInstance(mCatalystInstanceMock);
  mThemedContext = new ThemedReactContext(mContext, mContext);
  mManager = new ReactTextInputManager();
  DisplayMetricsHolder.setWindowDisplayMetrics(new DisplayMetrics());
}
项目:RNLearn_Project1    文件:ReactSliderPropertyTest.java   
@Before
public void setup() {
  ReactApplicationContext mContext = new ReactApplicationContext(RuntimeEnvironment.application);
  CatalystInstance mCatalystInstanceMock = ReactTestHelper.createMockCatalystInstance();
  mContext.initializeWithInstance(mCatalystInstanceMock);
  mThemedContext = new ThemedReactContext(mContext, mContext);
  mManager = new ReactSliderManager();
}
项目:RNLearn_Project1    文件:ReactTextTest.java   
public UIManagerModule getUIManagerModule() {
  ReactApplicationContext reactContext = ReactTestHelper.createCatalystContextForTest();
  List<ViewManager> viewManagers = Arrays.asList(
      new ViewManager[] {
          new ReactTextViewManager(),
          new ReactRawTextManager(),
      });
  UIManagerModule uiManagerModule = new UIManagerModule(
      reactContext,
      viewManagers,
      new UIImplementationProvider(),
      false);
  uiManagerModule.onHostResume();
  return uiManagerModule;
}
项目:RNLearn_Project1    文件:ReactImagePropertyTest.java   
@Before
public void setup() {
  mContext = new ReactApplicationContext(RuntimeEnvironment.application);
  mCatalystInstanceMock = ReactTestHelper.createMockCatalystInstance();
  mContext.initializeWithInstance(mCatalystInstanceMock);
  mThemeContext = new ThemedReactContext(mContext, mContext);
  Fresco.initialize(mContext);
  DisplayMetricsHolder.setWindowDisplayMetrics(new DisplayMetrics());
}
项目:RNLearn_Project1    文件:ShareModuleTest.java   
@Before
public void prepareModules() throws Exception {
  PowerMockito.mockStatic(Arguments.class);
  Mockito.when(Arguments.createMap()).thenAnswer(new Answer<Object>() {
    @Override
    public Object answer(InvocationOnMock invocation) throws Throwable {
      return new JavaOnlyMap();
    }
  });

  mShareModule = new ShareModule(ReactTestHelper.createCatalystContextForTest());
}
项目:RNLearn_Project1    文件:SimpleViewPropertyTest.java   
@Before
public void setup() {
  mContext = new ReactApplicationContext(RuntimeEnvironment.application);
  mCatalystInstanceMock = ReactTestHelper.createMockCatalystInstance();
  mContext.initializeWithInstance(mCatalystInstanceMock);
  mThemedContext = new ThemedReactContext(mContext, mContext);
  mManager = new ConcreteViewManager();
}
项目:ReactNativeSignatureExample    文件:ReactTextInputPropertyTest.java   
@Before
public void setup() {
  mContext = new ReactApplicationContext(RuntimeEnvironment.application);
  mCatalystInstanceMock = ReactTestHelper.createMockCatalystInstance();
  mContext.initializeWithInstance(mCatalystInstanceMock);
  mThemedContext = new ThemedReactContext(mContext, mContext);
  mManager = new ReactTextInputManager();
  DisplayMetricsHolder.setWindowDisplayMetrics(new DisplayMetrics());
}
项目:ReactNativeSignatureExample    文件:ReactImagePropertyTest.java   
@Before
public void setup() {
  mContext = new ReactApplicationContext(RuntimeEnvironment.application);
  mCatalystInstanceMock = ReactTestHelper.createMockCatalystInstance();
  mContext.initializeWithInstance(mCatalystInstanceMock);
  mThemeContext = new ThemedReactContext(mContext, mContext);
  Fresco.initialize(mContext);
  DisplayMetricsHolder.setWindowDisplayMetrics(new DisplayMetrics());
}
项目:ReactNativeSignatureExample    文件:SimpleViewPropertyTest.java   
@Before
public void setup() {
  mContext = new ReactApplicationContext(RuntimeEnvironment.application);
  mCatalystInstanceMock = ReactTestHelper.createMockCatalystInstance();
  mContext.initializeWithInstance(mCatalystInstanceMock);
  mThemedContext = new ThemedReactContext(mContext, mContext);
  mManager = new ConcreteViewManager();
}
项目:react-native-ibeacon-android    文件:ReactTextInputPropertyTest.java   
@Before
public void setup() {
  mContext = new ReactApplicationContext(RuntimeEnvironment.application);
  mCatalystInstanceMock = ReactTestHelper.createMockCatalystInstance();
  mContext.initializeWithInstance(mCatalystInstanceMock);
  mThemedContext = new ThemedReactContext(mContext, mContext);
  mManager = new ReactTextInputManager();
  DisplayMetricsHolder.setWindowDisplayMetrics(new DisplayMetrics());
}
项目:react-native-ibeacon-android    文件:ReactImagePropertyTest.java   
@Before
public void setup() {
  mContext = new ReactApplicationContext(RuntimeEnvironment.application);
  mCatalystInstanceMock = ReactTestHelper.createMockCatalystInstance();
  mContext.initializeWithInstance(mCatalystInstanceMock);
  mThemeContext = new ThemedReactContext(mContext, mContext);
  Fresco.initialize(mContext);
  DisplayMetricsHolder.setWindowDisplayMetrics(new DisplayMetrics());
}
项目:react-native-ibeacon-android    文件:SimpleViewPropertyTest.java   
@Before
public void setup() {
  mContext = new ReactApplicationContext(RuntimeEnvironment.application);
  mCatalystInstanceMock = ReactTestHelper.createMockCatalystInstance();
  mContext.initializeWithInstance(mCatalystInstanceMock);
  mThemedContext = new ThemedReactContext(mContext, mContext);
  mManager = new ConcreteViewManager();
}
项目:react-native-box-loaders    文件:ReactTextInputPropertyTest.java   
@Before
public void setup() {
  mContext = new ReactApplicationContext(RuntimeEnvironment.application);
  mCatalystInstanceMock = ReactTestHelper.createMockCatalystInstance();
  mContext.initializeWithInstance(mCatalystInstanceMock);
  mThemedContext = new ThemedReactContext(mContext, mContext);
  mManager = new ReactTextInputManager();
  DisplayMetricsHolder.setWindowDisplayMetrics(new DisplayMetrics());
}
项目:react-native-box-loaders    文件:ReactImagePropertyTest.java   
@Before
public void setup() {
  mContext = new ReactApplicationContext(RuntimeEnvironment.application);
  mCatalystInstanceMock = ReactTestHelper.createMockCatalystInstance();
  mContext.initializeWithInstance(mCatalystInstanceMock);
  mThemeContext = new ThemedReactContext(mContext, mContext);
  Fresco.initialize(mContext);
  DisplayMetricsHolder.setWindowDisplayMetrics(new DisplayMetrics());
}
项目:react-native-box-loaders    文件:SimpleViewPropertyTest.java   
@Before
public void setup() {
  mContext = new ReactApplicationContext(RuntimeEnvironment.application);
  mCatalystInstanceMock = ReactTestHelper.createMockCatalystInstance();
  mContext.initializeWithInstance(mCatalystInstanceMock);
  mThemedContext = new ThemedReactContext(mContext, mContext);
  mManager = new ConcreteViewManager();
}
项目:Ironman    文件:TextInputTest.java   
public UIManagerModule getUIManagerModule() {
  ReactApplicationContext reactContext = ReactTestHelper.createCatalystContextForTest();
  List<ViewManager> viewManagers = Arrays.asList(
      new ViewManager[] {
          new ReactTextInputManager(),
      });
  UIManagerModule uiManagerModule = new UIManagerModule(
      reactContext,
      viewManagers,
      new UIImplementationProvider());
  uiManagerModule.onHostResume();
  return uiManagerModule;
}
项目:Ironman    文件:ReactTextInputPropertyTest.java   
@Before
public void setup() {
  mContext = new ReactApplicationContext(RuntimeEnvironment.application);
  mCatalystInstanceMock = ReactTestHelper.createMockCatalystInstance();
  mContext.initializeWithInstance(mCatalystInstanceMock);
  mThemedContext = new ThemedReactContext(mContext, mContext);
  mManager = new ReactTextInputManager();
  DisplayMetricsHolder.setWindowDisplayMetrics(new DisplayMetrics());
}
项目:Ironman    文件:ReactTextTest.java   
public UIManagerModule getUIManagerModule() {
  ReactApplicationContext reactContext = ReactTestHelper.createCatalystContextForTest();
  List<ViewManager> viewManagers = Arrays.asList(
      new ViewManager[] {
          new ReactTextViewManager(),
          new ReactRawTextManager(),
      });
  UIManagerModule uiManagerModule = new UIManagerModule(
      reactContext,
      viewManagers,
      new UIImplementationProvider());
  uiManagerModule.onHostResume();
  return uiManagerModule;
}
项目:Ironman    文件:ReactImagePropertyTest.java   
@Before
public void setup() {
  mContext = new ReactApplicationContext(RuntimeEnvironment.application);
  mCatalystInstanceMock = ReactTestHelper.createMockCatalystInstance();
  mContext.initializeWithInstance(mCatalystInstanceMock);
  mThemeContext = new ThemedReactContext(mContext, mContext);
  Fresco.initialize(mContext);
  DisplayMetricsHolder.setWindowDisplayMetrics(new DisplayMetrics());
}
项目:Ironman    文件:ShareModuleTest.java   
@Before
public void prepareModules() throws Exception {
  PowerMockito.mockStatic(Arguments.class);
  Mockito.when(Arguments.createMap()).thenAnswer(new Answer<Object>() {
    @Override
    public Object answer(InvocationOnMock invocation) throws Throwable {
      return new JavaOnlyMap();
    }
  });

  mShareModule = new ShareModule(ReactTestHelper.createCatalystContextForTest());
}
项目:Ironman    文件:SimpleViewPropertyTest.java   
@Before
public void setup() {
  mContext = new ReactApplicationContext(RuntimeEnvironment.application);
  mCatalystInstanceMock = ReactTestHelper.createMockCatalystInstance();
  mContext.initializeWithInstance(mCatalystInstanceMock);
  mThemedContext = new ThemedReactContext(mContext, mContext);
  mManager = new ConcreteViewManager();
}
项目:ReactNativeSignatureExample    文件:ClipboardModuleTest.java   
@Before
public void setUp() {
  mClipboardModule = new ClipboardModule(ReactTestHelper.createCatalystContextForTest());
  mClipboardManager =
      (ClipboardManager) RuntimeEnvironment.application.getSystemService(Context.CLIPBOARD_SERVICE);
}
项目:react-native-ibeacon-android    文件:ClipboardModuleTest.java   
@Before
public void setUp() {
  mClipboardModule = new ClipboardModule(ReactTestHelper.createCatalystContextForTest());
  mClipboardManager =
      (ClipboardManager) RuntimeEnvironment.application.getSystemService(Context.CLIPBOARD_SERVICE);
}
项目:react-native-box-loaders    文件:ClipboardModuleTest.java   
@Before
public void setUp() {
  mClipboardModule = new ClipboardModule(ReactTestHelper.createCatalystContextForTest());
  mClipboardManager =
      (ClipboardManager) RuntimeEnvironment.application.getSystemService(Context.CLIPBOARD_SERVICE);
}
项目:Ironman    文件:ClipboardModuleTest.java   
@Before
public void setUp() {
  mClipboardModule = new ClipboardModule(ReactTestHelper.createCatalystContextForTest());
  mClipboardManager =
      (ClipboardManager) RuntimeEnvironment.application.getSystemService(Context.CLIPBOARD_SERVICE);
}