Search in sources :

Example 1 with AttachReply

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());
}
Also used : AttachReply(com.google.security.zynamics.binnavi.debug.connection.packets.replies.AttachReply) Test(org.junit.Test)

Example 2 with AttachReply

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());
}
Also used : TargetProcessThread(com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread) AttachReply(com.google.security.zynamics.binnavi.debug.connection.packets.replies.AttachReply) AuthenticationFailedReply(com.google.security.zynamics.binnavi.debug.connection.packets.replies.AuthenticationFailedReply) Test(org.junit.Test)

Example 3 with AttachReply

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());
}
Also used : TargetProcessThread(com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread) AttachReply(com.google.security.zynamics.binnavi.debug.connection.packets.replies.AttachReply) AuthenticationFailedReply(com.google.security.zynamics.binnavi.debug.connection.packets.replies.AuthenticationFailedReply) Test(org.junit.Test)

Example 4 with AttachReply

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);
}
Also used : AttachReply(com.google.security.zynamics.binnavi.debug.connection.packets.replies.AttachReply) Test(org.junit.Test)

Aggregations

AttachReply (com.google.security.zynamics.binnavi.debug.connection.packets.replies.AttachReply)4 Test (org.junit.Test)4 AuthenticationFailedReply (com.google.security.zynamics.binnavi.debug.connection.packets.replies.AuthenticationFailedReply)2 TargetProcessThread (com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread)2