本文整理汇总了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);
}
示例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));
}
示例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"));
}
示例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));
}
示例5: buildStyles
import com.facebook.react.bridge.JavaOnlyMap; //导入方法依赖的package包/类
public ReactStylesDiffMap buildStyles(Object... keysAndValues) {
return new ReactStylesDiffMap(JavaOnlyMap.of(keysAndValues));
}
示例6: buildStyles
import com.facebook.react.bridge.JavaOnlyMap; //导入方法依赖的package包/类
public static ReactStylesDiffMap buildStyles(Object... keysAndValues) {
return new ReactStylesDiffMap(JavaOnlyMap.of(keysAndValues));
}