* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.wamblee.support.persistence;
import java.io.File;
import java.util.logging.Level;
import java.util.logging.Logger;
+import junit.framework.Assert;
import junit.framework.TestCase;
import org.apache.derby.drda.NetworkServerControl;
*/
public void doStart() {
try {
+ System.setProperty("derby.stream.error.file", "target/derby.log");
// just in case a previous run was killed without the
// cleanup
cleanPersistentStorage();
lWaited += POLL_INTERVAL;
if (lWaited > MAX_WAIT_TIME) {
- throw new RuntimeException(
- "Derby database did not start within " + MAX_WAIT_TIME +
- "ms");
+ Assert.fail("Derby database did not start within " +
+ MAX_WAIT_TIME + "ms");
}
}
}
private void shutdownDerby() {
try {
DriverManager.getConnection("jdbc:derby:;shutdown=true");
- throw new RuntimeException("Derby did not shutdown, "
- + " should always throw exception at shutdown");
+ throw new RuntimeException(
+ "Derby did not shutdown, should always throw exception at shutdown");
} catch (Exception e) {
LOGGER.info("Derby has been shut down.");
}