@@ -0,0 +1,1897 @@
+package com.justjournal.db;%0A%0Aimport com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource;%0Aimport org.apache.cayenne.access.DataContext;%0Aimport org.apache.cayenne.configuration.server.ServerRuntime;%0Aimport org.junit.Before;%0Aimport org.junit.BeforeClass;%0Aimport org.junit.Test;%0A%0Aimport javax.naming.Context;%0Aimport javax.naming.InitialContext;%0Aimport javax.naming.NamingException;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0Apublic class LocationDaoTest %7B%0A    @BeforeClass%0A       public static void setUpClass() throws Exception %7B%0A           // rcarver - setup the jndi context and the datasource%0A           try %7B%0A               // Create initial context%0A               System.setProperty(Context.INITIAL_CONTEXT_FACTORY,%0A                   %22org.apache.naming.java.javaURLContextFactory%22);%0A               System.setProperty(Context.URL_PKG_PREFIXES,%0A                   %22org.apache.naming%22);%0A               InitialContext ic = new InitialContext();%0A%0A               ic.createSubcontext(%22java:%22);%0A               ic.createSubcontext(%22java:comp%22);%0A               ic.createSubcontext(%22java:comp/env%22);%0A               ic.createSubcontext(%22java:comp/env/jdbc%22);%0A%0A               // Construct DataSource%0A               MysqlConnectionPoolDataSource ds = new MysqlConnectionPoolDataSource();%0A               ds.setURL(%22jdbc:mysql://ds9.midnightbsd.org:3306/jj%22);%0A               ds.setUser(%22jj%22);%0A               ds.setPassword(%22%22);%0A%0A               ic.bind(%22java:comp/env/jdbc/jjDB%22, ds);%0A%0A               ServerRuntime cayenneRuntime = new ServerRuntime(%22cayenne-JustJournalDomain.xml%22);%0A               DataContext.bindThreadObjectContext(cayenneRuntime.getContext());%0A           %7D catch (NamingException ex) %7B%0A                System.err.println(ex.getMessage());%0A           %7D%0A%0A       %7D%0A%0A    @Test%0A    public void testView() throws Exception %7B%0A        assertEquals(5, LocationDao.view().size());%0A    %7D%0A%7D

add unit test