net.grinder.scriptengine.jython.instrumentation
Class AbstractJythonInstrumenterTestCase

java.lang.Object
  extended by net.grinder.scriptengine.jython.instrumentation.AbstractJythonInstrumenterTestCase
Direct Known Subclasses:
AbstractJythonDCRInstrumenterTestCase

public abstract class AbstractJythonInstrumenterTestCase
extends Object

Instrumentation unit tests.

Author:
Philip Aston

Field Summary
protected  Instrumenter m_instrumenter
           
protected  org.python.util.PythonInterpreter m_interpreter
           
protected  org.python.core.PyObject m_one
           
protected  Recorder m_recorder
           
protected  net.grinder.testutility.RandomStubFactory<Recorder> m_recorderStubFactory
           
protected  org.python.core.PyObject m_six
           
protected  Test m_test
           
protected  org.python.core.PyObject m_three
           
protected  org.python.core.PyObject m_two
           
protected  org.python.core.PyObject m_zero
           
 
Constructor Summary
AbstractJythonInstrumenterTestCase(Instrumenter instrumenter)
           
 
Method Summary
protected  void assertNotWrappable(Object o)
           
protected  void assertNotWrappableByThisInstrumenter(Object o)
           
protected  void assertTargetReference(org.python.core.PyObject proxy, Object original)
           
protected abstract  void assertTargetReference(org.python.core.PyObject proxy, Object original, boolean unwrapTarget)
           
protected abstract  void assertTestReference(org.python.core.PyObject proxy, Test test)
           
static void assertVersion(String expected)
           
protected  Object createInstrumentedProxy(Test test, Recorder recorder, org.python.core.PyObject pyTarget)
           
protected  Class<?> getClassForInstance(org.python.core.PyInstance target)
           
protected  org.python.util.PythonInterpreter getInterpretter()
           
static Integer[] getJythonVersion()
           
 void testCreateProxyWithBoundPyMethod()
           
 void testCreateProxyWithPyFunction()
           
 void testCreateProxyWithPyInstance()
           
 void testCreateProxyWithPyProxy()
           
 void testCreateProxyWithPyReflectedFunction()
           
 void testCreateProxyWithRecursiveCode()
           
 void testCreateProxyWithUnboundPyMethod()
           
 void testPyDispatcherErrorHandling()
           
 void testSelectiveInstrumentUnsupported()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_instrumenter

protected final Instrumenter m_instrumenter

m_interpreter

protected final org.python.util.PythonInterpreter m_interpreter

m_zero

protected final org.python.core.PyObject m_zero

m_one

protected final org.python.core.PyObject m_one

m_two

protected final org.python.core.PyObject m_two

m_three

protected final org.python.core.PyObject m_three

m_six

protected final org.python.core.PyObject m_six

m_test

protected final Test m_test

m_recorderStubFactory

protected final net.grinder.testutility.RandomStubFactory<Recorder> m_recorderStubFactory

m_recorder

protected final Recorder m_recorder
Constructor Detail

AbstractJythonInstrumenterTestCase

public AbstractJythonInstrumenterTestCase(Instrumenter instrumenter)
Method Detail

assertTestReference

protected abstract void assertTestReference(org.python.core.PyObject proxy,
                                            Test test)

assertTargetReference

protected abstract void assertTargetReference(org.python.core.PyObject proxy,
                                              Object original,
                                              boolean unwrapTarget)

assertTargetReference

protected void assertTargetReference(org.python.core.PyObject proxy,
                                     Object original)

getJythonVersion

public static Integer[] getJythonVersion()
                                  throws Exception
Throws:
Exception

assertVersion

public static void assertVersion(String expected)
                          throws Exception
Throws:
Exception

getInterpretter

protected final org.python.util.PythonInterpreter getInterpretter()

assertNotWrappable

protected final void assertNotWrappable(Object o)
                                 throws Exception
Throws:
Exception

assertNotWrappableByThisInstrumenter

protected final void assertNotWrappableByThisInstrumenter(Object o)
                                                   throws Exception
Throws:
Exception

createInstrumentedProxy

protected final Object createInstrumentedProxy(Test test,
                                               Recorder recorder,
                                               org.python.core.PyObject pyTarget)
                                        throws NotWrappableTypeException
Throws:
NotWrappableTypeException

getClassForInstance

protected final Class<?> getClassForInstance(org.python.core.PyInstance target)
                                      throws IllegalArgumentException,
                                             IllegalAccessException
Throws:
IllegalArgumentException
IllegalAccessException

testCreateProxyWithPyFunction

public void testCreateProxyWithPyFunction()
                                   throws Exception
Throws:
Exception

testCreateProxyWithPyInstance

public void testCreateProxyWithPyInstance()
                                   throws Exception
Throws:
Exception

testCreateProxyWithUnboundPyMethod

public void testCreateProxyWithUnboundPyMethod()
                                        throws Exception
Throws:
Exception

testCreateProxyWithBoundPyMethod

public void testCreateProxyWithBoundPyMethod()
                                      throws Exception
Throws:
Exception

testCreateProxyWithPyReflectedFunction

public void testCreateProxyWithPyReflectedFunction()
                                            throws Exception
Throws:
Exception

testCreateProxyWithPyProxy

public void testCreateProxyWithPyProxy()
                                throws Exception
Throws:
Exception

testCreateProxyWithRecursiveCode

public void testCreateProxyWithRecursiveCode()
                                      throws Exception
Throws:
Exception

testPyDispatcherErrorHandling

public void testPyDispatcherErrorHandling()
                                   throws Exception
Throws:
Exception

testSelectiveInstrumentUnsupported

public void testSelectiveInstrumentUnsupported()
                                        throws Exception
Throws:
Exception


Copyright © 2000-2013. All Rights Reserved.