本文整理汇总了Java中javax.sql.rowset.spi.SyncFactory类的典型用法代码示例。如果您正苦于以下问题:Java SyncFactory类的具体用法?Java SyncFactory怎么用?Java SyncFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SyncFactory类属于javax.sql.rowset.spi包,在下文中一共展示了SyncFactory类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: test07
import javax.sql.rowset.spi.SyncFactory; //导入依赖的package包/类
@Test
public void test07() throws SyncFactoryException {
// Validate that only the default providers and any specified via
// a System property are available
validateProviders(initialProviders);
// Register a provider and make sure it is avaiable
SyncFactory.registerProvider(stubProvider);
validateProviders(allProviders);
// Check that if a provider is unregistered, it does not show as
// registered
SyncFactory.unregisterProvider(stubProvider);
validateProviders(initialProviders);
}
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:17,代码来源:SyncFactoryTests.java
示例2: 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
}
}
开发者ID:shannah,项目名称:cn1,代码行数:25,代码来源:SyncFactoryTest.java
示例3: test_setLogger_Ljava_util_logging_LoggerLjava_util_logging_Level
import javax.sql.rowset.spi.SyncFactory; //导入依赖的package包/类
/**
* Test method for
* {@link javax.sql.rowset.spi.SyncFactory#setLogger(java.util.logging.Logger, java.util.logging.Level)}
*
* @throws SyncFactoryException
*/
public void test_setLogger_Ljava_util_logging_LoggerLjava_util_logging_Level()
throws SyncFactoryException {
Logger logger = Logger.getAnonymousLogger();
Level level = Level.parse("WARNING");
SyncFactory.setLogger(logger, level);
Logger actual = SyncFactory.getLogger();
assertEquals("set logger or get logger error", logger, actual);
assertEquals("set logger error in set level", level, logger.getLevel());
try {
SyncFactory.setLogger(null, level);
fail("should throw NullPointerException");
} catch (NullPointerException e) {
// expected
}
SyncFactory.setLogger(logger, null);
assertNull(SyncFactory.getLogger().getLevel());
}
开发者ID:shannah,项目名称:cn1,代码行数:24,代码来源:SyncFactoryTest.java
示例4: 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);
}
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:9,代码来源:SyncFactoryTests.java
示例5: validateProviders
import javax.sql.rowset.spi.SyncFactory; //导入依赖的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());
}
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:13,代码来源:SyncFactoryTests.java
示例6: commonCachedRowSetTest0003
import javax.sql.rowset.spi.SyncFactory; //导入依赖的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();
}
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:12,代码来源:CommonCachedRowSetTests.java
示例7: test_setLogger_Ljava_util_logging_Logger
import javax.sql.rowset.spi.SyncFactory; //导入依赖的package包/类
/**
* Test method for
* {@link javax.sql.rowset.spi.SyncFactory#setLogger(java.util.logging.Logger)}
* {@link javax.sql.rowset.spi.SyncFactory#getLogger()} .
*
* @throws SyncFactoryException
*/
public void test_setLogger_Ljava_util_logging_Logger()
throws SyncFactoryException {
Logger logger = Logger.getAnonymousLogger();
SyncFactory.setLogger(logger);
assertEquals(logger, SyncFactory.getLogger());
SyncFactory.setLogger(null);
try {
SyncFactory.getLogger();
fail("should throw SyncFactoryException");
} catch (SyncFactoryException e) {
// expected
}
}
开发者ID:shannah,项目名称:cn1,代码行数:21,代码来源:SyncFactoryTest.java
示例8: test_setJNDIContext_Ljavax_naming_Context
import javax.sql.rowset.spi.SyncFactory; //导入依赖的package包/类
/**
* Test method for
* {@link javax.sql.rowset.spi.SyncFactory#setJNDIContext(javax.naming.Context)}
*
* @throws NamingException
* @throws SyncFactoryException
*/
public void test_setJNDIContext_Ljavax_naming_Context()
throws NamingException, SyncFactoryException {
try {
SyncFactory.setJNDIContext(null);
fail("Should throw SyncFactoryException");
} catch (SyncFactoryException e) {
// expected
}
SyncFactory.setJNDIContext(new InitialContext());
}
开发者ID:shannah,项目名称:cn1,代码行数:18,代码来源:SyncFactoryTest.java
示例9: 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());
}
}
开发者ID:shannah,项目名称:cn1,代码行数:14,代码来源:SyncFactoryTest.java
示例10: setUpMethod
import javax.sql.rowset.spi.SyncFactory; //导入依赖的package包/类
@BeforeMethod
public void setUpMethod() throws Exception {
// Make sure the provider provider that is registered is removed
// before each run
SyncFactory.unregisterProvider(stubProvider);
}
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:7,代码来源:SyncFactoryTests.java
示例11: test
import javax.sql.rowset.spi.SyncFactory; //导入依赖的package包/类
@Test
public void test() throws SyncFactoryException {
SyncFactory syncFactory = SyncFactory.getSyncFactory();
assertTrue(syncFactory != null);
}
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:6,代码来源:SyncFactoryTests.java
示例12: test00
import javax.sql.rowset.spi.SyncFactory; //导入依赖的package包/类
@Test
public void test00() throws SyncFactoryException {
SyncProvider p = SyncFactory.getInstance(propertyStubProvider);
assertTrue(p instanceof PropertyStubProvider);
}
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:6,代码来源:SyncFactoryTests.java
示例13: 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);
}
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:7,代码来源:SyncFactoryTests.java
示例14: test03
import javax.sql.rowset.spi.SyncFactory; //导入依赖的package包/类
@Test(expectedExceptions = SyncFactoryException.class)
public void test03() throws SyncFactoryException {
SyncProvider p = SyncFactory.getInstance(null);
}
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:5,代码来源:SyncFactoryTests.java
示例15: test04
import javax.sql.rowset.spi.SyncFactory; //导入依赖的package包/类
@Test(expectedExceptions = SyncFactoryException.class,enabled=true)
public void test04() throws SyncFactoryException {
Logger l = SyncFactory.getLogger();
}
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:5,代码来源:SyncFactoryTests.java
示例16: test05
import javax.sql.rowset.spi.SyncFactory; //导入依赖的package包/类
@Test
public void test05() throws SyncFactoryException {
SyncFactory.setLogger(alogger);
Logger l = SyncFactory.getLogger();
assertTrue(l.equals(alogger));
}
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:7,代码来源:SyncFactoryTests.java
示例17: test06
import javax.sql.rowset.spi.SyncFactory; //导入依赖的package包/类
@Test
public void test06() throws SyncFactoryException {
SyncFactory.setLogger(alogger, Level.INFO);
Logger l = SyncFactory.getLogger();
assertTrue(l.equals(alogger));
}
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:7,代码来源:SyncFactoryTests.java
示例18: test08
import javax.sql.rowset.spi.SyncFactory; //导入依赖的package包/类
@Test(expectedExceptions = SyncFactoryException.class, enabled=true)
public void test08() throws Exception {
SyncFactory.setJNDIContext(null);
}
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:5,代码来源:SyncFactoryTests.java
示例19: test09
import javax.sql.rowset.spi.SyncFactory; //导入依赖的package包/类
@Test(enabled=true)
public void test09() throws Exception {
SyncFactory.setJNDIContext(ctx);
}
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:5,代码来源:SyncFactoryTests.java
注:本文中的javax.sql.rowset.spi.SyncFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论