Java Reference
In-Depth Information
$ ant test.unit
...
[junit] Running
org.apache.felix.cm.file.FilePersistenceManagerConstructorTest
[junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 0.027 sec
[junit] Running org.apache.felix.cm.file.FilePersistenceManagerTest
[junit] Tests run: 8, Failures: 0, Errors: 0, Time elapsed: 0.255 sec
[junit] Running org.apache.felix.cm.impl.CaseInsensitiveDictionaryTest
[junit] Tests run: 10, Failures: 0, Errors: 0, Time elapsed: 0.012 sec
[junit] Running org.apache.felix.cm.impl.ConfigurationAdapterTest
[junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 0.013 sec
[junit] Running org.apache.felix.cm.impl.ConfigurationManagerTest
[junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 0.037 sec
[junit] Running org.apache.felix.cm.impl.DynamicBindingsTest
[junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.055 sec
These are still considered unit tests because they don't run inside an OSG i con-
tainer. You could bundle them into a fragment as you did in section 7.1 and deploy
them using Pax Exam, in which case they would be called bundle tests . Bundle tests
are somewhere between unit and full-blown integration tests. They test more than
a single class or feature but don't involve more than one bundle. Figure 7.7 shows
the difference.
Bundle
Bundle
Bundle
Class
Class
Class
Class
Class
Class
Class
Class
Bundle
Class
Class
Unit test
Bundle test
Integration test
Figure 7.7 Unit, bundle, and integration testing
After you've tested your core functionality both inside and outside the OSG i container,
you can move on to integration testing. Integration testing is where Pax Exam shines.
7.3.4
Integration testing
Integration tests are where you start to piece together your application and test interac-
tions between individual components. To test combinations of components, you need
some way to compose them. For standard Java applications, it can be tricky deciding
which JAR files you need to load; but with OSG i applications, all the dependency infor-
mation is available in the metadata. Deployment becomes a simple matter of picking a
set of bundles.
 
Search WWH ::




Custom Search