AW: [sip-comm-dev] junit tests error

Emil Ivov emcho at sip-communicator.org
Sun Nov 11 21:27:06 CET 2007


Hello Bernhard,

Glatt Bernhard (Student Com07) wrote:
> Hi Emil,
> 
> thank you for your response. As you suggested I started with a new
> checkout, the errors don't appear anymore.

Great! Glad to hear this.

> To prepare the accounts.properties file correctly, I need real
> accounts for each service implemented, right? 

Right.

> Is there a possibility
> to launch the tests of only one service, for example msn? 

Yes, have a look at the lib/testing.properties file, you can edit it and
remove the lines with the protocol SLICKs that you don't want to run.

> My
> intention is to test first my own new written tests to see if they
> work, and in a second moment all the test-packages together. 

Good idea. Besides tests for protocols like MSN, Yahoo! and ICQ often
fail for reasons that we have no idea of determining since we don't have
access to the corresponding servers.

> I have a
> little experience with junit, but launching the existing tests with
> junit gives me most times a java.lang.NullPointerException. I assume
> because the environment in that case is not prepared for testing. 
> Could you explain me the "right" way to test my code?

We do it with the ant "test" target in the build.xml. If you'd like to
run them differently (e.g., in an IDE) you would have to make sure that
you specify the complete classpath and all the system properties that
you see in the test target.

> Thanks again for your help, Bernhard

Sure, you are most welcome!

Cheers
Emil

> 
> 
> -----Ursprüngliche Nachricht----- Von: Emil Ivov
> [mailto:emcho at sip-communicator.org] Gesendet: Fr 09.11.2007 09:45 An:
> dev at sip-communicator.dev.java.net Betreff: Re: [sip-comm-dev] junit
> tests error
> 
> Hello Bernhard,
> 
> One other thing you need to do before running the tests, is edit your
>  accounts.properties file in the sip-communicator/lib directory.
> That's where you define the user names and the passwords for the
> accounts that will be used for the testing. You can use the 
> sip-communicator/lib/accounts.properties.template file as a basis.
> 
> The exception that you have pasted in your mail, however, is not
> related to what I just said. Have you been modifying your 
> felix.unit.test.properties file? Or maybe lib/testing.properties? In 
> either case I'd suggest you start over with a clean checkout (and
> don't forget to create your own copy of the accounts.properties file)
> 
> 
> Hope this helps Emil
> 
> Bernhard Glatt wrote:
>> Hi to all, I've found out in the meantime that the tests should be
>> run by ant, starting them from the build.xml. Now each test is
>> launched, but only those of the slicklesstests-package succeed. For
>> most of the other slick packages (callhistory, configuration, 
>> fileaccess,...), the test report gives me an error like this for
>> each package:
>> 
>> No test with id=CallHistoryServiceLick
>> 
>> java.lang.IllegalArgumentException: No test with
>> id=CallHistoryServiceLick at 
>> net.java.sip.communicator.slick.runner.SipCommunicatorSlickRunner$2.runTest(SipCommunicatorSlickRunner.java:237)
>>  at junit.framework.TestCase.runBare(TestCase.java:127) 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 
>> net.java.sip.communicator.slick.runner.ScTestRunner.doRun(ScTestRunner.java:104)
>>  at 
>> net.java.sip.communicator.slick.runner.ScTestRunner.doRun(ScTestRunner.java:94)
>>  at 
>> net.java.sip.communicator.slick.runner.ScTestRunner.run(ScTestRunner.java:56)
>>  at 
>> net.java.sip.communicator.slick.runner.SipCommunicatorSlickRunner.start(SipCommunicatorSlickRunner.java:150)
>>  at 
>> org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:509)
>>  at org.apache.felix.framework.Felix._startBundle(Felix.java:1260) 
>> at org.apache.felix.framework.Felix.startBundle(Felix.java:1201) at
>> org.apache.felix.framework.Felix.setFrameworkStartLevel(Felix.java:807)
>>  at
>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:256)
>>  at java.lang.Thread.run(Unknown Source)
>> 
>> 
>> Has anyone suggestions for me how to go on?
>> 
>> Thanks, Bernhard Glatt
>> 
>> 
>> Bernhard Glatt schrieb:
>>> Hi to all,
>>> 
>>> I've downloaded sip-communicator's source code, and I can run it
>>> from source (in eclipse). I have a problem running the junit
>>> tests. I've tried to launch some single test classes, some of
>>> them work, some give errors. By right-clicking the whole test
>>> package and selecting "run as -> junit test", each test is
>>> called, but most of them end up with a 
>>> java.lang.NullPointerException (runs: 304, errors 242, failures
>>> 55).
>>> 
>>> Could someone help me to run all the test correctly?
>>> 
>>> Thanks, Bernhard Glatt
>>> 
>>> ---------------------------------------------------------------------
>>>  To unsubscribe, e-mail:
>>> dev-unsubscribe at sip-communicator.dev.java.net For additional
>>> commands, e-mail: dev-help at sip-communicator.dev.java.net
>>> 
>>> 
>> ---------------------------------------------------------------------
>>  To unsubscribe, e-mail:
>> dev-unsubscribe at sip-communicator.dev.java.net For additional
>> commands, e-mail: dev-help at sip-communicator.dev.java.net
>> 
>> 
> 
> ---------------------------------------------------------------------
>  To unsubscribe, e-mail:
> dev-unsubscribe at sip-communicator.dev.java.net For additional
> commands, e-mail: dev-help at sip-communicator.dev.java.net
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> 
> ---------------------------------------------------------------------
>  To unsubscribe, e-mail:
> dev-unsubscribe at sip-communicator.dev.java.net For additional
> commands, e-mail: dev-help at sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe at sip-communicator.dev.java.net
For additional commands, e-mail: dev-help at sip-communicator.dev.java.net





More information about the dev mailing list