From 99c35ed4bbb5e6307c036a9a1baa91e277e5a73f Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Sat, 23 Feb 2013 18:36:55 +0000 Subject: [PATCH] add mock for testing git-svn-id: https://svn.apache.org/repos/asf/archiva/redback/redback-core/trunk@1449388 13f79535-47bb-0310-9956-ffa450edef68 --- .../redback/system/MockUserManager.java | 175 ++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100644 redback-system/src/test/java/org/apache/archiva/redback/system/MockUserManager.java diff --git a/redback-system/src/test/java/org/apache/archiva/redback/system/MockUserManager.java b/redback-system/src/test/java/org/apache/archiva/redback/system/MockUserManager.java new file mode 100644 index 00000000..c51373dc --- /dev/null +++ b/redback-system/src/test/java/org/apache/archiva/redback/system/MockUserManager.java @@ -0,0 +1,175 @@ +package org.apache.archiva.redback.system; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +import org.apache.archiva.redback.users.User; +import org.apache.archiva.redback.users.UserManager; +import org.apache.archiva.redback.users.UserManagerException; +import org.apache.archiva.redback.users.UserManagerListener; +import org.apache.archiva.redback.users.UserNotFoundException; +import org.apache.archiva.redback.users.UserQuery; + +import java.util.List; + +/** + * @author Olivier Lamy + */ +public class MockUserManager implements UserManager +{ + public boolean isReadOnly() + { + return false; //To change body of implemented methods use File | Settings | File Templates. + } + + public String getId() + { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + public void addUserManagerListener( UserManagerListener listener ) + { + //To change body of implemented methods use File | Settings | File Templates. + } + + public void removeUserManagerListener( UserManagerListener listener ) + { + //To change body of implemented methods use File | Settings | File Templates. + } + + public User createUser( String username, String fullName, String emailAddress ) + throws UserManagerException + { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + public User createGuestUser() + throws UserManagerException + { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + public UserQuery createUserQuery() + { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + public List getUsers() + throws UserManagerException + { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + public List getUsers( boolean orderAscending ) + throws UserManagerException + { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + public User addUser( User user ) + throws UserManagerException + { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + public User updateUser( User user ) + throws UserNotFoundException, UserManagerException + { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + public User findUser( String username ) + throws UserNotFoundException, UserManagerException + { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + public User getGuestUser() + throws UserNotFoundException, UserManagerException + { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + public List findUsersByUsernameKey( String usernameKey, boolean orderAscending ) + throws UserManagerException + { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + public List findUsersByFullNameKey( String fullNameKey, boolean orderAscending ) + throws UserManagerException + { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + public List findUsersByEmailKey( String emailKey, boolean orderAscending ) + throws UserManagerException + { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + public List findUsersByQuery( UserQuery query ) + throws UserManagerException + { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + public boolean userExists( String principal ) + throws UserManagerException + { + return false; //To change body of implemented methods use File | Settings | File Templates. + } + + public void deleteUser( String username ) + throws UserNotFoundException, UserManagerException + { + //To change body of implemented methods use File | Settings | File Templates. + } + + public void addUserUnchecked( User user ) + throws UserManagerException + { + //To change body of implemented methods use File | Settings | File Templates. + } + + public void eraseDatabase() + { + //To change body of implemented methods use File | Settings | File Templates. + } + + public User updateUser( User user, boolean passwordChangeRequired ) + throws UserNotFoundException, UserManagerException + { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + public void initialize() + { + //To change body of implemented methods use File | Settings | File Templates. + } + + public boolean isFinalImplementation() + { + return false; //To change body of implemented methods use File | Settings | File Templates. + } + + public String getDescriptionKey() + { + return null; //To change body of implemented methods use File | Settings | File Templates. + } +}