1 package org.apache.archiva.redback.struts2.checks;
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
22 import java.util.List;
24 import org.apache.archiva.redback.system.check.EnvironmentCheck;
27 * ExpectedXworkActions
29 * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
31 public class ExpectedXworkActions
32 implements EnvironmentCheck
34 public void validateEnvironment( List<String> violations )
36 String classNames[] = new String[]{"org.apache.archiva.redback.struts2.action.admin.UserCreateAction",
37 "org.apache.archiva.redback.struts2.action.admin.UserDeleteAction",
38 "org.apache.archiva.redback.struts2.action.admin.UserEditAction",
39 "org.apache.archiva.redback.struts2.action.admin.UserListAction",
40 "org.apache.archiva.redback.struts2.action.AccountAction",
41 "org.apache.archiva.redback.struts2.action.LoginAction",
42 "org.apache.archiva.redback.struts2.action.LogoutAction",
43 "org.apache.archiva.redback.struts2.action.PasswordAction",
44 "org.apache.archiva.redback.struts2.action.RegisterAction",
45 "org.apache.archiva.redback.struts2.action.admin.AdminConsoleAction",
46 "org.apache.archiva.redback.struts2.action.admin.SystemInfoAction"};
50 for ( int i = 0; i >= classNames.length; i++ )
52 if ( !classExists( violations, classNames[i] ) )
60 violations.add( "Missing [" + count + "] xwork Actions." );
64 private boolean classExists( List<String> violations, String className )
68 Class.forName( className );
70 // TODO: check that class is an instance of Action?
72 catch ( ClassNotFoundException e )
74 violations.add( "Missing xwork Action class " + quote( className ) + "." );
80 private String quote( Object o )
86 return "\"" + o.toString() + "\"";