use of jakarta.ws.rs.core.NewCookie in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorTest21.
/*
* @testName: constructorTest21
*
* @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 constructorTest21() throws Fault {
String name = "name_1";
String value = "value_1";
String path = "/acme";
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 ck21 = new Cookie(name, value, path, domain, version);
NewCookie nck21 = new NewCookie(ck21, comment, maxage, secure);
verifyNewCookie(nck21, name, value, path, domain, version, comment, maxage, secure);
}
use of jakarta.ws.rs.core.NewCookie in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method equalsTest.
/*
* @testName: equalsTest
*
* @assertion_ids: JAXRS:JAVADOC:99; JAXRS:JAVADOC:102;
*
* @test_Strategy: Create two NewCookie instances using constructor
* Cookie(String, String, String, String, int) NewCookie(Cookie, String
* comment, int maxAge, boolean secure) and NewCokie(String name, String
* value, String path, String domain, int version, String comment, int maxAge,
* boolean secure) Verify that equals and hashCode methods work.
*/
@Test
public void equalsTest() throws Fault {
boolean pass = true;
StringBuffer sb = new StringBuffer();
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 ck28 = new Cookie(name, value, path, domain, version);
NewCookie nck28 = new NewCookie(ck28, comment, maxage, secure);
NewCookie nck29 = new NewCookie(name, value, path, domain, version, comment, maxage, secure);
if (!nck28.equals(nck29)) {
pass = false;
sb.append("Equal test failed.").append(newline);
sb.append("First :").append(nck28.toString()).append(newline);
sb.append("Second :").append(nck29.toString()).append(newline);
}
if (nck28.hashCode() != nck29.hashCode()) {
pass = false;
sb.append("HashCode equal test failed.").append(newline);
}
name = "name1";
nck29 = new NewCookie(name, value, path, domain, version, comment, maxage, secure);
if (nck28.equals(nck29)) {
pass = false;
sb.append("UnEqual test failed at name.").append(newline);
sb.append("First :").append(nck28.toString()).append(newline);
sb.append("Second :").append(nck29.toString()).append(newline);
}
if (nck28.hashCode() == nck29.hashCode()) {
pass = false;
sb.append("HashCode unequal test failed at name.").append(newline);
}
assertTrue(pass, "At least one assertion failed: " + sb.toString());
}
use of jakarta.ws.rs.core.NewCookie in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method toCookieTest.
/*
* @testName: toCookieTest
*
* @assertion_ids: JAXRS:JAVADOC:109; JAXRS:JAVADOC:52; JAXRS:JAVADOC:58;
*
* @test_Strategy: Create a Cookie instance using constructor Cookie(String,
* String, String, String, int) and a NewCookie instance NewCokie(String name,
* String value, String path, String domain, int version, String comment, int
* maxAge, boolean secure) NewCookie(Cookie, String comment, int maxAge,
* boolean secure) Verify that toCookie method works by using .equals and
* hashCode method.
*/
@Test
public void toCookieTest() throws Fault {
boolean pass = true;
StringBuffer sb = new StringBuffer();
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 ck30 = new Cookie(name, value, path, domain, version);
NewCookie nck30 = new NewCookie(name, value, path, domain, version, comment, maxage, secure);
Cookie ck31 = nck30.toCookie();
if (!ck30.equals(ck31)) {
pass = false;
sb.append("Equal test failed.").append(newline);
sb.append("First :").append(ck30.toString()).append(newline);
sb.append("Second :").append(ck31.toString()).append(newline);
}
if (ck30.hashCode() != ck31.hashCode()) {
pass = false;
sb.append("HashCode equal test failed.").append(newline);
}
assertTrue(pass, "At least one assertion failed: " + sb.toString());
}
use of jakarta.ws.rs.core.NewCookie in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorTest2.
/*
* @testName: constructorTest2
*
* @assertion_ids: JAXRS:JAVADOC:107; 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)
*/
@Test
public void constructorTest2() throws Fault {
String name = "name_1";
String value = "value_1";
String path = "/acme";
String domain = "";
String comment = "";
int maxage = jakarta.ws.rs.core.NewCookie.DEFAULT_MAX_AGE;
int version = 1;
boolean secure = false;
Cookie ck2 = new Cookie(name, value, path, domain);
NewCookie nck2 = new NewCookie(ck2);
verifyNewCookie(nck2, name, value, path, domain, version, comment, maxage, secure);
}
use of jakarta.ws.rs.core.NewCookie in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorTest4.
/*
* @testName: constructorTest4
*
* @assertion_ids: JAXRS:JAVADOC:107; 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)
*/
@Test
public void constructorTest4() throws Fault {
String name = "name_1";
String value = "value_1";
String path = "/acme";
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 ck4 = new Cookie(name, value, path, domain, version);
NewCookie nck4 = new NewCookie(ck4);
verifyNewCookie(nck4, name, value, path, domain, version, comment, maxage, secure);
}
Aggregations