Java Code Examples for org.apache.tomcat.unittest.TesterResponse#getCoyoteResponse()

The following examples show how to use org.apache.tomcat.unittest.TesterResponse#getCoyoteResponse() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestResponseUtil.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Test
public void testAddValidWithAll() {
    TesterResponse response = new TesterResponse();
    response.getCoyoteResponse();
    response.addHeader("vary", "host");
    Set<String> expected = new HashSet<>();
    expected.add("*");
    doTestAddVaryFieldName(response, "*", expected);
}
 
Example 2
Source File: TestResponseUtil.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Test
public void testAddAllWithAll() {
    TesterResponse response = new TesterResponse();
    response.getCoyoteResponse();
    response.addHeader("vary", "*");
    Set<String> expected = new HashSet<>();
    expected.add("*");
    doTestAddVaryFieldName(response, "*", expected);
}
 
Example 3
Source File: TestResponseUtil.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Test
public void testAddAllWithNone() {
    TesterResponse response = new TesterResponse();
    response.getCoyoteResponse();
    Set<String> expected = new HashSet<>();
    expected.add("*");
    doTestAddVaryFieldName(response, "*", expected);
}
 
Example 4
Source File: TestResponseUtil.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Test
public void testAddValidWithValidSingleHeader() {
    TesterResponse response = new TesterResponse();
    response.getCoyoteResponse();
    response.addHeader("vary", "foo, bar");
    Set<String> expected = new HashSet<>();
    expected.add("bar");
    expected.add("foo");
    expected.add("too");
    doTestAddVaryFieldName(response, "too", expected);
}
 
Example 5
Source File: TestResponseUtil.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Test
public void testAddValidWithValidSingleHeaderIncludingAll() {
    TesterResponse response = new TesterResponse();
    response.getCoyoteResponse();
    response.addHeader("vary", "foo, *");
    Set<String> expected = new HashSet<>();
    expected.add("*");
    doTestAddVaryFieldName(response, "too", expected);
}
 
Example 6
Source File: TestResponseUtil.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Test
public void testAddValidWithValidSingleHeaderAlreadyPresent() {
    TesterResponse response = new TesterResponse();
    response.getCoyoteResponse();
    response.addHeader("vary", "foo, bar");
    Set<String> expected = new HashSet<>();
    expected.add("bar");
    expected.add("foo");
    doTestAddVaryFieldName(response, "foo", expected);
}
 
Example 7
Source File: TestResponseUtil.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Test
public void testAddValidWithValidHeaders() {
    TesterResponse response = new TesterResponse();
    response.getCoyoteResponse();
    response.addHeader("vary", "foo");
    response.addHeader("vary", "bar");
    Set<String> expected = new HashSet<>();
    expected.add("bar");
    expected.add("foo");
    expected.add("too");
    doTestAddVaryFieldName(response, "too", expected);
}
 
Example 8
Source File: TestResponseUtil.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Test
public void testAddValidWithValidHeadersIncludingAll() {
    TesterResponse response = new TesterResponse();
    response.getCoyoteResponse();
    response.addHeader("vary", "foo");
    response.addHeader("vary", "*");
    Set<String> expected = new HashSet<>();
    expected.add("*");
    doTestAddVaryFieldName(response, "too", expected);
}
 
Example 9
Source File: TestResponseUtil.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Test
public void testAddValidWithValidHeadersAlreadyPresent() {
    TesterResponse response = new TesterResponse();
    response.getCoyoteResponse();
    response.addHeader("vary", "foo");
    response.addHeader("vary", "bar");
    Set<String> expected = new HashSet<>();
    expected.add("bar");
    expected.add("foo");
    doTestAddVaryFieldName(response, "foo", expected);
}
 
Example 10
Source File: TestResponseUtil.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Test
public void testAddValidWithPartiallyValidSingleHeader() {
    TesterResponse response = new TesterResponse();
    response.getCoyoteResponse();
    response.addHeader("vary", "{{{, bar");
    Set<String> expected = new HashSet<>();
    expected.add("bar");
    expected.add("too");
    doTestAddVaryFieldName(response, "too", expected);
}
 
Example 11
Source File: TestResponseUtil.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Test
public void testAddValidWithPartiallyValidSingleHeaderIncludingAll() {
    TesterResponse response = new TesterResponse();
    response.getCoyoteResponse();
    response.addHeader("vary", "{{{, *");
    Set<String> expected = new HashSet<>();
    expected.add("*");
    doTestAddVaryFieldName(response, "too", expected);
}
 
Example 12
Source File: TestResponseUtil.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Test
public void testAddValidWithPartiallyValidSingleHeaderAlreadyPresent() {
    TesterResponse response = new TesterResponse();
    response.getCoyoteResponse();
    response.addHeader("vary", "{{{, bar");
    Set<String> expected = new HashSet<>();
    expected.add("bar");
    doTestAddVaryFieldName(response, "bar", expected);
}