* Tests serialization/deserialization for {@link SingleInstanceProfilingEvent}.
*/
@Test
public void testSingleInstanceProfilingEvent() {
try {
final SingleInstanceProfilingEvent orig = new SingleInstanceProfilingEvent(PROFILING_INTERVAL, IOWAIT_CPU,
IDLE_CPU, USER_CPU, SYSTEM_CPU, HARD_IRQ_CPU, SOFT_IRQ_CPU, TOTAL_MEMORY, FREE_MEMORY, BUFFERED_MEMORY,
CACHED_MEMORY, CACHED_SWAP_MEMORY, RECEIVED_BYTES, TRANSMITTED_BYTES, new JobID(), TIMESTAMP,
PROFILING_TIMESTAMP, INSTANCE_NAME);
final SingleInstanceProfilingEvent copy = (SingleInstanceProfilingEvent) CommonTestUtils.createCopyWritable(orig);
assertEquals(orig.getProfilingInterval(), copy.getProfilingInterval());
assertEquals(orig.getIOWaitCPU(), copy.getIOWaitCPU());
assertEquals(orig.getIdleCPU(), copy.getIdleCPU());
assertEquals(orig.getUserCPU(), copy.getUserCPU());
assertEquals(orig.getSystemCPU(), copy.getSystemCPU());
assertEquals(orig.getHardIrqCPU(), copy.getHardIrqCPU());
assertEquals(orig.getSoftIrqCPU(), copy.getSoftIrqCPU());
assertEquals(orig.getTotalMemory(), copy.getTotalMemory());
assertEquals(orig.getFreeMemory(), copy.getFreeMemory());
assertEquals(orig.getBufferedMemory(), copy.getBufferedMemory());
assertEquals(orig.getCachedMemory(), copy.getCachedMemory());
assertEquals(orig.getCachedSwapMemory(), copy.getCachedSwapMemory());
assertEquals(orig.getReceivedBytes(), copy.getReceivedBytes());
assertEquals(orig.getTransmittedBytes(), copy.getTransmittedBytes());
assertEquals(orig.getJobID(), copy.getJobID());
assertEquals(orig.getTimestamp(), copy.getTimestamp());
assertEquals(orig.getProfilingTimestamp(), copy.getProfilingTimestamp());
assertEquals(orig.getInstanceName(), copy.getInstanceName());
assertEquals(orig.hashCode(), copy.hashCode());
assertTrue(orig.equals(copy));
}
catch (Exception e) {
e.printStackTrace();
fail(e.getMessage());