本文整理汇总了Java中javax.sql.rowset.spi.SyncProvider类的典型用法代码示例。如果您正苦于以下问题:Java SyncProvider类的具体用法?Java SyncProvider怎么用?Java SyncProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SyncProvider类属于javax.sql.rowset.spi包,在下文中一共展示了SyncProvider类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: test_getInstance_Ljava_lang_String
import javax.sql.rowset.spi.SyncProvider; //导入依赖的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.SyncProvider; //导入依赖的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: validateProviders
import javax.sql.rowset.spi.SyncProvider; //导入依赖的package包/类
private void validateProviders(List<String> expectedProviders)
throws SyncFactoryException {
List<String> results = new ArrayList<>();
Enumeration<SyncProvider> providers = SyncFactory.getRegisteredProviders();
while (providers.hasMoreElements()) {
SyncProvider p = providers.nextElement();
results.add(p.getProviderID());
}
assertTrue(expectedProviders.containsAll(results)
&& results.size() == expectedProviders.size());
}
示例4: commonCachedRowSetTest0003
import javax.sql.rowset.spi.SyncProvider; //导入依赖的package包/类
@Test(dataProvider = "rowSetType")
public void commonCachedRowSetTest0003(CachedRowSet rs) throws SQLException {
// Register a provider and make sure it is avaiable
SyncFactory.registerProvider(stubProvider);
rs.setSyncProvider(stubProvider);
SyncProvider sp = rs.getSyncProvider();
assertTrue(sp instanceof StubSyncProvider);
SyncFactory.unregisterProvider(stubProvider);
rs.close();
}
示例5: testGetRegisteredProviders
import javax.sql.rowset.spi.SyncProvider; //导入依赖的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());
}
}
示例6: getSyncProvider
import javax.sql.rowset.spi.SyncProvider; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public SyncProvider getSyncProvider() throws SQLException {
return crsInternal.getSyncProvider();
}
示例7: getSyncProvider
import javax.sql.rowset.spi.SyncProvider; //导入依赖的package包/类
@Override
public SyncProvider getSyncProvider() throws SQLException {
throw new UnsupportedOperationException("Not supported yet.");
}
示例8: test00
import javax.sql.rowset.spi.SyncProvider; //导入依赖的package包/类
@Test
public void test00() throws SyncFactoryException {
SyncProvider p = SyncFactory.getInstance(propertyStubProvider);
assertTrue(p instanceof PropertyStubProvider);
}
示例9: test01
import javax.sql.rowset.spi.SyncProvider; //导入依赖的package包/类
@Test
public void test01() throws SyncFactoryException {
SyncFactory.registerProvider(stubProvider);
SyncProvider p = SyncFactory.getInstance(stubProvider);
assertTrue(p instanceof StubSyncProvider);
}
示例10: test03
import javax.sql.rowset.spi.SyncProvider; //导入依赖的package包/类
@Test(expectedExceptions = SyncFactoryException.class)
public void test03() throws SyncFactoryException {
SyncProvider p = SyncFactory.getInstance(null);
}
示例11: showImpl
import javax.sql.rowset.spi.SyncProvider; //导入依赖的package包/类
private void showImpl(SyncProvider impl) {
System.out.println("Provider implementation:"
+ "\nVendor: " + impl.getVendor()
+ "\nVersion: " + impl.getVersion()
+ "\nProviderID: " + impl.getProviderID());
}
示例12: commonCachedRowSetTest0002
import javax.sql.rowset.spi.SyncProvider; //导入依赖的package包/类
@Test(dataProvider = "rowSetType")
public void commonCachedRowSetTest0002(CachedRowSet rs) throws SQLException {
SyncProvider sp = rs.getSyncProvider();
assertTrue(sp instanceof com.sun.rowset.providers.RIOptimisticProvider);
rs.close();
}