当前位置: 首页>>代码示例>>Java>>正文


Java SyncProviderException类代码示例

本文整理汇总了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();
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:21,代码来源:SyncProviderExceptionTests.java

示例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.
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:17,代码来源:JoinRowSetCachedRowSetTest.java

示例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);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:10,代码来源:SyncProviderExceptionTests.java

示例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);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:11,代码来源:SyncProviderExceptionTests.java

示例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);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:10,代码来源:SyncProviderExceptionTests.java

示例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);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:12,代码来源:SyncProviderExceptionTests.java

示例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);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:10,代码来源:SyncProviderExceptionTests.java

示例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()));
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:15,代码来源:SyncProviderExceptionTests.java

示例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());
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:11,代码来源:SyncProviderExceptionTests.java

示例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);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:13,代码来源:SyncProviderExceptionTests.java


注:本文中的javax.sql.rowset.spi.SyncProviderException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。