Java 类javax.sql.rowset.spi.SyncProvider 实例源码

项目:cn1    文件:SyncFactoryTest.java   
/**
 * 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
    }
}
项目:freeVM    文件:SyncFactoryTest.java   
/**
 * 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
    }
}
项目:jdk8u-jdk    文件:SyncFactoryTests.java   
@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);
}
项目:jdk8u-jdk    文件:SyncFactoryTests.java   
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());
}
项目:jdk8u-jdk    文件:CommonCachedRowSetTests.java   
@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();
}
项目:openjdk-jdk10    文件:SyncFactoryTests.java   
@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);
}
项目:openjdk-jdk10    文件:SyncFactoryTests.java   
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());
}
项目:openjdk-jdk10    文件:CommonCachedRowSetTests.java   
@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();
}
项目:openjdk9    文件:SyncFactoryTests.java   
@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);
}
项目:openjdk9    文件:SyncFactoryTests.java   
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());
}
项目:openjdk9    文件:CommonCachedRowSetTests.java   
@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();
}
项目:jdk8u_jdk    文件:SyncFactoryTests.java   
@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);
}
项目:jdk8u_jdk    文件:SyncFactoryTests.java   
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());
}
项目:jdk8u_jdk    文件:CommonCachedRowSetTests.java   
@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();
}
项目:lookaside_java-1.8.0-openjdk    文件:SyncFactoryTests.java   
@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);
}
项目:lookaside_java-1.8.0-openjdk    文件:SyncFactoryTests.java   
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());
}
项目:lookaside_java-1.8.0-openjdk    文件:CommonCachedRowSetTests.java   
@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();
}
项目:cn1    文件:SyncFactoryTest.java   
/**
 * 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());
    }
}
项目:freeVM    文件:SyncFactoryTest.java   
/**
 * 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());
    }
}
项目:OpenJSharp    文件:JoinRowSetImpl.java   
/**
 * {@inheritDoc}
 */
public SyncProvider getSyncProvider() throws SQLException {
   return crsInternal.getSyncProvider();
}
项目:jdk8u-jdk    文件:JoinRowSetImpl.java   
/**
 * {@inheritDoc}
 */
public SyncProvider getSyncProvider() throws SQLException {
   return crsInternal.getSyncProvider();
}
项目:jdk8u-jdk    文件:StubWebRowSetImpl.java   
@Override
public SyncProvider getSyncProvider() throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:jdk8u-jdk    文件:StubFilteredRowSetImpl.java   
@Override
public SyncProvider getSyncProvider() throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:jdk8u-jdk    文件:StubCachedRowSetImpl.java   
@Override
public SyncProvider getSyncProvider() throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:jdk8u-jdk    文件:StubJoinRowSetImpl.java   
@Override
public SyncProvider getSyncProvider() throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:jdk8u-jdk    文件:SyncFactoryTests.java   
@Test
public void test00() throws SyncFactoryException {
    SyncProvider p = SyncFactory.getInstance(propertyStubProvider);
    assertTrue(p instanceof PropertyStubProvider);
}
项目:jdk8u-jdk    文件:SyncFactoryTests.java   
@Test
public void test01() throws SyncFactoryException {
    SyncFactory.registerProvider(stubProvider);
    SyncProvider p = SyncFactory.getInstance(stubProvider);
    assertTrue(p instanceof StubSyncProvider);
}
项目:jdk8u-jdk    文件:SyncFactoryTests.java   
@Test(expectedExceptions = SyncFactoryException.class)
public void test03() throws SyncFactoryException {
    SyncProvider p = SyncFactory.getInstance(null);
}
项目:jdk8u-jdk    文件:SyncFactoryTests.java   
private void showImpl(SyncProvider impl) {
    System.out.println("Provider implementation:"
            + "\nVendor: " + impl.getVendor()
            + "\nVersion: " + impl.getVersion()
            + "\nProviderID: " + impl.getProviderID());
}
项目:jdk8u-jdk    文件:CommonCachedRowSetTests.java   
@Test(dataProvider = "rowSetType")
public void commonCachedRowSetTest0002(CachedRowSet rs) throws SQLException {
    SyncProvider sp = rs.getSyncProvider();
    assertTrue(sp instanceof com.sun.rowset.providers.RIOptimisticProvider);
    rs.close();
}
项目:openjdk-jdk10    文件:JoinRowSetImpl.java   
/**
 * {@inheritDoc}
 */
public SyncProvider getSyncProvider() throws SQLException {
   return crsInternal.getSyncProvider();
}
项目:openjdk-jdk10    文件:StubWebRowSetImpl.java   
@Override
public SyncProvider getSyncProvider() throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:openjdk-jdk10    文件:StubFilteredRowSetImpl.java   
@Override
public SyncProvider getSyncProvider() throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:openjdk-jdk10    文件:StubCachedRowSetImpl.java   
@Override
public SyncProvider getSyncProvider() throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:openjdk-jdk10    文件:StubJoinRowSetImpl.java   
@Override
public SyncProvider getSyncProvider() throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:openjdk-jdk10    文件:SyncFactoryTests.java   
@Test
public void test00() throws SyncFactoryException {
    SyncProvider p = SyncFactory.getInstance(propertyStubProvider);
    assertTrue(p instanceof PropertyStubProvider);
}
项目:openjdk-jdk10    文件:SyncFactoryTests.java   
@Test
public void test01() throws SyncFactoryException {
    SyncFactory.registerProvider(stubProvider);
    SyncProvider p = SyncFactory.getInstance(stubProvider);
    assertTrue(p instanceof StubSyncProvider);
}
项目:openjdk-jdk10    文件:SyncFactoryTests.java   
@Test(expectedExceptions = SyncFactoryException.class)
public void test03() throws SyncFactoryException {
    SyncProvider p = SyncFactory.getInstance(null);
}
项目:openjdk-jdk10    文件:SyncFactoryTests.java   
private void showImpl(SyncProvider impl) {
    System.out.println("Provider implementation:"
            + "\nVendor: " + impl.getVendor()
            + "\nVersion: " + impl.getVersion()
            + "\nProviderID: " + impl.getProviderID());
}
项目:openjdk-jdk10    文件:CommonCachedRowSetTests.java   
@Test(dataProvider = "rowSetType")
public void commonCachedRowSetTest0002(CachedRowSet rs) throws SQLException {
    SyncProvider sp = rs.getSyncProvider();
    assertTrue(sp instanceof com.sun.rowset.providers.RIOptimisticProvider);
    rs.close();
}