* added static factory method to ease instantiation of a new registry

* adapted unit test accordingly
 * polished !JavaDocs a little

git-svn-id: svn+ssh://svn.synyx.de/var/svn/synyx/opensource/synyx-plugin/trunk@3010 5a64d73e-33d6-4ccc-9058-23f8668ecac9
This commit is contained in:
Oliver Gierke
2008-10-13 16:05:42 +00:00
parent 29ee503813
commit 241169c1be
3 changed files with 22 additions and 2 deletions

View File

@@ -20,7 +20,7 @@ public class PluginRegistry<T extends Plugin<S>, S> implements Iterable<T> {
/**
* Constructor of {@code PluginRegistry}.
* Creates a new {@code PluginRegistry}.
*/
public PluginRegistry() {
@@ -28,6 +28,19 @@ public class PluginRegistry<T extends Plugin<S>, S> implements Iterable<T> {
}
/**
* Creates a new {@link PluginRegistry}.
*
* @param <T>
* @param <S>
* @return
*/
public static <T extends Plugin<S>, S> PluginRegistry<T, S> create() {
return new PluginRegistry<T, S>();
}
/**
* Register plugins.
*

View File

@@ -8,6 +8,11 @@ import org.junit.Before;
import org.junit.Test;
/**
* Unit test for {@link PluginRegistry}.
*
* @author Oliver Gierke - gierke@synyx.de
*/
public class PluginRegistryUnitTest {
private SamplePlugin provider;
@@ -24,7 +29,7 @@ public class PluginRegistryUnitTest {
provider = new SamplePluginImplementation();
registry = new PluginRegistry<SamplePlugin, String>();
registry = PluginRegistry.create();
registry.setPlugins(Arrays.asList(provider));
}

View File

@@ -12,6 +12,8 @@ import org.synyx.plugin.core.SamplePlugin;
/**
* Integration test to simply check if the configuration gets parsed correctly.
*
* @author Oliver Gierke - gierke@synyx.de
*/
@RunWith(SpringJUnit4ClassRunner.class)