Author: craigmcc Date: Wed Feb 15 16:50:45 2006 New Revision: 378130 URL: http://svn.apache.org/viewcvs?rev=378130&view=rev Log: Add a mock implementation of java.security.Principal to make working with things like MockHttpServletRequest.setUserPrincipal() easier.
Added: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockPrincipal.java (with props) Added: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockPrincipal.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockPrincipal.java?rev=378130&view=auto ============================================================================== --- struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockPrincipal.java (added) +++ struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockPrincipal.java Wed Feb 15 16:50:45 2006 @@ -0,0 +1,63 @@ +/* + * Copyright 2006 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.shale.test.mock; + +import java.security.Principal; + +/** + * <p>Mock implementation of <code>Principal</code>.</p> + */ +public class MockPrincipal implements Principal { + + + // ------------------------------------------------------------ Constructors + + + public MockPrincipal() { + this(null); + } + + + public MockPrincipal(String name) { + this.name = name; + } + + + // ------------------------------------------------------ Instance Variables + + + private String name = null; + + + // ----------------------------------------------------- Mock Object Methods + + + + public void setName(String name) { + this.name = name; + } + + + // ------------------------------------------------------- Principal Methods + + + public String getName() { + return this.name; + } + + +} Propchange: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockPrincipal.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockPrincipal.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]