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


C++ Cookie::getCommentUrl方法代码示例

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


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

示例1: assertTrue

TEST(CookieDecoderTest, testDecodingCommaSeparatedClientSideCookies) {
    String source =
        "$Version=\"1\"; session_id=\"1234\", " +
        "$Version=\"1\"; session_id=\"1111\"; $Domain=\".cracker.edu\"";

    Set<Cookie> cookies = CookieDecoder.decode(source);
    Iterator<Cookie> it = cookies.iterator();
    Cookie c;

    assertTrue(it.hasNext());
    c = it.next();
    assertEquals(1, c.getVersion());
    assertEquals("session_id", c.getName());
    assertEquals("1234", c.getValue());
    assertNull(c.getPath());
    assertNull(c.getComment());
    assertNull(c.getCommentUrl());
    assertNull(c.getDomain());
    assertTrue(c.getPorts().isEmpty());
    assertEquals(Long.MIN_VALUE, c.getMaxAge());

    assertTrue(it.hasNext());
    c = it.next();
    assertEquals(1, c.getVersion());
    assertEquals("session_id", c.getName());
    assertEquals("1111", c.getValue());
    assertEquals(".cracker.edu", c.getDomain());
    assertNull(c.getPath());
    assertNull(c.getComment());
    assertNull(c.getCommentUrl());
    assertTrue(c.getPorts().isEmpty());
    assertEquals(Long.MIN_VALUE, c.getMaxAge());

    assertFalse(it.hasNext());
}
开发者ID:1suming,项目名称:cetty2,代码行数:35,代码来源:CookieDecoderTest.cpp

示例2: assertEquals

TEST(CookieDecoderTest, testDecodingClientSideCookies) {
    String source = "$Version=\"1\"; " +
                    "Part_Number=\"Riding_Rocket_0023\"; $Path=\"/acme/ammo\"; " +
                    "Part_Number=\"Rocket_Launcher_0001\"; $Path=\"/acme\"";

    Set<Cookie> cookies = CookieDecoder.decode(source);
    Iterator<Cookie> it = cookies.iterator();
    Cookie c;

    c = it.next();
    assertEquals(1, c.getVersion());
    assertEquals("Part_Number", c.getName());
    assertEquals("Rocket_Launcher_0001", c.getValue());
    assertEquals("/acme", c.getPath());
    assertNull(c.getComment());
    assertNull(c.getCommentUrl());
    assertNull(c.getDomain());
    assertTrue(c.getPorts().isEmpty());
    assertEquals(Long.MIN_VALUE, c.getMaxAge());

    c = it.next();
    assertEquals(1, c.getVersion());
    assertEquals("Part_Number", c.getName());
    assertEquals("Riding_Rocket_0023", c.getValue());
    assertEquals("/acme/ammo", c.getPath());
    assertNull(c.getComment());
    assertNull(c.getCommentUrl());
    assertNull(c.getDomain());
    assertTrue(c.getPorts().isEmpty());
    assertEquals(Long.MIN_VALUE, c.getMaxAge());

    assertFalse(it.hasNext());
}
开发者ID:1suming,项目名称:cetty2,代码行数:33,代码来源:CookieDecoderTest.cpp


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