@@ -0,0 +1,2714 @@
+/*%0A * Copyright (c) 2013 Lucas Holt%0A * All rights reserved.%0A *%0A * Redistribution and use in source and binary forms, with or without%0A * modification, are permitted provided that the following conditions%0A * are met:%0A * 1. Redistributions of source code must retain the above copyright%0A *    notice, this list of conditions and the following disclaimer.%0A * 2. Redistributions in binary form must reproduce the above copyright%0A *    notice, this list of conditions and the following disclaimer in the%0A *    documentation and/or other materials provided with the distribution.%0A *%0A * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS %60%60AS IS'' AND%0A * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE%0A * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE%0A * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE%0A * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL%0A * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS%0A * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)%0A * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT%0A * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY%0A * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF%0A * SUCH DAMAGE.%0A */%0A%0Apackage com.justjournal.db;%0A%0Aimport org.junit.*;%0A%0Aimport java.util.Collection;%0Aimport java.util.List;%0A%0Aimport static junit.framework.Assert.assertNotNull;%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertNull;%0Aimport static org.junit.Assert.assertTrue;%0A%0A/**%0A * @author Lucas Holt%0A */%0Apublic class TestUserDao %7B%0A%0A    @Test%0A    public void testView() %7B%0A        UserTo user = UserDao.view(%22jjsite%22);%0A%0A        assertEquals(%22jjsite%22, user.getUserName());%0A        assertTrue(user.getId() %3E 0);%0A        assertEquals(%22%22, user.getPassword());%0A    %7D%0A%0A    @Test%0A    public void testViewWithPassword() %7B%0A        UserTo user = UserDao.viewWithPassword(%22jjsite%22);%0A%0A        assertEquals(%22jjsite%22, user.getUserName());%0A        assertTrue(user.getId() %3E 0);%0A        assertTrue(user.getPassword().length() %3E 0);%0A        assertTrue(user.getPasswordSha1().length() %3E 0);%0A    %7D%0A%0A    @Test%0A    public void testViewWithBadUser() %7B%0A        UserTo user = UserDao.view(%22realfakeuserstring%22);%0A        assertNull(user);%0A    %7D%0A%0A    @Test%0A    public void testMemberList() %7B%0A        Collection list = UserDao.memberList();%0A        assertNotNull(list);%0A        assertTrue(list.size() %3E 0);%0A    %7D%0A%0A    @Test%0A    public void testNewUsers() %7B%0A        Collection list = UserDao.newUsers();%0A        assertNotNull(list);%0A        assertEquals(5, list.size());%0A    %7D%0A%7D%0A

add user dao testing