FileDocCategorySizeDatePackage
SSLClientSessionCacheFactoryTest.javaAPI DocAndroid 1.5 API1936Wed May 06 22:42:02 BST 2009com.android.unit_tests

SSLClientSessionCacheFactoryTest

public final class SSLClientSessionCacheFactoryTest extends android.test.AndroidTestCase
Unit test for {@link SSLClientSessionCacheFactory}.

Fields Summary
Constructors Summary
Methods Summary
private static org.apache.harmony.xnet.provider.jsse.SSLClientSessionCachegetCache(android.content.Context context, java.lang.String type)

        setSslSessionCacheValue(context, type);
        return SSLClientSessionCacheFactory.getCache(context);
    
private static voidsetSslSessionCacheValue(android.content.Context context, java.lang.String value)

        ContentResolver resolver = context.getContentResolver();
        Settings.Gservices.putString(resolver, Settings.Gservices.SSL_SESSION_CACHE, value);
    
protected voidtearDown()

        setSslSessionCacheValue(getContext(), "");
        super.tearDown();
    
public voidtestGetDbCache()

        Context context = getContext();
        SSLClientSessionCache cache = getCache(context, "db");
        assertNotNull(cache);
        assertTrue(cache instanceof DbSSLSessionCache);
    
public voidtestGetFileCache()

        Context context = getContext();
        SSLClientSessionCache cache = getCache(context, "file");
        assertNotNull(cache);
        // yuck =)
        assertEquals("org.apache.harmony.xnet.provider.jsse.FileClientSessionCache$Impl",
                cache.getClass().getName());
    
public voidtestGetNoCache()

        Context context = getContext();
        SSLClientSessionCache cache = getCache(context, "none");
        assertNull(cache);