diff options
author | cyBerta <cyberta@riseup.net> | 2018-10-20 10:14:30 +0200 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2018-10-20 10:14:30 +0200 |
commit | b65eb4154b50644c5858a2d55f3ce531bcfc171e (patch) | |
tree | f9b472aeb5806952a761f42457d6be8c8633cdbf /app/src/test/java/de/blinkt/openvpn/core/TestConfigGenerator.java | |
parent | 9b88523f1d35e76daf7345a4b90e399eca4179c5 (diff) |
remove ics-openvpn mock classes
Diffstat (limited to 'app/src/test/java/de/blinkt/openvpn/core/TestConfigGenerator.java')
-rw-r--r-- | app/src/test/java/de/blinkt/openvpn/core/TestConfigGenerator.java | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/app/src/test/java/de/blinkt/openvpn/core/TestConfigGenerator.java b/app/src/test/java/de/blinkt/openvpn/core/TestConfigGenerator.java deleted file mode 100644 index 892a5807..00000000 --- a/app/src/test/java/de/blinkt/openvpn/core/TestConfigGenerator.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2012-2018 Arne Schwabe - * Distributed under the GNU GPL v2 with additional terms. For full terms see the file doc/LICENSE.txt - */ - -package de.blinkt.openvpn.core; - -import android.content.Context; -import android.content.pm.PackageManager; - -import junit.framework.Assert; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.robolectric.RobolectricTestRunner; -import org.robolectric.RuntimeEnvironment; -import org.robolectric.annotation.Config; - -import de.blinkt.openvpn.VpnProfile; - -import static de.blinkt.openvpn.VpnProfile.AUTH_RETRY_NOINTERACT; -import static de.blinkt.openvpn.VpnProfile.TYPE_USERPASS; - -/** - * Created by arne on 14.03.18. - */ - -@Config(manifest= Config.NONE) -@RunWith(RobolectricTestRunner.class) -public class TestConfigGenerator { - @Test - public void testAuthRetryGen() throws PackageManager.NameNotFoundException { - /*Context mc = mock(Context.class); - PackageManager mpm = mock(PackageManager.class); - - PackageInfo mpi = new PackageInfo(); - mpi.versionCode = 177; - mpi.versionName = "foo"; - - when(mc.getCacheDir()).thenReturn(new File("/j/unit/test/")); - when(mc.getPackageName()).thenReturn("de.blinkt.openvpn"); - when(mc.getPackageManager()).thenReturn(mpm); - when(mpm.getPackageInfo(eq("de.blinkt.openvpn"),eq(0))).thenReturn(mpi);*/ - - - - VpnProfile vp = new VpnProfile ("test") { - @Override - public String getVersionEnvString(Context c) { - return "no ver"; - } - - @Override - public String getPlatformVersionEnvString() { - return "test"; - } - }; - - vp.mAuthenticationType = TYPE_USERPASS; - vp.mAuthRetry = AUTH_RETRY_NOINTERACT; - String config = vp.getConfigFile(RuntimeEnvironment.application, false); - Assert.assertTrue(config.contains("\nauth-retry nointeract\n")); - for (Connection connection: vp.mConnections) - Assert.assertTrue(connection.mProxyType == Connection.ProxyType.NONE); - - } - - -} |