}
@SuppressWarnings( "cast" )
@Test
public void testPluginAdapterAsPublisher() throws Exception {
IPentahoPublisher asPublisher = (IPentahoPublisher) pluginAdapter;
assertEquals( Messages.getInstance().getString( "PluginAdapter.USER_PLUGIN_MANAGER" ), asPublisher.getName() ); //$NON-NLS-1$
assertNotSame( "!PluginAdapter.USER_PLUGIN_MANAGER!", asPublisher.getName() ); //$NON-NLS-1$
assertEquals(
Messages.getInstance().getString( "PluginAdapter.USER_REFRESH_PLUGINS" ), asPublisher.getDescription() ); //$NON-NLS-1$
assertNotSame( "!PluginAdapter.USER_REFRESH_PLUGINS!", asPublisher.getName() ); //$NON-NLS-1$
String str = asPublisher.publish( session, ILogger.DEBUG );
// If we see 'Discovered plugin' anywhere in the result string we know that the plugin adapter was able to invoke
// the plugin manager properly
assertTrue( "Result string '" + str + "' did not contain 'Discovered plugin'",
str.indexOf( "Discovered plugin" ) > 0 );
}