use of jakarta.ws.rs.core.Cookie in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method cookieCookieTest.
/*
* @testName: cookieCookieTest
*
* @assertion_ids: JAXRS:JAVADOC:535;
*
* @test_Strategy: Add a cookie to be set.
*/
@Test
public void cookieCookieTest() throws Fault {
String error = "Unexpected response returned:";
Invocation.Builder builder = createBuilderForMethod("cookie");
Cookie cookie = new Cookie("tck", "cts");
String response = builder.cookie(cookie).buildGet().invoke(String.class);
assertContainsIgnoreCase(response, "cts", error, response);
}
use of jakarta.ws.rs.core.Cookie in project jaxrs-api by eclipse-ee4j.
the class RequestFilter method getCookiesIsReadOnly.
public void getCookiesIsReadOnly() {
Map<String, Cookie> cookies = requestContext.getCookies();
int length = cookies.size();
try {
cookies.put("key", new Cookie("coo", "kie"));
} catch (Exception e) {
// expected, but optional
}
cookies = requestContext.getCookies();
if (assertTrue(cookies.size() == length, "Cookie was added present"))
return;
abortWithEntity("#getCookies is read-only as expected");
}
use of jakarta.ws.rs.core.Cookie in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorTest20.
/*
* @testName: constructorTest20
*
* @assertion_ids: JAXRS:JAVADOC:108; JAXRS:JAVADOC:100; JAXRS:JAVADOC:101;
* JAXRS:JAVADOC:103; JAXRS:JAVADOC:50; JAXRS:JAVADOC:53; JAXRS:JAVADOC:54;
* JAXRS:JAVADOC:55; JAXRS:JAVADOC:56;
*
* @test_Strategy: Create a NewCookie instance using constructor
* Cookie(String, String, String, String) NewCookie(Cookie, String comment,
* int maxAge, boolean secure)
*/
@Test
public void constructorTest20() throws Fault {
String name = "name_1";
String value = "value_1";
String path = "";
String domain = "y.x.foo.com";
String comment = "";
int maxage = jakarta.ws.rs.core.NewCookie.DEFAULT_MAX_AGE;
int version = 1;
boolean secure = false;
Cookie ck20 = new Cookie(name, value, path, domain);
NewCookie nck20 = new NewCookie(ck20, comment, maxage, secure);
verifyNewCookie(nck20, name, value, path, domain, version, comment, maxage, secure);
}
use of jakarta.ws.rs.core.Cookie in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorTest25.
/*
* @testName: constructorTest25
*
* @assertion_ids: JAXRS:JAVADOC:108; JAXRS:JAVADOC:100; JAXRS:JAVADOC:101;
* JAXRS:JAVADOC:103; JAXRS:JAVADOC:49; JAXRS:JAVADOC:53; JAXRS:JAVADOC:54;
* JAXRS:JAVADOC:55; JAXRS:JAVADOC:56;
*
* @test_Strategy: Create a version 1 NewCookie instance using constructor
* Cookie(String, String, String, String, int) NewCookie(Cookie, String
* comment, int maxAge, boolean secure)
*/
@Test
public void constructorTest25() throws Fault {
String name = "name_1";
String value = "value_1";
String path = "/acme";
String domain = "y.x.foo.com";
int version = 1;
String comment = "cts test comment";
int maxage = 12345;
boolean secure = false;
Cookie ck25 = new Cookie(name, value, path, domain, version);
NewCookie nck25 = new NewCookie(ck25, comment, maxage, secure);
verifyNewCookie(nck25, name, value, path, domain, version, comment, maxage, secure);
}
use of jakarta.ws.rs.core.Cookie in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorTest24.
/*
* @testName: constructorTest24
*
* @assertion_ids: JAXRS:JAVADOC:108; JAXRS:JAVADOC:100; JAXRS:JAVADOC:101;
* JAXRS:JAVADOC:103; JAXRS:JAVADOC:49; JAXRS:JAVADOC:53; JAXRS:JAVADOC:54;
* JAXRS:JAVADOC:55; JAXRS:JAVADOC:56;
*
* @test_Strategy: Create a version 1 NewCookie instance using constructor
* Cookie(String, String, String, String, int) NewCookie(Cookie, String
* comment, int maxAge, boolean secure)
*/
@Test
public void constructorTest24() throws Fault {
String name = "name_1";
String value = "value_1";
String path = "/acme";
String domain = "y.x.foo.com";
int version = 1;
String comment = "cts test comment";
int maxage = jakarta.ws.rs.core.NewCookie.DEFAULT_MAX_AGE;
boolean secure = true;
Cookie ck24 = new Cookie(name, value, path, domain, version);
NewCookie nck24 = new NewCookie(ck24, comment, maxage, secure);
verifyNewCookie(nck24, name, value, path, domain, version, comment, maxage, secure);
}
Aggregations