Commit 07020d90 authored by azara's avatar azara
Browse files

BS-14273 improve generation guidance

rename constant
parent e0d20d19
...@@ -110,7 +110,7 @@ public class ContractInputGenerationWizardTest { ...@@ -110,7 +110,7 @@ public class ContractInputGenerationWizardTest {
when(store.getBusinessObjectByQualifiedName("org.company.Employee")).thenReturn( when(store.getBusinessObjectByQualifiedName("org.company.Employee")).thenReturn(
BusinessObjectBuilder.aBO("org.company.Employee").withField(SimpleFieldBuilder.aStringField("firstName").build()).build()); BusinessObjectBuilder.aBO("org.company.Employee").withField(SimpleFieldBuilder.aStringField("firstName").build()).build());
when(repositoryAccessor.getRepositoryStore(BusinessObjectModelRepositoryStore.class)).thenReturn(store); when(repositoryAccessor.getRepositoryStore(BusinessObjectModelRepositoryStore.class)).thenReturn(store);
when(preferenceStore.getString(ContractInputGenerationInfoDialogFactory.HIDE_GENERATION_SUCCESS_DIALOG)).thenReturn("always"); when(preferenceStore.getString(ContractInputGenerationInfoDialogFactory.SHOW_GENERATION_SUCCESS_DIALOG)).thenReturn("always");
final ContractInputGenerationWizard wizard = new ContractInputGenerationWizard(process, editingDomain(), repositoryAccessor, operationBuilder, final ContractInputGenerationWizard wizard = new ContractInputGenerationWizard(process, editingDomain(), repositoryAccessor, operationBuilder,
expressionBuilder, expressionBuilder,
...@@ -136,7 +136,7 @@ public class ContractInputGenerationWizardTest { ...@@ -136,7 +136,7 @@ public class ContractInputGenerationWizardTest {
when(store.getBusinessObjectByQualifiedName("org.company.Employee")).thenReturn( when(store.getBusinessObjectByQualifiedName("org.company.Employee")).thenReturn(
BusinessObjectBuilder.aBO("org.company.Employee").withField(SimpleFieldBuilder.aStringField("firstName").build()).build()); BusinessObjectBuilder.aBO("org.company.Employee").withField(SimpleFieldBuilder.aStringField("firstName").build()).build());
when(repositoryAccessor.getRepositoryStore(BusinessObjectModelRepositoryStore.class)).thenReturn(store); when(repositoryAccessor.getRepositoryStore(BusinessObjectModelRepositoryStore.class)).thenReturn(store);
when(preferenceStore.getString(ContractInputGenerationInfoDialogFactory.HIDE_GENERATION_SUCCESS_DIALOG)).thenReturn("always"); when(preferenceStore.getString(ContractInputGenerationInfoDialogFactory.SHOW_GENERATION_SUCCESS_DIALOG)).thenReturn("always");
final ContractInputGenerationWizard wizard = new ContractInputGenerationWizard(process, editingDomain(), repositoryAccessor, operationBuilder, final ContractInputGenerationWizard wizard = new ContractInputGenerationWizard(process, editingDomain(), repositoryAccessor, operationBuilder,
expressionBuilder, expressionBuilder,
preferenceStore, sharedImages, dialogFactory); preferenceStore, sharedImages, dialogFactory);
...@@ -161,7 +161,7 @@ public class ContractInputGenerationWizardTest { ...@@ -161,7 +161,7 @@ public class ContractInputGenerationWizardTest {
when(store.getBusinessObjectByQualifiedName("org.company.Employee")).thenReturn( when(store.getBusinessObjectByQualifiedName("org.company.Employee")).thenReturn(
BusinessObjectBuilder.aBO("org.company.Employee").withField(SimpleFieldBuilder.aStringField("firstName").build()).build()); BusinessObjectBuilder.aBO("org.company.Employee").withField(SimpleFieldBuilder.aStringField("firstName").build()).build());
when(repositoryAccessor.getRepositoryStore(BusinessObjectModelRepositoryStore.class)).thenReturn(store); when(repositoryAccessor.getRepositoryStore(BusinessObjectModelRepositoryStore.class)).thenReturn(store);
when(preferenceStore.getString(ContractInputGenerationInfoDialogFactory.HIDE_GENERATION_SUCCESS_DIALOG)).thenReturn("always"); when(preferenceStore.getString(ContractInputGenerationInfoDialogFactory.SHOW_GENERATION_SUCCESS_DIALOG)).thenReturn("always");
when(expressionBuilder.toExpression(any(BusinessObjectData.class), any(FieldToContractInputMapping.class), anyBoolean())).thenReturn( when(expressionBuilder.toExpression(any(BusinessObjectData.class), any(FieldToContractInputMapping.class), anyBoolean())).thenReturn(
aGroovyScriptExpression().build()); aGroovyScriptExpression().build());
final ContractInputGenerationWizard wizard = new ContractInputGenerationWizard(process, editingDomain(), repositoryAccessor, operationBuilder, final ContractInputGenerationWizard wizard = new ContractInputGenerationWizard(process, editingDomain(), repositoryAccessor, operationBuilder,
...@@ -190,7 +190,7 @@ public class ContractInputGenerationWizardTest { ...@@ -190,7 +190,7 @@ public class ContractInputGenerationWizardTest {
when(store.getBusinessObjectByQualifiedName("org.company.Employee")).thenReturn( when(store.getBusinessObjectByQualifiedName("org.company.Employee")).thenReturn(
BusinessObjectBuilder.aBO("org.company.Employee").withField(SimpleFieldBuilder.aStringField("firstName").build()).build()); BusinessObjectBuilder.aBO("org.company.Employee").withField(SimpleFieldBuilder.aStringField("firstName").build()).build());
when(repositoryAccessor.getRepositoryStore(BusinessObjectModelRepositoryStore.class)).thenReturn(store); when(repositoryAccessor.getRepositoryStore(BusinessObjectModelRepositoryStore.class)).thenReturn(store);
when(preferenceStore.getString(ContractInputGenerationInfoDialogFactory.HIDE_GENERATION_SUCCESS_DIALOG)).thenReturn("always"); when(preferenceStore.getString(ContractInputGenerationInfoDialogFactory.SHOW_GENERATION_SUCCESS_DIALOG)).thenReturn("always");
final ContractInputGenerationWizard wizard = new ContractInputGenerationWizard(task, editingDomain(), repositoryAccessor, operationBuilder, final ContractInputGenerationWizard wizard = new ContractInputGenerationWizard(task, editingDomain(), repositoryAccessor, operationBuilder,
expressionBuilder, expressionBuilder,
preferenceStore, sharedImages, dialogFactory); preferenceStore, sharedImages, dialogFactory);
...@@ -217,7 +217,7 @@ public class ContractInputGenerationWizardTest { ...@@ -217,7 +217,7 @@ public class ContractInputGenerationWizardTest {
when(store.getBusinessObjectByQualifiedName("org.company.Employee")).thenReturn( when(store.getBusinessObjectByQualifiedName("org.company.Employee")).thenReturn(
BusinessObjectBuilder.aBO("org.company.Employee").withField(SimpleFieldBuilder.aStringField("firstName").build()).build()); BusinessObjectBuilder.aBO("org.company.Employee").withField(SimpleFieldBuilder.aStringField("firstName").build()).build());
when(repositoryAccessor.getRepositoryStore(BusinessObjectModelRepositoryStore.class)).thenReturn(store); when(repositoryAccessor.getRepositoryStore(BusinessObjectModelRepositoryStore.class)).thenReturn(store);
when(preferenceStore.getString(ContractInputGenerationInfoDialogFactory.HIDE_GENERATION_SUCCESS_DIALOG)).thenReturn("always"); when(preferenceStore.getString(ContractInputGenerationInfoDialogFactory.SHOW_GENERATION_SUCCESS_DIALOG)).thenReturn("always");
when(operationBuilder.toOperation(any(BusinessObjectData.class), any(FieldToContractInputMapping.class))).thenReturn( when(operationBuilder.toOperation(any(BusinessObjectData.class), any(FieldToContractInputMapping.class))).thenReturn(
anOperation().build()); anOperation().build());
final ContractInputGenerationWizard wizard = new ContractInputGenerationWizard(task, editingDomain(), repositoryAccessor, operationBuilder, final ContractInputGenerationWizard wizard = new ContractInputGenerationWizard(task, editingDomain(), repositoryAccessor, operationBuilder,
......
...@@ -29,12 +29,12 @@ import org.eclipse.swt.widgets.Shell; ...@@ -29,12 +29,12 @@ import org.eclipse.swt.widgets.Shell;
public class ContractInputGenerationInfoDialogFactory { public class ContractInputGenerationInfoDialogFactory {
public static final int NOT_OPENED = -2; public static final int NOT_OPENED = -2;
public static final String HIDE_GENERATION_SUCCESS_DIALOG = "SHOW_GENERATION_SUCCESS_DIALOG"; public static final String SHOW_GENERATION_SUCCESS_DIALOG = "SHOW_GENERATION_SUCCESS_DIALOG";
public int openInfoDialog(final IPreferenceStore preferenceStore, final Shell shell, final ContractContainer contractContainer, public int openInfoDialog(final IPreferenceStore preferenceStore, final Shell shell, final ContractContainer contractContainer,
final boolean isAutogeneratedScript) { final boolean isAutogeneratedScript) {
if (isNullOrEmpty(preferenceStore.getString(HIDE_GENERATION_SUCCESS_DIALOG)) if (isNullOrEmpty(preferenceStore.getString(SHOW_GENERATION_SUCCESS_DIALOG))
&& isAutogeneratedScript) { && isAutogeneratedScript) {
return MessageDialogWithToggle.openOkCancelConfirm(shell, return MessageDialogWithToggle.openOkCancelConfirm(shell,
Messages.contractGenerationTitle, Messages.contractGenerationTitle,
...@@ -42,7 +42,7 @@ public class ContractInputGenerationInfoDialogFactory { ...@@ -42,7 +42,7 @@ public class ContractInputGenerationInfoDialogFactory {
Messages.doNotShowMeAgain, Messages.doNotShowMeAgain,
false, false,
preferenceStore, preferenceStore,
HIDE_GENERATION_SUCCESS_DIALOG).getReturnCode(); SHOW_GENERATION_SUCCESS_DIALOG).getReturnCode();
} }
return NOT_OPENED; return NOT_OPENED;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment