From c1544d5cccb4db88a8530b5161e404ea7c2ae22f Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Mon, 3 Oct 2016 12:41:30 +0200 Subject: Fix http-proxy-user-pass not embedded correctly in custom options (closes #551) --- .../de/blinkt/openvpn/core/TestConfigParser.java | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 main/src/test/java/de/blinkt/openvpn/core/TestConfigParser.java (limited to 'main/src/test/java/de/blinkt/openvpn') diff --git a/main/src/test/java/de/blinkt/openvpn/core/TestConfigParser.java b/main/src/test/java/de/blinkt/openvpn/core/TestConfigParser.java new file mode 100644 index 00000000..560d4fc8 --- /dev/null +++ b/main/src/test/java/de/blinkt/openvpn/core/TestConfigParser.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2012-2016 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 org.junit.Assert; +import org.junit.Test; + +import java.io.IOException; +import java.io.StringReader; + +import de.blinkt.openvpn.VpnProfile; + +/** + * Created by arne on 03.10.16. + */ + +public class TestConfigParser { + + String miniconfig = "client\nremote test.blinkt.de\n"; + + @Test + public void testHttpProxyPass() throws IOException, ConfigParser.ConfigParseError { + String httpproxypass = "\n" + + "foo\n" + + "bar\n" + + "\n"; + + ConfigParser cp = new ConfigParser(); + cp.parseConfig(new StringReader(miniconfig + httpproxypass)); + VpnProfile p = cp.convertProfile(); + Assert.assertTrue(p.mCustomConfigOptions.contains(httpproxypass)); + + } +} -- cgit v1.2.3