mirror of
https://github.com/owncloud/android-library.git
synced 2025-06-07 16:06:08 +00:00
Cleanup
This commit is contained in:
parent
2970b54e7c
commit
ed720d0a65
@ -203,6 +203,21 @@ public class CopyFileTest extends ActivityInstrumentationTestCase2<TestActivity>
|
|||||||
|
|
||||||
public CopyFileTest() {
|
public CopyFileTest() {
|
||||||
super(TestActivity.class);
|
super(TestActivity.class);
|
||||||
|
|
||||||
|
Protocol pr = Protocol.getProtocol("https");
|
||||||
|
if (pr == null || !(pr.getSocketFactory() instanceof SelfSignedConfidentSslSocketFactory)) {
|
||||||
|
try {
|
||||||
|
ProtocolSocketFactory psf = new SelfSignedConfidentSslSocketFactory();
|
||||||
|
Protocol.registerProtocol(
|
||||||
|
"https",
|
||||||
|
new Protocol("https", psf, 443));
|
||||||
|
|
||||||
|
} catch (GeneralSecurityException e) {
|
||||||
|
throw new AssertionFailedError(
|
||||||
|
"Self-signed confident SSL context could not be loaded");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -428,13 +443,12 @@ public class CopyFileTest extends ActivityInstrumentationTestCase2<TestActivity>
|
|||||||
mPass = context.getString(R.string.password);
|
mPass = context.getString(R.string.password);
|
||||||
|
|
||||||
mClient = new OwnCloudClient(
|
mClient = new OwnCloudClient(
|
||||||
Uri.parse("http://" + mServerUri),
|
Uri.parse(mServerUri),
|
||||||
NetworkUtils.getMultiThreadedConnManager()
|
NetworkUtils.getMultiThreadedConnManager()
|
||||||
);
|
);
|
||||||
mClient.setDefaultTimeouts(
|
mClient.setDefaultTimeouts(
|
||||||
OwnCloudClientFactory.DEFAULT_DATA_TIMEOUT,
|
OwnCloudClientFactory.DEFAULT_DATA_TIMEOUT,
|
||||||
OwnCloudClientFactory.DEFAULT_CONNECTION_TIMEOUT);
|
OwnCloudClientFactory.DEFAULT_CONNECTION_TIMEOUT);
|
||||||
mClient.setBaseUri(Uri.parse("http://" + mServerUri));
|
|
||||||
mClient.setFollowRedirects(true);
|
mClient.setFollowRedirects(true);
|
||||||
mClient.setCredentials(
|
mClient.setCredentials(
|
||||||
OwnCloudCredentialsFactory.newBasicCredentials(
|
OwnCloudCredentialsFactory.newBasicCredentials(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user