1 package org.openecomp.vid.client;
3 import java.util.Enumeration;
5 import javax.servlet.ServletContext;
6 import javax.servlet.http.HttpSessionContext;
11 public class FakeHttpSessionTest {
13 private FakeHttpSession createTestSubject() {
14 return new FakeHttpSession();
19 public void testGetCreationTime() throws Exception {
20 FakeHttpSession testSubject;
24 testSubject = createTestSubject();
25 result = testSubject.getCreationTime();
30 public void testGetId() throws Exception {
31 FakeHttpSession testSubject;
35 testSubject = createTestSubject();
36 result = testSubject.getId();
41 public void testGetLastAccessedTime() throws Exception {
42 FakeHttpSession testSubject;
46 testSubject = createTestSubject();
47 result = testSubject.getLastAccessedTime();
52 public void testGetServletContext() throws Exception {
53 FakeHttpSession testSubject;
54 ServletContext result;
57 testSubject = createTestSubject();
58 result = testSubject.getServletContext();
63 public void testSetMaxInactiveInterval() throws Exception {
64 FakeHttpSession testSubject;
65 int maxInactiveInterval = 0;
68 testSubject = createTestSubject();
69 testSubject.setMaxInactiveInterval(maxInactiveInterval);
74 public void testGetMaxInactiveInterval() throws Exception {
75 FakeHttpSession testSubject;
79 testSubject = createTestSubject();
80 result = testSubject.getMaxInactiveInterval();
85 public void testGetSessionContext() throws Exception {
86 FakeHttpSession testSubject;
87 HttpSessionContext result;
90 testSubject = createTestSubject();
91 result = testSubject.getSessionContext();
96 public void testGetAttribute() throws Exception {
97 FakeHttpSession testSubject;
102 testSubject = createTestSubject();
103 result = testSubject.getAttribute(name);
108 public void testGetValue() throws Exception {
109 FakeHttpSession testSubject;
114 testSubject = createTestSubject();
115 result = testSubject.getValue(name);
120 public void testGetAttributeNames() throws Exception {
121 FakeHttpSession testSubject;
122 Enumeration<String> result;
125 testSubject = createTestSubject();
126 result = testSubject.getAttributeNames();
131 public void testGetValueNames() throws Exception {
132 FakeHttpSession testSubject;
136 testSubject = createTestSubject();
137 result = testSubject.getValueNames();
142 public void testSetAttribute() throws Exception {
143 FakeHttpSession testSubject;
148 testSubject = createTestSubject();
149 testSubject.setAttribute(name, value);
154 public void testPutValue() throws Exception {
155 FakeHttpSession testSubject;
160 testSubject = createTestSubject();
161 testSubject.putValue(name, value);
166 public void testRemoveAttribute() throws Exception {
167 FakeHttpSession testSubject;
171 testSubject = createTestSubject();
172 testSubject.removeAttribute(name);
177 public void testRemoveValue() throws Exception {
178 FakeHttpSession testSubject;
182 testSubject = createTestSubject();
183 testSubject.removeValue(name);
188 public void testInvalidate() throws Exception {
189 FakeHttpSession testSubject;
192 testSubject = createTestSubject();
193 testSubject.invalidate();
198 public void testIsNew() throws Exception {
199 FakeHttpSession testSubject;
203 testSubject = createTestSubject();
204 result = testSubject.isNew();