summaryrefslogtreecommitdiff
path: root/app/src/test/java/de/blinkt/openvpn/core/TestConfigParser.java
blob: 560d4fc8cc6a9238b403b3789c82413873daa96b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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 = "<http-proxy-user-pass>\n" +
                "foo\n" +
                "bar\n" +
                "</http-proxy-user-pass>\n";

        ConfigParser cp = new ConfigParser();
        cp.parseConfig(new StringReader(miniconfig + httpproxypass));
        VpnProfile p = cp.convertProfile();
        Assert.assertTrue(p.mCustomConfigOptions.contains(httpproxypass));

    }
}