Java Code Examples for javax.sql.rowset.spi.SyncFactory

The following examples show how to use javax.sql.rowset.spi.SyncFactory. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@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);
}
 
Example 2
@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);
}
 
Example 3
Source Project: jdk8u60   Source File: SyncFactoryTests.java    License: GNU General Public License v2.0 6 votes vote down vote up
@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);
}
 
Example 4
@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);
}
 
Example 5
@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();
}
 
Example 6
Source Project: hottub   Source File: SyncFactoryTests.java    License: GNU General Public License v2.0 5 votes vote down vote up
@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);
}
 
Example 7
@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();
}
 
Example 8
Source Project: jdk8u60   Source File: SyncFactoryTests.java    License: GNU General Public License v2.0 5 votes vote down vote up
@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);
}
 
Example 9
Source Project: jdk8u60   Source File: SyncFactoryTests.java    License: GNU General Public License v2.0 5 votes vote down vote up
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());
}
 
Example 10
@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();
}
 
Example 11
@BeforeMethod
public void setUpMethod() throws Exception {
    // Make sure the provider provider that is registered is removed
    // before each run
    SyncFactory.unregisterProvider(stubProvider);
}
 
Example 12
@Test
public void test00() throws SyncFactoryException {
    SyncProvider p = SyncFactory.getInstance(propertyStubProvider);
    assertTrue(p instanceof PropertyStubProvider);
}
 
Example 13
Source Project: jdk8u-jdk   Source File: SyncFactoryTests.java    License: GNU General Public License v2.0 4 votes vote down vote up
@BeforeMethod
public void setUpMethod() throws Exception {
    // Make sure the provider provider that is registered is removed
    // before each run
    SyncFactory.unregisterProvider(stubProvider);
}
 
Example 14
Source Project: jdk8u_jdk   Source File: SyncFactoryTests.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Test
public void test01() throws SyncFactoryException {
    SyncFactory.registerProvider(stubProvider);
    SyncProvider p = SyncFactory.getInstance(stubProvider);
    assertTrue(p instanceof StubSyncProvider);
}
 
Example 15
@Test(expectedExceptions = SyncFactoryException.class)
public void test03() throws SyncFactoryException {
    SyncProvider p = SyncFactory.getInstance(null);
}
 
Example 16
@Test
public void test01() throws Exception {
    setPolicy(new TestPolicy("setSyncFactory"));
    SyncFactory.setJNDIContext(ctx);
}
 
Example 17
@Test
public void test06() throws SyncFactoryException {
    SyncFactory.setLogger(alogger, Level.INFO);
    Logger l = SyncFactory.getLogger();
    assertTrue(l.equals(alogger));
}
 
Example 18
@Test
public void test05() throws Exception {
    setPolicy(new TestPolicy("all"));
    SyncFactory.setLogger(alogger);
}
 
Example 19
Source Project: jdk8u-jdk   Source File: SyncFactoryTests.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Test(expectedExceptions = SyncFactoryException.class)
public void test03() throws SyncFactoryException {
    SyncProvider p = SyncFactory.getInstance(null);
}
 
Example 20
@Test(expectedExceptions = SyncFactoryException.class,enabled=true)
public void test04() throws SyncFactoryException {
    Logger l = SyncFactory.getLogger();
}
 
Example 21
@Test(expectedExceptions = AccessControlException.class)
public void test06() throws Exception {
    setPolicy(new TestPolicy());
    SyncFactory.setLogger(alogger, Level.INFO);
}
 
Example 22
@Test
public void test00() throws SyncFactoryException {
    SyncProvider p = SyncFactory.getInstance(propertyStubProvider);
    assertTrue(p instanceof PropertyStubProvider);
}
 
Example 23
@Test
public void test02() throws Exception {
    setPolicy(new TestPolicy("all"));
    SyncFactory.setJNDIContext(ctx);
}
 
Example 24
@Test(expectedExceptions = AccessControlException.class)
public void test06() throws Exception {
    setPolicy(new TestPolicy());
    SyncFactory.setLogger(alogger, Level.INFO);
}
 
Example 25
@Test
public void test04() throws Exception {
    setPolicy(new TestPolicy("setSyncFactory"));
    SyncFactory.setLogger(alogger);
}
 
Example 26
@Test
public void test05() throws Exception {
    setPolicy(new TestPolicy("all"));
    SyncFactory.setLogger(alogger);
}
 
Example 27
@Test
public void test09() throws Exception {
    setPolicy(new TestPolicy("all"));
    SyncFactory.setLogger(alogger, Level.INFO);
}
 
Example 28
@Test
public void test() throws SyncFactoryException {
    SyncFactory syncFactory = SyncFactory.getSyncFactory();
    assertTrue(syncFactory != null);
}
 
Example 29
Source Project: jdk8u_jdk   Source File: SyncFactoryTests.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Test(expectedExceptions = SyncFactoryException.class)
public void test03() throws SyncFactoryException {
    SyncProvider p = SyncFactory.getInstance(null);
}
 
Example 30
@Test(expectedExceptions = AccessControlException.class)
public void test03() throws Exception {
    setPolicy(new TestPolicy());
    SyncFactory.setLogger(alogger);
}