Search in sources :

Example 1 with TraceMethod

use of org.apache.commons.httpclient.methods.TraceMethod in project camel by apache.

the class NettyHttpTraceDisabledTest method testTraceDisabled.

@Test
public void testTraceDisabled() throws Exception {
    HttpClient httpclient = new HttpClient();
    TraceMethod trace = new TraceMethod("http://localhost:" + portTraceOff + "/myservice");
    httpclient.executeMethod(trace);
    // TRACE shouldn't be allowed by default
    assertTrue(trace.getStatusCode() == 405);
    trace.releaseConnection();
}
Also used : HttpClient(org.apache.commons.httpclient.HttpClient) TraceMethod(org.apache.commons.httpclient.methods.TraceMethod) Test(org.junit.Test)

Example 2 with TraceMethod

use of org.apache.commons.httpclient.methods.TraceMethod in project camel by apache.

the class NettyHttpTraceDisabledTest method testTraceDisabled.

@Test
public void testTraceDisabled() throws Exception {
    HttpClient httpclient = new HttpClient();
    TraceMethod trace = new TraceMethod("http://localhost:" + portTraceOff + "/myservice");
    httpclient.executeMethod(trace);
    // TRACE shouldn't be allowed by default
    assertTrue(trace.getStatusCode() == 405);
    trace.releaseConnection();
}
Also used : HttpClient(org.apache.commons.httpclient.HttpClient) TraceMethod(org.apache.commons.httpclient.methods.TraceMethod) Test(org.junit.Test)

Example 3 with TraceMethod

use of org.apache.commons.httpclient.methods.TraceMethod in project camel by apache.

the class NettyHttpTraceDisabledTest method testTraceEnabled.

@Test
public void testTraceEnabled() throws Exception {
    HttpClient httpclient = new HttpClient();
    TraceMethod trace = new TraceMethod("http://localhost:" + portTraceOn + "/myservice");
    httpclient.executeMethod(trace);
    // TRACE is now allowed
    assertTrue(trace.getStatusCode() == 200);
    trace.releaseConnection();
}
Also used : HttpClient(org.apache.commons.httpclient.HttpClient) TraceMethod(org.apache.commons.httpclient.methods.TraceMethod) Test(org.junit.Test)

Example 4 with TraceMethod

use of org.apache.commons.httpclient.methods.TraceMethod in project camel by apache.

the class NettyHttpTraceDisabledTest method testTraceEnabled.

@Test
public void testTraceEnabled() throws Exception {
    HttpClient httpclient = new HttpClient();
    TraceMethod trace = new TraceMethod("http://localhost:" + portTraceOn + "/myservice");
    httpclient.executeMethod(trace);
    // TRACE is now allowed
    assertTrue(trace.getStatusCode() == 200);
    trace.releaseConnection();
}
Also used : HttpClient(org.apache.commons.httpclient.HttpClient) TraceMethod(org.apache.commons.httpclient.methods.TraceMethod) Test(org.junit.Test)

Example 5 with TraceMethod

use of org.apache.commons.httpclient.methods.TraceMethod in project camel by apache.

the class JettyEndpointSetHttpTraceTest method testTraceDisabled.

@Test
public void testTraceDisabled() throws Exception {
    HttpClient httpclient = new HttpClient();
    TraceMethod trace = new TraceMethod("http://localhost:" + portTraceOff + "/myservice");
    httpclient.executeMethod(trace);
    // TRACE shouldn't be allowed by default
    assertTrue(trace.getStatusCode() == 405);
    trace.releaseConnection();
}
Also used : HttpClient(org.apache.commons.httpclient.HttpClient) TraceMethod(org.apache.commons.httpclient.methods.TraceMethod) Test(org.junit.Test)

Aggregations

HttpClient (org.apache.commons.httpclient.HttpClient)6 TraceMethod (org.apache.commons.httpclient.methods.TraceMethod)6 Test (org.junit.Test)6