當前位置: 首頁>>代碼示例>>Java>>正文


Java ArrayAssert.assertEquals方法代碼示例

本文整理匯總了Java中junitx.framework.ArrayAssert.assertEquals方法的典型用法代碼示例。如果您正苦於以下問題:Java ArrayAssert.assertEquals方法的具體用法?Java ArrayAssert.assertEquals怎麽用?Java ArrayAssert.assertEquals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在junitx.framework.ArrayAssert的用法示例。


在下文中一共展示了ArrayAssert.assertEquals方法的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.assertEquals方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。