• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java MapEntry类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.fest.assertions.data.MapEntry的典型用法代码示例。如果您正苦于以下问题:Java MapEntry类的具体用法?Java MapEntry怎么用?Java MapEntry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MapEntry类属于org.fest.assertions.data包,在下文中一共展示了MapEntry类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testCustomBubblingEvents

import org.fest.assertions.data.MapEntry; //导入依赖的package包/类
@Test
public void testCustomBubblingEvents() {
  ViewManager mockViewManager = mock(ViewManager.class);
  List<ViewManager> viewManagers = Arrays.asList(mockViewManager);
  when(mockViewManager.getExportedCustomBubblingEventTypeConstants())
      .thenReturn(MapBuilder.of("onTwirl", TWIRL_BUBBLING_EVENT_MAP));
  UIManagerModule uiManagerModule = new UIManagerModule(
    mReactContext,
    viewManagers,
    mUIImplementationProvider,
    false);
  Map<String, Object> constants = uiManagerModule.getConstants();
  assertThat((Map) constants.get(CUSTOM_BUBBLING_EVENT_TYPES))
      .contains(MapEntry.entry("onTwirl", TWIRL_BUBBLING_EVENT_MAP))
      .containsKey("topChange");
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:17,代码来源:UIManagerModuleConstantsTest.java


示例2: testCustomDirectEvents

import org.fest.assertions.data.MapEntry; //导入依赖的package包/类
@Test
public void testCustomDirectEvents() {
  ViewManager mockViewManager = mock(ViewManager.class);
  List<ViewManager> viewManagers = Arrays.asList(mockViewManager);
  when(mockViewManager.getExportedCustomDirectEventTypeConstants())
      .thenReturn(MapBuilder.of("onTwirl", TWIRL_DIRECT_EVENT_MAP));
  UIManagerModule uiManagerModule = new UIManagerModule(
    mReactContext,
    viewManagers,
    mUIImplementationProvider,
    false);
  Map<String, Object> constants = uiManagerModule.getConstants();
  assertThat((Map) constants.get(CUSTOM_DIRECT_EVENT_TYPES))
      .contains(MapEntry.entry("onTwirl", TWIRL_DIRECT_EVENT_MAP))
      .containsKey("topLoadingStart");
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:17,代码来源:UIManagerModuleConstantsTest.java


示例3: completePart

import org.fest.assertions.data.MapEntry; //导入依赖的package包/类
@Test public void completePart() throws Exception {
  Part p = new Part.Builder() //
      .contentDisposition("form-data; filename=\"foo.txt\"") //
      .contentType("application/json") //
      .contentLength(13) //
      .contentLanguage("English") //
      .contentEncoding("UTF-8") //
      .body("{'foo':'bar'}") //
      .build();

  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  p.writeBodyTo(baos);
  String actual = new String(baos.toByteArray(), UTF_8);
  assertThat(actual).isEqualTo("{'foo':'bar'}");
  assertThat(p.getHeaders())
      .hasSize(5)
      .contains( //
          MapEntry.entry("Content-Disposition", "form-data; filename=\"foo.txt\""), //
          MapEntry.entry("Content-Type", "application/json"), //
          MapEntry.entry("Content-Length", "13"), //
          MapEntry.entry("Content-Language", "English"), //
          MapEntry.entry("Content-Transfer-Encoding", "UTF-8") //
      );
}
 
开发者ID:square,项目名称:mimecraft,代码行数:25,代码来源:PartTest.java


示例4: singlePart

import org.fest.assertions.data.MapEntry; //导入依赖的package包/类
@Test public void singlePart() throws Exception {
  String expected = "" //
      + "--123\r\n" //
      + "\r\n" //
      + "Hello, World!\r\n" //
      + "--123--";

  Multipart m = new Multipart.Builder("123")
      .addPart(new TestPart("Hello, World!"))
      .build();

  ByteArrayOutputStream out = new ByteArrayOutputStream();
  m.writeBodyTo(out);
  String actual = new String(out.toByteArray(), UTF_8);
  assertThat(actual).isEqualTo(expected);
  assertThat(m.getHeaders())
      .hasSize(1)
      .contains(MapEntry.entry("Content-Type", "multipart/mixed; boundary=123"));
}
 
开发者ID:square,项目名称:mimecraft,代码行数:20,代码来源:MultipartWriterTest.java


示例5: getIOS

import org.fest.assertions.data.MapEntry; //导入依赖的package包/类
@Test
public void getIOS() throws Exception {
    doReturn(true).when(agentUtil).isMobileUserAgent(eq(MobileUserAgent.SAFARI));

    ModuleStyle moduleStyle = instance.get();
    assertThat(moduleStyle).isInstanceOf(IOSModuleStyle.class);
    assertThat(moduleStyle).contains(MapEntry.entry("1", "11"));
    verify(agentUtil).isMobileUserAgent(eq(MobileUserAgent.SAFARI));
    verify(styleSocket).getStyles(eq(element));

}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:12,代码来源:CssStylesModuleScopedProviderTest.java


示例6: get

import org.fest.assertions.data.MapEntry; //导入依赖的package包/类
@Test
public void get() throws Exception {
    ModuleStyle moduleStyle = instance.get();
    assertThat(moduleStyle).isInstanceOf(ModuleStyleImpl.class);
    assertThat(moduleStyle).contains(MapEntry.entry("1", "11"));
    verify(agentUtil).isMobileUserAgent(eq(MobileUserAgent.SAFARI));
    verify(styleSocket).getStyles(eq(element));
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:9,代码来源:CssStylesModuleScopedProviderTest.java


示例7: testCustomBubblingEvents

import org.fest.assertions.data.MapEntry; //导入依赖的package包/类
@Test
public void testCustomBubblingEvents() {
  ViewManager mockViewManager = mock(ViewManager.class);
  List<ViewManager> viewManagers = Arrays.asList(mockViewManager);
  when(mockViewManager.getExportedCustomBubblingEventTypeConstants())
      .thenReturn(MapBuilder.of("onTwirl", TWIRL_BUBBLING_EVENT_MAP));
  UIManagerModule uiManagerModule = new UIManagerModule(
      mReactContext,
      viewManagers,
      mUIImplementation);
  Map<String, Object> constants = uiManagerModule.getConstants();
  assertThat((Map) constants.get(CUSTOM_BUBBLING_EVENT_TYPES))
      .contains(MapEntry.entry("onTwirl", TWIRL_BUBBLING_EVENT_MAP))
      .containsKey("topChange");
}
 
开发者ID:john1jan,项目名称:ReactNativeSignatureExample,代码行数:16,代码来源:UIManagerModuleConstantsTest.java


示例8: testCustomDirectEvents

import org.fest.assertions.data.MapEntry; //导入依赖的package包/类
@Test
public void testCustomDirectEvents() {
  ViewManager mockViewManager = mock(ViewManager.class);
  List<ViewManager> viewManagers = Arrays.asList(mockViewManager);
  when(mockViewManager.getExportedCustomDirectEventTypeConstants())
      .thenReturn(MapBuilder.of("onTwirl", TWIRL_DIRECT_EVENT_MAP));
  UIManagerModule uiManagerModule = new UIManagerModule(
      mReactContext,
      viewManagers,
      mUIImplementation);
  Map<String, Object> constants = uiManagerModule.getConstants();
  assertThat((Map) constants.get(CUSTOM_DIRECT_EVENT_TYPES))
      .contains(MapEntry.entry("onTwirl", TWIRL_DIRECT_EVENT_MAP))
      .containsKey("topLoadingStart");
}
 
开发者ID:john1jan,项目名称:ReactNativeSignatureExample,代码行数:16,代码来源:UIManagerModuleConstantsTest.java


示例9: testCustomBubblingEvents

import org.fest.assertions.data.MapEntry; //导入依赖的package包/类
@Test
public void testCustomBubblingEvents() {
  ViewManager mockViewManager = mock(ViewManager.class);
  List<ViewManager> viewManagers = Arrays.asList(mockViewManager);
  when(mockViewManager.getExportedCustomBubblingEventTypeConstants())
      .thenReturn(MapBuilder.of("onTwirl", TWIRL_BUBBLING_EVENT_MAP));
  UIManagerModule uiManagerModule = new UIManagerModule(
      mReactContext,
      viewManagers,
    mUIImplementationProvider);
  Map<String, Object> constants = uiManagerModule.getConstants();
  assertThat((Map) constants.get(CUSTOM_BUBBLING_EVENT_TYPES))
      .contains(MapEntry.entry("onTwirl", TWIRL_BUBBLING_EVENT_MAP))
      .containsKey("topChange");
}
 
开发者ID:Right-Men,项目名称:Ironman,代码行数:16,代码来源:UIManagerModuleConstantsTest.java


示例10: testCustomDirectEvents

import org.fest.assertions.data.MapEntry; //导入依赖的package包/类
@Test
public void testCustomDirectEvents() {
  ViewManager mockViewManager = mock(ViewManager.class);
  List<ViewManager> viewManagers = Arrays.asList(mockViewManager);
  when(mockViewManager.getExportedCustomDirectEventTypeConstants())
      .thenReturn(MapBuilder.of("onTwirl", TWIRL_DIRECT_EVENT_MAP));
  UIManagerModule uiManagerModule = new UIManagerModule(
      mReactContext,
      viewManagers,
    mUIImplementationProvider);
  Map<String, Object> constants = uiManagerModule.getConstants();
  assertThat((Map) constants.get(CUSTOM_DIRECT_EVENT_TYPES))
      .contains(MapEntry.entry("onTwirl", TWIRL_DIRECT_EVENT_MAP))
      .containsKey("topLoadingStart");
}
 
开发者ID:Right-Men,项目名称:Ironman,代码行数:16,代码来源:UIManagerModuleConstantsTest.java


示例11: shouldCallRestApiWithPassedText

import org.fest.assertions.data.MapEntry; //导入依赖的package包/类
@Test
public void shouldCallRestApiWithPassedText() {
    // given
    String queryString = "query string";
    query.setText(queryString);

    // when
    search.performClick();

    // then
    ArgumentCaptor<Map> arg = ArgumentCaptor.forClass(Map.class);
    Mockito.verify(mockRestApi, times(1)).search(arg.capture(), any(Integer.class), any(Callback.class));
    assertThat(arg.getValue()).contains(MapEntry.entry("intitle", queryString));
}
 
开发者ID:WojciechKo,项目名称:stack-overflow-android,代码行数:15,代码来源:SimpleTest.java


示例12: multipartBodySetsType

import org.fest.assertions.data.MapEntry; //导入依赖的package包/类
@Test public void multipartBodySetsType() throws Exception {
  Multipart m = new Multipart.Builder().addPart(new TestPart("hi")).build();

  try {
    new Part.Builder().body(m).contentType("break me!");
    fail();
  } catch (IllegalStateException expected) {
  }

  Part p = new Part.Builder().body(m).build();
  for (Map.Entry<String, String> header : m.getHeaders().entrySet()) {
    assertThat(p.getHeaders()).contains(MapEntry.entry(header.getKey(), header.getValue()));
  }
}
 
开发者ID:square,项目名称:mimecraft,代码行数:15,代码来源:PartTest.java


示例13: threeParts

import org.fest.assertions.data.MapEntry; //导入依赖的package包/类
@Test public void threeParts() throws Exception {
  String expected = ""
      + "--123\r\n"
      + "\r\n"
      + "Quick\r\n"
      + "--123\r\n"
      + "\r\n"
      + "Brown\r\n"
      + "--123\r\n"
      + "\r\n"
      + "Fox\r\n"
      + "--123--";

  Multipart m = new Multipart.Builder("123")
      .addPart(new TestPart("Quick"))
      .addPart(new TestPart("Brown"))
      .addPart(new TestPart("Fox"))
      .build();

  ByteArrayOutputStream out = new ByteArrayOutputStream();
  m.writeBodyTo(out);
  String actual = new String(out.toByteArray(), UTF_8);
  assertThat(actual).isEqualTo(expected);
  assertThat(m.getHeaders())
      .hasSize(1)
      .contains(MapEntry.entry("Content-Type", "multipart/mixed; boundary=123"));
}
 
开发者ID:square,项目名称:mimecraft,代码行数:28,代码来源:MultipartWriterTest.java


示例14: testMergeConstants

import org.fest.assertions.data.MapEntry; //导入依赖的package包/类
@Test
public void testMergeConstants() {
  ViewManager managerX = mock(ViewManager.class);
  when(managerX.getExportedCustomDirectEventTypeConstants()).thenReturn(MapBuilder.of(
      "onTwirl",
      MapBuilder.of(
          "registrationName",
          "onTwirl",
          "keyToOverride",
          "valueX",
          "mapToMerge",
          MapBuilder.of("keyToOverride", "innerValueX", "anotherKey", "valueX"))));

  ViewManager managerY = mock(ViewManager.class);
  when(managerY.getExportedCustomDirectEventTypeConstants()).thenReturn(MapBuilder.of(
      "onTwirl",
      MapBuilder.of(
          "extraKey",
          "extraValue",
          "keyToOverride",
          "valueY",
          "mapToMerge",
          MapBuilder.of("keyToOverride", "innerValueY", "extraKey", "valueY"))));

  List<ViewManager> viewManagers = Arrays.asList(managerX, managerY);
  UIManagerModule uiManagerModule = new UIManagerModule(
    mReactContext,
    viewManagers,
    mUIImplementationProvider,
    false);
  Map<String, Object> constants = uiManagerModule.getConstants();
  assertThat((Map) constants.get(CUSTOM_DIRECT_EVENT_TYPES)).containsKey("onTwirl");

  Map twirlMap = (Map) valueAtPath(constants, CUSTOM_DIRECT_EVENT_TYPES, "onTwirl");
  assertThat(twirlMap)
      .contains(MapEntry.entry("registrationName", "onTwirl"))
      .contains(MapEntry.entry("keyToOverride", "valueY"))
      .contains(MapEntry.entry("extraKey", "extraValue"))
      .containsKey("mapToMerge");

  Map mapToMerge = (Map) valueAtPath(twirlMap, "mapToMerge");
  assertThat(mapToMerge)
      .contains(MapEntry.entry("keyToOverride", "innerValueY"))
      .contains(MapEntry.entry("anotherKey", "valueX"))
      .contains(MapEntry.entry("extraKey", "valueY"));
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:47,代码来源:UIManagerModuleConstantsTest.java


示例15: testMergeConstants

import org.fest.assertions.data.MapEntry; //导入依赖的package包/类
@Test
public void testMergeConstants() {
  ViewManager managerX = mock(ViewManager.class);
  when(managerX.getExportedCustomDirectEventTypeConstants()).thenReturn(MapBuilder.of(
      "onTwirl",
      MapBuilder.of(
          "registrationName",
          "onTwirl",
          "keyToOverride",
          "valueX",
          "mapToMerge",
          MapBuilder.of("keyToOverride", "innerValueX", "anotherKey", "valueX"))));

  ViewManager managerY = mock(ViewManager.class);
  when(managerY.getExportedCustomDirectEventTypeConstants()).thenReturn(MapBuilder.of(
      "onTwirl",
      MapBuilder.of(
          "extraKey",
          "extraValue",
          "keyToOverride",
          "valueY",
          "mapToMerge",
          MapBuilder.of("keyToOverride", "innerValueY", "extraKey", "valueY"))));

  List<ViewManager> viewManagers = Arrays.asList(managerX, managerY);
  UIManagerModule uiManagerModule = new UIManagerModule(
      mReactContext,
      viewManagers,
      mUIImplementation);
  Map<String, Object> constants = uiManagerModule.getConstants();
  assertThat((Map) constants.get(CUSTOM_DIRECT_EVENT_TYPES)).containsKey("onTwirl");

  Map twirlMap = (Map) valueAtPath(constants, CUSTOM_DIRECT_EVENT_TYPES, "onTwirl");
  assertThat(twirlMap)
      .contains(MapEntry.entry("registrationName", "onTwirl"))
      .contains(MapEntry.entry("keyToOverride", "valueY"))
      .contains(MapEntry.entry("extraKey", "extraValue"))
      .containsKey("mapToMerge");

  Map mapToMerge = (Map) valueAtPath(twirlMap, "mapToMerge");
  assertThat(mapToMerge)
      .contains(MapEntry.entry("keyToOverride", "innerValueY"))
      .contains(MapEntry.entry("anotherKey", "valueX"))
      .contains(MapEntry.entry("extraKey", "valueY"));
}
 
开发者ID:john1jan,项目名称:ReactNativeSignatureExample,代码行数:46,代码来源:UIManagerModuleConstantsTest.java


示例16: testMergeConstants

import org.fest.assertions.data.MapEntry; //导入依赖的package包/类
@Test
public void testMergeConstants() {
  ViewManager managerX = mock(ViewManager.class);
  when(managerX.getExportedCustomDirectEventTypeConstants()).thenReturn(MapBuilder.of(
      "onTwirl",
      MapBuilder.of(
          "registrationName",
          "onTwirl",
          "keyToOverride",
          "valueX",
          "mapToMerge",
          MapBuilder.of("keyToOverride", "innerValueX", "anotherKey", "valueX"))));

  ViewManager managerY = mock(ViewManager.class);
  when(managerY.getExportedCustomDirectEventTypeConstants()).thenReturn(MapBuilder.of(
      "onTwirl",
      MapBuilder.of(
          "extraKey",
          "extraValue",
          "keyToOverride",
          "valueY",
          "mapToMerge",
          MapBuilder.of("keyToOverride", "innerValueY", "extraKey", "valueY"))));

  List<ViewManager> viewManagers = Arrays.asList(managerX, managerY);
  UIManagerModule uiManagerModule = new UIManagerModule(
      mReactContext,
      viewManagers,
    mUIImplementationProvider);
  Map<String, Object> constants = uiManagerModule.getConstants();
  assertThat((Map) constants.get(CUSTOM_DIRECT_EVENT_TYPES)).containsKey("onTwirl");

  Map twirlMap = (Map) valueAtPath(constants, CUSTOM_DIRECT_EVENT_TYPES, "onTwirl");
  assertThat(twirlMap)
      .contains(MapEntry.entry("registrationName", "onTwirl"))
      .contains(MapEntry.entry("keyToOverride", "valueY"))
      .contains(MapEntry.entry("extraKey", "extraValue"))
      .containsKey("mapToMerge");

  Map mapToMerge = (Map) valueAtPath(twirlMap, "mapToMerge");
  assertThat(mapToMerge)
      .contains(MapEntry.entry("keyToOverride", "innerValueY"))
      .contains(MapEntry.entry("anotherKey", "valueX"))
      .contains(MapEntry.entry("extraKey", "valueY"));
}
 
开发者ID:Right-Men,项目名称:Ironman,代码行数:46,代码来源:UIManagerModuleConstantsTest.java


示例17: fieldAndTwoFiles

import org.fest.assertions.data.MapEntry; //导入依赖的package包/类
@Test public void fieldAndTwoFiles() throws Exception {
  String expected = ""
      + "--AaB03x\r\n"
      + "Content-Disposition: form-data; name=\"submit-name\"\r\n"
      + "Content-Length: 5\r\n"
      + "\r\n"
      + "Larry\r\n"
      + "--AaB03x\r\n"
      + "Content-Disposition: form-data; name=\"files\"\r\n"
      + "Content-Type: multipart/mixed; boundary=BbC04y\r\n"
      + "\r\n"
      + "--BbC04y\r\n"
      + "Content-Disposition: file; filename=\"file1.txt\"\r\n"
      + "Content-Type: text/plain\r\n"
      + "Content-Length: 29\r\n"
      + "\r\n"
      + "... contents of file1.txt ...\r\n"
      + "--BbC04y\r\n"
      + "Content-Disposition: file; filename=\"file2.gif\"\r\n"
      + "Content-Type: image/gif\r\n"
      + "Content-Length: 29\r\n"
      + "Content-Transfer-Encoding: binary\r\n"
      + "\r\n"
      + "... contents of file2.gif ...\r\n"
      + "--BbC04y--\r\n"
      + "--AaB03x--";

  Multipart m = new Multipart.Builder("AaB03x") //
      .type(Multipart.Type.FORM) //
      .addPart(new Part.Builder() //
          .contentDisposition("form-data; name=\"submit-name\"") //
          .body("Larry") //
          .build()) //
      .addPart(new Part.Builder() //
          .contentDisposition("form-data; name=\"files\"") //
          .body(new Multipart.Builder("BbC04y") //
              .addPart(new Part.Builder() //
                  .contentDisposition("file; filename=\"file1.txt\"") //
                  .contentType("text/plain") //
                  .body("... contents of file1.txt ...") //
                  .build()) //
              .addPart(new Part.Builder() //
                  .contentDisposition("file; filename=\"file2.gif\"") //
                  .contentType("image/gif") //
                  .contentEncoding("binary") //
                  .body("... contents of file2.gif ...") //
                  .build()) //
              .build()) //
          .build()) //
      .build();

  ByteArrayOutputStream out = new ByteArrayOutputStream();
  m.writeBodyTo(out);
  String actual = new String(out.toByteArray(), UTF_8);
  assertThat(actual).isEqualTo(expected);
  assertThat(m.getHeaders()) //
      .hasSize(1) //
      .contains(MapEntry.entry("Content-Type", "multipart/form-data; boundary=AaB03x"));
}
 
开发者ID:square,项目名称:mimecraft,代码行数:60,代码来源:ComplexExamplesTest.java



注:本文中的org.fest.assertions.data.MapEntry类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Graph类代码示例发布时间:2022-05-23
下一篇:
Java IConfigEntry类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap