View Javadoc
1 package com.tirsen.angkor.test.unit.mock; 2 3 import javax.servlet.ServletContext; 4 import javax.servlet.http.HttpSession; 5 import javax.servlet.http.HttpSessionContext; 6 import javax.servlet.http.HttpSessionBindingListener; 7 import javax.servlet.http.HttpSessionBindingEvent; 8 import java.util.Enumeration; 9 import java.util.HashMap; 10 import java.util.Map; 11 12 /* 13 * Created by IntelliJ IDEA. 14 * User: Jon Tirsén 15 * Date: 2002-okt-09 16 * Time: 21:08:04 17 * To change this template use Options | File Templates. 18 */ 19 public class MockHttpSession implements HttpSession 20 { 21 private Map attributes = new HashMap(); 22 23 public MockHttpSession() 24 { 25 } 26 27 public boolean isNew() 28 { 29 // TODO implement MockHttpSession.isNew 30 throw new RuntimeException("MockHttpSession.isNew is not implemented yet."); 31 } 32 33 public void invalidate() 34 { 35 // TODO implement MockHttpSession.invalidate 36 throw new RuntimeException("MockHttpSession.invalidate is not implemented yet."); 37 } 38 39 public void removeValue(String s) 40 { 41 // TODO implement MockHttpSession.removeValue 42 throw new RuntimeException("MockHttpSession.removeValue is not implemented yet."); 43 } 44 45 public void removeAttribute(String s) 46 { 47 // TODO implement MockHttpSession.removeAttribute 48 throw new RuntimeException("MockHttpSession.removeAttribute is not implemented yet."); 49 } 50 51 public void putValue(String s, Object o) 52 { 53 // TODO implement MockHttpSession.putValue 54 throw new RuntimeException("MockHttpSession.putValue is not implemented yet."); 55 } 56 57 public void setAttribute(String attribute, Object value) 58 { 59 attributes.put(attribute, value); 60 if (value instanceof HttpSessionBindingListener) 61 { 62 HttpSessionBindingListener httpSessionBindingListener = (HttpSessionBindingListener) value; 63 httpSessionBindingListener.valueBound(new HttpSessionBindingEvent(this, attribute)); 64 } 65 } 66 67 public String[] getValueNames() 68 { 69 // TODO implement MockHttpSession.getValueNames 70 throw new RuntimeException("MockHttpSession.getValueNames is not implemented yet."); 71 } 72 73 public Enumeration getAttributeNames() 74 { 75 // TODO implement MockHttpSession.getAttributeNames 76 throw new RuntimeException("MockHttpSession.getAttributeNames is not implemented yet."); 77 } 78 79 public Object getValue(String s) 80 { 81 // TODO implement MockHttpSession.getValue 82 throw new RuntimeException("MockHttpSession.getValue is not implemented yet."); 83 } 84 85 public Object getAttribute(String attribute) 86 { 87 return attributes.get(attribute); 88 } 89 90 public HttpSessionContext getSessionContext() 91 { 92 // TODO implement MockHttpSession.getSessionContext 93 throw new RuntimeException("MockHttpSession.getSessionContext is not implemented yet."); 94 } 95 96 public int getMaxInactiveInterval() 97 { 98 // TODO implement MockHttpSession.getMaxInactiveInterval 99 throw new RuntimeException("MockHttpSession.getMaxInactiveInterval is not implemented yet."); 100 } 101 102 public void setMaxInactiveInterval(int i) 103 { 104 // ignore 105 } 106 107 public ServletContext getServletContext() 108 { 109 // TODO implement MockHttpSession.getServletContext 110 throw new RuntimeException("MockHttpSession.getServletContext is not implemented yet."); 111 } 112 113 public long getLastAccessedTime() 114 { 115 // TODO implement MockHttpSession.getLastAccessedTime 116 throw new RuntimeException("MockHttpSession.getLastAccessedTime is not implemented yet."); 117 } 118 119 public String getId() 120 { 121 // TODO implement MockHttpSession.getId 122 throw new RuntimeException("MockHttpSession.getId is not implemented yet."); 123 } 124 125 public long getCreationTime() 126 { 127 // TODO implement MockHttpSession.getCreationTime 128 throw new RuntimeException("MockHttpSession.getCreationTime is not implemented yet."); 129 } 130 }

This page was automatically generated by Maven