<commit_before>package li.http;

import java.net.Authenticator;
import java.net.InetSocketAddress;
import java.net.MalformedURLException;
import java.net.PasswordAuthentication;
import java.net.Proxy;
import java.net.Proxy.Type;
import java.net.URL;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;

import li.util.Convert;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.junit.Test;

public class TestHttp {
    public static void main(String[] args) {
        Integer times = 1000;
        Long start = System.currentTimeMillis();
        for (int i = 0; i < times; i++) {
            Request request = new Request();
            request.setUrl("http://localhost:8080/li_osc/performance_test_action.htm");
            request.execute();
        }
        System.out.println("##################  运行 " + times + " 次 耗时 " + (System.currentTimeMillis() - start) + " 毫秒");
    }

    @Test
    public void testCookie() {
        Request request = new Request();
        request.setUrl("g.cn");
        Response response = request.execute();
        System.out.println("body = " + response.getCookies());
    }

    @Test
    public void testHttpNotStringArgs() {
        Request request = new Request();<commit_msg>TokenFilter测试<commit_after>package li.http;

import java.net.Authenticator;
import java.net.InetSocketAddress;
import java.net.MalformedURLException;
import java.net.PasswordAuthentication;
import java.net.Proxy;
import java.net.Proxy.Type;
import java.net.URL;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;

import li.util.Convert;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.junit.Test;

public class TestHttp {
    public static void main(String[] args) {
        Integer times = 1000;
        Long start = System.currentTimeMillis();
        for (int i = 0; i < times; i++) {
            Request request = new Request();
            request.setUrl("http://localhost:8080/li_osc/performance_test_action.htm");
            request.execute();
        }
        System.out.println("##################  运行 " + times + " 次 耗时 " + (System.currentTimeMillis() - start) + " 毫秒");
    }

    @Test
    public void test() {
        System.out.println(new Request().setUrl("http://localhost:8080/site_analysis/view.htm?_token=" + "<PASSWORD>" + "&a=1&b=2&c=3").execute().getBody());
        System.out.println(new Request().setUrl("http://localhost:8080/site_analysis/view.htm?_token=" + "<PASSWORD>" + "&a=1&b=2&c=3").setMethod(Request.POST).execute().getBody());
    }

    @Test
    public void testCookie() {
        Request request = new Request();
        request.setUrl("g.cn");
        Response response = request.execute();
        System.out.println("body = " + response.getCookies());
    }

    @Test
    public void testHttpNotStringArgs() {
        Request request = new Request();
{'fraction_non_alphanumeric': 0.15179806362378975, 'fraction_numerical': 0.011065006915629323, 'mean_word_length': 3.144699140401146, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4482182', 'n_tokens_mistral': 902, 'n_tokens_neox': 888, 'n_words': 185}