@@ -0,0 +1,1888 @@
+/*%0A *  Copyright 2011 Rudolf Biczok%0A *%0A *  Licensed under the Apache License, Version 2.0 (the %22License%22);%0A *  you may not use this file except in compliance with the License.%0A *  You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A *  Unless required by applicable law or agreed to in writing, software%0A *  distributed under the License is distributed on an %22AS IS%22 BASIS,%0A *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A *  See the License for the specific language governing permissions and%0A *  limitations under the License.%0A */%0Apackage org.github.pamther;%0A%0Aimport org.github.pamther.test.TempUser;%0Aimport org.junit.AfterClass;%0Aimport org.junit.Assert;%0Aimport org.junit.BeforeClass;%0Aimport org.junit.Test;%0Aimport org.pamther.PAMException;%0Aimport org.pamther.Transaction;%0A%0A/**%0A * The class %7B@link PAMService%7D should ...%0A * %0A * @author %3Ca href=%22https://github.com/RCBiczok%22%3ERudolf Biczok%3C/a%3E%0A */%0Apublic class TransactionTest %7B%0A%0A%09private static final String NAME = %22pamtest%22;%0A%09private static final String PASSWORD = %22mop%22;%0A%09private static TempUser user;%0A%0A%09@BeforeClass%0A%09public static void createUser() throws Exception %7B%0A%09%09TransactionTest.user = new TempUser(TransactionTest.NAME,%0A%09%09%09%09TransactionTest.PASSWORD);%0A%09%09TransactionTest.user.create();%0A%09%7D%0A%0A%09@AfterClass%0A%09public static void deleteUser() %7B%0A%09%09TransactionTest.user.delete();%0A%09%09TransactionTest.user = null;%0A%09%7D%0A%0A%09@Test%0A%09public void haveAService() throws PAMException %7B%0A%09%09Transaction pam = new Transaction();%0A%09%09Assert.assertEquals(%22login%22, pam.getService());%0A%09%09pam.setService(%22su%22);%0A%09%09Assert.assertEquals(%22su%22, pam.getService());%0A%09%7D%0A%0A%09@Test%0A%09public void login() throws PAMException %7B%0A%09%09Transaction pam = new Transaction(%22login%22, TransactionTest.NAME, null);%0A%09%09pam.setPassword(TransactionTest.PASSWORD);%0A%09%09pam.authenticate();%0A%09%09pam.verify();%0A%09%09pam.close();%0A%09%7D%0A%7D%0A

add test case for testing basic authentication and validation