test_class.declarator: classUnderTest = null
test_class.modifier: private
test_class.original_string: private CopyWikiTableActionFactory classUnderTest = null;
test_class.type: CopyWikiTableActionFactory
test_class.var_name: classUnderTest
test_class.declarator: mockCallback = null
test_class.modifier: private
test_class.original_string: private ITableActionCallback mockCallback = null;
test_class.type: ITableActionCallback
test_class.var_name: mockCallback
test_class.file: sql12/fw/src/test/java/net/sourceforge/squirrel_sql/fw/gui/action/wikiTable/CopyWikiTableActionFactoryTest.java
test_class.identifier: CopyWikiTableActionFactoryTest
test_class.superclass: extends BaseSQuirreLJUnit4TestCase
test_case.body: @Test
  	public void testCreateMenueItem() {
  		
  		mockHelper.resetAll();
  		IWikiTableConfigurationFactory mockWikiConfigFactory = mockHelper.createMock(IWikiTableConfigurationFactory.class);
  		IWikiTableConfiguration mockConfigA = mockHelper.createMock(IWikiTableConfiguration.class);
  		expect(mockConfigA.getName()).andStubReturn("MockConfigA");
  		expect(mockConfigA.isEnabled()).andStubReturn(true);
  		
  		IWikiTableConfiguration mockConfigB = mockHelper.createMock(IWikiTableConfiguration.class);
  		expect(mockConfigB.getName()).andStubReturn("MockConfigB");
  		expect(mockConfigB.isEnabled()).andStubReturn(true);
  		
  		List<IWikiTableConfiguration> configList = new ArrayList<IWikiTableConfiguration>();
  		configList.add(mockConfigA);
  		configList.add(mockConfigB);
  		
  		expect(mockWikiConfigFactory.getConfigurations()).andReturn(configList);
  		
  		classUnderTest.setConfigurationFactory(mockWikiConfigFactory);
  		mockHelper.replayAll();
  		
  		
  		JMenuItem menuItem = classUnderTest.createMenueItem(mockCallback);
  		assertNotNull(menuItem);
  		assertEquals(JMenu.class, menuItem.getClass());
  		JMenu menu = (JMenu) menuItem;
  		assertEquals(2, menu.getItemCount());
  	}
test_case.class_method_signature: CopyWikiTableActionFactoryTest.testCreateMenueItem()
test_case.full_signature: @Test public void testCreateMenueItem()
test_case.identifier: testCreateMenueItem
test_case.invocations: resetAll createMock createMock andStubReturn expect getName andStubReturn expect isEnabled createMock andStubReturn expect getName andStubReturn expect isEnabled add add andReturn expect getConfigurations setConfigurationFactory replayAll createMenueItem assertNotNull assertEquals getClass assertEquals getItemCount
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCreateMenueItem()
focal_class.declarator: instance = null
focal_class.modifier: private static
focal_class.original_string: private static CopyWikiTableActionFactory instance = null;
focal_class.type: CopyWikiTableActionFactory
focal_class.var_name: instance
focal_class.declarator: configurationFactory = WikiTableConfigurationFactory.getInstance()
focal_class.modifier: private
focal_class.original_string: private IWikiTableConfigurationFactory configurationFactory = WikiTableConfigurationFactory.getInstance();
focal_class.type: IWikiTableConfigurationFactory
focal_class.var_name: configurationFactory
focal_class.declarator: s_stringMgr =
  		StringManagerFactory.getStringManager(TablePopupMenu.class)
focal_class.modifier: private static final
focal_class.original_string: private static final StringManager s_stringMgr =
  		StringManagerFactory.getStringManager(TablePopupMenu.class);
focal_class.type: StringManager
focal_class.var_name: s_stringMgr
focal_class.file: sql12/fw/src/main/java/net/sourceforge/squirrel_sql/fw/gui/action/wikiTable/CopyWikiTableActionFactory.java
focal_class.identifier: CopyWikiTableActionFactory
focal_class.interfaces: implements ICopyWikiTableActionFactory
focal_class.class_method_signature: CopyWikiTableActionFactory.CopyWikiTableActionFactory()
focal_class.full_signature:   CopyWikiTableActionFactory()
focal_class.identifier: CopyWikiTableActionFactory
focal_class.parameters: ()
focal_class.signature:  CopyWikiTableActionFactory()
focal_class.class_method_signature: CopyWikiTableActionFactory.createMenueItem(ITableActionCallback callback)
focal_class.full_signature: @Override public JMenuItem createMenueItem(ITableActionCallback callback)
focal_class.identifier: createMenueItem
focal_class.modifiers: @Override public
focal_class.parameters: (ITableActionCallback callback)
focal_class.return: JMenuItem
focal_class.signature: JMenuItem createMenueItem(ITableActionCallback callback)
focal_class.class_method_signature: CopyWikiTableActionFactory.createMenuForAListOfConfiguration(ITableActionCallback callback,
  			Collection<IWikiTableConfiguration> configurations)
