当前位置: 首页>>代码示例>>Java>>正文


Java VDBMetaData.addProperty方法代码示例

本文整理汇总了Java中org.teiid.adminapi.impl.VDBMetaData.addProperty方法的典型用法代码示例。如果您正苦于以下问题:Java VDBMetaData.addProperty方法的具体用法?Java VDBMetaData.addProperty怎么用?Java VDBMetaData.addProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.teiid.adminapi.impl.VDBMetaData的用法示例。


在下文中一共展示了VDBMetaData.addProperty方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testVDBConnectionProperty

import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
@Test public void testVDBConnectionProperty() throws Exception {
	VDBMetaData vdb = new VDBMetaData();
	vdb.setName("x");
	vdb.addProperty("connection.foo", "bar");
	ModelMetaData mmd = new ModelMetaData();
	mmd.setName("x");
	mmd.setSchemaSourceType("ddl");
	mmd.setModelType(Type.VIRTUAL);
	mmd.setSchemaText("create view v as select 1");
	vdb.addModel(mmd);
	odbcServer.server.deployVDB(vdb);
	this.conn.close();
	connect("x");
	Statement s = conn.createStatement();
	assertTrue(s.execute("show foo"));
	ResultSet rs = s.getResultSet();
	assertTrue(rs.next());
	String value = rs.getString(1);
	assertEquals("bar", value);
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:21,代码来源:TestODBCSocketTransport.java

示例2: testSecurityDomain

import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
@Test public void testSecurityDomain() throws Exception {
	VDBRepository repo = Mockito.mock(VDBRepository.class);
	VDBMetaData vdb = new VDBMetaData();
	vdb.setName("name");
	vdb.setVersion(1);
	vdb.setStatus(Status.ACTIVE);
	vdb.addProperty(SessionServiceImpl.SECURITY_DOMAIN_PROPERTY, "domain");
	
	Mockito.stub(repo.getLiveVDB("name", 1)).toReturn(vdb);
	
	ssi.setVDBRepository(repo);
	
	Properties properties = new Properties();
	properties.setProperty(TeiidURL.JDBC.VDB_NAME, "name.1");
	SessionMetadata s = ssi.createSession("name", "1", AuthenticationType.USERPASSWORD, "x", new Credentials(new char[] {'y'}), "z", properties);
	assertEquals("domain", s.getSecurityDomain());
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:18,代码来源:TestSessionServiceImpl.java

示例3: testImportVisibility

import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
@Test public void testImportVisibility() throws Exception {
	VDBRepository repo = new VDBRepository();
	repo.setSystemStore(RealMetadataFactory.example1Cached().getMetadataStore());
	repo.setSystemFunctionManager(RealMetadataFactory.SFM);
	MetadataStore metadataStore = RealMetadataFactory.exampleBQTCached().getMetadataStore();
	VDBMetaData vdb = createVDBMetadata(metadataStore, "bqt");
	repo.addVDB(vdb, metadataStore, null, null, new ConnectorManagerRepository(), false);
	
	vdb = createVDBMetadata(RealMetadataFactory.exampleBusObjStore(), "example1");
	vdb.addProperty("BQT1.visible", "false");
	VDBImportMetadata vdbImport = new VDBImportMetadata();
	vdbImport.setName("bqt");
	vdb.getVDBImports().add(vdbImport);
	
	repo.addVDB(vdb, metadataStore, null, null, new ConnectorManagerRepository(), false);
	
	assertTrue(vdb.isVisible("BQT1"));
	
	vdb = repo.getLiveVDB("example1");
	
	assertFalse(vdb.isVisible("BQT1"));
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:23,代码来源:TestCompositeVDB.java

示例4: addVdb

import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
private VDBMetaData addVdb(VDBRepository repo, String name, String sc, String authenticationType) {
	VDBMetaData vdb = new VDBMetaData();
	vdb.setName(name);
	vdb.setVersion(1);
	vdb.setStatus(Status.ACTIVE);
	Mockito.stub(repo.getLiveVDB(name, 1)).toReturn(vdb);
	vdb.addProperty(SessionServiceImpl.SECURITY_DOMAIN_PROPERTY, sc);
	vdb.addProperty(SessionServiceImpl.AUTHENTICATION_TYPE_PROPERTY, authenticationType);
	return vdb;
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:11,代码来源:TestLogonImpl.java

示例5: testLogonAuthenticationType

import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
@Test
public void testLogonAuthenticationType() throws Exception {
	VDBRepository repo = Mockito.mock(VDBRepository.class);
	VDBMetaData vdb = new VDBMetaData();
	vdb.addProperty(SessionServiceImpl.GSS_PATTERN_PROPERTY, "GSS");
	vdb.setName("name");
	vdb.setVersion(1);
	vdb.setStatus(Status.ACTIVE);
	Mockito.stub(repo.getLiveVDB("name", 1)).toReturn(vdb);
	
	ssi.setVDBRepository(repo);
	ssi.setSecurityDomain("SC");
	
	// default transport - what Teiid has before TEIID-2863
	ssi.setAuthenticationType(AuthenticationType.USERPASSWORD); // this is transport default		
	DQPWorkContext.setWorkContext(new DQPWorkContext());
	Properties p = buildProperties("fred", "name");		
	LogonImpl impl = new LogonImpl(ssi, "fakeCluster"); //$NON-NLS-1$
	LogonResult result = impl.logon(p);
	assertEquals("[email protected]", result.getUserName());
	
	// if no preference then choose USERPASSWORD
	ssi.setAuthenticationType(AuthenticationType.USERPASSWORD); // this is transport default		
	DQPWorkContext.setWorkContext(new DQPWorkContext());
	p = buildProperties("fred", "name");		
	impl = new LogonImpl(ssi, "fakeCluster"); //$NON-NLS-1$
	result = impl.logon(p);
	assertEquals("[email protected]", result.getUserName());

	// if user name is set to "GSS", then the preference is set to "GSS"
	ssi.setAuthenticationType(AuthenticationType.USERPASSWORD); // this is transport default		
	DQPWorkContext.setWorkContext(new DQPWorkContext());
	p = buildProperties("GSS", "name");		
	FakeGssLogonImpl fimpl = new FakeGssLogonImpl(ssi, "fakeCluster"); //$NON-NLS-1$
	fimpl.addToken("bytes".getBytes(), "SecurityContext");
	p.put(ILogon.KRB5TOKEN, "bytes".getBytes());
	result = fimpl.logon(p);
	assertEquals("[email protected]", result.getUserName());
	
	// if the transport default defined as GSS, then preference is USERPASSWORD, throw exception
	ssi.setAuthenticationType(AuthenticationType.GSS); 		
	try {
		DQPWorkContext.setWorkContext(new DQPWorkContext());
		p = buildProperties("fred", "name");		
		impl = new LogonImpl(ssi, "fakeCluster"); //$NON-NLS-1$
		result = impl.logon(p);
		fail("should have failed due server does not support USERPASSWORD");
	} catch(LogonException e) {
		// pass
	}
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:52,代码来源:TestLogonImpl.java


注:本文中的org.teiid.adminapi.impl.VDBMetaData.addProperty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。