<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <TITLE> jala.Test.DatabaseMgr </TITLE> <LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> </HEAD> <SCRIPT> function asd() { parent.document.title="jala.Test.DatabaseMgr"; } </SCRIPT> <BODY BGCOLOR="white" onload="asd();"> <!-- ========== START OF NAVBAR ========== --> <A NAME="navbar_bottom"><!-- --></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"> <TR> <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-summary-Global_jala.Test.js.html"><FONT CLASS="NavBarFont1"><B>File</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <!--TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"--> <!--A HREF="deprecated-list.html"--><!--FONT CLASS="NavBarFont1">Deprecated</FONT--><!--/A--><!-- </TD--> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"--><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <B>Jala Test</B> </EM> </TD </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="jala.Test.ArgumentsException.html"><B>PREV CLASS</B></A><!-- NEXT CLASS --> <A HREF="jala.Test.EvaluatorException.html"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="jala.Test.DatabaseMgr.html" TARGET="_top"><B>NO FRAMES</B></A> <SCRIPT> <!-- if(window==top) { document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <!-- =========== END OF NAVBAR =========== --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2>Class jala.Test.DatabaseMgr</H2> <PRE>Object | +--<b>jala.Test.DatabaseMgr</b> </PRE> <HR> <DL> <!-- Class definition --> <DT>class <B>jala.Test.DatabaseMgr</B> </DL> <P> <BR/>Instances of this class allow managing test databases and switching a running application to an in-memory test database to use within a unit test. <BR/><I>Defined in <a href='overview-summary-Global_jala.Test.js.html'>Global/jala.Test.js</a></I><BR/><BR/> </P> <HR> <!-- ======== NESTED CLASS SUMMARY ======== --> <!-- ======== END NESTED CLASS SUMMARY ======== --> <!-- =========== FIELD SUMMARY =========== --> <A NAME="field_summary"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=2><FONT SIZE="+2"> <B>Field Summary</B></FONT></TD> </TR> <!-- This is one instance field summary --> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> Object</CODE></FONT></TD> <TD><CODE><B><A HREF="#databases">databases</A></B></CODE> <BR> Map containing all test databases</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> Object</CODE></FONT></TD> <TD><CODE><B><A HREF="#dbSourceProperties">dbSourceProperties</A></B></CODE> <BR> Map containing the original datasource properties that were temporarily deactivated by activating a test database</TD> </TR> </TABLE> <!-- =========== END FIELD SUMMARY =========== --> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=2><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD> <CODE> <B> <A HREF="jala.Test.DatabaseMgr.html#jala.Test.DatabaseMgr()">jala.Test.DatabaseMgr</A> </B> () </CODE> <BR> Returns a newly created DatabaseMgr instance </TD> </TR> </TABLE> <!-- ======== END CONSTRUCTOR SUMMARY ======== --> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=2><FONT SIZE="+2"> <B>Method Summary</B></FONT></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"> <FONT SIZE="-1"> <CODE> jala.db.RamDatabase</CODE> </FONT> </TD> <TD> <CODE> <B> <A HREF="#startDatabase">startDatabase</A></B>(<String> dbSourceName, <Boolean> copyTables, <Array> tables) </CODE> <BR> Switches the application datasource with the given name to a newly created in-memory database. </TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"> <FONT SIZE="-1"> <CODE> void</CODE> </FONT> </TD> <TD> <CODE> <B> <A HREF="#stopAll">stopAll</A></B>() </CODE> <BR> Stops all registered test databases and and reverts the application to its original datasource(s) as defined in db.properties file. </TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"> <FONT SIZE="-1"> <CODE> Object</CODE> </FONT> </TD> <TD> <CODE> <B> <A HREF="#toString">toString</A></B>() </CODE> <BR> </TD> </TR> </TABLE> <P> <!-- ========== END METHOD SUMMARY =========== --> <!-- ============ FIELD DETAIL START =========== --> <A NAME="field_detail"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=1><FONT SIZE="+2"><B>Field Detail</B></FONT></TD> </TR> </TABLE> <A NAME="databases"><!-- --></A> <H3>databases</H3> <PRE>Object <B>databases</B></PRE> <UL> Map containing all test databases </UL> <HR> <A NAME="dbSourceProperties"><!-- --></A> <H3>dbSourceProperties</H3> <PRE>Object <B>dbSourceProperties</B></PRE> <UL> Map containing the original datasource properties that were temporarily deactivated by activating a test database </UL> <HR> <!-- ============ FIELD DETAIL END =========== --> <!-- ========= CONSTRUCTOR DETAIL START ======== --> <A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=1> <FONT SIZE="+2"><B>Constructor Detail</B></FONT> </TD> </TR> </TABLE> <A NAME="jala.Test.DatabaseMgr()"><!-- --></A><H3> jala.Test.DatabaseMgr</H3> <PRE><B>jala.Test.DatabaseMgr</B>()</PRE> <UL> Returns a newly created DatabaseMgr instance </UL> </UL> <!-- Constructor return value(s) --> <UL> <B>Returns:</B> <UL> A newly created instance of DatabaseMgr </UL> </UL> <!-- End constructor return value(s) --> <!-- ADDITIONAL ATTRIBUTES --> <HR/> <!-- END ADDITIONAL ATTRIBUTES --> <!-- ========= CONSTRUCTOR DETAIL END ======== --> <!-- ============ METHOD DETAIL START ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=1><FONT SIZE="+2"> <B>Method Detail</B></FONT> </TD> </TR> </TABLE> <!-- One single method detail entry --> <A NAME="startDatabase"><!-- --></A> <H3>startDatabase</H3> <PRE>jala.db.RamDatabase <B>startDatabase</B>(<String> dbSourceName, <Boolean> copyTables, <Array> tables)</PRE> <UL>Switches the application datasource with the given name to a newly created in-memory database. In addition this method also clears the application cache and invalidates the root object to ensure that everything is re-retrieved from the test database. This method can be called with a second boolean argument indicating that tables used by the application should be created in the in-memory database (excluding any data).</UL> <!-- METHOD PARAMETERS START --> <UL> <B>Parameters:</B> <UL><CODE>dbSourceName</CODE> - The name of the application database source as defined in db.properties </UL> <UL><CODE>copyTables</CODE> - If true this method also copies all tables in the source database to the test database (excluding indexes). </UL> <UL><CODE>tables</CODE> - An optional array containing table names that should be created in the test database. If not specified this method collects all tables that are mapped in the application. </UL> </UL> <!-- METHOD PARAMETERS END --> <UL> <B>Returns:</B> <UL> The test database </UL> </UL> <!-- ADDITIONAL ATTRIBUTES START --> <!-- ADDITIONAL ATTRIBUTES END --> <HR> <A NAME="stopAll"><!-- --></A> <H3>stopAll</H3> <PRE>void <B>stopAll</B>()</PRE> <UL>Stops all registered test databases and and reverts the application to its original datasource(s) as defined in db.properties file. In addition this method commits all pending changes within the request, cleares the application cache and invalidates the root object to ensure no traces of the test database are left behind.</UL> <!-- METHOD PARAMETERS START --> <!-- METHOD PARAMETERS END --> <!-- ADDITIONAL ATTRIBUTES START --> <!-- ADDITIONAL ATTRIBUTES END --> <HR> <A NAME="toString"><!-- --></A> <H3>toString</H3> <PRE>Object <B>toString</B>()</PRE> <!-- METHOD PARAMETERS START --> <!-- METHOD PARAMETERS END --> <!-- ADDITIONAL ATTRIBUTES START --> <!-- ADDITIONAL ATTRIBUTES END --> <HR> <!-- ============ METHOD DETAIL END ========== --> <!-- ========= END OF CLASS DATA ========= --> <!-- ========== START OF NAVBAR ========== --> <A NAME="navbar_bottom"><!-- --></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"> <TR> <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-summary-Global_jala.Test.js.html"><FONT CLASS="NavBarFont1"><B>File</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><b>Tree</b></FONT></A> </TD> <!--TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"--> <!--A HREF="deprecated-list.html"--><!--FONT CLASS="NavBarFont1">Deprecated</FONT--><!--/A--><!-- </TD--> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <B>Jala Test</B> </EM> </TD </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="jala.Test.ArgumentsException.html"><B>PREV CLASS</B></A><!-- NEXT CLASS --> <A HREF="jala.Test.EvaluatorException.html"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="jala.Test.DatabaseMgr.html" TARGET="_top"><B>NO FRAMES</B></A> <SCRIPT> <!-- if(window==top) { document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <!-- =========== END OF NAVBAR =========== --> <HR> <FONT SIZE="-1"> </FONT> <div class="jsdoc_ctime">Documentation generated by <a href="http://jsdoc.sourceforge.net/" target="_parent">JSDoc</a> on Tue Jan 8 15:50:17 2008</div> </BODY> </HTML>