|
From: Boleslaw D. <bd...@o2...> - 2006-07-07 08:45:15
|
User: bdaw
Date: 06/07/07 04:45:13
Modified: portlet/src/main/org/jboss/portal/test/portlet/info
InfoTestSuite.java
Added: portlet/src/main/org/jboss/portal/test/portlet/info
SecurityInfoTest.java
Log:
- SecurityInfo interface initial test - failing
Revision Changes Path
1.8 +2 -1 jboss-portal/portlet/src/main/org/jboss/portal/test/portlet/info/InfoTestSuite.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: InfoTestSuite.java
===================================================================
RCS file: /cvsroot/jboss/jboss-portal/portlet/src/main/org/jboss/portal/test/portlet/info/InfoTestSuite.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- InfoTestSuite.java 30 Jun 2006 21:23:19 -0000 1.7
+++ InfoTestSuite.java 7 Jul 2006 08:45:13 -0000 1.8
@@ -27,7 +27,7 @@
/**
* @author <a href="mailto:ju...@jb...">Julien Viet</a>
- * @version $Revision: 1.7 $
+ * @version $Revision: 1.8 $
*/
public class InfoTestSuite
{
@@ -43,6 +43,7 @@
suite.addTest(new TestCase("ModeInfoTest"));
suite.addTest(new TestCase("PortletInfoTest"));
suite.addTest(new TestCase("SessionInfoTest"));
+ suite.addTest(new TestCase("SecurityInfoTest"));
return suite;
}
1.1 date: 2006/07/07 08:45:13; author: bdaw; state: Exp;jboss-portal/portlet/src/main/org/jboss/portal/test/portlet/info/SecurityInfoTest.java
Index: SecurityInfoTest.java
===================================================================
/*
* JBoss, Home of Professional Open Source
* Copyright 2005, JBoss Inc., and individual contributors as indicated
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software 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 this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.portal.test.portlet.info;
import org.jboss.portal.test.server.AbstractTest;
import org.jboss.portal.test.framework.container.result.Result;
import org.jboss.portal.test.framework.container.result.AssertResult;
import org.jboss.portal.portlet.container.PortletApplicationRegistry;
import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.info.SecurityInfo;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.util.TransportGuarantee;
/**
* @author <a href="mailto:bol...@jb...">Boleslaw Dawidowicz</a>
* @version $Revision: 1.1 $
*/
public class SecurityInfoTest extends AbstractTest
{
private PortletApplicationRegistry registry;
public PortletApplicationRegistry getRegistry()
{
return registry;
}
public void setRegistry(PortletApplicationRegistry registry)
{
this.registry = registry;
}
public Result execute(ServerInvocation invocation)
{
AssertResult result = new AssertResult();
result.execute(new AssertResult.Test()
{
public void run() throws Exception
{
//This asserts only .isRemotable() as rest is checked in other tests
PortletContainer container = (PortletContainer)registry.getPortletContainer("/test-info.SecuredPortlet1");
PortletInfo info = container.getInfo();
SecurityInfo secInfo = info.getSecurity();
secInfo = info.getSecurity();
assertEquals(1, secInfo.getTransportGuarantees().size());
assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.CONFIDENTIAL));
//assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.INTEGRAL));
//assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.NONE));
container = (PortletContainer)registry.getPortletContainer("/test-info.SecuredPortlet2");
info = container.getInfo();
secInfo = info.getSecurity();
assertEquals(1, secInfo.getTransportGuarantees().size());
assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.INTEGRAL));
container = (PortletContainer)registry.getPortletContainer("/test-info.SecuredPortlet3");
info = container.getInfo();
secInfo = info.getSecurity();
assertEquals(1, secInfo.getTransportGuarantees().size());
assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.INTEGRAL));
}
});
return result;
}
}
|