use of com.google.security.zynamics.binnavi.debug.connection.packets.replies.AttachReply in project binnavi by google.
the class CDebuggerSynchronizerTest method testAttachSuccess.
@Test
public void testAttachSuccess() throws DebugExceptionWrapper {
// Connect the debugger
mockDebugger.connect();
assertTrue(mockDebugger.isConnected());
debuggerSynchronizer.receivedEvent(new AttachReply(0, 0));
assertTrue(mockDebugger.getProcessManager().isAttached());
}
use of com.google.security.zynamics.binnavi.debug.connection.packets.replies.AttachReply in project binnavi by google.
the class DebuggerTest method testListeners1.
@Test
public void testListeners1() throws DebugExceptionWrapper {
final DebuggerListener listener = new DebuggerListener();
debugger.addListener(listener);
mockDebugger.connect();
mockDebugger.getProcessManager().addThread(new TargetProcessThread(1, ThreadState.RUNNING));
mockDebugger.connection.m_synchronizer.receivedEvent(new AttachReply(0, 0));
mockDebugger.connection.m_synchronizer.receivedEvent(new AttachReply(0, 1));
mockDebugger.connection.m_synchronizer.receivedEvent(new AuthenticationFailedReply());
}
use of com.google.security.zynamics.binnavi.debug.connection.packets.replies.AttachReply in project binnavi by google.
the class CHistoryStringBuilderTest method testComplete.
/**
* This test tries to achieve complete code coverage to make sure all string formatters are
* working as expected.
*
* @throws DebugExceptionWrapper
* @throws IOException
* @throws SAXException
* @throws ParserConfigurationException
* @throws MessageParserException
* @throws MaybeNullException
*/
@Test
public void testComplete() throws DebugExceptionWrapper, ParserConfigurationException, SAXException, IOException, MessageParserException, MaybeNullException {
final CHistoryStringBuilder builder = new CHistoryStringBuilder();
builder.setDebugger(m_debugger);
m_debugger.connect();
m_synchronizer.receivedEvent(DebuggerMessageBuilder.buildProcessStartReply(mockMemoryModule));
m_debugger.getProcessManager().addThread(new TargetProcessThread(1, ThreadState.RUNNING));
m_synchronizer.receivedEvent(new AttachReply(0, 0));
m_synchronizer.receivedEvent(new AttachReply(0, 1));
m_synchronizer.receivedEvent(new AuthenticationFailedReply());
}
use of com.google.security.zynamics.binnavi.debug.connection.packets.replies.AttachReply in project binnavi by google.
the class CDebuggerSynchronizerTest method testAttachError.
@Test
public void testAttachError() throws DebugExceptionWrapper {
mockDebugger.connect();
debuggerSynchronizer.receivedEvent(new AttachReply(0, 5));
assertFalse(mockDebugger.getProcessManager().isAttached());
assertEquals("ERROR_ATTACH/5;", listener.events);
}
Aggregations