Java 类com.facebook.react.bridge.queue.MessageQueueThreadSpec 实例源码

项目:RNLearn_Project1    文件:ReactTestHelper.java   
/**
 * @return a CatalystInstance mock that has a default working ReactQueueConfiguration.
 */
public static CatalystInstance createMockCatalystInstance() {
  ReactQueueConfigurationSpec spec = ReactQueueConfigurationSpec.builder()
      .setJSQueueThreadSpec(MessageQueueThreadSpec.mainThreadSpec())
      .setNativeModulesQueueThreadSpec(MessageQueueThreadSpec.mainThreadSpec())
      .build();
  ReactQueueConfiguration ReactQueueConfiguration = ReactQueueConfigurationImpl.create(
      spec,
      new QueueThreadExceptionHandler() {
        @Override
        public void handleException(Exception e) {
          throw new RuntimeException(e);
        }
      });

  CatalystInstance reactInstance = mock(CatalystInstance.class);
  when(reactInstance.getReactQueueConfiguration()).thenReturn(ReactQueueConfiguration);
  when(reactInstance.getNativeModule(UIManagerModule.class))
      .thenReturn(mock(UIManagerModule.class));

  return reactInstance;
}
项目:RNLearn_Project1    文件:ReactTestHelper.java   
/**
 * @return a CatalystInstance mock that has a default working ReactQueueConfiguration.
 */
public static CatalystInstance createMockCatalystInstance() {
  ReactQueueConfigurationSpec spec = ReactQueueConfigurationSpec.builder()
      .setJSQueueThreadSpec(MessageQueueThreadSpec.mainThreadSpec())
      .setNativeModulesQueueThreadSpec(MessageQueueThreadSpec.mainThreadSpec())
      .build();
  ReactQueueConfiguration ReactQueueConfiguration = ReactQueueConfigurationImpl.create(
      spec,
      new QueueThreadExceptionHandler() {
        @Override
        public void handleException(Exception e) {
          throw new RuntimeException(e);
        }
      });

  CatalystInstance reactInstance = mock(CatalystInstance.class);
  when(reactInstance.getReactQueueConfiguration()).thenReturn(ReactQueueConfiguration);
  when(reactInstance.getNativeModule(UIManagerModule.class))
      .thenReturn(mock(UIManagerModule.class));

  return reactInstance;
}
项目:ReactNativeSignatureExample    文件:ReactTestHelper.java   
/**
 * @return a CatalystInstance mock that has a default working ReactQueueConfiguration.
 */
public static CatalystInstance createMockCatalystInstance() {
  ReactQueueConfigurationSpec spec = ReactQueueConfigurationSpec.builder()
      .setJSQueueThreadSpec(MessageQueueThreadSpec.mainThreadSpec())
      .setNativeModulesQueueThreadSpec(MessageQueueThreadSpec.mainThreadSpec())
      .build();
  ReactQueueConfiguration ReactQueueConfiguration = ReactQueueConfigurationImpl.create(
      spec,
      new QueueThreadExceptionHandler() {
        @Override
        public void handleException(Exception e) {
          throw new RuntimeException(e);
        }
      });

  CatalystInstance reactInstance = mock(CatalystInstance.class);
  when(reactInstance.getReactQueueConfiguration()).thenReturn(ReactQueueConfiguration);
  when(reactInstance.getNativeModule(UIManagerModule.class))
      .thenReturn(mock(UIManagerModule.class));

  return reactInstance;
}
项目:react-native-ibeacon-android    文件:ReactTestHelper.java   
/**
 * @return a CatalystInstance mock that has a default working ReactQueueConfiguration.
 */
public static CatalystInstance createMockCatalystInstance() {
  ReactQueueConfigurationSpec spec = ReactQueueConfigurationSpec.builder()
      .setJSQueueThreadSpec(MessageQueueThreadSpec.mainThreadSpec())
      .setNativeModulesQueueThreadSpec(MessageQueueThreadSpec.mainThreadSpec())
      .build();
  ReactQueueConfiguration ReactQueueConfiguration = ReactQueueConfigurationImpl.create(
      spec,
      new QueueThreadExceptionHandler() {
        @Override
        public void handleException(Exception e) {
          throw new RuntimeException(e);
        }
      });

  CatalystInstance reactInstance = mock(CatalystInstance.class);
  when(reactInstance.getReactQueueConfiguration()).thenReturn(ReactQueueConfiguration);
  when(reactInstance.getNativeModule(UIManagerModule.class))
      .thenReturn(mock(UIManagerModule.class));

  return reactInstance;
}
项目:react-native-box-loaders    文件:ReactTestHelper.java   
/**
 * @return a CatalystInstance mock that has a default working ReactQueueConfiguration.
 */
public static CatalystInstance createMockCatalystInstance() {
  ReactQueueConfigurationSpec spec = ReactQueueConfigurationSpec.builder()
      .setJSQueueThreadSpec(MessageQueueThreadSpec.mainThreadSpec())
      .setNativeModulesQueueThreadSpec(MessageQueueThreadSpec.mainThreadSpec())
      .build();
  ReactQueueConfiguration ReactQueueConfiguration = ReactQueueConfigurationImpl.create(
      spec,
      new QueueThreadExceptionHandler() {
        @Override
        public void handleException(Exception e) {
          throw new RuntimeException(e);
        }
      });

  CatalystInstance reactInstance = mock(CatalystInstance.class);
  when(reactInstance.getReactQueueConfiguration()).thenReturn(ReactQueueConfiguration);
  when(reactInstance.getNativeModule(UIManagerModule.class))
      .thenReturn(mock(UIManagerModule.class));

  return reactInstance;
}
项目:Ironman    文件:ReactTestHelper.java   
/**
 * @return a CatalystInstance mock that has a default working ReactQueueConfiguration.
 */
public static CatalystInstance createMockCatalystInstance() {
  ReactQueueConfigurationSpec spec = ReactQueueConfigurationSpec.builder()
      .setJSQueueThreadSpec(MessageQueueThreadSpec.mainThreadSpec())
      .setNativeModulesQueueThreadSpec(MessageQueueThreadSpec.mainThreadSpec())
      .build();
  ReactQueueConfiguration ReactQueueConfiguration = ReactQueueConfigurationImpl.create(
      spec,
      new QueueThreadExceptionHandler() {
        @Override
        public void handleException(Exception e) {
          throw new RuntimeException(e);
        }
      });

  CatalystInstance reactInstance = mock(CatalystInstance.class);
  when(reactInstance.getReactQueueConfiguration()).thenReturn(ReactQueueConfiguration);
  when(reactInstance.getNativeModule(UIManagerModule.class))
      .thenReturn(mock(UIManagerModule.class));

  return reactInstance;
}