Esempio n. 1
0
        public TestUtil(TestProperties testProperties)
        {
            this.testProperties = testProperties;

            // create admin user:
            ClientConfig clientConfig = new DefaultApacheHttpClient4Config();

            clientConfig.Features.put(JSONConfiguration.FEATURE_POJO_MAPPING, true);
            client = ApacheHttpClient4.create(clientConfig);

            defaultHttpClient = (DefaultHttpClient)client.ClientHandler.HttpClient;
        }
Esempio n. 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void createClient() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        public virtual void createClient()
        {
            testProperties = new TestProperties();

            string applicationContextPath = ApplicationContextPath;

            APP_BASE_PATH = testProperties.getApplicationPath("/" + applicationContextPath);
            LOGGER.info("Connecting to application " + APP_BASE_PATH);

            ClientConfig clientConfig = new DefaultApacheHttpClient4Config();

            clientConfig.Features.put(JSONConfiguration.FEATURE_POJO_MAPPING, true);
            client = ApacheHttpClient4.create(clientConfig);

            defaultHttpClient = (DefaultHttpClient)client.ClientHandler.HttpClient;
            HttpParams @params = defaultHttpClient.Params;

            HttpConnectionParams.setConnectionTimeout(@params, 3 * 60 * 1000);
            HttpConnectionParams.setSoTimeout(@params, 10 * 60 * 1000);
        }