// Path: org.jenerate/src/java/org/jenerate/internal/domain/identifier/CommandIdentifier.java
// public interface CommandIdentifier {
// 
//     /**
//      * @return the unique string identifier of a command
//      */
//     String getIdentifier();
// 
// }
// 
// Path: org.jenerate/src/java/org/jenerate/internal/manage/DialogStrategyManager.java
// public interface DialogStrategyManager {
// 
//     /**
//      * Get the {@link DialogStrategy} for the given parameters
//      * 
//      * @param commandIdentifier the unique identifier of a command
//      * @param strategyIdentifier the unique identifier of a strategy
//      * @return the {@link DialogStrategy} for the provided parameters
//      * @throws IllegalStateException if no {@link DialogStrategy} could be found for a provided parameters
//      */
//     <U extends MethodGenerationData> DialogStrategy<U> getDialogStrategy(CommandIdentifier commandIdentifier,
//             StrategyIdentifier strategyIdentifier);
// 
// }
// 
// Path: org.jenerate/src/java/org/jenerate/internal/manage/PreferencesManager.java
// public interface PreferencesManager {
// 
//     /**
//      * Gets the current value for a specific preference
//      * 
//      * @param preference the preference to get the value from
//      * @return the value for this preference
//      */
//     <T> T getCurrentPreferenceValue(PluginPreference<T> preference);
// 
// }
// 
// Path: org.jenerate/src/java/org/jenerate/internal/ui/dialogs/factory/DialogFactoryHelper.java
// public interface DialogFactoryHelper {
// 
//     /**
//      * Check if the method specified with methodName and methodParameterType parameters is overridden and concrete in a
//      * subclass of the original declared class, and that subclass is a superclass of objectClass.
//      * 
//      * @param objectClass the class for which the code generation is in effect
//      * @param methodName the name of the method to check
//      * @param methodParameterTypes the fully qualified typenames of the method parameters to check
//      * @param originalClassFullyQualifiedName the name of the original class where the method is implemented
//      * @return {@code true} if the method is overridden in the superclass, {@code false} otherwise
//      * @throws JavaModelException if a problem occurs
//      */
//     boolean isOverriddenInSuperclass(IType objectClass, String methodName, String[] methodParameterTypes,
//             String originalClassFullyQualifiedName) throws JavaModelException;
// 
//     /**
//      * Gets the fields of a class identifier by the {@link IType} objectClass.
//      * 
//      * @param objectClass the class where to retrieve the fields from
//      * @param preferencesManager the preference manager
//      * @return all fields to be used by the {@link DialogFactory}
//      * @throws JavaModelException if a problem occurs retrieving the class fields
//      */
//     IField[] getObjectClassFields(IType objectClass, PreferencesManager preferencesManager) throws JavaModelException;
// 
//     /**
//      * @return the current {@link IDialogSettings}
//      */
//     IDialogSettings getDialogSettings();
// 
//     /**
//      * Get all the positions where generated code can be inserted in a provided java class.
//      * 
//      * @param objectClass the class where generated code will be inserted
//      * @param excludedMethods the method to exclude from the possible position of insertion
//      * @return the map of String insertion labels -> insertion positions
//      * @throws JavaModelException if a problem occurs while computing the insertion positions
//      */
//     LinkedHashMap<String, IJavaElement> getInsertPositions(IType objectClass, Set<IMethod> excludedMethods)
//             throws JavaModelException;
// }


import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.when;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;
import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.swt.widgets.Shell;
import org.jenerate.internal.domain.data.MethodGenerationData;
import org.jenerate.internal.domain.identifier.CommandIdentifier;
import org.jenerate.internal.domain.identifier.StrategyIdentifier;
import org.jenerate.internal.domain.preference.impl.JeneratePreferences;
import org.jenerate.internal.manage.DialogStrategyManager;
import org.jenerate.internal.manage.PreferencesManager;
import org.jenerate.internal.ui.dialogs.factory.DialogFactory;
import org.jenerate.internal.ui.dialogs.factory.DialogFactoryHelper;
import org.jenerate.internal.ui.dialogs.impl.FieldDialogImpl;
import org.jenerate.internal.ui.dialogs.strategy.DialogStrategy;
import org.junit.Before;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;

package org.jenerate.internal.ui.dialogs.factory.impl;




/**
 * Abstract test for the {@link DialogFactory}
 * 
 * @author maudrain
 */
@RunWith(MockitoJUnitRunner.Silent.class)
public abstract class AbstractDialogFactoryTest {

    @Mock
    protected DialogStrategyManager dialogStrategyManager;
    @Mock
    protected DialogFactoryHelper dialogFactoryHelper;
    @Mock
    protected PreferencesManager preferencesManager;

    @Mock
    protected IDialogSettings dialogSettings;
    @Mock
    protected IType objectClass;
    @Mock
    protected Shell parentShell;

