Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 16. Testing OSGi components > Our first OSGi service

16.2. Our first OSGi service

In the first chapter of the book, we implemented a simple calculator application. That application was simple enough to demonstrate the basic concepts of unit testing. We take the same approach in this chapter. We implement the calculator application as an OSGi service. We also implement a sample client for that service and a test bundle for the client. Finally, we install the three bundles in the Apache Felix environment.

Apache Felix—open source implementation of the service platform

The OSGi alliance defines a number of specifications for the OSGi service platform. The implementation of these specifications can be done by anyone. In this chapter, we use the Apache Software Foundation implementation Apache Felix (http://felix.apache.org/). The installation of the Felix project is easy. Start by downloading the latest distribution. Extract the archive and create an environment variable called FELIX_HOME pointing to the Felix folder. The Felix folder should contain the following:

  • bin—This folder contains only one JAR file, called felix.jar. This JAR is used to instantiate the Felix console to remotely operate the different services.

  • bundle—This folder contains the various Felix bundles.

  • conf—This folder contains the Felix configuration file.

  • doc—This folder contains the documentation.



  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial