EventLogTestpublic class EventLogTest extends TestCase tests for {@link EventLog} |
Fields Summary |
---|
private static final int | TEST_TAG |
Methods Summary |
---|
void | assertIntInByteArrayEquals(int expected, byte[] buf, int pos)
ByteBuffer computedBuf = ByteBuffer.wrap(buf).order(ByteOrder.nativeOrder());
int computed = computedBuf.getInt(pos);
Assert.assertEquals(expected, computed);
| void | assertLongInByteArrayEquals(long expected, byte[] buf, int pos)
ByteBuffer computedBuf = ByteBuffer.wrap(buf).order(ByteOrder.nativeOrder());
long computed = computedBuf.getLong(pos);
Assert.assertEquals(expected, computed);
| void | assertStringInByteArrayEquals(java.lang.String expected, byte[] buf, int pos)
byte[] expectedBytes = expected.getBytes();
Assert.assertTrue(expectedBytes.length <= buf.length - pos);
for (byte expectedByte : expectedBytes) {
Assert.assertEquals(expectedByte, buf[pos++]);
}
| public void | testIllegalListTypesThrowException()
try {
EventLog.writeEvent(TEST_TAG, new EventLog.List(new Object()));
fail("Can't create List with any old Object");
} catch (IllegalArgumentException e) {
// expected
}
try {
EventLog.writeEvent(TEST_TAG, new EventLog.List((byte) 1));
fail("Can't create List with any old byte");
} catch (IllegalArgumentException e) {
// expected
}
|
|