KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sleepycat > je > dbi > CodeCoverageTest


1 /*-
2  * See the file LICENSE for redistribution information.
3  *
4  * Copyright (c) 2002,2006 Oracle. All rights reserved.
5  *
6  * $Id: CodeCoverageTest.java,v 1.6 2006/10/30 21:14:43 bostic Exp $
7  */

8
9 package com.sleepycat.je.dbi;
10
11 import com.sleepycat.je.DatabaseException;
12 import com.sleepycat.je.DbInternal;
13 import com.sleepycat.je.LockMode;
14 import com.sleepycat.je.OperationStatus;
15 import com.sleepycat.je.util.StringDbt;
16
17 /**
18  * Various unit tests for CursorImpl to enhance code coverage.
19  */

20 public class CodeCoverageTest extends DbCursorTestBase {
21
22     public CodeCoverageTest()
23         throws DatabaseException {
24
25         super();
26     }
27
28     /**
29      * Test the internal CursorImpl.delete() deleted LN code..
30      */

31     public void testDeleteDeleted()
32         throws Throwable JavaDoc {
33
34         try {
35         initEnv(false);
36             doSimpleCursorPuts();
37
38         StringDbt foundKey = new StringDbt();
39         StringDbt foundData = new StringDbt();
40
41         OperationStatus status = cursor.getFirst(foundKey, foundData,
42                              LockMode.DEFAULT);
43         assertEquals(OperationStatus.SUCCESS, status);
44
45         cursor.delete();
46         cursor.delete();
47
48         /*
49          * While we've got a cursor in hand, call CursorImpl.dumpToString()
50          */

51         DbInternal.getCursorImpl(cursor).dumpToString(true);
52         } catch (Throwable JavaDoc t) {
53             t.printStackTrace();
54             throw t;
55         }
56     }
57 }
58
Popular Tags