com.atlassian.plugin.manager
Class TestDefaultPluginManager
java.lang.Object
com.atlassian.plugin.manager.TestDefaultPluginManager
- Direct Known Subclasses:
- TestEnabledModuleCachingPluginAccessor
public class TestDefaultPluginManager
- extends 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.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
capturedLogging
public CapturedLogging capturedLogging
expectedException
public org.junit.rules.ExpectedException expectedException
restoreSystemProperties
public org.junit.contrib.java.lang.system.RestoreSystemProperties restoreSystemProperties
manager
protected DefaultPluginManager manager
- the object being tested
pluginEventManager
protected PluginEventManager pluginEventManager
TestDefaultPluginManager
public TestDefaultPluginManager()
setUp
public void setUp()
throws Exception
- Throws:
Exception
tearDown
public void tearDown()
throws Exception
- Throws:
Exception
newDefaultPluginManager
protected DefaultPluginManager newDefaultPluginManager(PluginLoader... pluginLoaders)
getPluginAccessor
protected PluginAccessor getPluginAccessor()
testRetrievePlugins
public void testRetrievePlugins()
throws PluginParseException
- Throws:
PluginParseException
testEnableModuleFailed
public void testEnableModuleFailed()
throws PluginParseException
- Throws:
PluginParseException
testEnabledModuleOutOfSyncWithPlugin
public void testEnabledModuleOutOfSyncWithPlugin()
throws PluginParseException
- Throws:
PluginParseException
testDisablePluginModuleWithCannotDisableAnnotation
public void testDisablePluginModuleWithCannotDisableAnnotation()
testDisablePluginModuleWithCannotDisableAnnotationInSuperclass
public void testDisablePluginModuleWithCannotDisableAnnotationInSuperclass()
testEnabledDisabledRetrieval
public void testEnabledDisabledRetrieval()
throws PluginParseException
- Throws:
PluginParseException
testDuplicatePluginKeysAreIgnored
public void testDuplicatePluginKeysAreIgnored()
throws PluginParseException
- Throws:
PluginParseException
testDuplicateSnapshotVersionsAreNotLoaded
public void testDuplicateSnapshotVersionsAreNotLoaded()
throws PluginParseException
- Throws:
PluginParseException
testChangedSnapshotVersionIsLoaded
public void testChangedSnapshotVersionIsLoaded()
throws PluginParseException
- Throws:
PluginParseException
testLoadOlderDuplicatePlugin
public void testLoadOlderDuplicatePlugin()
testLoadOlderDuplicatePluginDoesNotTryToEnableIt
public void testLoadOlderDuplicatePluginDoesNotTryToEnableIt()
testLoadNewerDuplicatePlugin
public void testLoadNewerDuplicatePlugin()
testLoadNewerDuplicateDynamicPluginPreservesPluginState
public void testLoadNewerDuplicateDynamicPluginPreservesPluginState()
throws PluginParseException
- Throws:
PluginParseException
testLoadNewerDuplicateDynamicPluginPreservesModuleState
public void testLoadNewerDuplicateDynamicPluginPreservesModuleState()
throws PluginParseException
- Throws:
PluginParseException
testLoadChangedDynamicPluginWithSameVersionNumberDoesNotReplaceExisting
public void testLoadChangedDynamicPluginWithSameVersionNumberDoesNotReplaceExisting()
throws PluginParseException
- Throws:
PluginParseException
testGetPluginsWithPluginMatchingPluginPredicate
public void testGetPluginsWithPluginMatchingPluginPredicate()
throws Exception
- Throws:
Exception
testGetPluginsWithPluginNotMatchingPluginPredicate
public void testGetPluginsWithPluginNotMatchingPluginPredicate()
throws Exception
- Throws:
Exception
testGetPluginModulesWithModuleMatchingPredicate
public void testGetPluginModulesWithModuleMatchingPredicate()
throws Exception
- Throws:
Exception
testGetPluginModulesWithGetModuleThrowingException
public void testGetPluginModulesWithGetModuleThrowingException()
throws Exception
- Throws:
Exception
testGetPluginModulesWith2GetModulesThrowingExceptionOnlyNotifiesOnce
public void testGetPluginModulesWith2GetModulesThrowingExceptionOnlyNotifiesOnce()
throws Exception
- Throws:
Exception
testGetPluginModulesWithModuleNotMatchingPredicate
public void testGetPluginModulesWithModuleNotMatchingPredicate()
throws Exception
- Throws:
Exception
testGetPluginModuleDescriptorWithModuleMatchingPredicate
public void testGetPluginModuleDescriptorWithModuleMatchingPredicate()
throws Exception
- Throws:
Exception
testGetPluginModuleDescriptorsWithModuleNotMatchingPredicate
public void testGetPluginModuleDescriptorsWithModuleNotMatchingPredicate()
throws Exception
- Throws:
Exception
testGetPluginAndModules
public void testGetPluginAndModules()
throws PluginParseException
- Throws:
PluginParseException
testGetModuleByModuleClassOneFound
public void testGetModuleByModuleClassOneFound()
throws PluginParseException
- Throws:
PluginParseException
testGetModuleByModuleClassAndDescriptor
public void testGetModuleByModuleClassAndDescriptor()
throws PluginParseException
- Throws:
PluginParseException
testGetModuleByModuleClassNoneFound
public void testGetModuleByModuleClassNoneFound()
throws PluginParseException
- Throws:
PluginParseException
testGetModuleDescriptorsByType
public void testGetModuleDescriptorsByType()
throws PluginParseException
- Throws:
PluginParseException
testRetrievingDynamicResources
public void testRetrievingDynamicResources()
throws PluginParseException,
IOException
- Throws:
PluginParseException
IOException
testGetDynamicPluginClass
public void testGetDynamicPluginClass()
throws IOException,
PluginParseException
- Throws:
IOException
PluginParseException
testGetEnabledPluginsDoesNotReturnEnablingPlugins
public void testGetEnabledPluginsDoesNotReturnEnablingPlugins()
throws Exception
- Throws:
Exception
testFindingNewPlugins
public void testFindingNewPlugins()
throws PluginParseException,
IOException
- Throws:
PluginParseException
IOException
testFindingNewPluginsNotLoadingRestartRequiredDescriptors
public void testFindingNewPluginsNotLoadingRestartRequiredDescriptors()
throws PluginParseException,
IOException
- Throws:
PluginParseException
IOException
testFindingUpgradePluginsNotLoadingRestartRequiredDescriptors
public void testFindingUpgradePluginsNotLoadingRestartRequiredDescriptors()
throws PluginParseException,
IOException
- Tests upgrade of plugin where the old version didn't have any restart required module descriptors, but the new one does
- Throws:
PluginParseException
IOException
testInstallPluginThatRequiresRestart
public void testInstallPluginThatRequiresRestart()
throws PluginParseException,
IOException,
InterruptedException
- Throws:
PluginParseException
IOException
InterruptedException
testInstallPluginThatRequiresRestartThenRevert
public void testInstallPluginThatRequiresRestartThenRevert()
throws PluginParseException,
IOException,
InterruptedException
- Throws:
PluginParseException
IOException
InterruptedException
testUpgradePluginThatRequiresRestart
public void testUpgradePluginThatRequiresRestart()
throws PluginParseException,
IOException,
InterruptedException
- Throws:
PluginParseException
IOException
InterruptedException
testUpgradePluginThatRequiresRestartThenReverted
public void testUpgradePluginThatRequiresRestartThenReverted()
throws PluginParseException,
IOException,
InterruptedException
- Throws:
PluginParseException
IOException
InterruptedException
testUpgradePluginThatRequiresRestartThenRevertedRevertsToOriginalPlugin
public void testUpgradePluginThatRequiresRestartThenRevertedRevertsToOriginalPlugin()
throws PluginParseException,
IOException,
InterruptedException
- Throws:
PluginParseException
IOException
InterruptedException
testUpgradePluginThatRequiresRestartMultipleTimeStaysUpgraded
public void testUpgradePluginThatRequiresRestartMultipleTimeStaysUpgraded()
throws PluginParseException,
IOException,
InterruptedException
- Throws:
PluginParseException
IOException
InterruptedException
testUpgradePluginThatPreviouslyRequiredRestart
public void testUpgradePluginThatPreviouslyRequiredRestart()
throws PluginParseException,
IOException,
InterruptedException
- Throws:
PluginParseException
IOException
InterruptedException
testInstallPluginThatPreviouslyRequiredRestart
public void testInstallPluginThatPreviouslyRequiredRestart()
throws PluginParseException,
IOException,
InterruptedException
- Throws:
PluginParseException
IOException
InterruptedException
testInstallPluginMoreThanOnceStaysAsInstall
public void testInstallPluginMoreThanOnceStaysAsInstall()
throws PluginParseException,
IOException,
InterruptedException
- Throws:
PluginParseException
IOException
InterruptedException
testRemovePluginThatRequiresRestart
public void testRemovePluginThatRequiresRestart()
throws PluginParseException,
IOException
- Throws:
PluginParseException
IOException
testRemovePluginThatRequiresRestartThenReverted
public void testRemovePluginThatRequiresRestartThenReverted()
throws PluginParseException,
IOException
- Throws:
PluginParseException
IOException
testRemovePluginThatRequiresRestartViaSubclass
public void testRemovePluginThatRequiresRestartViaSubclass()
throws PluginParseException,
IOException
- Throws:
PluginParseException
IOException
testDisableEnableOfPluginThatRequiresRestart
public void testDisableEnableOfPluginThatRequiresRestart()
throws PluginParseException,
IOException
- Throws:
PluginParseException
IOException
testCannotRemovePluginFromStaticLoader
public void testCannotRemovePluginFromStaticLoader()
throws PluginParseException,
IOException
- Throws:
PluginParseException
IOException
testRemovingPlugins
public void testRemovingPlugins()
throws PluginException,
IOException
- Throws:
PluginException
IOException
testPluginModuleAvailableAfterInstallation
public void testPluginModuleAvailableAfterInstallation()
testPluginModuleAvailableAfterInstallationButConfiguredToBeDisabled
public void testPluginModuleAvailableAfterInstallationButConfiguredToBeDisabled()
testPluginModuleUnavailableAfterInstallation
public void testPluginModuleUnavailableAfterInstallation()
testPluginContainerUnavailable
public void testPluginContainerUnavailable()
testUninstallPluginWithDependencies
public void testUninstallPluginWithDependencies()
throws PluginException,
IOException
- Throws:
PluginException
IOException
testUninstallPluginWithMultiLevelDependencies
public void testUninstallPluginWithMultiLevelDependencies()
throws PluginException,
IOException
- Throws:
PluginException
IOException
testCircularDependencyWouldNotCauseInfiniteLoop
public void testCircularDependencyWouldNotCauseInfiniteLoop()
throws PluginException,
IOException
- Throws:
PluginException
IOException
testThreeCycleDependencyWouldNotCauseInfiniteLoop
public void testThreeCycleDependencyWouldNotCauseInfiniteLoop()
throws PluginException,
IOException
- Throws:
PluginException
IOException
testNonRemovablePlugins
public void testNonRemovablePlugins()
throws PluginParseException
- Throws:
PluginParseException
testNonDeletablePlugins
public void testNonDeletablePlugins()
throws PluginException,
IOException
- Throws:
PluginException
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 IOException,
PluginException
- Throws:
IOException
PluginException
testValidatePlugin
public void testValidatePlugin()
throws PluginParseException
- Throws:
PluginParseException
testValidatePluginWithNoDynamicLoaders
public void testValidatePluginWithNoDynamicLoaders()
throws PluginParseException
- Throws:
PluginParseException
testInvalidationOfDynamicClassCache
public void testInvalidationOfDynamicClassCache()
throws IOException,
PluginException
- Throws:
IOException
PluginException
testInstallPlugin
public void testInstallPlugin()
throws Exception
- Throws:
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 Exception
- Throws:
Exception
testUninstallPluginClearsState
public void testUninstallPluginClearsState()
throws IOException
- Throws:
IOException
testCannotInitTwice
public void testCannotInitTwice()
throws PluginParseException
- Throws:
PluginParseException
testCannotShutdownTwice
public void testCannotShutdownTwice()
throws PluginParseException
- Throws:
PluginParseException
testGetPluginWithNullKey
public void testGetPluginWithNullKey()
testShutdownHandlesException
public void testShutdownHandlesException()
testExceptionOnRequiredPluginNotEnabling
public void testExceptionOnRequiredPluginNotEnabling()
throws Exception
- Throws:
Exception
pluginReturnedByLoadAllPluginsButNotUsedIsDiscarded
public void pluginReturnedByLoadAllPluginsButNotUsedIsDiscarded()
oldPluginReturnedByLoadFoundPluginsIsDiscarded
public void oldPluginReturnedByLoadFoundPluginsIsDiscarded()
uninstallingDeletableUninstallablePluginRemovesItFromLoader
public void uninstallingDeletableUninstallablePluginRemovesItFromLoader()
uninstallingNotDeletableUninstallablePluginRemovesItFromLoader
public void uninstallingNotDeletableUninstallablePluginRemovesItFromLoader()
uninstallingDeletableNotUninstallablePluginDoesNotRemoveItFromLoader
public void uninstallingDeletableNotUninstallablePluginDoesNotRemoveItFromLoader()
uninstallingNotDeletableNotUninstallablePluginDoesNotRemoveItFromLoader
public void uninstallingNotDeletableNotUninstallablePluginDoesNotRemoveItFromLoader()
earlyLateStartupEvents
public void earlyLateStartupEvents()
delayedPluginsAreDelayed
public void delayedPluginsAreDelayed()
delayedPluginsCanBeDisabled
public void delayedPluginsCanBeDisabled()
delayedPluginsCanBeEnabled
public void delayedPluginsCanBeEnabled()
scanForNewPluginsNotAllowedBeforeLateStartup
public void scanForNewPluginsNotAllowedBeforeLateStartup()
scanForNewPluginsDuringLateStartup
public void scanForNewPluginsDuringLateStartup()
earlyStartupDoesNotSavePluginPersistentState
public void earlyStartupDoesNotSavePluginPersistentState()
lateStartupRemovesPluginsMarkedForRemoval
public void lateStartupRemovesPluginsMarkedForRemoval()
exampleUsingPersistentStateDelegation
public void exampleUsingPersistentStateDelegation()
upgradePluginUpgradesPlugin
public void upgradePluginUpgradesPlugin()
upgradePluginDisablesDependentPlugins
public void upgradePluginDisablesDependentPlugins()
scanForNewPluginsScansAllPluginLoaders
public void scanForNewPluginsScansAllPluginLoaders()
startupElementInPluginInformationOverridesDelayPredicate
public void startupElementInPluginInformationOverridesDelayPredicate()
startupOverrideFileOverridesPluginInformationAndDelayPredicate
public void startupOverrideFileOverridesPluginInformationAndDelayPredicate()
throws Exception
- Throws:
Exception
installEventSequencing
public void installEventSequencing()
enableAndDisableEventSequencing
public void enableAndDisableEventSequencing()
upgradeEventSequencing
public void upgradeEventSequencing()
uninstallEventSequencing
public void uninstallEventSequencing()
moduleEnableDisableEventSequencing
public void moduleEnableDisableEventSequencing()
shutdownEventsAreSent
public void shutdownEventsAreSent()
lateStartupDoesntRetryEnableWhenNotRequested
public void lateStartupDoesntRetryEnableWhenNotRequested()
lateStartupDoesRetryEnableWhenRequested
public void lateStartupDoesRetryEnableWhenRequested()
createPluginWithVersion
public Plugin createPluginWithVersion(String version)
Copyright © 2015 Atlassian. All rights reserved.