本文整理汇总了Java中javax.sql.rowset.spi.SyncFactory.setLogger方法的典型用法代码示例。如果您正苦于以下问题:Java SyncFactory.setLogger方法的具体用法?Java SyncFactory.setLogger怎么用?Java SyncFactory.setLogger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.sql.rowset.spi.SyncFactory
的用法示例。
在下文中一共展示了SyncFactory.setLogger方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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());
}
示例2: 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
}
}
示例3: 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));
}
示例4: 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));
}
示例5: test03
import javax.sql.rowset.spi.SyncFactory; //导入方法依赖的package包/类
@Test(expectedExceptions = AccessControlException.class)
public void test03() throws Exception {
setPolicy(new TestPolicy());
SyncFactory.setLogger(alogger);
}
示例6: test04
import javax.sql.rowset.spi.SyncFactory; //导入方法依赖的package包/类
@Test
public void test04() throws Exception {
setPolicy(new TestPolicy("setSyncFactory"));
SyncFactory.setLogger(alogger);
}
示例7: test05
import javax.sql.rowset.spi.SyncFactory; //导入方法依赖的package包/类
@Test
public void test05() throws Exception {
setPolicy(new TestPolicy("all"));
SyncFactory.setLogger(alogger);
}
示例8: test06
import javax.sql.rowset.spi.SyncFactory; //导入方法依赖的package包/类
@Test(expectedExceptions = AccessControlException.class)
public void test06() throws Exception {
setPolicy(new TestPolicy());
SyncFactory.setLogger(alogger, Level.INFO);
}
示例9: test07
import javax.sql.rowset.spi.SyncFactory; //导入方法依赖的package包/类
@Test(expectedExceptions = AccessControlException.class)
public void test07() throws Exception {
setPolicy(new TestPolicy("setSyncFactory"));
SyncFactory.setLogger(alogger, Level.INFO);
}
示例10: test08
import javax.sql.rowset.spi.SyncFactory; //导入方法依赖的package包/类
@Test
public void test08() throws Exception {
setPolicy(new TestPolicy("setSyncFactoryLogger"));
SyncFactory.setLogger(alogger, Level.INFO);
}
示例11: test09
import javax.sql.rowset.spi.SyncFactory; //导入方法依赖的package包/类
@Test
public void test09() throws Exception {
setPolicy(new TestPolicy("all"));
SyncFactory.setLogger(alogger, Level.INFO);
}