本文整理汇总了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());
}
示例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());
}
示例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());
}
示例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());
}
示例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);
}
示例6: testLatin1
import junitx.framework.ArrayAssert; //导入依赖的package包/类
@Test
public void testLatin1() {
ArrayAssert.assertEquals(LATIN1_UTF8_DATA, CharsetUtil.getUtf8Bytes(LATIN1_STRING));
}