@Test public void testResolvedHitPolicy() throws Exception { final Package pkg = mock(Package.class); final Path resourcesPath = PathFactory.newPath("resources", "default: when(pkg.getPackageMainResourcesPath()).thenReturn(resourcesPath); when(options.isUsingWizard()).thenReturn(false); when(options.getHitPolicy()).thenReturn(GuidedDecisionTable52.HitPolicy.RESOLVED_HIT); handler.create(pkg, "fileName", newResourcePresenter); final ArgumentCaptor<GuidedDecisionTable52> dtableArgumentCaptor = ArgumentCaptor.forClass(GuidedDecisionTable52.class); verify(service, times(1)).create(eq(resourcesPath), eq("fileName." + resourceType.getSuffix()), dtableArgumentCaptor.capture(), any(String.class)); final GuidedDecisionTable52 model = dtableArgumentCaptor.getValue(); assertEquals(1, model.getMetadataCols() .size()); final MetadataCol52 metadataCol52 = model.getMetadataCols().get(0); assertEquals(GuidedDecisionTable52.HitPolicy.RESOLVED_HIT_METADATA_NAME, metadataCol52.getMetadata()); }
@Override public void create(final Package pkg, final String baseFileName, final NewResourcePresenter presenter) { this.newResourcePresenter = presenter; if (!options.isUsingWizard()) { createEmptyDecisionTable(pkg.getPackageMainResourcesPath(), baseFileName); } else { createDecisionTableWithWizard(pkg.getPackageMainResourcesPath(), baseFileName); } }
NewGuidedDecisionTableHandler extends DefaultNewResourceHandler { @Override public void create(final Package pkg, final String baseFileName, final NewResourcePresenter presenter) { this.newResourcePresenter = presenter; if (!options.isUsingWizard()) { createEmptyDecisionTable(pkg.getPackageMainResourcesPath(), baseFileName); } else { createDecisionTableWithWizard(pkg.getPackageMainResourcesPath(), baseFileName); } } }
NewGuidedDecisionTableHandler extends DefaultNewResourceHandler { @Override public void create(final Package pkg, final String baseFileName, final NewResourcePresenter presenter) { this.newResourcePresenter = presenter; if (!options.isUsingWizard()) { createEmptyDecisionTable(pkg.getPackageMainResourcesPath(), baseFileName); } else { createDecisionTableWithWizard(pkg.getPackageMainResourcesPath(), baseFileName); } } NewGuidedDecisionTableHandler(); @Inject  NewGuidedDecisionTableHandler(final PlaceManager placeManager,
                                         final Caller<GuidedDecisionTableEditorService> service,
                                         final GuidedDTableResourceType resourceType,
                                         final GuidedDecisionTableOptions options,
                                         final BusyIndicatorView busyIndicatorView,
                                         final NewGuidedDecisionTableWizardHelper helper); }
NewGuidedDecisionTableHandler extends DefaultNewResourceHandler { @Override public void create(final Package pkg, final String baseFileName, final NewResourcePresenter presenter) { this.newResourcePresenter = presenter; if (!options.isUsingWizard()) { createEmptyDecisionTable(pkg.getPackageMainResourcesPath(), baseFileName); } else { createDecisionTableWithWizard(pkg.getPackageMainResourcesPath(), baseFileName); } } NewGuidedDecisionTableHandler(); @Inject  NewGuidedDecisionTableHandler(final PlaceManager placeManager,
                                         final Caller<GuidedDecisionTableEditorService> service,
                                         final GuidedDTableResourceType resourceType,
                                         final GuidedDecisionTableOptions options,
                                         final BusyIndicatorView busyIndicatorView,
                                         final NewGuidedDecisionTableWizardHelper helper); @Override String getDescription(); @Override IsWidget getIcon(); @Override ResourceTypeDefinition getResourceType(); @Override void create(final Package pkg,
                       final String baseFileName,
                       final NewResourcePresenter presenter); @Override int order(); }
NewGuidedDecisionTableHandler extends DefaultNewResourceHandler { @Override public void create(final Package pkg, final String baseFileName, final NewResourcePresenter presenter) { this.newResourcePresenter = presenter; if (!options.isUsingWizard()) { createEmptyDecisionTable(pkg.getPackageMainResourcesPath(), baseFileName); } else { createDecisionTableWithWizard(pkg.getPackageMainResourcesPath(), baseFileName); } } NewGuidedDecisionTableHandler(); @Inject  NewGuidedDecisionTableHandler(final PlaceManager placeManager,
                                         final Caller<GuidedDecisionTableEditorService> service,
                                         final GuidedDTableResourceType resourceType,
                                         final GuidedDecisionTableOptions options,
                                         final BusyIndicatorView busyIndicatorView,
                                         final NewGuidedDecisionTableWizardHelper helper); @Override String getDescription(); @Override IsWidget getIcon(); @Override ResourceTypeDefinition getResourceType(); @Override void create(final Package pkg,
                       final String baseFileName,
                       final NewResourcePresenter presenter); @Override int order();  }