1 package com.diasparsoftware.javax.servlet.test; 2 3 import java.util.*; 4 5 import javax.servlet.ServletContext; 6 import javax.servlet.http.*; 7 8 public class HardcodedHttpSession implements HttpSession { 9 private Map attributes = new HashMap(); 10 11 public long getCreationTime() { 12 return 0; 13 } 14 15 public String getId() { 16 return null; 17 } 18 19 public long getLastAccessedTime() { 20 return 0; 21 } 22 23 public ServletContext getServletContext() { 24 return null; 25 } 26 27 public void setMaxInactiveInterval(int arg0) { 28 } 29 30 public int getMaxInactiveInterval() { 31 return 0; 32 } 33 34 public HttpSessionContext getSessionContext() { 35 return null; 36 } 37 38 public Object getAttribute(String name) { 39 return attributes.get(name); 40 } 41 42 public Object getValue(String arg0) { 43 return null; 44 } 45 46 public Enumeration getAttributeNames() { 47 return new Vector(attributes.keySet()).elements(); 48 } 49 50 public String[] getValueNames() { 51 return null; 52 } 53 54 public void setAttribute(String name, Object value) { 55 attributes.put(name, value); 56 } 57 58 public void putValue(String arg0, Object arg1) { 59 } 60 61 public void removeAttribute(String name) { 62 attributes.remove(name); 63 } 64 65 public void removeValue(String arg0) { 66 } 67 68 public void invalidate() { 69 attributes.clear(); 70 } 71 72 public boolean isNew() { 73 return false; 74 } 75 }