Search in sources :

Example 1 with FactoryAccessor

use of spoon.processing.FactoryAccessor in project spoon by INRIA.

the class IntercessionContractTest method testContract.

@Test
public void testContract() throws Throwable {
    Factory factory = new FactoryImpl(new DefaultCoreFactory(), new StandardEnvironment());
    Object element = instance;
    if (element instanceof FactoryAccessor) {
        ((FactoryAccessor) element).setFactory(factory);
    }
    // we invoke the setter
    toTest.invoke(element, new Object[] { null });
}
Also used : FactoryAccessor(spoon.processing.FactoryAccessor) DefaultCoreFactory(spoon.support.DefaultCoreFactory) Factory(spoon.reflect.factory.Factory) DefaultCoreFactory(spoon.support.DefaultCoreFactory) ParentContractTest.createCompatibleObject(spoon.test.parent.ParentContractTest.createCompatibleObject) FactoryImpl(spoon.reflect.factory.FactoryImpl) StandardEnvironment(spoon.support.StandardEnvironment) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 FactoryAccessor (spoon.processing.FactoryAccessor)1 Factory (spoon.reflect.factory.Factory)1 FactoryImpl (spoon.reflect.factory.FactoryImpl)1 DefaultCoreFactory (spoon.support.DefaultCoreFactory)1 StandardEnvironment (spoon.support.StandardEnvironment)1 ParentContractTest.createCompatibleObject (spoon.test.parent.ParentContractTest.createCompatibleObject)1