use of jakarta.ws.rs.core.CacheControl in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method emptyConstructorTest.
/*
* @testName: emptyConstructorTest
*
* @assertion_ids: JAXRS:JAVADOC:24; JAXRS:JAVADOC:28; JAXRS:JAVADOC:29;
* JAXRS:JAVADOC:32; JAXRS:JAVADOC:33; JAXRS:JAVADOC:34; JAXRS:JAVADOC:35;
* JAXRS:JAVADOC:36; JAXRS:JAVADOC:37;
*
* @test_Strategy: Client instantiate a CacheControl instance using Constructor
* CacheControl(). Verify all values are set correctly.
*/
@Test
public void emptyConstructorTest() throws Fault {
boolean pass = true;
StringBuffer sb = new StringBuffer();
CacheControl ccl = new CacheControl();
pass = verifyList(expected, ccl, sb);
assertTrue(pass, "At least one assertion failed: " + sb);
}
use of jakarta.ws.rs.core.CacheControl in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method noTransformTest.
/*
* @testName: noTransformTest
*
* @assertion_ids: JAXRS:JAVADOC:24; JAXRS:JAVADOC:28; JAXRS:JAVADOC:29;
* JAXRS:JAVADOC:32; JAXRS:JAVADOC:33; JAXRS:JAVADOC:34; JAXRS:JAVADOC:35;
* JAXRS:JAVADOC:36; JAXRS:JAVADOC:37; JAXRS:JAVADOC:42;
*
* @test_Strategy: Client instantiate a CacheControl instance using Constructor
* CacheControl(). Verify all values are set correctly.
*/
@Test
public void noTransformTest() throws Fault {
boolean pass = true;
StringBuffer sb = new StringBuffer();
boolean notransform = false;
expected[4] = notransform;
CacheControl ccl4 = new CacheControl();
ccl4.setNoTransform(notransform);
pass = verifyList(expected, ccl4, sb);
notransform = true;
expected[4] = notransform;
ccl4.setNoTransform(notransform);
pass &= verifyList(expected, ccl4, sb);
assertTrue(pass, "At least one assertion failed: " + sb);
}
use of jakarta.ws.rs.core.CacheControl in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method cacheControlTest.
/*
* @testName: cacheControlTest
*
* @assertion_ids: JAXRS:JAVADOC:533;
*
* @test_Strategy: Set the cache control data of the message.
*/
@Test
public void cacheControlTest() throws Fault {
String error = "Unexpected response returned:";
Invocation.Builder builder = createBuilderForMethod("headerstostring");
CacheControl control = new CacheControl();
control.setMaxAge(2);
String response = builder.cacheControl(control).buildGet().invoke(String.class).toLowerCase();
assertContainsIgnoreCase(response, "max-age", error, response);
}
use of jakarta.ws.rs.core.CacheControl in project jaxrs-api by eclipse-ee4j.
the class ResponseTest method getHeaders.
@POST
@Path("headers")
public Response getHeaders(String headers) {
CacheControl ccl = new CacheControl();
NewCookie cookie = new NewCookie("cookie", "eikooc");
String encoding = "gzip";
Date date = Calendar.getInstance().getTime();
ResponseBuilder builder = Response.ok();
if (headers != null && headers.length() != 0) {
builder = builder.cacheControl(ccl).cookie(cookie).encoding(encoding).expires(date).language(Locale.CANADA_FRENCH);
}
return builder.build();
}
Aggregations