com.atlassian.plugin.manager
Class TestDefaultPluginManager
java.lang.Object
com.atlassian.plugin.manager.TestDefaultPluginManager
- Direct Known Subclasses:
- TestEnabledModuleCachingPluginAccessor
public class TestDefaultPluginManager
- extends java.lang.Object
Unit and low level integration tests for TestDefaultPluginManager.
If you're tempted to try to push mocks further through this, be aware that there are subclasses
which need to wrap components and which react to events sent during processing. That is, these
tests are also testing to some extent integration between DefaultPluginManager and
DefaultPluginEventManager and other related classes.
|
Field Summary |
protected com.atlassian.plugin.manager.DefaultPluginManager |
manager
the object being tested |
protected com.atlassian.plugin.event.PluginEventManager |
pluginEventManager
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
manager
protected com.atlassian.plugin.manager.DefaultPluginManager manager
- the object being tested
pluginEventManager
protected com.atlassian.plugin.event.PluginEventManager pluginEventManager
TestDefaultPluginManager
public TestDefaultPluginManager()
setUp
public void setUp()
throws java.lang.Exception
- Throws:
java.lang.Exception
tearDown
public void tearDown()
throws java.lang.Exception
- Throws:
java.lang.Exception
newDefaultPluginManager
protected com.atlassian.plugin.manager.DefaultPluginManager newDefaultPluginManager(com.atlassian.plugin.loaders.PluginLoader... pluginLoaders)
getPluginAccessor
protected com.atlassian.plugin.PluginAccessor getPluginAccessor()
testRetrievePlugins
public void testRetrievePlugins()
throws com.atlassian.plugin.PluginParseException
- Throws:
com.atlassian.plugin.PluginParseException
testEnableModuleFailed
public void testEnableModuleFailed()
throws com.atlassian.plugin.PluginParseException
- Throws:
com.atlassian.plugin.PluginParseException
testEnabledModuleOutOfSyncWithPlugin
public void testEnabledModuleOutOfSyncWithPlugin()
throws com.atlassian.plugin.PluginParseException
- Throws:
com.atlassian.plugin.PluginParseException
testDisablePluginModuleWithCannotDisableAnnotation
public void testDisablePluginModuleWithCannotDisableAnnotation()
testDisablePluginModuleWithCannotDisableAnnotationInSuperclass
public void testDisablePluginModuleWithCannotDisableAnnotationInSuperclass()
testEnabledDisabledRetrieval
public void testEnabledDisabledRetrieval()
throws com.atlassian.plugin.PluginParseException
- Throws:
com.atlassian.plugin.PluginParseException
testDuplicatePluginKeysAreIgnored
public void testDuplicatePluginKeysAreIgnored()
throws com.atlassian.plugin.PluginParseException
- Throws:
com.atlassian.plugin.PluginParseException
testDuplicateSnapshotVersionsAreNotLoaded
public void testDuplicateSnapshotVersionsAreNotLoaded()
throws com.atlassian.plugin.PluginParseException
- Throws:
com.atlassian.plugin.PluginParseException
testChangedSnapshotVersionIsLoaded
public void testChangedSnapshotVersionIsLoaded()
throws com.atlassian.plugin.PluginParseException
- Throws:
com.atlassian.plugin.PluginParseException
testLoadOlderDuplicatePlugin
public void testLoadOlderDuplicatePlugin()
testLoadOlderDuplicatePluginDoesNotTryToEnableIt
public void testLoadOlderDuplicatePluginDoesNotTryToEnableIt()
testLoadNewerDuplicatePlugin
public void testLoadNewerDuplicatePlugin()
testLoadNewerDuplicateDynamicPluginPreservesPluginState
public void testLoadNewerDuplicateDynamicPluginPreservesPluginState()
throws com.atlassian.plugin.PluginParseException
- Throws:
com.atlassian.plugin.PluginParseException
testLoadNewerDuplicateDynamicPluginPreservesModuleState
public void testLoadNewerDuplicateDynamicPluginPreservesModuleState()
throws com.atlassian.plugin.PluginParseException
- Throws:
com.atlassian.plugin.PluginParseException
testLoadChangedDynamicPluginWithSameVersionNumberDoesNotReplaceExisting
public void testLoadChangedDynamicPluginWithSameVersionNumberDoesNotReplaceExisting()
throws com.atlassian.plugin.PluginParseException
- Throws:
com.atlassian.plugin.PluginParseException
testGetPluginsWithPluginMatchingPluginPredicate
public void testGetPluginsWithPluginMatchingPluginPredicate()
throws java.lang.Exception
- Throws:
java.lang.Exception
testGetPluginsWithPluginNotMatchingPluginPredicate
public void testGetPluginsWithPluginNotMatchingPluginPredicate()
throws java.lang.Exception
- Throws:
java.lang.Exception
testGetPluginModulesWithModuleMatchingPredicate
public void testGetPluginModulesWithModuleMatchingPredicate()
throws java.lang.Exception
- Throws:
java.lang.Exception
testGetPluginModulesWithGetModuleThrowingException
public void testGetPluginModulesWithGetModuleThrowingException()
throws java.lang.Exception
- Throws:
java.lang.Exception
testGetPluginModulesWith2GetModulesThrowingExceptionOnlyNotifiesOnce
public void testGetPluginModulesWith2GetModulesThrowingExceptionOnlyNotifiesOnce()
throws java.lang.Exception
- Throws:
java.lang.Exception
testGetPluginModulesWithModuleNotMatchingPredicate
public void testGetPluginModulesWithModuleNotMatchingPredicate()
throws java.lang.Exception
- Throws:
java.lang.Exception
testGetPluginModuleDescriptorWithModuleMatchingPredicate
public void testGetPluginModuleDescriptorWithModuleMatchingPredicate()
throws java.lang.Exception
- Throws:
java.lang.Exception
testGetPluginModuleDescriptorsWithModuleNotMatchingPredicate
public void testGetPluginModuleDescriptorsWithModuleNotMatchingPredicate()
throws java.lang.Exception
- Throws:
java.lang.Exception
testGetPluginAndModules
public void testGetPluginAndModules()
throws com.atlassian.plugin.PluginParseException
- Throws:
com.atlassian.plugin.PluginParseException
testGetModuleByModuleClassOneFound
public void testGetModuleByModuleClassOneFound()
throws com.atlassian.plugin.PluginParseException
- Throws:
com.atlassian.plugin.PluginParseException
testGetModuleByModuleClassAndDescriptor
public void testGetModuleByModuleClassAndDescriptor()
throws com.atlassian.plugin.PluginParseException
- Throws:
com.atlassian.plugin.PluginParseException
testGetModuleByModuleClassNoneFound
public void testGetModuleByModuleClassNoneFound()
throws com.atlassian.plugin.PluginParseException
- Throws:
com.atlassian.plugin.PluginParseException
testGetModuleDescriptorsByType
public void testGetModuleDescriptorsByType()
throws com.atlassian.plugin.PluginParseException
- Throws:
com.atlassian.plugin.PluginParseException
testRetrievingDynamicResources
public void testRetrievingDynamicResources()
throws com.atlassian.plugin.PluginParseException,
java.io.IOException
- Throws:
com.atlassian.plugin.PluginParseException
java.io.IOException
testGetDynamicPluginClass
public void testGetDynamicPluginClass()
throws java.io.IOException,
com.atlassian.plugin.PluginParseException
- Throws:
java.io.IOException
com.atlassian.plugin.PluginParseException
testGetEnabledPluginsDoesNotReturnEnablingPlugins
public void testGetEnabledPluginsDoesNotReturnEnablingPlugins()
throws java.lang.Exception
- Throws:
java.lang.Exception
testFindingNewPlugins
public void testFindingNewPlugins()
throws com.atlassian.plugin.PluginParseException,
java.io.IOException
- Throws:
com.atlassian.plugin.PluginParseException
java.io.IOException
testFindingNewPluginsNotLoadingRestartRequiredDescriptors
public void testFindingNewPluginsNotLoadingRestartRequiredDescriptors()
throws com.atlassian.plugin.PluginParseException,
java.io.IOException
- Throws:
com.atlassian.plugin.PluginParseException
java.io.IOException
testFindingUpgradePluginsNotLoadingRestartRequiredDescriptors
public void testFindingUpgradePluginsNotLoadingRestartRequiredDescriptors()
throws com.atlassian.plugin.PluginParseException,
java.io.IOException
- Tests upgrade of plugin where the old version didn't have any restart required module descriptors, but the new one does
- Throws:
com.atlassian.plugin.PluginParseException
java.io.IOException
testInstallPluginThatRequiresRestart
public void testInstallPluginThatRequiresRestart()
throws com.atlassian.plugin.PluginParseException,
java.io.IOException,
java.lang.InterruptedException
- Throws:
com.atlassian.plugin.PluginParseException
java.io.IOException
java.lang.InterruptedException
testInstallPluginThatRequiresRestartThenRevert
public void testInstallPluginThatRequiresRestartThenRevert()
throws com.atlassian.plugin.PluginParseException,
java.io.IOException,
java.lang.InterruptedException
- Throws:
com.atlassian.plugin.PluginParseException
java.io.IOException
java.lang.InterruptedException
testUpgradePluginThatRequiresRestart
public void testUpgradePluginThatRequiresRestart()
throws com.atlassian.plugin.PluginParseException,
java.io.IOException,
java.lang.InterruptedException
- Throws:
com.atlassian.plugin.PluginParseException
java.io.IOException
java.lang.InterruptedException
testUpgradePluginThatRequiresRestartThenReverted
public void testUpgradePluginThatRequiresRestartThenReverted()
throws com.atlassian.plugin.PluginParseException,
java.io.IOException,
java.lang.InterruptedException
- Throws:
com.atlassian.plugin.PluginParseException
java.io.IOException
java.lang.InterruptedException
testUpgradePluginThatRequiresRestartThenRevertedRevertsToOriginalPlugin
public void testUpgradePluginThatRequiresRestartThenRevertedRevertsToOriginalPlugin()
throws com.atlassian.plugin.PluginParseException,
java.io.IOException,
java.lang.InterruptedException
- Throws:
com.atlassian.plugin.PluginParseException
java.io.IOException
java.lang.InterruptedException
testUpgradePluginThatRequiresRestartMultipleTimeStaysUpgraded
public void testUpgradePluginThatRequiresRestartMultipleTimeStaysUpgraded()
throws com.atlassian.plugin.PluginParseException,
java.io.IOException,
java.lang.InterruptedException
- Throws:
com.atlassian.plugin.PluginParseException
java.io.IOException
java.lang.InterruptedException
testUpgradePluginThatPreviouslyRequiredRestart
public void testUpgradePluginThatPreviouslyRequiredRestart()
throws com.atlassian.plugin.PluginParseException,
java.io.IOException,
java.lang.InterruptedException
- Throws:
com.atlassian.plugin.PluginParseException
java.io.IOException
java.lang.InterruptedException
testInstallPluginThatPreviouslyRequiredRestart
public void testInstallPluginThatPreviouslyRequiredRestart()
throws com.atlassian.plugin.PluginParseException,
java.io.IOException,
java.lang.InterruptedException
- Throws:
com.atlassian.plugin.PluginParseException
java.io.IOException
java.lang.InterruptedException
testInstallPluginMoreThanOnceStaysAsInstall
public void testInstallPluginMoreThanOnceStaysAsInstall()
throws com.atlassian.plugin.PluginParseException,
java.io.IOException,
java.lang.InterruptedException
- Throws:
com.atlassian.plugin.PluginParseException
java.io.IOException
java.lang.InterruptedException
testRemovePluginThatRequiresRestart
public void testRemovePluginThatRequiresRestart()
throws com.atlassian.plugin.PluginParseException,
java.io.IOException
- Throws:
com.atlassian.plugin.PluginParseException
java.io.IOException
testRemovePluginThatRequiresRestartThenReverted
public void testRemovePluginThatRequiresRestartThenReverted()
throws com.atlassian.plugin.PluginParseException,
java.io.IOException
- Throws:
com.atlassian.plugin.PluginParseException
java.io.IOException
testRemovePluginThatRequiresRestartViaSubclass
public void testRemovePluginThatRequiresRestartViaSubclass()
throws com.atlassian.plugin.PluginParseException,
java.io.IOException
- Throws:
com.atlassian.plugin.PluginParseException
java.io.IOException
testDisableEnableOfPluginThatRequiresRestart
public void testDisableEnableOfPluginThatRequiresRestart()
throws com.atlassian.plugin.PluginParseException,
java.io.IOException
- Throws:
com.atlassian.plugin.PluginParseException
java.io.IOException
testCannotRemovePluginFromStaticLoader
public void testCannotRemovePluginFromStaticLoader()
throws com.atlassian.plugin.PluginParseException,
java.io.IOException
- Throws:
com.atlassian.plugin.PluginParseException
java.io.IOException
testRemovingPlugins
public void testRemovingPlugins()
throws com.atlassian.plugin.PluginException,
java.io.IOException
- Throws:
com.atlassian.plugin.PluginException
java.io.IOException
testPluginModuleAvailableAfterInstallation
public void testPluginModuleAvailableAfterInstallation()
testPluginModuleAvailableAfterInstallationButConfiguredToBeDisabled
public void testPluginModuleAvailableAfterInstallationButConfiguredToBeDisabled()
testPluginModuleUnavailableAfterInstallation
public void testPluginModuleUnavailableAfterInstallation()
testPluginContainerUnavailable
public void testPluginContainerUnavailable()
testUninstallPluginWithDependencies
public void testUninstallPluginWithDependencies()
throws com.atlassian.plugin.PluginException,
java.io.IOException
- Throws:
com.atlassian.plugin.PluginException
java.io.IOException
testUninstallPluginWithMultiLevelDependencies
public void testUninstallPluginWithMultiLevelDependencies()
throws com.atlassian.plugin.PluginException,
java.io.IOException
- Throws:
com.atlassian.plugin.PluginException
java.io.IOException
testCircularDependencyWouldNotCauseInfiniteLoop
public void testCircularDependencyWouldNotCauseInfiniteLoop()
throws com.atlassian.plugin.PluginException,
java.io.IOException
- Throws:
com.atlassian.plugin.PluginException
java.io.IOException
testThreeCycleDependencyWouldNotCauseInfiniteLoop
public void testThreeCycleDependencyWouldNotCauseInfiniteLoop()
throws com.atlassian.plugin.PluginException,
java.io.IOException
- Throws:
com.atlassian.plugin.PluginException
java.io.IOException
testNonRemovablePlugins
public void testNonRemovablePlugins()
throws com.atlassian.plugin.PluginParseException
- Throws:
com.atlassian.plugin.PluginParseException
testNonDeletablePlugins
public void testNonDeletablePlugins()
throws com.atlassian.plugin.PluginException,
java.io.IOException
- Throws:
com.atlassian.plugin.PluginException
java.io.IOException
testComparePluginNewer
public void testComparePluginNewer()
testComparePluginOlder
public void testComparePluginOlder()
testComparePluginEqual
public void testComparePluginEqual()
testComparePluginNoVersion
public void testComparePluginNoVersion()
testComparePluginBadPlugin
public void testComparePluginBadPlugin()
testInvalidationOfDynamicResourceCache
public void testInvalidationOfDynamicResourceCache()
throws java.io.IOException,
com.atlassian.plugin.PluginException
- Throws:
java.io.IOException
com.atlassian.plugin.PluginException
testValidatePlugin
public void testValidatePlugin()
throws com.atlassian.plugin.PluginParseException
- Throws:
com.atlassian.plugin.PluginParseException
testValidatePluginWithNoDynamicLoaders
public void testValidatePluginWithNoDynamicLoaders()
throws com.atlassian.plugin.PluginParseException
- Throws:
com.atlassian.plugin.PluginParseException
testInvalidationOfDynamicClassCache
public void testInvalidationOfDynamicClassCache()
throws java.io.IOException,
com.atlassian.plugin.PluginException
- Throws:
java.io.IOException
com.atlassian.plugin.PluginException
testInstallPlugin
public void testInstallPlugin()
throws java.lang.Exception
- Throws:
java.lang.Exception
testInstallPluginsWithOne
public void testInstallPluginsWithOne()
testInstallPluginsWithTwo
public void testInstallPluginsWithTwo()
testInstallPluginsWithTwoButOneFailsValidation
public void testInstallPluginsWithTwoButOneFailsValidation()
testInstallPluginsWithTwoButOneFailsValidationWithException
public void testInstallPluginsWithTwoButOneFailsValidationWithException()
testInstallTwoPluginsButOneFailsToEnableAModuleAndThenFailsToDisableAModule
public void testInstallTwoPluginsButOneFailsToEnableAModuleAndThenFailsToDisableAModule()
testAddPluginsThatThrowExceptionOnEnabled
public void testAddPluginsThatThrowExceptionOnEnabled()
throws java.lang.Exception
- Throws:
java.lang.Exception
testUninstallPluginClearsState
public void testUninstallPluginClearsState()
throws java.io.IOException
- Throws:
java.io.IOException
testCannotInitTwice
public void testCannotInitTwice()
throws com.atlassian.plugin.PluginParseException
- Throws:
com.atlassian.plugin.PluginParseException
testCannotShutdownTwice
public void testCannotShutdownTwice()
throws com.atlassian.plugin.PluginParseException
- Throws:
com.atlassian.plugin.PluginParseException
testGetPluginWithNullKey
public void testGetPluginWithNullKey()
testShutdownHandlesException
public void testShutdownHandlesException()
testExceptionOnRequiredPluginNotEnabling
public void testExceptionOnRequiredPluginNotEnabling()
throws java.lang.Exception
- Throws:
java.lang.Exception
pluginReturnedByLoadAllPluginsButNotUsedIsDiscarded
public void pluginReturnedByLoadAllPluginsButNotUsedIsDiscarded()
oldPluginReturnedByLoadFoundPluginsIsDiscarded
public void oldPluginReturnedByLoadFoundPluginsIsDiscarded()
createPluginWithVersion
public com.atlassian.plugin.Plugin createPluginWithVersion(java.lang.String version)
Copyright © 2013 Atlassian. All Rights Reserved.