Loading src/com/owncloud/android/lib/common/OwnCloudAccount.java +13 −2 Original line number Diff line number Diff line Loading @@ -54,6 +54,11 @@ public class OwnCloudAccount { if (savedAccount == null) { throw new IllegalArgumentException("Parameter 'savedAccount' cannot be null"); } if (context == null) { throw new IllegalArgumentException("Parameter 'context' cannot be null"); } mSavedAccount = savedAccount; mSavedAccountName = savedAccount.name; mBaseUri = Uri.parse(AccountUtils.getBaseUrlForAccount(context, mSavedAccount)); Loading @@ -73,8 +78,14 @@ public class OwnCloudAccount { throws AccountNotFoundException, AuthenticatorException, IOException, OperationCanceledException { if (context == null) { throw new IllegalArgumentException("Parameter 'context' cannot be null"); } if (mSavedAccount != null) { mCredentials = AccountUtils.getCredentialsForAccount(context, mSavedAccount); } } /* public OwnCloudAccount(Account savedAccount, Context context) Loading src/com/owncloud/android/lib/common/network/AdvancedSslSocketFactory.java +3 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,7 @@ public class AdvancedSslSocketFactory implements SecureProtocolSocketFactory { /** * @see ProtocolSocketFactory#createSocket(java.lang.String,int,java.net.InetAddress,int) */ @Override public Socket createSocket(String host, int port, InetAddress clientHost, int clientPort) throws IOException, UnknownHostException { Loading Loading @@ -157,6 +158,7 @@ public class AdvancedSslSocketFactory implements SecureProtocolSocketFactory { * @throws UnknownHostException if the IP address of the host cannot be * determined */ @Override public Socket createSocket(final String host, final int port, final InetAddress localAddress, final int localPort, final HttpConnectionParams params) throws IOException, Loading Loading @@ -187,6 +189,7 @@ public class AdvancedSslSocketFactory implements SecureProtocolSocketFactory { /** * @see ProtocolSocketFactory#createSocket(java.lang.String,int) */ @Override public Socket createSocket(String host, int port) throws IOException, UnknownHostException { Log_OC.d(TAG, "Creating SSL Socket with remote " + host + ":" + port); Loading test_client/tests/src/com/owncloud/android/lib/test_project/test/SimpleFactoryManagerTest.java +18 −10 Original line number Diff line number Diff line Loading @@ -94,6 +94,7 @@ public class SimpleFactoryManagerTest extends AndroidTestCase { } public void testGetClientFor() { try { OwnCloudClient client = mSFMgr.getClientFor(mValidAccount, getContext()); assertNotSame("Got same client instances for same account", Loading @@ -102,15 +103,22 @@ public class SimpleFactoryManagerTest extends AndroidTestCase { assertNotSame("Got same client instances for different accounts", client, mSFMgr.getClientFor(mAnonymousAccount, getContext())); } catch (Exception e) { throw new AssertionFailedError("Exception getting client for account: " + e.getMessage()); } // TODO harder tests } public void testRemoveClientFor() { try { OwnCloudClient client = mSFMgr.getClientFor(mValidAccount, getContext()); mSFMgr.removeClientFor(mValidAccount); assertNotSame("Got same client instance after removing it from manager", client, mSFMgr.getClientFor(mValidAccount, getContext())); } catch (Exception e) { throw new AssertionFailedError("Exception getting client for account: " + e.getMessage()); } // TODO harder tests } Loading test_client/tests/src/com/owncloud/android/lib/test_project/test/SingleSessionManagerTest.java +21 −12 Original line number Diff line number Diff line Loading @@ -93,6 +93,7 @@ public class SingleSessionManagerTest extends AndroidTestCase { } public void testGetClientFor() { try { OwnCloudClient client1 = mSSMgr.getClientFor(mValidAccount, getContext()); OwnCloudClient client2 = mSSMgr.getClientFor(mAnonymousAccount, getContext()); Loading @@ -101,14 +102,22 @@ public class SingleSessionManagerTest extends AndroidTestCase { assertSame("Got different client instances for same account", client1, mSSMgr.getClientFor(mValidAccount, getContext())); } catch (Exception e) { throw new AssertionFailedError("Exception getting client for account: " + e.getMessage()); } // TODO harder tests } public void testRemoveClientFor() { try { OwnCloudClient client1 = mSSMgr.getClientFor(mValidAccount, getContext()); mSSMgr.removeClientFor(mValidAccount); assertNotSame("Got same client instance after removing it from manager", client1, mSSMgr.getClientFor(mValidAccount, getContext())); } catch (Exception e) { throw new AssertionFailedError("Exception getting client for account: " + e.getMessage()); } // TODO harder tests } Loading Loading
src/com/owncloud/android/lib/common/OwnCloudAccount.java +13 −2 Original line number Diff line number Diff line Loading @@ -54,6 +54,11 @@ public class OwnCloudAccount { if (savedAccount == null) { throw new IllegalArgumentException("Parameter 'savedAccount' cannot be null"); } if (context == null) { throw new IllegalArgumentException("Parameter 'context' cannot be null"); } mSavedAccount = savedAccount; mSavedAccountName = savedAccount.name; mBaseUri = Uri.parse(AccountUtils.getBaseUrlForAccount(context, mSavedAccount)); Loading @@ -73,8 +78,14 @@ public class OwnCloudAccount { throws AccountNotFoundException, AuthenticatorException, IOException, OperationCanceledException { if (context == null) { throw new IllegalArgumentException("Parameter 'context' cannot be null"); } if (mSavedAccount != null) { mCredentials = AccountUtils.getCredentialsForAccount(context, mSavedAccount); } } /* public OwnCloudAccount(Account savedAccount, Context context) Loading
src/com/owncloud/android/lib/common/network/AdvancedSslSocketFactory.java +3 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,7 @@ public class AdvancedSslSocketFactory implements SecureProtocolSocketFactory { /** * @see ProtocolSocketFactory#createSocket(java.lang.String,int,java.net.InetAddress,int) */ @Override public Socket createSocket(String host, int port, InetAddress clientHost, int clientPort) throws IOException, UnknownHostException { Loading Loading @@ -157,6 +158,7 @@ public class AdvancedSslSocketFactory implements SecureProtocolSocketFactory { * @throws UnknownHostException if the IP address of the host cannot be * determined */ @Override public Socket createSocket(final String host, final int port, final InetAddress localAddress, final int localPort, final HttpConnectionParams params) throws IOException, Loading Loading @@ -187,6 +189,7 @@ public class AdvancedSslSocketFactory implements SecureProtocolSocketFactory { /** * @see ProtocolSocketFactory#createSocket(java.lang.String,int) */ @Override public Socket createSocket(String host, int port) throws IOException, UnknownHostException { Log_OC.d(TAG, "Creating SSL Socket with remote " + host + ":" + port); Loading
test_client/tests/src/com/owncloud/android/lib/test_project/test/SimpleFactoryManagerTest.java +18 −10 Original line number Diff line number Diff line Loading @@ -94,6 +94,7 @@ public class SimpleFactoryManagerTest extends AndroidTestCase { } public void testGetClientFor() { try { OwnCloudClient client = mSFMgr.getClientFor(mValidAccount, getContext()); assertNotSame("Got same client instances for same account", Loading @@ -102,15 +103,22 @@ public class SimpleFactoryManagerTest extends AndroidTestCase { assertNotSame("Got same client instances for different accounts", client, mSFMgr.getClientFor(mAnonymousAccount, getContext())); } catch (Exception e) { throw new AssertionFailedError("Exception getting client for account: " + e.getMessage()); } // TODO harder tests } public void testRemoveClientFor() { try { OwnCloudClient client = mSFMgr.getClientFor(mValidAccount, getContext()); mSFMgr.removeClientFor(mValidAccount); assertNotSame("Got same client instance after removing it from manager", client, mSFMgr.getClientFor(mValidAccount, getContext())); } catch (Exception e) { throw new AssertionFailedError("Exception getting client for account: " + e.getMessage()); } // TODO harder tests } Loading
test_client/tests/src/com/owncloud/android/lib/test_project/test/SingleSessionManagerTest.java +21 −12 Original line number Diff line number Diff line Loading @@ -93,6 +93,7 @@ public class SingleSessionManagerTest extends AndroidTestCase { } public void testGetClientFor() { try { OwnCloudClient client1 = mSSMgr.getClientFor(mValidAccount, getContext()); OwnCloudClient client2 = mSSMgr.getClientFor(mAnonymousAccount, getContext()); Loading @@ -101,14 +102,22 @@ public class SingleSessionManagerTest extends AndroidTestCase { assertSame("Got different client instances for same account", client1, mSSMgr.getClientFor(mValidAccount, getContext())); } catch (Exception e) { throw new AssertionFailedError("Exception getting client for account: " + e.getMessage()); } // TODO harder tests } public void testRemoveClientFor() { try { OwnCloudClient client1 = mSSMgr.getClientFor(mValidAccount, getContext()); mSSMgr.removeClientFor(mValidAccount); assertNotSame("Got same client instance after removing it from manager", client1, mSSMgr.getClientFor(mValidAccount, getContext())); } catch (Exception e) { throw new AssertionFailedError("Exception getting client for account: " + e.getMessage()); } // TODO harder tests } Loading