本文整理汇总了Java中javax.sql.rowset.spi.SyncFactory.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java SyncFactory.getInstance方法的具体用法?Java SyncFactory.getInstance怎么用?Java SyncFactory.getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.sql.rowset.spi.SyncFactory
的用法示例。
在下文中一共展示了SyncFactory.getInstance方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: test_getInstance_Ljava_lang_String
import javax.sql.rowset.spi.SyncFactory; //导入方法依赖的package包/类
/**
* Test method for
* {@link javax.sql.rowset.spi.SyncFactory#getInstance(java.lang.String)}.
*
* @throws SyncFactoryException
*/
public void test_getInstance_Ljava_lang_String()
throws SyncFactoryException {
Enumeration<SyncProvider> providers = SyncFactory
.getRegisteredProviders();
SyncProvider expected = providers.nextElement();
String id = expected.getProviderID();
SyncProvider provider = SyncFactory.getInstance(id);
assertEquals("getInstance error", expected.getVersion(), provider
.getVersion());
provider = SyncFactory.getInstance("nonExist");// should return default
assertNotNull(provider);
try {
provider = SyncFactory.getInstance(null);
fail("should throw NullPointerException");
} catch (NullPointerException e) {
// expected
}
}
示例2: test02
import javax.sql.rowset.spi.SyncFactory; //导入方法依赖的package包/类
@Test
public void test02() throws SyncFactoryException {
SyncProvider p = SyncFactory.getInstance("");
assertTrue(p instanceof RIOptimisticProvider);
// Attempt to get an invalid provider and get the default provider
p = SyncFactory.getInstance("util.InvalidSyncProvider");
assertTrue(p instanceof RIOptimisticProvider);
}
示例3: testGetRegisteredProviders
import javax.sql.rowset.spi.SyncFactory; //导入方法依赖的package包/类
/**
* Test for SyncFactory.getRegisteredProviders(). Regression for
* HARMONY-6345.
*
* @throws SyncFactoryException
*/
public void testGetRegisteredProviders() throws SyncFactoryException {
Enumeration<SyncProvider> providers = SyncFactory
.getRegisteredProviders();
while (providers.hasMoreElements()) {
SyncFactory.getInstance(providers.nextElement().getProviderID());
}
}
示例4: test00
import javax.sql.rowset.spi.SyncFactory; //导入方法依赖的package包/类
@Test
public void test00() throws SyncFactoryException {
SyncProvider p = SyncFactory.getInstance(propertyStubProvider);
assertTrue(p instanceof PropertyStubProvider);
}
示例5: test01
import javax.sql.rowset.spi.SyncFactory; //导入方法依赖的package包/类
@Test
public void test01() throws SyncFactoryException {
SyncFactory.registerProvider(stubProvider);
SyncProvider p = SyncFactory.getInstance(stubProvider);
assertTrue(p instanceof StubSyncProvider);
}
示例6: test03
import javax.sql.rowset.spi.SyncFactory; //导入方法依赖的package包/类
@Test(expectedExceptions = SyncFactoryException.class)
public void test03() throws SyncFactoryException {
SyncProvider p = SyncFactory.getInstance(null);
}
示例7: CachedRowSetImpl
import javax.sql.rowset.spi.SyncFactory; //导入方法依赖的package包/类
public CachedRowSetImpl(String providerID) throws SyncFactoryException {
syncProvider = SyncFactory.getInstance(providerID);
initialProperties();
}
示例8: setSyncProvider
import javax.sql.rowset.spi.SyncFactory; //导入方法依赖的package包/类
public void setSyncProvider(String provider) throws SQLException {
syncProvider = SyncFactory.getInstance(provider);
}