pitclipse icon indicating copy to clipboard operation
pitclipse copied to clipboard

Uncovered UI code

Open LorenzoBettini opened this issue 3 years ago • 0 comments

Tests do not yet cover some code.

Investigate that, especially for #136

org.pitest.pitclipse.launch.ui:

  • [x] org.pitest.pitclipse.launch.ui.PitLaunchShortcut
    • [x] A test with no tests
      • [x] If we select a README (non Java element) in the project explorer, it just doesn't run anything, but we should show "no tests found" https://github.com/pitest/pitclipse/commit/3b9ee6289e761192505f286c14ffa44215a3875e
      • [x] If we select two elements, we get "no tests found" https://github.com/pitest/pitclipse/commit/a2d2793bd31961d14c3bcd93bbbfbcc221f35dee
      • [x] If we select a field and we run, we get the dialog "no tests found" https://github.com/pitest/pitclipse/commit/624f9669c53fa6bd055bbdf75f9d2f830d0c0074
    • [x] Run PIT on a BinaryTest class file https://github.com/pitest/pitclipse/commit/ffdbdb54861f352d196652271bc242eb0b818117 https://github.com/pitest/pitclipse/commit/74381e7a49681c69bf3a1f952da3b8b43202c0f1
    • [x] A test with several launch configurations (prepare a project with saved launch configurations) https://github.com/pitest/pitclipse/commit/ae4e464c9cbf38733a840b968f92aa0a8c9ec447 https://github.com/pitest/pitclipse/commit/b7122baf767d3b7bbf2efbc2fc44c7e53bcefdb4
    • [x] org.pitest.pitclipse.launch.ui.PitLaunchShortcut.launch(Object[], String) ignoring exceptions https://github.com/pitest/pitclipse/commit/078dc390488e1f697d6db6cbafaadf1bce134a5f
    • [X] org.pitest.pitclipse.launch.ui.PitLaunchShortcut.hasSameAttributes(ILaunchConfiguration, ILaunchConfiguration, String[]) ignores exceptions https://github.com/pitest/pitclipse/commit/ed5a2e6fb072064fd1aa3623f54e98b428abc6c7
    • [x] org.pitest.pitclipse.launch.ui.PitLaunchShortcut.createLaunchConfiguration(IJavaElement) case for method: select a method in the project explorer; example foo.bar.FooTest.fooTest3() https://github.com/pitest/pitclipse/commit/d82c9f1dad2a0eddecafcfb6e897f25be476dedb
    • [x] org.pitest.pitclipse.launch.ui.PitLaunchShortcut.launch(ISelection, String) I don't see how it cannot be a StructuredSelection https://github.com/pitest/pitclipse/commit/d311a2c1a9dfc226ee5c177cbb7e3d17f41a8ebd
    • [x] PitLaunchShortcut.createLaunchConfiguration(IJavaElement) cannot get to an invalid selection since it's filtered beforehand in org.pitest.pitclipse.launch.ui.PitLaunchShortcut.launch(Object[], String) https://github.com/pitest/pitclipse/commit/beb2bb92799c73f44fc19649332c55ef0115cd35
  • [x] test for running from the editor
    • [x] org.pitest.pitclipse.launch.ui.PitLaunchShortcut.launch(IEditorPart, String) https://github.com/pitest/pitclipse/commit/5184f4a72c0c850ec09f36d8f006f05791927d65
    • [x] If we open README in an editor and we run, we get the dialog "no tests found" https://github.com/pitest/pitclipse/commit/5184f4a72c0c850ec09f36d8f006f05791927d65
    • [x] PitLaunchShortcut.getLaunchConfigurations(ISelection) I don't see how it cannot be a StructuredSelection (and it's called from here: org.eclipse.debug.internal.ui.contextlaunching.LaunchingResourceManager.getParticipatingLaunchConfigurations(IStructuredSelection, IResource, List<LaunchShortcutExtension>, String), where it's a structured selection). https://github.com/pitest/pitclipse/pull/206/commits/4408201a66af2dcb23b1dfdaafe1c238519de811
    • [x] editor context menus?
  • [x] org.pitest.pitclipse.launch.ui.PitLaunchShortcut.getLaunchConfigurations(ISelection) is called when something is selected and we hover on the toolbar button
    • [X] "Run" toolbar button https://github.com/pitest/pitclipse/commit/777b2c952c05d0c195b69c38600118ed70ccf324
    • [x] Also when editor is selected https://github.com/pitest/pitclipse/pull/206/commits/c17de184d22a5e605b43c31015690636f3e33783
    • [x] but again we must assume structured selection?
  • [x] org.pitest.pitclipse.launch.ui.LaunchShortcut https://github.com/pitest/pitclipse/pull/206/commits/6f7dc07bd478be32c64525de3743939222e48ee4 https://github.com/pitest/pitclipse/pull/206/commits/478c29832728996fc01722bdc5a20b46ac7cdbd7

The above tasks have been addressed in https://github.com/pitest/pitclipse/pull/206

org.pitest.pitclipse.ui:

  • [x] Visitor adapter with default implementations (that must be uncovered) https://github.com/pitest/pitclipse/pull/207/commits/9c29d688dd64cfa4c31b1d30fbc64c0bce889c86
  • [x] ViewContentProvider should assume Visitable object and no check for instanceof https://github.com/pitest/pitclipse/pull/207/commits/1c30b28d1607f17d9073cd03dded5c2819dcf661
  • [x] ViewLabelProvider similar and there are other cases that cannot take place https://github.com/pitest/pitclipse/pull/207/commits/72aa6ec30622d4dced2ba1680d1002ed4bf00a8b
  • [x] OpenMutationDoubleClick https://github.com/pitest/pitclipse/pull/207/commits/a4e38fdc10269d2195eac1f2e98138c10ff6988a https://github.com/pitest/pitclipse/pull/207/commits/5d15bc88b83395d33fb5dbf904796dfb27b108aa
    • [x] PitclipseLaunchUiUtils should be in PitclipseUiUtils since .launch.ui depends on .ui https://github.com/pitest/pitclipse/pull/207/commits/38c5583e14ec37724dfa818b1b58badfc63d0411
  • [x] ExpandingDoubleClick https://github.com/pitest/pitclipse/pull/207/commits/b4dd65d6954c612b5d9f8fea35cef9a1900daaad
  • [x] PitViewFinder when the views are closed return NoOpMutationsView NoOpSummaryView but maybe it should also try to open them? Instead we have
private static synchronized void activateViewOnceAndOnceOnly(String viewId) throws PartInitException {
    if (!initialisedViews.contains(viewId)) {
        IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
        activePage.showView(viewId);
        initialisedViews.add(viewId);
    }
}

done in https://github.com/pitest/pitclipse/pull/207/commits/62d700916e95a27e9de173b13b01e117a114f65d

The above tasks have been addressed in https://github.com/pitest/pitclipse/pull/207

LorenzoBettini avatar Aug 24 '22 14:08 LorenzoBettini