Search in sources :

Example 6 with HQLCodeAssist

use of org.hibernate.tool.ide.completion.HQLCodeAssist in project jbosstools-hibernate by jbosstools.

the class FacadeFactoryTest method testCreateHQLCodeAssist.

@Test
public void testCreateHQLCodeAssist() {
    StandardServiceRegistryBuilder ssrb = new StandardServiceRegistryBuilder();
    ssrb.applySetting(AvailableSettings.DIALECT, TestDialect.class.getName());
    HQLCodeAssist hqlCodeAssist = new HQLCodeAssist(new MetadataSources().buildMetadata(ssrb.build()));
    IHQLCodeAssist facade = facadeFactory.createHQLCodeAssist(hqlCodeAssist);
    assertSame(hqlCodeAssist, ((IFacade) facade).getTarget());
}
Also used : HQLCodeAssist(org.hibernate.tool.ide.completion.HQLCodeAssist) IHQLCodeAssist(org.jboss.tools.hibernate.runtime.spi.IHQLCodeAssist) StandardServiceRegistryBuilder(org.hibernate.boot.registry.StandardServiceRegistryBuilder) IHQLCodeAssist(org.jboss.tools.hibernate.runtime.spi.IHQLCodeAssist) MetadataSources(org.hibernate.boot.MetadataSources) Test(org.junit.jupiter.api.Test)

Example 7 with HQLCodeAssist

use of org.hibernate.tool.ide.completion.HQLCodeAssist in project jbosstools-hibernate by jbosstools.

the class FacadeFactoryTest method testCreateHQLCodeAssist.

@Test
public void testCreateHQLCodeAssist() {
    StandardServiceRegistryBuilder ssrb = new StandardServiceRegistryBuilder();
    ssrb.applySetting(AvailableSettings.DIALECT, MockDialect.class.getName());
    ssrb.applySetting(AvailableSettings.CONNECTION_PROVIDER, MockConnectionProvider.class.getName());
    HQLCodeAssist hqlCodeAssist = new HQLCodeAssist(new MetadataSources().buildMetadata(ssrb.build()));
    IHQLCodeAssist facade = facadeFactory.createHQLCodeAssist(hqlCodeAssist);
    assertSame(hqlCodeAssist, ((IFacade) facade).getTarget());
}
Also used : MockConnectionProvider(org.jboss.tools.hibernate.runtime.v_5_6.internal.util.MockConnectionProvider) HQLCodeAssist(org.hibernate.tool.ide.completion.HQLCodeAssist) IHQLCodeAssist(org.jboss.tools.hibernate.runtime.spi.IHQLCodeAssist) StandardServiceRegistryBuilder(org.hibernate.boot.registry.StandardServiceRegistryBuilder) IHQLCodeAssist(org.jboss.tools.hibernate.runtime.spi.IHQLCodeAssist) MockDialect(org.jboss.tools.hibernate.runtime.v_5_6.internal.util.MockDialect) MetadataSources(org.hibernate.boot.MetadataSources) Test(org.junit.jupiter.api.Test)

Example 8 with HQLCodeAssist

use of org.hibernate.tool.ide.completion.HQLCodeAssist in project jbosstools-hibernate by jbosstools.

the class FacadeFactoryTest method testCreateHQLCodeAssist.

@Test
public void testCreateHQLCodeAssist() {
    StandardServiceRegistryBuilder ssrb = new StandardServiceRegistryBuilder();
    ssrb.applySetting(AvailableSettings.DIALECT, MockDialect.class.getName());
    HQLCodeAssist hqlCodeAssist = new HQLCodeAssist(new MetadataSources().buildMetadata(ssrb.build()));
    IHQLCodeAssist facade = facadeFactory.createHQLCodeAssist(hqlCodeAssist);
    assertSame(hqlCodeAssist, ((IFacade) facade).getTarget());
}
Also used : HQLCodeAssist(org.hibernate.tool.ide.completion.HQLCodeAssist) IHQLCodeAssist(org.jboss.tools.hibernate.runtime.spi.IHQLCodeAssist) StandardServiceRegistryBuilder(org.hibernate.boot.registry.StandardServiceRegistryBuilder) IHQLCodeAssist(org.jboss.tools.hibernate.runtime.spi.IHQLCodeAssist) MockDialect(org.jboss.tools.hibernate.runtime.v_5_3.internal.util.MockDialect) MetadataSources(org.hibernate.boot.MetadataSources) Test(org.junit.jupiter.api.Test)

