From 87e8a79a9232395efe7e48d149e81141470e6412 Mon Sep 17 00:00:00 2001 From: Cleverson Sacramento Date: Thu, 19 Jul 2012 22:33:57 -0300 Subject: [PATCH] Remoção de classes que não eram mais utilizadas internamente e que atrapalhavam o deploy no GAE --- impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/producer/ContextProducer.java | 84 ------------------------------------------------------------------------------------ impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/proxy/ContextProxy.java | 168 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ impl/core/src/test/java/br/gov/frameworkdemoiselle/internal/producer/ContextProducerTest.java | 66 ------------------------------------------------------------------ impl/core/src/test/java/br/gov/frameworkdemoiselle/internal/proxy/ContextProxyTest.java | 305 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- impl/extension/jsf/src/test/java/br/gov/frameworkdemoiselle/internal/proxy/HttpSessionProxyTest.java | 126 ------------------------------------------------------------------------------------------------------------------------------ 5 files changed, 0 insertions(+), 749 deletions(-) delete mode 100644 impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/producer/ContextProducer.java delete mode 100644 impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/proxy/ContextProxy.java delete mode 100644 impl/core/src/test/java/br/gov/frameworkdemoiselle/internal/producer/ContextProducerTest.java delete mode 100644 impl/core/src/test/java/br/gov/frameworkdemoiselle/internal/proxy/ContextProxyTest.java delete mode 100644 impl/extension/jsf/src/test/java/br/gov/frameworkdemoiselle/internal/proxy/HttpSessionProxyTest.java diff --git a/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/producer/ContextProducer.java b/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/producer/ContextProducer.java deleted file mode 100644 index e2d29be..0000000 --- a/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/producer/ContextProducer.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Demoiselle Framework - * Copyright (C) 2010 SERPRO - * ---------------------------------------------------------------------------- - * This file is part of Demoiselle Framework. - * - * Demoiselle Framework is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License version 3 - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License version 3 - * along with this program; if not, see - * or write to the Free Software Foundation, Inc., 51 Franklin Street, - * Fifth Floor, Boston, MA 02110-1301, USA. - * ---------------------------------------------------------------------------- - * Este arquivo é parte do Framework Demoiselle. - * - * O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou - * modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação - * do Software Livre (FSF). - * - * Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA - * GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou - * APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português - * para maiores detalhes. - * - * Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título - * "LICENCA.txt", junto com esse programa. Se não, acesse - * ou escreva para a Fundação do Software Livre (FSF) Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. - */ -/* - * Demoiselle Framework Copyright (c) 2010 Serpro and other contributors as indicated by the @author tag. See the - * copyright.txt in the distribution for a full listing of contributors. Demoiselle Framework is an open source Java EE - * library designed to accelerate the development of transactional database Web applications. Demoiselle Framework is - * released under the terms of the LGPL license 3 http://www.gnu.org/licenses/lgpl.html LGPL License 3 This file is part - * of Demoiselle Framework. Demoiselle Framework is free software: you can redistribute it and/or modify it under the - * terms of the GNU Lesser General Public License 3 as published by the Free Software Foundation. Demoiselle Framework - * is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You - * should have received a copy of the GNU Lesser General Public License along with Demoiselle Framework. If not, see - * . - */ -package br.gov.frameworkdemoiselle.internal.producer; - -import java.io.Serializable; - -import javax.enterprise.inject.Default; -import javax.enterprise.inject.Produces; -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.naming.NamingException; - -import br.gov.frameworkdemoiselle.DemoiselleException; -import br.gov.frameworkdemoiselle.internal.proxy.ContextProxy; - -public class ContextProducer implements Serializable { - - private static final long serialVersionUID = 1L; - - // @Inject - // @Name("demoiselle-core-bundle") - // private ResourceBundle bundle; - - @Produces - @Default - public static Context create() { - Context context = null; - - try { - context = new ContextProxy(new InitialContext()); - - } catch (NamingException cause) { - throw new DemoiselleException("Erro ao criar InitialContext", cause); - } - - return context; - } -} diff --git a/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/proxy/ContextProxy.java b/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/proxy/ContextProxy.java deleted file mode 100644 index fae2f03..0000000 --- a/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/proxy/ContextProxy.java +++ /dev/null @@ -1,168 +0,0 @@ -package br.gov.frameworkdemoiselle.internal.proxy; - -import java.io.Serializable; -import java.util.Hashtable; - -import javax.naming.Binding; -import javax.naming.Context; -import javax.naming.Name; -import javax.naming.NameClassPair; -import javax.naming.NameParser; -import javax.naming.NamingEnumeration; -import javax.naming.NamingException; - -public class ContextProxy implements Context, Serializable { - - private static final long serialVersionUID = 1L; - - private final Context delegate; - - public ContextProxy(Context delegate) { - this.delegate = delegate; - } - - @Override - public Object addToEnvironment(String propName, Object propVal) throws NamingException { - return delegate.addToEnvironment(propName, propVal); - } - - @Override - public void bind(Name name, Object obj) throws NamingException { - delegate.bind(name, obj); - } - - @Override - public void bind(String name, Object obj) throws NamingException { - delegate.bind(name, obj); - } - - @Override - public void close() throws NamingException { - delegate.close(); - } - - @Override - public Name composeName(Name name, Name prefix) throws NamingException { - return delegate.composeName(name, prefix); - } - - @Override - public String composeName(String name, String prefix) throws NamingException { - return delegate.composeName(name, prefix); - } - - @Override - public Context createSubcontext(Name name) throws NamingException { - return delegate.createSubcontext(name); - } - - @Override - public Context createSubcontext(String name) throws NamingException { - return delegate.createSubcontext(name); - } - - @Override - public void destroySubcontext(Name name) throws NamingException { - delegate.destroySubcontext(name); - } - - @Override - public void destroySubcontext(String name) throws NamingException { - delegate.destroySubcontext(name); - } - - @Override - public Hashtable getEnvironment() throws NamingException { - return delegate.getEnvironment(); - } - - @Override - public String getNameInNamespace() throws NamingException { - return delegate.getNameInNamespace(); - } - - @Override - public NameParser getNameParser(Name name) throws NamingException { - return delegate.getNameParser(name); - } - - @Override - public NameParser getNameParser(String name) throws NamingException { - return delegate.getNameParser(name); - } - - @Override - public NamingEnumeration list(Name name) throws NamingException { - return delegate.list(name); - } - - @Override - public NamingEnumeration list(String name) throws NamingException { - return delegate.list(name); - } - - @Override - public NamingEnumeration listBindings(Name name) throws NamingException { - return delegate.listBindings(name); - } - - @Override - public NamingEnumeration listBindings(String name) throws NamingException { - return delegate.listBindings(name); - } - - @Override - public Object lookup(Name name) throws NamingException { - return delegate.lookup(name); - } - - @Override - public Object lookup(String name) throws NamingException { - return delegate.lookup(name); - } - - @Override - public Object lookupLink(Name name) throws NamingException { - return delegate.lookupLink(name); - } - - @Override - public Object lookupLink(String name) throws NamingException { - return delegate.lookupLink(name); - } - - @Override - public void rebind(Name name, Object obj) throws NamingException { - delegate.rebind(name, obj); - } - - @Override - public void rebind(String name, Object obj) throws NamingException { - delegate.rebind(name, obj); - } - - @Override - public Object removeFromEnvironment(String propName) throws NamingException { - return delegate.removeFromEnvironment(propName); - } - - @Override - public void rename(Name oldName, Name newName) throws NamingException { - delegate.rename(oldName, newName); - } - - @Override - public void rename(String oldName, String newName) throws NamingException { - delegate.rename(oldName, newName); - } - - @Override - public void unbind(Name name) throws NamingException { - delegate.unbind(name); - } - - @Override - public void unbind(String name) throws NamingException { - delegate.unbind(name); - } -} diff --git a/impl/core/src/test/java/br/gov/frameworkdemoiselle/internal/producer/ContextProducerTest.java b/impl/core/src/test/java/br/gov/frameworkdemoiselle/internal/producer/ContextProducerTest.java deleted file mode 100644 index 8dc04e1..0000000 --- a/impl/core/src/test/java/br/gov/frameworkdemoiselle/internal/producer/ContextProducerTest.java +++ /dev/null @@ -1,66 +0,0 @@ -package br.gov.frameworkdemoiselle.internal.producer; - -import static junit.framework.Assert.assertNull; -import static junit.framework.Assert.assertTrue; -import static junit.framework.Assert.fail; -import static org.easymock.EasyMock.expect; -import static org.powermock.api.easymock.PowerMock.mockStatic; - -import javax.naming.Context; -import javax.naming.NamingException; - -import junit.framework.Assert; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.powermock.api.easymock.PowerMock; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.PowerMockRunner; - -import br.gov.frameworkdemoiselle.DemoiselleException; - -import com.sun.naming.internal.ResourceManager; - -@SuppressWarnings("restriction") -@RunWith(PowerMockRunner.class) -@PrepareForTest(ResourceManager.class) -public class ContextProducerTest { - - @Test - public void testCreate() { - - Context context = ContextProducer.create(); - - Assert.assertNotNull(context); - - } - - @Test - public void testCreateThrowingException() { - - Context context = null; - - try { - - mockStatic(ResourceManager.class); - expect(ResourceManager.getInitialEnvironment(null)).andThrow(new NamingException()); - PowerMock.replay(ResourceManager.class); - - context = ContextProducer.create(); - fail(); - - } catch (Exception e) { - assertNull(context); - assertTrue(e instanceof DemoiselleException); - } - - } - - // This test exists only to get 100% on conbertura. - @Test - public void testInstantiateContextProducer() { - @SuppressWarnings("unused") - ContextProducer contextProducer = new ContextProducer(); - } - -} diff --git a/impl/core/src/test/java/br/gov/frameworkdemoiselle/internal/proxy/ContextProxyTest.java b/impl/core/src/test/java/br/gov/frameworkdemoiselle/internal/proxy/ContextProxyTest.java deleted file mode 100644 index f141c32..0000000 --- a/impl/core/src/test/java/br/gov/frameworkdemoiselle/internal/proxy/ContextProxyTest.java +++ /dev/null @@ -1,305 +0,0 @@ -/* - * Demoiselle Framework - * Copyright (C) 2010 SERPRO - * ---------------------------------------------------------------------------- - * This file is part of Demoiselle Framework. - * - * Demoiselle Framework is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License version 3 - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License version 3 - * along with this program; if not, see - * or write to the Free Software Foundation, Inc., 51 Franklin Street, - * Fifth Floor, Boston, MA 02110-1301, USA. - * ---------------------------------------------------------------------------- - * Este arquivo é parte do Framework Demoiselle. - * - * O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou - * modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação - * do Software Livre (FSF). - * - * Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA - * GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou - * APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português - * para maiores detalhes. - * - * Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título - * "LICENCA.txt", junto com esse programa. Se não, acesse - * ou escreva para a Fundação do Software Livre (FSF) Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. - */ -package br.gov.frameworkdemoiselle.internal.proxy; - -import static org.easymock.EasyMock.expect; -import static org.easymock.EasyMock.replay; -import static org.easymock.EasyMock.verify; - -import javax.naming.Context; -import javax.naming.Name; -import javax.naming.NamingException; - -import org.easymock.EasyMock; -import org.junit.Before; -import org.junit.Test; - -public class ContextProxyTest { - - private Context context; - private ContextProxy contextProxy; - - @Before - public void setUp() throws Exception { - this.context = EasyMock.createMock(Context.class); - this.contextProxy = new ContextProxy(this.context); - } - - @Test - public void testAddToEnvironment() throws NamingException { - expect(this.context.addToEnvironment("", null)).andReturn(null); - replay(this.context); - this.contextProxy.addToEnvironment("", null); - verify(this.context); - } - - @Test - public void testBindWithNameAndObject() throws NamingException { - Name name = null; - this.context.bind(name, null); - replay(this.context); - this.contextProxy.bind(name, null); - verify(this.context); - } - - @Test - public void testBindWithStringAndObject() throws NamingException { - this.context.bind("", null); - replay(this.context); - this.contextProxy.bind("", null); - verify(this.context); - } - - @Test - public void testClose() throws NamingException { - this.context.close(); - replay(this.context); - this.contextProxy.close(); - verify(this.context); - } - - @Test - public void testComposeNameWithTwoNames() throws NamingException { - Name n1=null, n2=null; - expect(this.context.composeName(n1,n2)).andReturn(null); - replay(this.context); - this.contextProxy.composeName(n1,n2); - verify(this.context); - } - - @Test - public void testComposeNameWithTwoStrings() throws NamingException { - expect(this.context.composeName("","")).andReturn(null); - replay(this.context); - this.contextProxy.composeName("",""); - verify(this.context); - } - - @Test - public void testCreateSubcontextWithName() throws NamingException { - Name n1 = null; - expect(this.context.createSubcontext(n1)).andReturn(null); - replay(this.context); - this.contextProxy.createSubcontext(n1); - verify(this.context); - } - - @Test - public void testCreateSubcontextWithString() throws NamingException { - expect(this.context.createSubcontext("")).andReturn(null); - replay(this.context); - this.contextProxy.createSubcontext(""); - verify(this.context); - } - - @Test - public void testDestroySubcontextWithName() throws NamingException { - Name n1=null; - context.destroySubcontext(n1); - replay(this.context); - this.contextProxy.destroySubcontext(n1); - verify(this.context); - } - - @Test - public void testDestroySubcontextWithString() throws NamingException { - context.destroySubcontext(""); - replay(this.context); - this.contextProxy.destroySubcontext(""); - verify(this.context); - } - - @Test - public void testGetNameInNamespace() throws NamingException { - expect(this.context.getNameInNamespace()).andReturn(null); - replay(this.context); - this.contextProxy.getNameInNamespace(); - verify(this.context); - } - - @Test - public void testGetNameParserWithName() throws NamingException { - Name n1=null; - expect(this.context.getNameParser(n1)).andReturn(null); - replay(this.context); - this.contextProxy.getNameParser(n1); - verify(this.context); - } - - @Test - public void testGetNameParserWithString() throws NamingException { - expect(this.context.getNameParser("")).andReturn(null); - replay(this.context); - this.contextProxy.getNameParser(""); - verify(this.context); - } - - @Test - public void testListWithName() throws NamingException { - Name n1=null; - expect(this.context.list(n1)).andReturn(null); - replay(this.context); - this.contextProxy.list(n1); - verify(this.context); - } - - @Test - public void testListWithString() throws NamingException { - expect(this.context.list("")).andReturn(null); - replay(this.context); - this.contextProxy.list(""); - verify(this.context); - } - - @Test - public void testListBindingsWithName() throws NamingException { - Name n1=null; - expect(this.context.listBindings(n1)).andReturn(null); - replay(this.context); - this.contextProxy.listBindings(n1); - verify(this.context); - } - - @Test - public void testListBindingsWithString() throws NamingException { - expect(this.context.listBindings("")).andReturn(null); - replay(this.context); - this.contextProxy.listBindings(""); - verify(this.context); - } - - @Test - public void testLookupBindingsWithString() throws NamingException { - Name n1 = null; - expect(this.context.lookup(n1)).andReturn(null); - replay(this.context); - this.contextProxy.lookup(n1); - verify(this.context); - } - - @Test - public void testLookupWithString() throws NamingException { - expect(this.context.lookup("")).andReturn(null); - replay(this.context); - this.contextProxy.lookup(""); - verify(this.context); - } - - @Test - public void testLookupLinkBindingsWithString() throws NamingException { - Name n1 = null; - expect(this.context.lookupLink(n1)).andReturn(null); - replay(this.context); - this.contextProxy.lookupLink(n1); - verify(this.context); - } - - @Test - public void testLookupLinkWithString() throws NamingException { - expect(this.context.lookupLink("")).andReturn(null); - replay(this.context); - this.contextProxy.lookupLink(""); - verify(this.context); - } - - @Test - public void testRebindWithNameAndObject() throws NamingException { - Name n1 = null; - this.context.rebind(n1,null); - replay(this.context); - this.contextProxy.rebind(n1,null); - verify(this.context); - } - - @Test - public void testRebindWithStringAndObject() throws NamingException { - this.context.rebind("",null); - replay(this.context); - this.contextProxy.rebind("",null); - verify(this.context); - } - - @Test - public void testRemoveFromEnvironmentWithString() throws NamingException { - expect(this.context.removeFromEnvironment("")).andReturn(null); - replay(this.context); - this.contextProxy.removeFromEnvironment(""); - verify(this.context); - } - - @Test - public void testRenameWithTwoNames() throws NamingException { - Name n1 = null, n2=null; - this.context.rename(n1,n2); - replay(this.context); - this.contextProxy.rename(n1,n2); - verify(this.context); - } - - @Test - public void testRenameWithTwoStrings() throws NamingException{ - this.context.rename("",""); - replay(this.context); - this.contextProxy.rename("",""); - verify(this.context); - } - - @Test - public void testUnbind() throws NamingException { - Name n1 = null; - this.context.unbind(n1); - replay(this.context); - this.contextProxy.unbind(n1); - verify(this.context); - } - - @Test - public void testUnbindWithString() throws NamingException { - this.context.unbind(""); - replay(this.context); - this.contextProxy.unbind(""); - verify(this.context); - } - - @Test - public void testGetEnvironment() throws NamingException { - expect(this.context.getEnvironment()).andReturn(null); - replay(this.context); - this.contextProxy.getEnvironment(); - verify(this.context); - } -} diff --git a/impl/extension/jsf/src/test/java/br/gov/frameworkdemoiselle/internal/proxy/HttpSessionProxyTest.java b/impl/extension/jsf/src/test/java/br/gov/frameworkdemoiselle/internal/proxy/HttpSessionProxyTest.java deleted file mode 100644 index 317e26c..0000000 --- a/impl/extension/jsf/src/test/java/br/gov/frameworkdemoiselle/internal/proxy/HttpSessionProxyTest.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Demoiselle Framework - * Copyright (C) 2010 SERPRO - * ---------------------------------------------------------------------------- - * This file is part of Demoiselle Framework. - * - * Demoiselle Framework is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License version 3 - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License version 3 - * along with this program; if not, see - * or write to the Free Software Foundation, Inc., 51 Franklin Street, - * Fifth Floor, Boston, MA 02110-1301, USA. - * ---------------------------------------------------------------------------- - * Este arquivo é parte do Framework Demoiselle. - * - * O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou - * modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação - * do Software Livre (FSF). - * - * Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA - * GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou - * APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português - * para maiores detalhes. - * - * Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título - * "LICENCA.txt", junto com esse programa. Se não, acesse - * ou escreva para a Fundação do Software Livre (FSF) Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. - */ -package br.gov.frameworkdemoiselle.internal.proxy; - -import static org.easymock.EasyMock.expect; -import static org.easymock.EasyMock.replay; -import static org.easymock.EasyMock.verify; -import static org.junit.Assert.assertEquals; - -import java.util.Enumeration; - -import javax.servlet.ServletContext; -import javax.servlet.http.HttpSession; -import javax.servlet.http.HttpSessionContext; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.powermock.api.easymock.PowerMock; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.PowerMockRunner; - -@SuppressWarnings("deprecation") -@RunWith(PowerMockRunner.class) -@PrepareForTest({ HttpSession.class, ServletContext.class, Enumeration.class, HttpSessionContext.class }) -public class HttpSessionProxyTest { - - private HttpSessionProxy proxy; - - private ServletContext servletContext; - - private Enumeration enumeration; - - private HttpSession session; - - private HttpSessionContext sessionContext; - - @Before - public void before() { - session = PowerMock.createMock(HttpSession.class); - servletContext = PowerMock.createMock(ServletContext.class); - enumeration = PowerMock.createMock(Enumeration.class); - sessionContext = PowerMock.createMock(HttpSessionContext.class); - - expect(session.getValueNames()).andReturn(new String[] {"abcdef"}); - expect(session.getValue("value")).andReturn("value"); - expect(session.getSessionContext()).andReturn(sessionContext); - expect(session.getCreationTime()).andReturn(10L); - expect(session.getId()).andReturn("ID"); - expect(session.getLastAccessedTime()).andReturn(1L); - expect(session.getServletContext()).andReturn(servletContext); - expect(session.getMaxInactiveInterval()).andReturn(2); - expect(session.getAttribute("attribute")).andReturn("attribute-1"); - expect(session.getAttributeNames()).andReturn(enumeration); - expect(session.isNew()).andReturn(true); - - session.removeValue("removeValue"); - session.putValue("put", "it"); - session.invalidate(); - session.removeAttribute("remove"); - session.setAttribute("name", "object"); - session.setMaxInactiveInterval(1); - - replay(session); - - proxy = new HttpSessionProxy(session); - } - - @Test - public void testDelegation() { - assertEquals(sessionContext, proxy.getSessionContext()); - assertEquals("value", proxy.getValue("value")); - assertEquals("abcdef", proxy.getValueNames()[0]); - assertEquals(10L, proxy.getCreationTime()); - assertEquals("ID", proxy.getId()); - assertEquals(1L, proxy.getLastAccessedTime()); - assertEquals(servletContext, proxy.getServletContext()); - assertEquals(2, proxy.getMaxInactiveInterval()); - assertEquals("attribute-1", proxy.getAttribute("attribute")); - assertEquals(enumeration, proxy.getAttributeNames()); - assertEquals(true, proxy.isNew()); - - proxy.removeValue("removeValue"); - proxy.putValue("put","it"); - proxy.invalidate(); - proxy.removeAttribute("remove"); - proxy.setAttribute("name", "object"); - proxy.setMaxInactiveInterval(1); - - verify(session); - } -} -- libgit2 0.21.2