Methods Summary |
---|
private void | registerService(java.lang.String servicename)
this.configurator.setName(servicename);
this.reg.registerService(this.configurator);
|
protected void | setUp()
this.reg = GDataServerRegistry.getRegistry();
this.configurator = new ProvidedServiceConfig();
this.configurator.setEntryType(Entry.class);
this.configurator.setFeedType(Feed.class);
this.configurator.setExtensionProfile(new ExtensionProfile());
|
protected void | tearDown()
this.reg.flushRegistry();
|
public void | testFlushRegistry()Test method for
'org.apache.lucene.gdata.server.registry.FeedRegistry.getFeedConfigurator(String)'
String service = "service";
registerService(service);
assertEquals("Registered Configurator", this.configurator, this.reg
.getProvidedService(service));
this.reg.flushRegistry();
assertNull("Registry flushed", this.reg.getProvidedService(service));
|
public void | testGetRegistry()Test method for
'org.apache.lucene.gdata.server.registry.FeedRegistry.getRegistry()'
GDataServerRegistry reg1 = GDataServerRegistry.getRegistry();
assertEquals("test singleton", this.reg, reg1);
|
public void | testIsFeedRegistered()
String service = "service";
registerService(service);
assertTrue("Feed is registerd", this.reg.isServiceRegistered(service));
assertFalse("null Feed is not registerd", this.reg
.isServiceRegistered(null));
assertFalse("Feed is not registerd", this.reg
.isServiceRegistered("something"));
|
public void | testRegisterComponent()
try {
this.reg.registerComponent(StorageController.class, null);
fail("RegistryException expected");
} catch (RegistryException e) {
//
}
new GDataRequestListener();
try {
this.reg.registerComponent(StorageCoreController.class, null);
fail("no config");
} catch (Exception e) {
// TODO: handle exception
}
this.reg.registerComponent(DefaultRequestHandlerFactory.class, null);
RequestHandlerFactory factory = this.reg.lookup(
RequestHandlerFactory.class,
ComponentType.REQUESTHANDLERFACTORY);
try {
this.reg
.registerComponent(DefaultRequestHandlerFactory.class, null);
fail("RegistryException expected");
} catch (RegistryException e) {
//
}
this.reg.registerComponent(ServiceFactory.class, null);
ServiceFactory servicefactory = this.reg.lookup(ServiceFactory.class,
ComponentType.SERVICEFACTORY);
assertNotNull(servicefactory);
assertNotNull(factory);
|
public void | testRegisterService()Test method for
'org.apache.lucene.gdata.server.registry.FeedRegistry.registerFeed(FeedInstanceConfigurator)'
String service = "service";
registerService(service);
assertEquals("Registered Configurator", this.configurator, this.reg
.getProvidedService(service));
assertNull("not registered Configurator", this.reg
.getProvidedService("something"));
try {
this.reg.getProvidedService(null);
fail("Exception expected");
} catch (IllegalArgumentException e) {
//
}
|