[redhat-ccm-list] how can I solve db-related problem when I run DataQueryImplTest.java using eclipse?

Dennis Gregorovic dgregor at redhat.com
Wed Mar 24 17:18:27 UTC 2004


If you take a look at the test suites (e.g. PersistenceSuite.java),
you'll notice that they create a test wrapper from
com.arsdigita.tools.junit.extensions.BaseTestSetup.java.  That file
performs initialization before running the tests.  In particular, it
reads in the enterprise.init file specified by the test.initscript
system property and then runs the initializers in that file.

This system property and a number of other ones are set by the runtests
target in build.xml.  If you install the ccm-config package you can look
at build-template.xsl and see what it does.

-- Dennis

On Wed, 2004-03-24 at 09:23, Mary Wang wrote:
> Hi,
> Thank you for your rapid response.
>  
> I did not use ant to compile these JUNIT test file because I am not
> familar with Ant. and as if there were no  infomation about  the
> configuration of  ant.properties in your develop guide as Dennis wrote
> in his letter.
>  
> I used the compiler integrated with Eclipse.
>  
> I found that not only  DataQueryImplTest.java but also
> DataOperationTest.java and DatatypeTest.java and many other JUNIT test
> file in the persistence packages have these db-related problem.
>  
> I think my test envirenment is not properly installed.
>  
> I only started a new project in eclipse and moved in all the source
> code and test code of version 5.03.I have also excuted
> enterprise/infrastructure/dev/persistence/sql/data-query-test.sql to
> make DataQueryImplTest.java pass.
>  
> Then I clicked run--->run as--->Junit Test in eclipse. And then the
> test failed.
>  
> I do want to add such parameters as database url,user name and
> password to my source file, but I don't know how and where to add to
> make the test pass and if I can make these tests pass without the use
> of ant.
>  
> Can you help me out?
>  
> Thank you!
>  
> 
> Richard Li <richardl at redhat.com> wrote:
>         One of our release criteria is to make sure all regression
>         tests pass. 
>         This includes unit tests. There are some exceptions to this
>         rule, but 
>         they're pretty rare and complicated and require agreement from
>         a variety 
>         of folks.
>         
>         For your purposes, I would perform an impact analysis of the
>         specific 
>         test failures. If you have a significant number of test
>         failures on a 
>         standard install, it's probably your test environment. If all
>         of your 
>         tests pass except for a few, I'd look at the tests to
>         determine whether 
>         or not it could portend of something more significant.
>         
>         Richard
>         
>         Kevin C. Flaherty wrote:
>         
>         >in a proper environment, do all of the test pass? ie, shall
>         we not feel happy till all suites pass doing 'ant
>         runtest-project' on 5.0.3?
>         >
>         >
>         >
>         >Here's what Dennis Gregorovic (dgregor at redhat.com) had to
>         say:
>         >
>         > 
>         >
>         >>It could be a number of things, but the first make sure that
>         the
>         >>test.initscript property in your ant.properties is set
>         correctly.
>         >>
>         >>-- Dennis
>         >>
>         >>On Tue, 2004-03-23 at 21:22, Mary Wang wrote:
>         >> 
>         >>
>         >>>Hi,
>         >>>I am a WAF newbie and I noticed that there are many JUNIT
>         test code
>         >>>which can be used the test the WAF java class,so I want to
>         run them
>         >>>using eclipse. 
>         >>> 
>         >>>My os is windows 2000,database is Oracle9.0.1,my WAF
>         version is 5.0.3.
>         >>> 
>         >>>I can successfully run ModelTest.java.But when I run
>         >>>DataQueryImplTest.java ,the test failed.And the Failure
>         Trace is:
>         >>>java.lang.NullPointerException
>         >>> at
>         >>>com.arsdigita.db.ConnectionManager.getConnection(ConnectionManager.java:195)
>         >>> at
>         >>>com.arsdigita.persistence.TransactionContext.getConnection(TransactionContext.java:96)
>         >>> at
>         >>>com.arsdigita.persistence.DataStore.getConnection(DataStore.java:104)
>         >>> at
>         >>>com.arsdigita.persistence.DataStore.fireOperation(DataStore.java:309)
>         >>> at
>         >>>com.arsdigita.persistence.DataStore.fireOperation(DataStore.java:179)
>         >>> at
>         >>>com.arsdigita.persistence.DataQueryImpl.executeQuery(DataQueryImpl.java:902)
>         >>> at
>         >>>com.arsdigita.persistence.DataQueryImpl.checkResultSet(DataQueryImpl.java:879)
>         >>> at
>         >>>com.arsdigita.persistence.DataQueryImpl.next(DataQueryImpl.java:416)
>         >>> at
>         >>>com.arsdigita.persistence.DataQueryImplTest.testSetOrder(DataQueryImplTest.java:84)
>         >>> at java.lang.reflect.Method.invoke(Native Method)
>         >>> at junit.framework.TestCase.runTest(TestCase.java:154)
>         >>> at junit.framework.TestCase.runBare(TestCase.java:127)
>         >>> at
>         >>>com.arsdigita.persistence.PersistenceTestCase.runBare(PersistenceTestCase.java:70)
>         >>> at
>         junit.framework.TestResult$1.protect(TestResult.java:106)
>         >>> at
>         junit.framework.TestResult.runProtected(TestResult.java:124)
>         >>> at junit.framework.TestResult.run(TestResult.java:109)
>         >>> at junit.framework.TestCase.run(TestCase.java:118)
>         >>> at junit.framework.TestSuite.runTest(TestSuite.java:208)
>         >>> at junit.framework.TestSuite.run(TestSuite.java:203)
>         >>> at
>         >>>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:392)
>         >>> at
>         >>>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:276)
>         >>> at
>         >>>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:167)
>         >>> 
>         >>>I know that I should solve some db-related problems,but
>         where and how
>         >>>should I modify some source code to make the test pass?
>         >>> 
>         >>>Thank you!
>         >>> 
>         >>>Wanghu
>         >>> 
>         >>>
>         >>>
>         >>>
>         >>>______________________________________________________________________
>         >>>Do You Yahoo!?
>         >>>瀹ㄥ璐圭甸锛椹涓娉ㄥ疯?棰澶60缃缁瀛ㄧ┖?lt;br>>>>
>         >>>______________________________________________________________________
>         >>>-- 
>         >>>Redhat-ccm-list mailing list
>         >>>Redhat-ccm-list at redhat.com
>         >>>https://www.redhat.com/mailman/listinfo/redhat-ccm-list
>         >>>Archives: https://www.redhat.com/pipermail/redhat-ccm-list/
>         >>> 
>         >>>
>         >>-- 
>         >>Redhat-ccm-list mailing list
>         >>Redhat-ccm-list at redhat.com
>         >>https://www.redhat.com/mailman/listinfo/redhat-ccm-list
>         >>Archives: https://www.redhat.com/pipermail/redhat-ccm-list/
>         >> 
>         >>
>         >
>         > 
>         >
>         
>         
>         
>         -- 
>         Redhat-ccm-list mailing list
>         Redhat-ccm-list at redhat.com
>         https://www.redhat.com/mailman/listinfo/redhat-ccm-list
>         Archives: https://www.redhat.com/pipermail/redhat-ccm-list/
> 
> 
> ______________________________________________________________________
> Do You Yahoo!?
> 完全免费的雅虎电邮,马上注册获赠额外60兆网络存储空间





More information about the Redhat-ccm-list mailing list