001// *************************************************************************************************************************** 002// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * 003// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * 004// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance * 005// * with the License. You may obtain a copy of the License at * 006// * * 007// * http://www.apache.org/licenses/LICENSE-2.0 * 008// * * 009// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an * 010// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * 011// * specific language governing permissions and limitations under the License. * 012// *************************************************************************************************************************** 013package org.apache.juneau.rest.mock; 014 015import java.util.*; 016 017import javax.servlet.*; 018import javax.servlet.http.*; 019 020/** 021 * An implementation of {@link HttpSession} for mocking purposes. 022 * 023 * <div class='warn'> 024 * <b>Deprecated</b> - Use <c>org.apache.juneau.restmock2</c> 025 * </div> 026 */ 027@Deprecated 028public class MockHttpSession implements HttpSession { 029 030 /** 031 * Creates a new HTTP session. 032 * 033 * @return A new HTTP session. 034 */ 035 public static MockHttpSession create() { 036 return new MockHttpSession(); 037 } 038 039 @Override /* HttpSession */ 040 public long getCreationTime() { 041 return 0; 042 } 043 044 @Override /* HttpSession */ 045 public String getId() { 046 return null; 047 } 048 049 @Override /* HttpSession */ 050 public long getLastAccessedTime() { 051 return 0; 052 } 053 054 @Override /* HttpSession */ 055 public ServletContext getServletContext() { 056 return null; 057 } 058 059 @Override /* HttpSession */ 060 public void setMaxInactiveInterval(int interval) { 061 } 062 063 @Override /* HttpSession */ 064 public int getMaxInactiveInterval() { 065 return 0; 066 } 067 068 @Override /* HttpSession */ 069 public HttpSessionContext getSessionContext() { 070 return null; 071 } 072 073 @Override /* HttpSession */ 074 public Object getAttribute(String name) { 075 return null; 076 } 077 078 @Override /* HttpSession */ 079 public Object getValue(String name) { 080 return null; 081 } 082 083 @Override /* HttpSession */ 084 public Enumeration<String> getAttributeNames() { 085 return null; 086 } 087 088 @Override /* HttpSession */ 089 public String[] getValueNames() { 090 return null; 091 } 092 093 @Override /* HttpSession */ 094 public void setAttribute(String name, Object value) { 095 } 096 097 @Override /* HttpSession */ 098 public void putValue(String name, Object value) { 099 } 100 101 @Override /* HttpSession */ 102 public void removeAttribute(String name) { 103 } 104 105 @Override /* HttpSession */ 106 public void removeValue(String name) { 107 } 108 109 @Override /* HttpSession */ 110 public void invalidate() { 111 } 112 113 @Override /* HttpSession */ 114 public boolean isNew() { 115 return false; 116 } 117}