    @Mock
    protected IMethod method1;
    @Mock
    protected IMethod method2;
    protected Set<IMethod> excludedMethods;


// Path: org.jenerate/src/java/org/jenerate/internal/domain/identifier/CommandIdentifier.java
// public interface CommandIdentifier {
// 
//     /**
//      * @return the unique string identifier of a command
//      */
//     String getIdentifier();
// 
// }
// 
// Path: org.jenerate/src/java/org/jenerate/internal/manage/DialogStrategyManager.java
// public interface DialogStrategyManager {
// 
//     /**
//      * Get the {@link DialogStrategy} for the given parameters
//      * 
//      * @param commandIdentifier the unique identifier of a command
//      * @param strategyIdentifier the unique identifier of a strategy
//      * @return the {@link DialogStrategy} for the provided parameters
//      * @throws IllegalStateException if no {@link DialogStrategy} could be found for a provided parameters
//      */
//     <U extends MethodGenerationData> DialogStrategy<U> getDialogStrategy(CommandIdentifier commandIdentifier,
//             StrategyIdentifier strategyIdentifier);
// 
// }
// 
// Path: org.jenerate/src/java/org/jenerate/internal/manage/PreferencesManager.java
// public interface PreferencesManager {
// 
//     /**
//      * Gets the current value for a specific preference
//      * 
//      * @param preference the preference to get the value from
//      * @return the value for this preference
//      */
//     <T> T getCurrentPreferenceValue(PluginPreference<T> preference);
// 
// }
// 
// Path: org.jenerate/src/java/org/jenerate/internal/ui/dialogs/factory/DialogFactoryHelper.java
// public interface DialogFactoryHelper {
// 
//     /**
//      * Check if the method specified with methodName and methodParameterType parameters is overridden and concrete in a
//      * subclass of the original declared class, and that subclass is a superclass of objectClass.
//      * 
//      * @param objectClass the class for which the code generation is in effect
//      * @param methodName the name of the method to check
//      * @param methodParameterTypes the fully qualified typenames of the method parameters to check
//      * @param originalClassFullyQualifiedName the name of the original class where the method is implemented
//      * @return {@code true} if the method is overridden in the superclass, {@code false} otherwise
//      * @throws JavaModelException if a problem occurs
//      */
//     boolean isOverriddenInSuperclass(IType objectClass, String methodName, String[] methodParameterTypes,
//             String originalClassFullyQualifiedName) throws JavaModelException;
// 
//     /**
//      * Gets the fields of a class identifier by the {@link IType} objectClass.
//      * 
//      * @param objectClass the class where to retrieve the fields from
//      * @param preferencesManager the preference manager
//      * @return all fields to be used by the {@link DialogFactory}
//      * @throws JavaModelException if a problem occurs retrieving the class fields
//      */
//     IField[] getObjectClassFields(IType objectClass, PreferencesManager preferencesManager) throws JavaModelException;
// 
//     /**
//      * @return the current {@link IDialogSettings}
//      */
//     IDialogSettings getDialogSettings();
// 
//     /**
//      * Get all the positions where generated code can be inserted in a provided java class.
//      * 
//      * @param objectClass the class where generated code will be inserted
//      * @param excludedMethods the method to exclude from the possible position of insertion
//      * @return the map of String insertion labels -> insertion positions
//      * @throws JavaModelException if a problem occurs while computing the insertion positions
//      */
//     LinkedHashMap<String, IJavaElement> getInsertPositions(IType objectClass, Set<IMethod> excludedMethods)
//             throws JavaModelException;
// }


// Path: org.jenerate/src/test/org/jenerate/internal/ui/dialogs/factory/impl/AbstractDialogFactoryTest.java
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.when;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;
import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.swt.widgets.Shell;
import org.jenerate.internal.domain.data.MethodGenerationData;
import org.jenerate.internal.domain.identifier.CommandIdentifier;
import org.jenerate.internal.domain.identifier.StrategyIdentifier;
import org.jenerate.internal.domain.preference.impl.JeneratePreferences;
import org.jenerate.internal.manage.DialogStrategyManager;
import org.jenerate.internal.manage.PreferencesManager;
import org.jenerate.internal.ui.dialogs.factory.DialogFactory;
import org.jenerate.internal.ui.dialogs.factory.DialogFactoryHelper;
import org.jenerate.internal.ui.dialogs.impl.FieldDialogImpl;
import org.jenerate.internal.ui.dialogs.strategy.DialogStrategy;
import org.junit.Before;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;

package org.jenerate.internal.ui.dialogs.factory.impl;




/**
 * Abstract test for the {@link DialogFactory}
 * 
 * @author maudrain
 */
@RunWith(MockitoJUnitRunner.Silent.class)
public abstract class AbstractDialogFactoryTest {

    @Mock
    protected DialogStrategyManager dialogStrategyManager;
    @Mock
    protected DialogFactoryHelper dialogFactoryHelper;
    @Mock
    protected PreferencesManager preferencesManager;

    @Mock
    protected IDialogSettings dialogSettings;
    @Mock
    protected IType objectClass;
    @Mock
    protected Shell parentShell;

    @Mock
    protected IMethod method1;
    @Mock
    protected IMethod method2;
    protected Set<IMethod> excludedMethods;


    @Mock
