com.atlassian.plugin.manager
Class TestDefaultPluginManager

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by com.atlassian.plugin.loaders.classloading.AbstractTestClassLoader
              extended by com.atlassian.plugin.manager.TestDefaultPluginManager
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
TestEnabledModuleCachingPluginAccessor

public class TestDefaultPluginManager
extends AbstractTestClassLoader


Nested Class Summary
static class TestDefaultPluginManager.MyModuleDisabledListener
           
static class TestDefaultPluginManager.PluginDisabledListener
           
static class TestDefaultPluginManager.PluginModuleDisabledListener
           
static class TestDefaultPluginManager.PluginModuleEnabledListener
           
static class TestDefaultPluginManager.RequiresRestartModuleDescriptor
           
static class TestDefaultPluginManager.RequiresRestartSubclassModuleDescriptor
           
static class TestDefaultPluginManager.ThingsAreWrongListener
           
 
Field Summary
protected  DefaultPluginManager manager
          the object being tested
protected  PluginEventManager pluginEventManager
           
 
Fields inherited from class com.atlassian.plugin.loaders.classloading.AbstractTestClassLoader
PADDINGTON_JAR, pluginsDirectory, pluginsTestDir, POOH_JAR
 
Constructor Summary
TestDefaultPluginManager()
           
 
Method Summary
 Plugin createPluginWithVersion(String version)
           
protected  PluginAccessor getPluginAccessor()
           
protected  void setUp()
           
protected  void tearDown()
           
 void testAddPluginsThatThrowExceptionOnEnabled()
           
 void testCannotInitTwice()
           
 void testCannotRemovePluginFromStaticLoader()
           
 void testCannotShutdownTwice()
           
 void testComparePluginBadPlugin()
           
 void testComparePluginEqual()
           
 void testComparePluginNewer()
           
 void testComparePluginNoVersion()
           
 void testComparePluginOlder()
           
 void testDisableEnableOfPluginThatRequiresRestart()
           
 void testDisablePluginModuleWithCannotDisableAnnotation()
           
 void testDisablePluginModuleWithCannotDisableAnnotationinSuperclass()
           
 void testDuplicatePluginKeysAreBad()
           
 void testEnabledDisabledRetrieval()
           
 void testEnabledModuleOutOfSyncWithPlugin()
           
 void testEnableModuleFailed()
           
 void testFindingNewPlugins()
           
 void testFindingNewPluginsNotLoadingRestartRequiredDescriptors()
           
 void testFindingUpgradePluginsNotLoadingRestartRequiredDescriptors()
          Tests upgrade of plugin where the old version didn't have any restart required module descriptors, but the new one does
 void testGetDynamicPluginClass()
           
 void testGetEnabledPluginsDoesNotReturnEnablingPlugins()
           
 void testGetModuleByModuleClassAndDescriptor()
           
 void testGetModuleByModuleClassNoneFound()
           
 void testGetModuleByModuleClassOneFound()
           
 void testGetModuleDescriptorsByType()
           
 void testGetPluginAndModules()
           
 void testGetPluginModuleDescriptorsWithModuleNotMatchingPredicate()
           
 void testGetPluginModuleDescriptorWithModuleMatchingPredicate()
           
 void testGetPluginModulesWithGetModuleThrowingException()
           
 void testGetPluginModulesWithModuleMatchingPredicate()
           
 void testGetPluginModulesWithModuleNotMatchingPredicate()
           
 void testGetPluginsWithPluginMatchingPluginPredicate()
           
 void testGetPluginsWithPluginNotMatchingPluginPredicate()
           
 void testGetPluginWithNullKey()
           
 void testInstallPlugin()
           
 void testInstallPluginMoreThanOnceStaysAsInstall()
           
 void testInstallPluginsWithOne()
           
 void testInstallPluginsWithTwo()
           
 void testInstallPluginsWithTwoButOneFailsValidation()
           
 void testInstallPluginsWithTwoButOneFailsValidationWithException()
           
 void testInstallPluginThatPreviouslyRequiredRestart()
           
 void testInstallPluginThatRequiresRestart()
           
 void testInstallPluginThatRequiresRestartThenRevert()
           
 void testInvalidationOfDynamicClassCache()
           
 void testInvalidationOfDynamicResourceCache()
           
 void testLoadChangedDynamicPluginWithSameVersionNumberReplacesExisting()
           
 void testLoadNewerDuplicateDynamicPluginPreservesModuleState()
           
 void testLoadNewerDuplicateDynamicPluginPreservesPluginState()
           
 void testLoadNewerDuplicatePlugin()
           
 void testLoadOlderDuplicatePlugin()
           
 void testLoadOlderDuplicatePluginDoesNotTryToEnableIt()
           
 void testNonDeletablePlugins()
           
 void testNonRemovablePlugins()
           
 void testPluginContainerUnavailable()
           
 void testPluginModuleAvailableAfterInstallation()
           
 void testPluginModuleAvailableAfterInstallationButConfiguredToBeDisabled()
           
 void testPluginModuleUnavailableAfterInstallation()
           
 void testRemovePluginThatRequiresRestart()
           
 void testRemovePluginThatRequiresRestartThenReverted()
           
 void testRemovePluginThatRequiresRestartViaSubclass()
           
 void testRemovingPlugins()
           
 void testRetrievePlugins()
           
 void testRetrievingDynamicResources()
           
 void testShutdownHandlesException()
           
 void testUninstallPluginClearsState()
           
 void testUninstallPluginWithDependencies()
           
 void testUpgradePluginThatPreviouslyRequiredRestart()
           
 void testUpgradePluginThatRequiresRestart()
           
 void testUpgradePluginThatRequiresRestartMultipleTimeStaysUpgraded()
           
 void testUpgradePluginThatRequiresRestartThenReverted()
           
 void testUpgradePluginThatRequiresRestartThenRevertedRevertsToOriginalPlugin()
           
 void testValidatePlugin()
           
 void testValidatePluginWithNoDynamicLoaders()
           
 
