com.atlassian.bamboo.mock.plugins
Class MockPrefixModuleFactory

java.lang.Object
  extended by com.atlassian.bamboo.mock.plugins.MockPrefixModuleFactory
All Implemented Interfaces:
com.atlassian.plugin.module.ModuleFactory, com.atlassian.plugin.module.PrefixModuleFactory

public class MockPrefixModuleFactory
extends java.lang.Object
implements com.atlassian.plugin.module.PrefixModuleFactory

Use it to instantiate fake module descriptors in unit tests if you don't want them to throw exceptions left right and centre.

You may add instances of modules for given module complete key (plugin + module). Otherwise module classes are expected to have no-arg constructor and require no dependencies.


Field Summary
 
Fields inherited from interface com.atlassian.plugin.module.ModuleFactory
LEGACY_MODULE_FACTORY
 
Constructor Summary
MockPrefixModuleFactory()
           
 
Method Summary
 MockPrefixModuleFactory addModuleInstance(java.lang.String completeKey, java.lang.Object instance)
           
<T> T
createModule(java.lang.String name, com.atlassian.plugin.ModuleDescriptor<T> moduleDescriptor)
           
 java.lang.String getPrefix()
           
static com.atlassian.plugin.module.PrefixDelegatingModuleFactory newDelegatingFactory()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockPrefixModuleFactory

public MockPrefixModuleFactory()
Method Detail

newDelegatingFactory

public static com.atlassian.plugin.module.PrefixDelegatingModuleFactory newDelegatingFactory()

getPrefix

public java.lang.String getPrefix()
Specified by:
getPrefix in interface com.atlassian.plugin.module.PrefixModuleFactory

createModule

public <T> T createModule(java.lang.String name,
                          com.atlassian.plugin.ModuleDescriptor<T> moduleDescriptor)
               throws com.atlassian.plugin.PluginParseException
Specified by:
createModule in interface com.atlassian.plugin.module.ModuleFactory
Throws:
com.atlassian.plugin.PluginParseException

addModuleInstance

public MockPrefixModuleFactory addModuleInstance(java.lang.String completeKey,
                                                 java.lang.Object instance)


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.