focal_class.full_signature: private JMenuItem createMenuForAListOfConfiguration(ITableActionCallback callback,
  			Collection<IWikiTableConfiguration> configurations)
focal_class.identifier: createMenuForAListOfConfiguration
focal_class.modifiers: private
focal_class.parameters: (ITableActionCallback callback,
  			Collection<IWikiTableConfiguration> configurations)
focal_class.return: JMenuItem
focal_class.signature: JMenuItem createMenuForAListOfConfiguration(ITableActionCallback callback,
  			Collection<IWikiTableConfiguration> configurations)
focal_class.class_method_signature: CopyWikiTableActionFactory.createMenuForExactlyOneConfiguration(ITableActionCallback callback,
  			IWikiTableConfiguration configuration)
focal_class.full_signature: private JMenuItem createMenuForExactlyOneConfiguration(ITableActionCallback callback,
  			IWikiTableConfiguration configuration)
focal_class.identifier: createMenuForExactlyOneConfiguration
focal_class.modifiers: private
focal_class.parameters: (ITableActionCallback callback,
  			IWikiTableConfiguration configuration)
focal_class.return: JMenuItem
focal_class.signature: JMenuItem createMenuForExactlyOneConfiguration(ITableActionCallback callback,
  			IWikiTableConfiguration configuration)
focal_class.class_method_signature: CopyWikiTableActionFactory.createMenuForEmptyConfigurations()
focal_class.full_signature: private JMenuItem createMenuForEmptyConfigurations()
focal_class.identifier: createMenuForEmptyConfigurations
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: JMenuItem
focal_class.signature: JMenuItem createMenuForEmptyConfigurations()
focal_class.class_method_signature: CopyWikiTableActionFactory.getInstance()
focal_class.full_signature: public static synchronized ICopyWikiTableActionFactory getInstance()
focal_class.identifier: getInstance
focal_class.modifiers: public static synchronized
focal_class.parameters: ()
focal_class.return: ICopyWikiTableActionFactory
focal_class.signature: ICopyWikiTableActionFactory getInstance()
focal_class.class_method_signature: CopyWikiTableActionFactory.getConfigurationFactory()
focal_class.full_signature: public IWikiTableConfigurationFactory getConfigurationFactory()
focal_class.identifier: getConfigurationFactory
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: IWikiTableConfigurationFactory
focal_class.signature: IWikiTableConfigurationFactory getConfigurationFactory()
focal_class.class_method_signature: CopyWikiTableActionFactory.setConfigurationFactory(IWikiTableConfigurationFactory configurationFactory)
focal_class.full_signature: public void setConfigurationFactory(IWikiTableConfigurationFactory configurationFactory)
focal_class.identifier: setConfigurationFactory
focal_class.modifiers: public
focal_class.parameters: (IWikiTableConfigurationFactory configurationFactory)
focal_class.return: void
focal_class.signature: void setConfigurationFactory(IWikiTableConfigurationFactory configurationFactory)
focal_method.body: @Override
  	public JMenuItem createMenueItem(ITableActionCallback callback){
  		@SuppressWarnings("unchecked")
  		Collection<IWikiTableConfiguration> configurations = CollectionUtils.select(configurationFactory.getConfigurations(), new EnabledConfigurationPredicate());
  		if(configurations.isEmpty()){
  			return createMenuForEmptyConfigurations();
  		}else if(configurations.size() == 1){
  			return createMenuForExactlyOneConfiguration(callback, configurations.iterator().next());
  		}else{
  			return createMenuForAListOfConfiguration(callback, configurations);
  		}
  	}
focal_method.class_method_signature: CopyWikiTableActionFactory.createMenueItem(ITableActionCallback callback)
focal_method.full_signature: @Override public JMenuItem createMenueItem(ITableActionCallback callback)
focal_method.identifier: createMenueItem
focal_method.invocations: select getConfigurations isEmpty createMenuForEmptyConfigurations size createMenuForExactlyOneConfiguration next iterator createMenuForAListOfConfiguration
focal_method.modifiers: @Override public
focal_method.parameters: (ITableActionCallback callback)
focal_method.return: JMenuItem
focal_method.signature: JMenuItem createMenueItem(ITableActionCallback callback)