Search in sources :

Example 1 with AbstractHbm2DDLExporterFacade

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

the class Hbm2DDLExporterFacadeTest method setUp.

@Before
public void setUp() throws Exception {
    ProxyFactory proxyFactory = new ProxyFactory();
    proxyFactory.setSuperclass(Hbm2DDLExporter.class);
    Class<?> proxyClass = proxyFactory.createClass();
    hbm2ddlExporter = (Hbm2DDLExporter) proxyClass.newInstance();
    ((ProxyObject) hbm2ddlExporter).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);
        }
    });
    hbm2DDLExporterFacade = new AbstractHbm2DDLExporterFacade(FACADE_FACTORY, hbm2ddlExporter) {
    };
    reset();
}
Also used : ProxyObject(javassist.util.proxy.ProxyObject) AbstractHbm2DDLExporterFacade(org.jboss.tools.hibernate.runtime.common.AbstractHbm2DDLExporterFacade) MethodHandler(javassist.util.proxy.MethodHandler) ProxyFactory(javassist.util.proxy.ProxyFactory) ProxyObject(javassist.util.proxy.ProxyObject) Method(java.lang.reflect.Method) Before(org.junit.Before)

Example 2 with AbstractHbm2DDLExporterFacade

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

the class Hbm2DDLExporterFacadeTest method setUp.

@Before
public void setUp() throws Exception {
    ProxyFactory proxyFactory = new ProxyFactory();
    proxyFactory.setSuperclass(Hbm2DDLExporter.class);
    Class<?> proxyClass = proxyFactory.createClass();
    hbm2ddlExporter = (Hbm2DDLExporter) proxyClass.newInstance();
    ((ProxyObject) hbm2ddlExporter).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);
        }
    });
    hbm2DDLExporterFacade = new AbstractHbm2DDLExporterFacade(FACADE_FACTORY, hbm2ddlExporter) {
    };
    reset();
}
Also used : ProxyObject(javassist.util.proxy.ProxyObject) AbstractHbm2DDLExporterFacade(org.jboss.tools.hibernate.runtime.common.AbstractHbm2DDLExporterFacade) MethodHandler(javassist.util.proxy.MethodHandler) ProxyFactory(javassist.util.proxy.ProxyFactory) ProxyObject(javassist.util.proxy.ProxyObject) Method(java.lang.reflect.Method) Before(org.junit.Before)

Example 3 with AbstractHbm2DDLExporterFacade

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

the class Hbm2DDLExporterFacadeTest method before.

@BeforeEach
public void before() {
    ddlExporterTarget = new Hbm2DDLExporter();
    ddlExporterFacade = new AbstractHbm2DDLExporterFacade(FACADE_FACTORY, ddlExporterTarget) {
    };
}
Also used : AbstractHbm2DDLExporterFacade(org.jboss.tools.hibernate.runtime.common.AbstractHbm2DDLExporterFacade) IHbm2DDLExporter(org.jboss.tools.hibernate.runtime.spi.IHbm2DDLExporter) Hbm2DDLExporter(org.hibernate.tool.hbm2x.Hbm2DDLExporter) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 4 with AbstractHbm2DDLExporterFacade

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

the class Hbm2DDLExporterFacadeTest method before.

@BeforeEach
public void before() {
    ddlExporterTarget = new Hbm2DDLExporter();
    ddlExporterFacade = new AbstractHbm2DDLExporterFacade(FACADE_FACTORY, ddlExporterTarget) {
    };
}
Also used : AbstractHbm2DDLExporterFacade(org.jboss.tools.hibernate.runtime.common.AbstractHbm2DDLExporterFacade) IHbm2DDLExporter(org.jboss.tools.hibernate.runtime.spi.IHbm2DDLExporter) Hbm2DDLExporter(org.hibernate.tool.hbm2x.Hbm2DDLExporter) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 5 with AbstractHbm2DDLExporterFacade

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

the class Hbm2DDLExporterFacadeTest method before.

@BeforeEach
public void before() {
    ddlExporterTarget = new Hbm2DDLExporter();
    ddlExporterFacade = new AbstractHbm2DDLExporterFacade(FACADE_FACTORY, ddlExporterTarget) {
    };
}
Also used : AbstractHbm2DDLExporterFacade(org.jboss.tools.hibernate.runtime.common.AbstractHbm2DDLExporterFacade) IHbm2DDLExporter(org.jboss.tools.hibernate.runtime.spi.IHbm2DDLExporter) Hbm2DDLExporter(org.hibernate.tool.hbm2x.Hbm2DDLExporter) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

AbstractHbm2DDLExporterFacade (org.jboss.tools.hibernate.runtime.common.AbstractHbm2DDLExporterFacade)17 Hbm2DDLExporter (org.hibernate.tool.hbm2x.Hbm2DDLExporter)9 IHbm2DDLExporter (org.jboss.tools.hibernate.runtime.spi.IHbm2DDLExporter)9 BeforeEach (org.junit.jupiter.api.BeforeEach)9 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