javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestTransaction.java
changeset 80 d6dafc5d983f
parent 21 2a9601315dfc
equal deleted inserted replaced
78:71ad690e91f5 80:d6dafc5d983f
    19 package com.nokia.mj.test.storage;
    19 package com.nokia.mj.test.storage;
    20 
    20 
    21 import com.nokia.mj.test.storage.utils.StorageSessionTestUtils;
    21 import com.nokia.mj.test.storage.utils.StorageSessionTestUtils;
    22 import com.nokia.mj.impl.storage.*;
    22 import com.nokia.mj.impl.storage.*;
    23 
    23 
    24 import com.nokia.mj.impl.installer.utils.InstallerMain;
    24 import com.nokia.mj.impl.rt.test.UnitTestSuiteCreator;
    25 import j2meunit.framework.Test;
    25 import j2meunit.framework.Test;
    26 import j2meunit.framework.TestCase;
    26 import j2meunit.framework.TestCase;
    27 import j2meunit.framework.TestMethod;
    27 import j2meunit.framework.TestMethod;
    28 import j2meunit.framework.TestSuite;
    28 import j2meunit.framework.TestSuite;
    29 
    29 
    31  * Transaction test cases. See test methods for test case details.<p>
    31  * Transaction test cases. See test methods for test case details.<p>
    32  * NOTE: Multiple transactions are not supported simultaneuously so
    32  * NOTE: Multiple transactions are not supported simultaneuously so
    33  * they're not tested. If second transaction can be created however
    33  * they're not tested. If second transaction can be created however
    34  * writing data with it causes DB server busy.
    34  * writing data with it causes DB server busy.
    35  */
    35  */
    36 public class TestTransaction extends TestCase implements InstallerMain
    36 public class TestTransaction extends TestCase implements UnitTestSuiteCreator
    37 {
    37 {
    38     /**
       
    39      * Directory for JavaStorage tests.
       
    40      */
       
    41     private static final String iTestRoot = "./jstest";
       
    42 
       
    43     /**
       
    44      * Directory for JavaStorage journal and temp files.
       
    45      */
       
    46     private static final String iIsRoot = iTestRoot + "/js";
       
    47 
       
    48     private StorageSession iSession = null;
    38     private StorageSession iSession = null;
    49     private StorageSessionTestUtils iJtu = null;
    39     private StorageSessionTestUtils iJtu = null;
    50 
    40 
    51     public void installerMain(String[] args)
    41     public TestSuite createTestSuite(String[] args)
    52     {
    42     {
    53         TestSuite suite = new TestSuite(this.getClass().getName());
    43         TestSuite suite = new TestSuite(this.getClass().getName());
    54 
    44 
    55         suite.addTest(new TestTransaction("testStartTransaction", new TestMethod()
    45         suite.addTest(new TestTransaction("testStartTransaction", new TestMethod()
    56         {
    46         {
    82             {
    72             {
    83                 ((TestTransaction)tc).testForceRollback();
    73                 ((TestTransaction)tc).testForceRollback();
    84             }
    74             }
    85         }));
    75         }));
    86 
    76 
    87         com.nokia.mj.impl.utils.OmjTestRunner.run(suite);
    77         return suite;
    88     }
    78     }
    89 
    79 
    90     public TestTransaction()
    80     public TestTransaction()
    91     {
    81     {
    92     }
    82     }