Search in sources :

Example 21 with IHQLCodeAssist

use of org.jboss.tools.hibernate.runtime.spi.IHQLCodeAssist 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_5.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_5.internal.util.MockDialect) MetadataSources(org.hibernate.boot.MetadataSources) Test(org.junit.jupiter.api.Test)

Example 22 with IHQLCodeAssist

use of org.jboss.tools.hibernate.runtime.spi.IHQLCodeAssist in project jbosstools-hibernate by jbosstools.

the class ServiceImplTest method testNewHQLCodeAssist.

@Test
public void testNewHQLCodeAssist() {
    IConfiguration configuration = service.newDefaultConfiguration();
    configuration.setProperty(AvailableSettings.DIALECT, TestDialect.class.getName());
    IHQLCodeAssist hqlCodeAssist = service.newHQLCodeAssist(configuration);
    assertNotNull(hqlCodeAssist);
}
Also used : IHQLCodeAssist(org.jboss.tools.hibernate.runtime.spi.IHQLCodeAssist) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) Test(org.junit.jupiter.api.Test)

Example 23 with IHQLCodeAssist

use of org.jboss.tools.hibernate.runtime.spi.IHQLCodeAssist 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 24 with IHQLCodeAssist

use of org.jboss.tools.hibernate.runtime.spi.IHQLCodeAssist in project jbosstools-hibernate by jbosstools.

the class ServiceImplTest method testNewHQLCodeAssist.

@Test
public void testNewHQLCodeAssist() {
    IConfiguration configuration = service.newDefaultConfiguration();
    configuration.setProperty(AvailableSettings.DIALECT, TestDialect.class.getName());
    IHQLCodeAssist hqlCodeAssist = service.newHQLCodeAssist(configuration);
    assertNotNull(hqlCodeAssist);
}
Also used : IHQLCodeAssist(org.jboss.tools.hibernate.runtime.spi.IHQLCodeAssist) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) Test(org.junit.jupiter.api.Test)

Aggregations

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