/*
* Copyright (C) 2006 Methodhead Software LLC. All rights reserved.
*
* This file is part of TransferCM.
*
* TransferCM is free software; you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option) any later
* version.
*
* TransferCM 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 General Public License along with
* TransferCM; if not, write to the Free Software Foundation, Inc., 51 Franklin St,
* Fifth Floor, Boston, MA 02110-1301 USA
*/
package com.methodhead.transfer;
import java.util.*;
import java.sql.*;
import java.io.*;
import junit.framework.*;
import org.apache.log4j.*;
import com.methodhead.persistable.*;
import com.methodhead.test.*;
import com.methodhead.auth.*;
import com.methodhead.aikp.*;
import com.methodhead.sitecontext.*;
import com.methodhead.reg.*;
import servletunit.struts.*;
import org.apache.struts.action.*;
import org.apache.cactus.*;
public class AboutActionTest extends CactusStrutsTestCase {
static {
TestUtils.initLogger();
}
public AboutActionTest( String name ) {
super( name );
}
public void setUp() {
try {
super.setUp();
ConnectionSingleton.runBatchUpdate( new FileReader( "webapp/WEB-INF/db/transfer-reset.sql" ) );
}
catch ( Exception e ) {
fail( e.getMessage() );
}
}
public void tearDown()
throws
Exception {
super.tearDown();
}
public void testReset() throws Exception {
Role role = new Role();
role.setSiteContext( SiteContext.getDefaultContext() );
role.setName( DefaultTransferPolicy.ROLE_SYSADMIN );
User user = new User();
user.getRoles().add( role );
AuthUtil.setUser( request, user );
setRequestPathInfo( "/about" );
actionPerform();
verifyForward( "form" );
}
}
|