spring dm & pax exam
От: ses_hardz http://www.hardz.com
Дата: 07.12.09 14:55
Оценка:
There is an article:
[url=http://www.jroller.com/habuma/date/20090728]

So, there are two parts:
1. a module(bundle) we are going to test
2. the code that performs those tests

The problem is:
@Test
public void serviceReferenceShouldExist() {
   ServiceReference serviceReference = 
      bundleContext.getServiceReference(Translator.class.getName());
   assertNotNull(serviceReference);
}


it's falls down by java.lang.AssertionError. Because serviceReference is null..

It is interesting WHY.
I've got the same sample(similar) to this man has, it was started using Spring DM on server side (using <service> tags without OSGI Activators etc.). And this bundle able to be started — able to be in ACTIVE state in the OSGI registry. It exports package that has Translator interface. But when it was trying to invoke this line of the code
bundleContext.getServiceReference
that returned the
null
back.

Does any one use SPRING DM and tried to make some tests? Help me plz.
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.