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


Java ArrayAssert类代码示例

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


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

示例1: testDoFilterInternalDuplication

import junitx.framework.ArrayAssert; //导入依赖的package包/类
@Test
public void testDoFilterInternalDuplication() throws ServletException,
		IOException {
	request.addLocale(LocaleUtils.toLocale("en_US"));
	request.addLocale(LocaleUtils.toLocale("zh_CN"));
	request.addLocale(LocaleUtils.toLocale("en_US"));

	service.addLocale(LocaleUtils.toLocale("en_US"));
	service.addLocale(LocaleUtils.toLocale("ja_JP"));
	service.addLocale(LocaleUtils.toLocale("zh_CN"));
	service.addLocale(LocaleUtils.toLocale("zh_TW"));

	assertEquals(3, Collections.list(request.getLocales()).size());
	assertEquals(4, service.getAvailableLocales().size());

	ualf.doFilterInternal(request, response, filterChain);

	Collection<Locale> actualLocales = UserAgentLocalesFilter
			.getUserAgentLocales(request);
	assertEquals(2, actualLocales.size());

	Collection<Locale> expectedLocales = new LinkedHashSet<Locale>();
	expectedLocales.add(LocaleUtils.toLocale("en_US"));
	expectedLocales.add(LocaleUtils.toLocale("zh_CN"));
	ArrayAssert.assertEquals(expectedLocales.toArray(), actualLocales
			.toArray());
}
 
开发者ID:sutra,项目名称:openid-server,代码行数:28,代码来源:UserAgentLocalesFilterTest.java

示例2: testPost_withBody

import junitx.framework.ArrayAssert; //导入依赖的package包/类
@Test public void testPost_withBody() throws Exception {
  byte[] body = new byte[5000];
  for (int i=0; i < body.length; ++i) {
    body[i] = (byte)(i % 255);
  }
  HttpRequest request = new HttpRequest(BASE_URL)
      .setMethod("POST")
      .setPostBody(body)
      .addHeader("content-type", "application/octet-stream");
  HttpResponse response = fetcher.fetch(request);
  assertEquals("POST", response.getHeader("x-method"));
  ArrayAssert.assertEquals(body, response.getResponseAsBytes());
}
 
开发者ID:inevo,项目名称:shindig-1.1-BETA5-incubating,代码行数:14,代码来源:AbstractHttpFetcherTest.java

示例3: testPut_withBody

import junitx.framework.ArrayAssert; //导入依赖的package包/类
@Test public void testPut_withBody() throws Exception {
  byte[] body = new byte[5000];
  for (int i=0; i < body.length; ++i) {
    body[i] = (byte)i;
  }
  HttpRequest request = new HttpRequest(BASE_URL)
      .setMethod("PUT")
      .setPostBody(body)
      .addHeader("content-type", "application/octet-stream");
  HttpResponse response = fetcher.fetch(request);
  assertEquals("PUT", response.getHeader("x-method"));
  ArrayAssert.assertEquals(body, response.getResponseAsBytes());
}
 
开发者ID:inevo,项目名称:shindig-1.1-BETA5-incubating,代码行数:14,代码来源:AbstractHttpFetcherTest.java

示例4: testHugeBody

import junitx.framework.ArrayAssert; //导入依赖的package包/类
@Test public void testHugeBody() throws Exception {
  byte[] body = new byte[1024*1024]; // 1 MB
  for (int i=0; i < body.length; ++i) {
    body[i] = (byte)i;
  }
  HttpRequest request = new HttpRequest(BASE_URL)
      .setMethod("POST")
      .setPostBody(body)
      .addHeader("content-type", "application/octet-stream");
  HttpResponse response = fetcher.fetch(request);
  assertEquals("POST", response.getHeader("x-method"));
  ArrayAssert.assertEquals(body, response.getResponseAsBytes());
}
 
开发者ID:inevo,项目名称:shindig-1.1-BETA5-incubating,代码行数:14,代码来源:AbstractHttpFetcherTest.java

示例5: testGetUtf8String

import junitx.framework.ArrayAssert; //导入依赖的package包/类
@Test
public void testGetUtf8String() {
  ArrayAssert.assertEquals(new byte[] { 0x69, 0x6e }, CharsetUtil.getUtf8Bytes("in"));
  ArrayAssert.assertEquals(new byte[] {}, CharsetUtil.getUtf8Bytes(null));
  testStringOfLength(0);
  testStringOfLength(10);
  testStringOfLength(100);
  testStringOfLength(1000);
}
 
开发者ID:inevo,项目名称:shindig-1.1-BETA5-incubating,代码行数:10,代码来源:CharsetUtilTest.java

示例6: testLatin1

import junitx.framework.ArrayAssert; //导入依赖的package包/类
@Test
public void testLatin1() {
  ArrayAssert.assertEquals(LATIN1_UTF8_DATA, CharsetUtil.getUtf8Bytes(LATIN1_STRING));
}
 
开发者ID:inevo,项目名称:shindig-1.1-BETA5-incubating,代码行数:5,代码来源:CharsetUtilTest.java


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