Search in sources :

Example 11 with AbstractGenericExporterFacade

use of org.jboss.tools.hibernate.runtime.common.AbstractGenericExporterFacade in project jbosstools-hibernate by jbosstools.

the class GenericExporterFacadeTest method setUp.

@Before
public void setUp() throws Exception {
    ProxyFactory proxyFactory = new ProxyFactory();
    proxyFactory.setSuperclass(GenericExporter.class);
    Class<?> proxyClass = proxyFactory.createClass();
    genericExporter = (GenericExporter) proxyClass.newInstance();
    ((ProxyObject) genericExporter).setHandler(new MethodHandler() {

        @Override
        public Object invoke(Object self, Method m, Method proceed, Object[] args) throws Throwable {
            if (methodName == null) {
                methodName = m.getName();
            }
            if (arguments == null) {
                arguments = args;
            }
            return proceed.invoke(self, args);
        }
    });
    genericExporterFacade = new AbstractGenericExporterFacade(FACADE_FACTORY, genericExporter) {
    };
    reset();
}
Also used : ProxyObject(javassist.util.proxy.ProxyObject) MethodHandler(javassist.util.proxy.MethodHandler) ProxyFactory(javassist.util.proxy.ProxyFactory) ProxyObject(javassist.util.proxy.ProxyObject) Method(java.lang.reflect.Method) AbstractGenericExporterFacade(org.jboss.tools.hibernate.runtime.common.AbstractGenericExporterFacade) Before(org.junit.Before)

Example 12 with AbstractGenericExporterFacade

use of org.jboss.tools.hibernate.runtime.common.AbstractGenericExporterFacade in project jbosstools-hibernate by jbosstools.

the class GenericExporterFacadeTest method setUp.

@Before
public void setUp() throws Exception {
    ProxyFactory proxyFactory = new ProxyFactory();
    proxyFactory.setSuperclass(GenericExporter.class);
    Class<?> proxyClass = proxyFactory.createClass();
    genericExporter = (GenericExporter) proxyClass.newInstance();
    ((ProxyObject) genericExporter).setHandler(new MethodHandler() {

        @Override
        public Object invoke(Object self, Method m, Method proceed, Object[] args) throws Throwable {
            if (methodName == null) {
                methodName = m.getName();
            }
            if (arguments == null) {
                arguments = args;
            }
            return proceed.invoke(self, args);
        }
    });
    genericExporterFacade = new AbstractGenericExporterFacade(FACADE_FACTORY, genericExporter) {
    };
    reset();
}
Also used : ProxyObject(javassist.util.proxy.ProxyObject) MethodHandler(javassist.util.proxy.MethodHandler) ProxyFactory(javassist.util.proxy.ProxyFactory) ProxyObject(javassist.util.proxy.ProxyObject) Method(java.lang.reflect.Method) AbstractGenericExporterFacade(org.jboss.tools.hibernate.runtime.common.AbstractGenericExporterFacade) Before(org.junit.Before)

Example 13 with AbstractGenericExporterFacade

use of org.jboss.tools.hibernate.runtime.common.AbstractGenericExporterFacade in project jbosstools-hibernate by jbosstools.

the class GenericExporterFacadeTest method beforeEach.

@BeforeEach
public void beforeEach() {
    genericExporter = new GenericExporter();
    genericExporterFacade = new AbstractGenericExporterFacade(FACADE_FACTORY, genericExporter) {
    };
}
Also used : GenericExporter(org.hibernate.tool.hbm2x.GenericExporter) IGenericExporter(org.jboss.tools.hibernate.runtime.spi.IGenericExporter) AbstractGenericExporterFacade(org.jboss.tools.hibernate.runtime.common.AbstractGenericExporterFacade) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 14 with AbstractGenericExporterFacade

use of org.jboss.tools.hibernate.runtime.common.AbstractGenericExporterFacade in project jbosstools-hibernate by jbosstools.

the class GenericExporterFacadeTest method beforeEach.

@BeforeEach
public void beforeEach() {
    genericExporter = new GenericExporter();
    genericExporterFacade = new AbstractGenericExporterFacade(FACADE_FACTORY, genericExporter) {
    };
}
Also used : GenericExporter(org.hibernate.tool.hbm2x.GenericExporter) IGenericExporter(org.jboss.tools.hibernate.runtime.spi.IGenericExporter) AbstractGenericExporterFacade(org.jboss.tools.hibernate.runtime.common.AbstractGenericExporterFacade) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 15 with AbstractGenericExporterFacade

use of org.jboss.tools.hibernate.runtime.common.AbstractGenericExporterFacade in project jbosstools-hibernate by jbosstools.

the class GenericExporterFacadeTest method beforeEach.

@BeforeEach
public void beforeEach() {
    genericExporter = new GenericExporter();
    genericExporterFacade = new AbstractGenericExporterFacade(FACADE_FACTORY, genericExporter) {
    };
}
Also used : GenericExporter(org.hibernate.tool.hbm2x.GenericExporter) IGenericExporter(org.jboss.tools.hibernate.runtime.spi.IGenericExporter) AbstractGenericExporterFacade(org.jboss.tools.hibernate.runtime.common.AbstractGenericExporterFacade) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

AbstractGenericExporterFacade (org.jboss.tools.hibernate.runtime.common.AbstractGenericExporterFacade)18 GenericExporter (org.hibernate.tool.hbm2x.GenericExporter)10 IGenericExporter (org.jboss.tools.hibernate.runtime.spi.IGenericExporter)10 BeforeEach (org.junit.jupiter.api.BeforeEach)10 Method (java.lang.reflect.Method)8 Before (org.junit.Before)8 MethodHandler (javassist.util.proxy.MethodHandler)6 ProxyFactory (javassist.util.proxy.ProxyFactory)6 ProxyObject (javassist.util.proxy.ProxyObject)6 Enhancer (net.sf.cglib.proxy.Enhancer)2 MethodInterceptor (net.sf.cglib.proxy.MethodInterceptor)2 MethodProxy (net.sf.cglib.proxy.MethodProxy)2