db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From karan malhi <karan.ma...@gmail.com>
Subject Writing TestCase for Sequence Assertions
Date Thu, 15 Sep 2005 01:33:32 GMT
I am trying to follow Michelle's instructions and writing a test case 
for Sequence Assertions. I have the following question:
1. What package should i put my Test Case in?
2. Which .jdo file should i add the <sequence> element to?
3. I have specified my own .conf file, below are the contents of that file:
jdo.tck.description = Run one test for debugging
jdo.tck.testdata =
jdo.tck.standarddata =
jdo.tck.mapping = 0
jdo.tck.classes = org.apache.jdo.tck.api.persistencemanager.Test # 
Change the name of the class once the Test Case runs successfully
As you can see from above, i was trying to run the Test Case so i 
temporarily made a Test Case named "Test" and put it in package 
org.apache.jdo.tck.api.persistencemanager. Then i  inserted the 
<sequence> element in

        <sequence name="TestSequence" datastore-sequence="TEST_SEQ" 

--------------Below is my test() method.---------------------

   public void test() {
        pm = getPM();
        Transaction tx = pm.currentTransaction();
        Sequence seq = 
//            fail(ASSERTION_FAILED,
//                     "Expected a sequence named 
org.apache.jdo.tck.pc.company.ProductSequence but got null instead");
        pm = null;
When i run the test i get  the following error (I know i am testing for 
this error if sequence not found, i just want to make sure i am doing 
stuff properly):

   [java] 1) 
The requested sequence "org.apache.jdo.tck.pc.company.ProductSequence" 
could not be found. Please mak
 sure that it is specified in a valid Meta-Data file.
   [java]      at 
   [java]      at 
   [java]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
   [java]      at 
   [java]      at 
   [java]      at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:204)
   [java]      at 

Michelle: One issue here is that your instructions say that i should 
invoke maven -Djdo.tck.cfglist=aaa.conf installSchema first. If i do 
that with a mapping of jdo.tck.mapping=0, then it takes a long time to 
install the schema. Do we really need to installSchema everytime for the 
value 0. In my case, i am simply trying to test 
pm.getSequence("org.apache.jdo.tck.pc.company.TestSequence"), can i 
simply put a jdo.tck.mapping = 1 instead?

An early response would be appreciated

Karan Singh

View raw message