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");
}
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");
}
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));
}
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);
}
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);
}
Aggregations