Methods inherited from class com.atlassian.plugin.loaders.classloading.AbstractTestClassLoader
createFillAndCleanTempPluginDirectory, getPluginsDirectory
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

manager

protected DefaultPluginManager manager
the object being tested


pluginEventManager

protected PluginEventManager pluginEventManager
Constructor Detail

TestDefaultPluginManager

public TestDefaultPluginManager()
Method Detail

setUp

protected void setUp()
              throws Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
Exception

tearDown

protected void tearDown()
                 throws Exception
Overrides:
tearDown in class junit.framework.TestCase
Throws:
Exception

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

testDuplicatePluginKeysAreBad

public void testDuplicatePluginKeysAreBad()
                                   throws PluginParseException
Throws:
PluginParseException

testLoadOlderDuplicatePlugin

public void testLoadOlderDuplicatePlugin()
                                  throws PluginParseException
Throws:
PluginParseException

testLoadOlderDuplicatePluginDoesNotTryToEnableIt

public void testLoadOlderDuplicatePluginDoesNotTryToEnableIt()

testLoadNewerDuplicatePlugin

public void testLoadNewerDuplicatePlugin()
                                  throws PluginParseException
Throws:
PluginParseException

testLoadNewerDuplicateDynamicPluginPreservesPluginState

public void testLoadNewerDuplicateDynamicPluginPreservesPluginState()
                                                             throws PluginParseException
Throws:
PluginParseException

testLoadNewerDuplicateDynamicPluginPreservesModuleState

public void testLoadNewerDuplicateDynamicPluginPreservesModuleState()
                                                             throws PluginParseException
Throws:
PluginParseException

testLoadChangedDynamicPluginWithSameVersionNumberReplacesExisting

public void testLoadChangedDynamicPluginWithSameVersionNumberReplacesExisting()
                                                                       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

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

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()

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()

createPluginWithVersion

public Plugin createPluginWithVersion(String version)


Copyright © 2011 Atlassian. All Rights Reserved.