Commit d45c72e1 authored by Florian Fittkau's avatar Florian Fittkau

fixed tests

parent 8d245e25
......@@ -36,6 +36,8 @@ public class AbstractAspectTest {
assertEquals(0, buffer.getInt());
assertTrue(0 != buffer.getInt());
assertEquals(4, buffer.getInt());
assertEquals(5, buffer.getInt());
assertEquals(6, buffer.getInt());
assertEquals(AfterOperationEventRecord.CLAZZ_ID, buffer.get());
assertTrue((System.nanoTime() - 100000000L) < buffer.getLong());
......@@ -60,6 +62,8 @@ public class AbstractAspectTest {
assertEquals(0, buffer.getInt());
assertTrue(0 != buffer.getInt());
assertEquals(0, buffer.getInt());
assertEquals(1, buffer.getInt());
assertEquals(2, buffer.getInt());
assertEquals(AfterFailedOperationEventRecord.CLAZZ_ID, buffer.get());
assertTrue((System.nanoTime() - 100000000L) < buffer.getLong());
......@@ -74,6 +78,7 @@ public class AbstractAspectTest {
try {
super.operation(this, new ProceedingMock());
} catch (final Throwable e) {
// e.printStackTrace();
}
}
......@@ -89,6 +94,7 @@ public class AbstractAspectTest {
try {
super.operation(this, new ProceedingFailingMock());
} catch (final Throwable e) {
// e.printStackTrace();
}
}
......@@ -103,7 +109,7 @@ public class AbstractAspectTest {
@SuppressWarnings("rawtypes")
@Override
public Class getDeclaringType() {
return null;
return SignatureMock.class;
}
@Override
......
......@@ -119,19 +119,20 @@ public class TCPWriterTest {
buffer.putLong(0);
buffer.putInt(0);
buffer.putInt(MonitoringStringRegistry.getIdForStringWithoutSending("testMethod"));
buffer.putInt(MonitoringStringRegistry.getIdForStringWithoutSending("Clazz"));
buffer.putInt(MonitoringStringRegistry.getIdForStringWithoutSending("Interface"));
buffer.put(AfterOperationEventRecord.CLAZZ_ID);
buffer.putLong(TimeProvider.getCurrentTimestamp());
buffer.putLong(0);
buffer.putInt(1);
buffer.putInt(MonitoringStringRegistry.getIdForStringWithoutSending("testMethod"));
tcpWriter.onEvent(bufferEvent, 0, true);
Thread.sleep(100);
readBuffer.flip();
assertEquals(162, readBuffer.limit());
assertEquals(167, readBuffer.limit());
thread.interrupt();
}
......
package testpackage;
import explorviz.live_trace_processing.main.MonitoringController;
public class MonitoringAnonymousStarterTest {
public static void main(final String[] args) {
final MyTestThread myTestThread = new MyTestThread();
myTestThread.run();
try {
myTestThread.join();
} catch (final InterruptedException e) {
}
MonitoringController.shutdown();
}
}
package testpackage;
public class MyTestThread extends Thread {
public MyTestThread() {
super(new Runnable() {
@Override
public void run() {
// ...
}
});
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment