<commit_before>/*
 * Copyright 2017 Huawei Technologies Co., Ltd
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.servicecomb.demo.springmvc.client;

import java.util.HashMap;
import java.util.Map;

import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;

import io.servicecomb.core.CseContext;
import io.servicecomb.demo.DemoConst;
import io.servicecomb.demo.TestMgr;
import io.servicecomb.demo.controller.Controller;
import io.servicecomb.demo.controller.Person;
import io.servicecomb.provider.springmvc.reference.RestTemplateBuilder;
import io.servicecomb.foundation.common.utils.BeanUtils;
import io.servicecomb.foundation.common.utils.Log4jUtils;

public class SpringmvcClient {
    private static RestTemplate restTemplate;

    private static Controller controller;

    public static void main(String[] args) throws Exception {
        init();

        run();
    }

    public static void run() throws Exception {
        restTemplate = RestTemplateBuilder.create();
        controller = BeanUtils.getBean("controller");

        String prefix = "cse://springmvc";

        try {
            // this test class is intended for rery hang issue JAV-27
            restTemplate.getForObject(prefix + "/controller/sayhi?name=throwexception", String.class);
            TestMgr.check("true", "true");
        } catch (Exception e) {
            TestMgr.check("true", "true");
        }

        CodeFirstRestTemplateSpringmvc codeFirstClient =
            BeanUtils.getContext().getBean(CodeFirstRestTemplateSpringmvc.class);
        codeFirstClient.testCodeFirst(restTemplate, "springmvc", "/codeFirstSpringmvc/");
        runTest();<commit_msg>[JAV-127]retry的场景在自己的线程池执行 modify test case<commit_after>/*
 * Copyright 2017 Huawei Technologies Co., Ltd
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.servicecomb.demo.springmvc.client;

import java.util.HashMap;
import java.util.Map;

import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;

import io.servicecomb.core.CseContext;
import io.servicecomb.demo.DemoConst;
import io.servicecomb.demo.TestMgr;
import io.servicecomb.demo.controller.Controller;
import io.servicecomb.demo.controller.Person;
import io.servicecomb.provider.springmvc.reference.RestTemplateBuilder;
import io.servicecomb.foundation.common.utils.BeanUtils;
import io.servicecomb.foundation.common.utils.Log4jUtils;

public class SpringmvcClient {
    private static RestTemplate restTemplate;

    private static Controller controller;

    public static void main(String[] args) throws Exception {
        init();

        run();
    }

    public static void run() throws Exception {
        restTemplate = RestTemplateBuilder.create();
        controller = BeanUtils.getBean("controller");

        String prefix = "cse://springmvc";

        try {
            // this test class is intended for rery hang issue JAV-27
            restTemplate.getForObject(prefix + "/controller/sayhi?name=throwexception", String.class);
            TestMgr.check("true", "false");
        } catch (Exception e) {
            TestMgr.check("true", "true");
        }

        CodeFirstRestTemplateSpringmvc codeFirstClient =
            BeanUtils.getContext().getBean(CodeFirstRestTemplateSpringmvc.class);
        codeFirstClient.testCodeFirst(restTemplate, "springmvc", "/codeFirstSpringmvc/");
        runTest();
{'fraction_non_alphanumeric': 0.09317557574477076, 'fraction_numerical': 0.005282062117050497, 'mean_word_length': 3.7866531850353895, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2898997', 'n_tokens_mistral': 1270, 'n_tokens_neox': 1251, 'n_words': 358}