public void testCreateInstrumentedProxyWithDefaults() throws Exception {
    final MasterInstrumenter masterInstrumenter =
        new MasterInstrumenter(m_loggerStubFactory.getLogger(), false);

    assertEquals(
        "traditional Jython instrumenter; " + "byte code transforming instrumenter for Java",
        masterInstrumenter.getDescription());

    m_loggerStubFactory.assertOutputMessageContains("traditional Jython");
    m_loggerStubFactory.assertNoMoreCalls();

    try {
      masterInstrumenter.createInstrumentedProxy(null, m_recorder, null);
      fail("Expected NotWrappableTypeException");
    } catch (NotWrappableTypeException e) {
    }

    final Object foo = new Object();

    final PyObject proxy =
        (PyObject) masterInstrumenter.createInstrumentedProxy(m_test, m_recorder, foo);

    assertSame(proxy.__getattr__("__target__").__tojava__(Object.class), foo);

    try {
      masterInstrumenter.createInstrumentedProxy(m_test, m_recorder, new PyObject());
      fail("Expected NotWrappableTypeException");
    } catch (NotWrappableTypeException e) {
    }
  }
  public void testInstrumentWithDefaults() throws Exception {
    final MasterInstrumenter masterInstrumenter =
        new MasterInstrumenter(m_loggerStubFactory.getLogger(), false);

    assertEquals(
        "traditional Jython instrumenter; " + "byte code transforming instrumenter for Java",
        masterInstrumenter.getDescription());

    m_loggerStubFactory.assertOutputMessageContains("traditional Jython");
    m_loggerStubFactory.assertNoMoreCalls();

    try {
      masterInstrumenter.instrument(null, m_recorder, null);
      fail("Expected NonInstrumentableTypeException");
    } catch (NonInstrumentableTypeException e) {
    }

    final Object foo = new Object();

    try {
      masterInstrumenter.instrument(m_test, m_recorder, foo);
      fail("Expected NonInstrumentableTypeException");
    } catch (NonInstrumentableTypeException e) {
    }
  }
  public void testWithForcedDCRInsstrumentation() throws Exception {
    final MasterInstrumenter masterInstrumenter =
        new MasterInstrumenter(m_loggerStubFactory.getLogger(), true);

    assertEquals(
        "byte code transforming instrumenter for Jython 2.1/2.2; "
            + "byte code transforming instrumenter for Java",
        masterInstrumenter.getDescription());

    m_loggerStubFactory.assertOutputMessageContains("byte code");
    m_loggerStubFactory.assertNoMoreCalls();
  }