Nepomuk Mockup

NepomukMockup is a set of classes that implement the core nepomuk interfaces and which let you start mockup versions of these services without OSGI, middleware or any otehr framework. This makes it easy to write self-contained junit tests or running small experiments.

The mockup classes are written as Java OSGi plugin project, browse the source in SVN:

NepomukMockup uses NepomukClient to connect to a local Nepomuk Server for the remote testing.

Responsible

Initiated by LeoSauermann, but I won't fix things, its up to you to improve it.

Usage

With OSGi, or when programming OSGi-plugins yourself:

Plain old Java Projects:

Background info on nepomuk_mockup: this is a project bundling all mockup JARs into one package, for users that don't use OSGi.

Writing JUnit tests using the Mockup

Write your JUnit tests like this:

class MyTest extends TestCase {
 MockupNepomukServices services;

 protected void setUp() {
   super.setUp();
   // will create a working NEPOMUK in-memory for you.
   services = new MockupNepomukServices(Setup.INMEMORY);
 }

 protected void tearDown() throws Exception {
   services.shutdown();
   super.tearDown();
 }

 public void testThisAndThat() {
   ModelSet main = services.getService(RDF2GoRepository.class).getMainRepository();
   main......
   // access any service here using getService
 }

Loading Claudia Stern testdata

We have testdata for the fictious user Claudia Stern, you need to download it to c:\home\claudia_stern or /home/claudia_stern. You get it from here (nepomuk consortium members only because of copyright issues)

You can load the claudia_stern testdata programmatically:

  services = new MockupNepomukServices(Setup.INMEMORY);
  services.loadClaudiaSternTestData();
  // THEN initialize pimoservice...
  services.getPimoService();

You can also load the testdata using the WebConfigGui