Search in sources :

Example 1 with VDBRepository

use of org.teiid.deployers.VDBRepository in project teiid by teiid.

the class TestSessionServiceImpl method testActiveVDBNameWithVersion.

@Test
public void testActiveVDBNameWithVersion() throws Exception {
    VDBRepository repo = Mockito.mock(VDBRepository.class);
    VDBMetaData vdb = new VDBMetaData();
    vdb.setName("name");
    vdb.setVersion(1);
    vdb.setStatus(Status.ACTIVE);
    Mockito.stub(repo.getLiveVDB("name", "1")).toReturn(vdb);
    ssi.setVDBRepository(repo);
    ssi.getActiveVDB("name", "1");
    Mockito.verify(repo, Mockito.times(1)).getLiveVDB("name", "1");
}
Also used : VDBMetaData(org.teiid.adminapi.impl.VDBMetaData) VDBRepository(org.teiid.deployers.VDBRepository) Test(org.junit.Test)

Example 2 with VDBRepository

use of org.teiid.deployers.VDBRepository in project teiid by teiid.

the class TestSessionServiceImpl method testActiveVDBWithNoVersion.

@Test
public void testActiveVDBWithNoVersion() throws Exception {
    VDBRepository repo = Mockito.mock(VDBRepository.class);
    VDBMetaData vdb = new VDBMetaData();
    vdb.setName("name");
    vdb.setVersion(1);
    vdb.setStatus(Status.ACTIVE);
    Mockito.stub(repo.getLiveVDB("name")).toReturn(vdb);
    ssi.setVDBRepository(repo);
    ssi.getActiveVDB("name", null);
    Mockito.verify(repo, Mockito.times(1)).getLiveVDB("name");
}
Also used : VDBMetaData(org.teiid.adminapi.impl.VDBMetaData) VDBRepository(org.teiid.deployers.VDBRepository) Test(org.junit.Test)

Example 3 with VDBRepository

use of org.teiid.deployers.VDBRepository in project teiid by teiid.

the class TestSessionServiceImpl method testActiveVDBNameWithVersionNonInteger.

@Test
public void testActiveVDBNameWithVersionNonInteger() throws Exception {
    VDBRepository repo = Mockito.mock(VDBRepository.class);
    VDBMetaData vdb = new VDBMetaData();
    vdb.setName("name");
    vdb.setVersion(1);
    vdb.setStatus(Status.ACTIVE);
    Mockito.stub(repo.getLiveVDB("name", 1)).toReturn(vdb);
    ssi.setVDBRepository(repo);
    assertNull(ssi.getActiveVDB("name.x", null));
}
Also used : VDBMetaData(org.teiid.adminapi.impl.VDBMetaData) VDBRepository(org.teiid.deployers.VDBRepository) Test(org.junit.Test)

Example 4 with VDBRepository

use of org.teiid.deployers.VDBRepository in project teiid by teiid.

the class TransportService method waitForFinished.

@Override
public void waitForFinished(VDBKey vdbKey, int timeOutMillis) throws ConnectionException {
    VDBRepository repo = this.vdbRepositoryInjector.getValue();
    repo.waitForFinished(vdbKey, timeOutMillis);
}
Also used : VDBRepository(org.teiid.deployers.VDBRepository)

Example 5 with VDBRepository

use of org.teiid.deployers.VDBRepository in project teiid by teiid.

the class TestMatViewAliasing method setUp.

@Before
public void setUp() throws Exception {
    server = new FakeServer(true);
    VDBRepository vdbRepository = new VDBRepository();
    MetadataFactory mf = new MetadataFactory(null, 1, "foo", vdbRepository.getRuntimeTypeMap(), new Properties(), null);
    mf.getSchema().setPhysical(false);
    Table mat = mf.addTable("mat");
    mat.setVirtual(true);
    mat.setMaterialized(true);
    mat.setSelectTransformation("/*+ cache(ttl:0) */ select 1 as x, 'y' as Name");
    mf.addColumn("x", DataTypeManager.DefaultDataTypes.INTEGER, mat);
    mf.addColumn("Name", DataTypeManager.DefaultDataTypes.STRING, mat);
    MetadataStore ms = mf.asMetadataStore();
    server.deployVDB(MATVIEWS, ms);
    conn = server.createConnection("jdbc:teiid:" + MATVIEWS);
}
Also used : MetadataStore(org.teiid.metadata.MetadataStore) Table(org.teiid.metadata.Table) MetadataFactory(org.teiid.metadata.MetadataFactory) FakeServer(org.teiid.jdbc.FakeServer) VDBRepository(org.teiid.deployers.VDBRepository) Properties(java.util.Properties) Before(org.junit.Before)

Aggregations

VDBRepository (org.teiid.deployers.VDBRepository)15 VDBMetaData (org.teiid.adminapi.impl.VDBMetaData)12 Test (org.junit.Test)11 Properties (java.util.Properties)5 Subject (javax.security.auth.Subject)2 OperationFailedException (org.jboss.as.controller.OperationFailedException)2 SessionMetadata (org.teiid.adminapi.impl.SessionMetadata)2 LogonResult (org.teiid.client.security.LogonResult)2 DQPWorkContext (org.teiid.dqp.internal.process.DQPWorkContext)2 Credentials (org.teiid.security.Credentials)2 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)1 Environment (org.jboss.as.controller.access.Environment)1 ContextNames (org.jboss.as.naming.deployment.ContextNames)1 BinderService (org.jboss.as.naming.service.BinderService)1 AbstractDeploymentChainStep (org.jboss.as.server.AbstractDeploymentChainStep)1 DeploymentProcessorTarget (org.jboss.as.server.DeploymentProcessorTarget)1 ServiceName (org.jboss.msc.service.ServiceName)1 ServiceTarget (org.jboss.msc.service.ServiceTarget)1 ValueService (org.jboss.msc.service.ValueService)1 Before (org.junit.Before)1