本文整理汇总了Java中javax.sql.rowset.spi.SyncProviderException类的典型用法代码示例。如果您正苦于以下问题:Java SyncProviderException类的具体用法?Java SyncProviderException怎么用?Java SyncProviderException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SyncProviderException类属于javax.sql.rowset.spi包,在下文中一共展示了SyncProviderException类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: test06
import javax.sql.rowset.spi.SyncProviderException; //导入依赖的package包/类
@Test
public void test06() {
SQLException ex = new SyncProviderException("Exception 1");
ex.initCause(t1);
SyncProviderException ex1 = new SyncProviderException("Exception 2");
SyncProviderException ex2 = new SyncProviderException("Exception 3");
ex2.initCause(t2);
ex.setNextException(ex1);
ex.setNextException(ex2);
int num = 0;
while (ex != null) {
assertTrue(msgs[num++].equals(ex.getMessage()));
Throwable c = ex.getCause();
while (c != null) {
assertTrue(msgs[num++].equals(c.getMessage()));
c = c.getCause();
}
ex = ex.getNextException();
}
}
示例2: testAcceptChanges_TwoSameRowSets
import javax.sql.rowset.spi.SyncProviderException; //导入依赖的package包/类
public void testAcceptChanges_TwoSameRowSets() throws Exception {
jrs.addRowSet(crset, 1);
crset.beforeFirst();
jrs.addRowSet(crset, 1);
jrs.absolute(4);
jrs.updateString(2, "Updated");
jrs.updateRow();
try {
jrs.acceptChanges(conn);
fail("Should throw SyncProviderException.");
} catch (SyncProviderException e) {
// Expected.
}
}
示例3: test
import javax.sql.rowset.spi.SyncProviderException; //导入依赖的package包/类
@Test
public void test() {
SyncProviderException ex = new SyncProviderException();
assertTrue(ex.getMessage() == null
&& ex.getSQLState() == null
&& ex.getCause() == null
&& ex.getErrorCode() == 0
&& ex.getSyncResolver() instanceof SyncResolverImpl);
}
示例4: test01
import javax.sql.rowset.spi.SyncProviderException; //导入依赖的package包/类
@Test
public void test01() {
SyncProviderException ex = new SyncProviderException();
ex.setSyncResolver(new StubSyncResolver());
assertTrue(ex.getMessage() == null
&& ex.getSQLState() == null
&& ex.getCause() == null
&& ex.getErrorCode() == 0
&& ex.getSyncResolver() instanceof StubSyncResolver);
}
示例5: test02
import javax.sql.rowset.spi.SyncProviderException; //导入依赖的package包/类
@Test
public void test02() {
SyncProviderException ex = new SyncProviderException(reason);
assertTrue(ex.getMessage().equals(reason)
&& ex.getSQLState() == null
&& ex.getCause() == null
&& ex.getErrorCode() == 0
&& ex.getSyncResolver() instanceof SyncResolverImpl);
}
示例6: test03
import javax.sql.rowset.spi.SyncProviderException; //导入依赖的package包/类
@Test
public void test03() {
SyncProviderException ex = new SyncProviderException(reason);
ex.setSyncResolver(new StubSyncResolver());
assertTrue(ex.getMessage().equals(reason)
&& ex.getSQLState() == null
&& ex.getCause() == null
&& ex.getErrorCode() == 0
&& ex.getSyncResolver() instanceof StubSyncResolver);
}
示例7: test04
import javax.sql.rowset.spi.SyncProviderException; //导入依赖的package包/类
@Test
public void test04() {
SyncProviderException ex = new SyncProviderException(new StubSyncResolver());
assertTrue(ex.getMessage() == null
&& ex.getSQLState() == null
&& ex.getCause() == null
&& ex.getErrorCode() == 0
&& ex.getSyncResolver() instanceof StubSyncResolver);
}
示例8: test05
import javax.sql.rowset.spi.SyncProviderException; //导入依赖的package包/类
@Test
public void test05() {
SyncProviderException ex = new SyncProviderException("Exception 1");
ex.initCause(t1);
SyncProviderException ex1 = new SyncProviderException("Exception 2");
SyncProviderException ex2 = new SyncProviderException("Exception 3");
ex2.initCause(t2);
ex.setNextException(ex1);
ex.setNextException(ex2);
int num = 0;
for (Throwable e : ex) {
assertTrue(msgs[num++].equals(e.getMessage()));
}
}
示例9: test07
import javax.sql.rowset.spi.SyncProviderException; //导入依赖的package包/类
@Test
public void test07() throws Exception {
SyncProviderException e = new SyncProviderException(reason);
SyncProviderException ex1 = createSerializedException(e);
assertTrue(ex1.getMessage().equals(reason)
&& ex1.getSQLState() == null
&& ex1.getCause() == null
&& ex1.getErrorCode() == 0
&& ex1.getSyncResolver() instanceof SyncResolverImpl, ex1.getSyncResolver().getClass().getName());
}
示例10: test08
import javax.sql.rowset.spi.SyncProviderException; //导入依赖的package包/类
@Test
public void test08() throws Exception {
SyncProviderException e = new SyncProviderException(reason);
e.setSyncResolver(new StubSyncResolver());
SyncProviderException ex1 = createSerializedException(e);
assertTrue(ex1.getMessage().equals(reason)
&& ex1.getSQLState() == null
&& ex1.getCause() == null
&& ex1.getErrorCode() == 0
&& ex1.getSyncResolver() instanceof StubSyncResolver);
}