Se comenzaron a realizar unit tests

Junto con ello se modificaron las clases para poder hacer la conexion a
una uri diferente para sqlite.
This commit is contained in:
Daniel Cortés
2019-03-30 00:01:31 -03:00
parent 5a46dde8e5
commit fab3950e07
31 changed files with 1020 additions and 64 deletions

View File

@@ -47,18 +47,18 @@ import danielcortes.xyz.models.version.VersionDAO;
public class DAOManager {
private static final CajaDAO cajaDAO;
private static final CalculoFondoDAO calculoFondoDAO;
private static final DocumentosDAO documentosDAO;
private static final EfectivoDAO efectivoDAO;
private static final EgresoDAO egresoDAO;
private static final IngresoDAO ingresoDAO;
private static final TipoEgresoDAO tipoEgresoDAO;
private static final TipoIngresoDAO tipoIngresoDAO;
private static final EstadoResultadoDAO estadoResultadoDAO;
private static final VersionDAO versionDAO;
private static CajaDAO cajaDAO;
private static CalculoFondoDAO calculoFondoDAO;
private static DocumentosDAO documentosDAO;
private static EfectivoDAO efectivoDAO;
private static EgresoDAO egresoDAO;
private static IngresoDAO ingresoDAO;
private static TipoEgresoDAO tipoEgresoDAO;
private static TipoIngresoDAO tipoIngresoDAO;
private static EstadoResultadoDAO estadoResultadoDAO;
private static VersionDAO versionDAO;
static {
public static void setup() {
cajaDAO = new SQLiteCajaDAO();
calculoFondoDAO = new SQLiteCalculoFondoDAO();
documentosDAO = new SQLiteDocumentosDAO();
@@ -71,6 +71,19 @@ public class DAOManager {
versionDAO = new SQLiteVersionDAO();
}
public static void setup(ConnectionHolder connectionHolder){
cajaDAO = new SQLiteCajaDAO(connectionHolder);
calculoFondoDAO = new SQLiteCalculoFondoDAO(connectionHolder);
documentosDAO = new SQLiteDocumentosDAO(connectionHolder);
efectivoDAO = new SQLiteEfectivoDAO(connectionHolder);
egresoDAO = new SQLiteEgresoDAO(connectionHolder);
ingresoDAO = new SQLiteIngresoDAO(connectionHolder);
tipoEgresoDAO = new SQLiteTipoEgresoDAO(connectionHolder);
tipoIngresoDAO = new SQLiteTipoIngresoDAO(connectionHolder);
estadoResultadoDAO = new SQLiteEstadoResultadoDAO(connectionHolder);
versionDAO = new SQLiteVersionDAO(connectionHolder);
}
public static CajaDAO getCajaDAO() {
return cajaDAO;
}