本文整理匯總了Java中org.junit.jupiter.api.Assertions.assertArrayEquals方法的典型用法代碼示例。如果您正苦於以下問題:Java Assertions.assertArrayEquals方法的具體用法?Java Assertions.assertArrayEquals怎麽用?Java Assertions.assertArrayEquals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.junit.jupiter.api.Assertions
的用法示例。
在下文中一共展示了Assertions.assertArrayEquals方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: verifyCompression
import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
void verifyCompression(long[] input, int expectedAmount) {
long[] compressed = new long[input.length];
long[] uncompressed = new long[input.length];
int amount = Simple8.compress(input, compressed);
if(expectedAmount > 0) {
assertEquals(expectedAmount, amount);
}
Simple8.decompress(compressed, 0, amount, uncompressed, 0);
Assertions.assertArrayEquals(input, uncompressed);
Arrays.fill(compressed, 0);
Arrays.fill(uncompressed, 0);
amount = Simple8RLE.compress(input, compressed);
if(expectedAmount > 0) {
assertEquals(expectedAmount, amount);
}
Simple8RLE.decompress(compressed, 0, amount, uncompressed, 0);
Assertions.assertArrayEquals(input, uncompressed);
}
示例2: assertEncodeDecodeEquals
import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
private void assertEncodeDecodeEquals(ChunkClusterTranscoder transcoder, ChunkCluster chunkCluster)
{
byte[] encoded = transcoder.encode(chunkCluster);
ChunkCluster decoded = transcoder.decode(encoded);
assertEqualsChunkCluster(chunkCluster, decoded);
byte[] encodedAgain = transcoder.encode(decoded);
Assertions.assertArrayEquals(encoded, encodedAgain, "encodedAgain not equal to first encoded");
}
示例3: nenc
import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Test
void nenc() throws IOException {
byte[] encoded = SphinxClient.Nenc(8);
Assertions.assertArrayEquals(
encoded,
new byte[]{(byte) 0x92, (byte) 0xc4, 0x01, (byte) 0xf0, 0x08});
}
示例4: testClassArrayMethodInvoke
import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Test
public void testClassArrayMethodInvoke() throws Exception {
ClassWrapper<TestClassFour> cw = Reflect.wrapClass(TestClassFour.class);
Double[] expected = new Double[]{-1D, -1D, -1D};
Double[] actual = cw.invokeMethod("get2", Double[].class);
Assertions.assertArrayEquals(expected, actual);
}
示例5: testClassPrimitiveArrayMethodInvoke
import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Test
public void testClassPrimitiveArrayMethodInvoke() throws Exception {
ClassWrapper<TestClassFour> cw = Reflect.wrapClass(TestClassFour.class);
double[] expected = new double[]{-1, -1, -1};
double[] actual = cw.invokeMethod("get", double[].class);
Assertions.assertArrayEquals(expected, actual);
}
示例6: testArrayMethodReflector
import org.junit.jupiter.api.Assertions; //導入方法依賴的package包/類
@Test
public void testArrayMethodReflector() {
ClassWrapper<TestClass5> tc = wrapClass(TestClass5.class).construct();
MethodReflector<TestClass5Reflector> reflector = newInstance(tc, TestClass5Reflector.class);
TestClass5Reflector reflectorImpl = reflector.getReflector();
byte[] EXPECTED = new byte[] { 0, 1, 0, 1, 1 };
Assertions.assertArrayEquals(EXPECTED, reflectorImpl.a());
}