Example 9 with HQLCodeAssist

use of org.hibernate.tool.ide.completion.HQLCodeAssist in project jbosstools-hibernate by jbosstools.

the class FacadeFactoryTest method testCreateHQLCodeAssist.

@Test
public void testCreateHQLCodeAssist() {
    HQLCodeAssist hqlCodeAssist = new HQLCodeAssist(null);
    IHQLCodeAssist facade = facadeFactory.createHQLCodeAssist(hqlCodeAssist);
    Assert.assertSame(hqlCodeAssist, ((IFacade) facade).getTarget());
}
Also used : HQLCodeAssist(org.hibernate.tool.ide.completion.HQLCodeAssist) IHQLCodeAssist(org.jboss.tools.hibernate.runtime.spi.IHQLCodeAssist) IHQLCodeAssist(org.jboss.tools.hibernate.runtime.spi.IHQLCodeAssist) Test(org.junit.Test)

Example 10 with HQLCodeAssist

use of org.hibernate.tool.ide.completion.HQLCodeAssist in project jbosstools-hibernate by jbosstools.

the class FacadeFactoryTest method testCreateHQLCodeAssist.

@Test
public void testCreateHQLCodeAssist() {
    Configuration configuration = new Configuration();
    configuration.setProperty(AvailableSettings.DIALECT, TestDialect.class.getName());
    HQLCodeAssist hqlCodeAssist = new HQLCodeAssist(configuration);
    IHQLCodeAssist facade = facadeFactory.createHQLCodeAssist(hqlCodeAssist);
    assertSame(hqlCodeAssist, ((IFacade) facade).getTarget());
}
Also used : HQLCodeAssist(org.hibernate.tool.ide.completion.HQLCodeAssist) IHQLCodeAssist(org.jboss.tools.hibernate.runtime.spi.IHQLCodeAssist) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) Configuration(org.hibernate.cfg.Configuration) IHQLCodeAssist(org.jboss.tools.hibernate.runtime.spi.IHQLCodeAssist) Test(org.junit.jupiter.api.Test)

Aggregations

HQLCodeAssist (org.hibernate.tool.ide.completion.HQLCodeAssist)12 IHQLCodeAssist (org.jboss.tools.hibernate.runtime.spi.IHQLCodeAssist)12 Test (org.junit.jupiter.api.Test)11 MetadataSources (org.hibernate.boot.MetadataSources)6 StandardServiceRegistryBuilder (org.hibernate.boot.registry.StandardServiceRegistryBuilder)6 Configuration (org.hibernate.cfg.Configuration)4 IConfiguration (org.jboss.tools.hibernate.runtime.spi.IConfiguration)4 MockDialect (org.jboss.tools.hibernate.runtime.v_5_3.internal.util.MockDialect)1 MockConnectionProvider (org.jboss.tools.hibernate.runtime.v_5_4.internal.util.MockConnectionProvider)1 MockDialect (org.jboss.tools.hibernate.runtime.v_5_4.internal.util.MockDialect)1 MockConnectionProvider (org.jboss.tools.hibernate.runtime.v_5_5.internal.util.MockConnectionProvider)1 MockDialect (org.jboss.tools.hibernate.runtime.v_5_5.internal.util.MockDialect)1 MockConnectionProvider (org.jboss.tools.hibernate.runtime.v_5_6.internal.util.MockConnectionProvider)1 MockDialect (org.jboss.tools.hibernate.runtime.v_5_6.internal.util.MockDialect)1 Test (org.junit.Test)1