当前位置: 首页>>代码示例>>Java>>正文


Java JavaOnlyMap.of方法代码示例

本文整理汇总了Java中com.facebook.react.bridge.JavaOnlyMap.of方法的典型用法代码示例。如果您正苦于以下问题:Java JavaOnlyMap.of方法的具体用法?Java JavaOnlyMap.of怎么用?Java JavaOnlyMap.of使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.facebook.react.bridge.JavaOnlyMap的用法示例。


在下文中一共展示了JavaOnlyMap.of方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testSelection

import com.facebook.react.bridge.JavaOnlyMap; //导入方法依赖的package包/类
@Test
public void testSelection() {
  ReactEditText view = mManager.createViewInstance(mThemedContext);
  view.setText("Need some text to select something...");

  mManager.updateProperties(view, buildStyles());
  assertThat(view.getSelectionStart()).isEqualTo(0);
  assertThat(view.getSelectionEnd()).isEqualTo(0);

  JavaOnlyMap selection = JavaOnlyMap.of("start", 5, "end", 10);
  mManager.updateProperties(view, buildStyles("selection", selection));
  assertThat(view.getSelectionStart()).isEqualTo(5);
  assertThat(view.getSelectionEnd()).isEqualTo(10);

  mManager.updateProperties(view, buildStyles("selection", null));
  assertThat(view.getSelectionStart()).isEqualTo(5);
  assertThat(view.getSelectionEnd()).isEqualTo(10);
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:19,代码来源:ReactTextInputPropertyTest.java

示例2: shouldDeleteDbEntry

import com.facebook.react.bridge.JavaOnlyMap; //导入方法依赖的package包/类
@Test
public void shouldDeleteDbEntry() throws Exception {
    String tableName  = "testTable";
    ReadableMap readableMap = JavaOnlyMap.of("id", 1);
    AwaitablePromise<Integer> awaitablePromise = new AwaitablePromise<>();
    when(sqLiteDatabase.delete(tableName, "id = ?", new String[] {"1"})).thenReturn(1);

    DeleteCommand deleteCommand = new DeleteCommand(reactContext, rnRecordSQLiteHelper);
    deleteCommand.delete(tableName, readableMap, awaitablePromise.promise());
    Integer deleteCount = awaitablePromise.awaitResolve();
    assertThat(deleteCount, is(1));
}
 
开发者ID:reneweb,项目名称:rnrecord,代码行数:13,代码来源:DeleteCommandTest.java

示例3: shouldFindDbEntry

import com.facebook.react.bridge.JavaOnlyMap; //导入方法依赖的package包/类
@Test
public void shouldFindDbEntry() throws Exception {
    String tableName  = "testTable";
    ReadableMap readableMap = JavaOnlyMap.of("id", 1D);
    AwaitablePromise<JavaOnlyArray> awaitablePromise = new AwaitablePromise<>();
    Cursor cursor = mockCursor();
    when(sqLiteDatabase.rawQuery("SELECT * from " + tableName + " WHERE id = ? ;", new String[] { "1.0" })).thenReturn(cursor);

    FindCommand findCommand = new FindCommand(reactContext, rnRecordSQLiteHelper);
    findCommand.find(tableName, readableMap, awaitablePromise.promise());
    JavaOnlyArray result = awaitablePromise.awaitResolve();
    assertThat(result.size(), is(1));
    assertThat(result.getMap(0).getString("name"), is("rob"));
}
 
开发者ID:reneweb,项目名称:rnrecord,代码行数:15,代码来源:FindCommandTest.java

示例4: shouldUpdateDbEntry

import com.facebook.react.bridge.JavaOnlyMap; //导入方法依赖的package包/类
@Test
public void shouldUpdateDbEntry() throws Exception {
    String tableName  = "testTable";
    ContentValues contentValues = new ContentValues();
    contentValues.put("name", "rob");
    contentValues.put("id", 1D);
    ReadableMap readableMap = JavaOnlyMap.of("id", 1D, "name", "rob");
    AwaitablePromise<Integer> awaitablePromise = new AwaitablePromise<>();
    when(sqLiteDatabase.update(tableName, contentValues, "id = ?", new String[] {"1.0"})).thenReturn(1);

    UpdateCommand updateCommand = new UpdateCommand(reactContext, rnRecordSQLiteHelper);
    updateCommand.update(tableName, readableMap, awaitablePromise.promise());
    Integer updateCount = awaitablePromise.awaitResolve();
    assertThat(updateCount, is(1));
}
 
开发者ID:reneweb,项目名称:rnrecord,代码行数:16,代码来源:UpdateCommandTest.java

示例5: buildStyles

import com.facebook.react.bridge.JavaOnlyMap; //导入方法依赖的package包/类
public ReactStylesDiffMap buildStyles(Object... keysAndValues) {
  return new ReactStylesDiffMap(JavaOnlyMap.of(keysAndValues));
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:4,代码来源:ReactTextInputPropertyTest.java

示例6: buildStyles

import com.facebook.react.bridge.JavaOnlyMap; //导入方法依赖的package包/类
public static ReactStylesDiffMap buildStyles(Object... keysAndValues) {
  return new ReactStylesDiffMap(JavaOnlyMap.of(keysAndValues));
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:4,代码来源:ReactPropForShadowNodeSetterTest.java


注:本文中的com.facebook.react.bridge.JavaOnlyMap.of方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。