GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Test generation for an abstract class fails · Issue #873 · UnitTestBot/UTBotJava

Test generation for an abstract class fails #873

New issue
Copy link
New issue
Copy link
Closed
Closed
Test generation for an abstract class fails#873
Copy link
Assignees
EgorkaKulikovvolivan239
Labels
ctg-bugIssue is a bugIssue is a bug

Description

@sergeypospelov
sergeypospelov
opened on Sep 8, 2022
Issue body actions

Description

If we run test generation for an abstract class, the dialog appears, but further test generation fails.

To Reproduce

Steps to reproduce the behavior:

  1. Create a Java project
  2. Paste this code:
abstract public class AbstractClass {
    int testMe(int x) {
        if (x == 0) {
            throw new IllegalStateException("123");
        }
        return 0;
    }
}
  1. Run "Create Tests with UtBot" action
  2. Doesn't matter mocks enabled or not
  3. Choose the single method and press "Generate Tests" button

Expected behavior

I see these possible behaviors:

  • Prohibit to generate tests for abstract classes completely, so action is disabled, if the caret context class is abstract
  • Prohibit to generate tests for abstract classes completely, so popup appears if the user tries to run the action for an abstract class
  • Allow to generate tests for abstract classes if mocks are enabled, and initialize an abstract class instance with mocks

Maybe there are better solutions.

Actual behavior

An error popup appears saying nothing about the class is abstract.

Visual proofs (screenshots, logs, images)

image

Activity

  1. sergeypospelov
    assigned
    EgorkaKulikov
    and
    volivan239
    on Sep 8, 2022
  2. korifey
    added this to UTBot Javaon Sep 8, 2022
  3. korifey
    moved this to Todo in UTBot Javaon Sep 8, 2022
  4. sergeypospelov
    added
    ctg-bugIssue is a bugIssue is a bug
    on Sep 9, 2022
  5. Vassiliy-Kudryashov commented on Sep 14, 2022

    @Vassiliy-Kudryashov
    Vassiliy-Kudryashov
    on Sep 14, 2022
    Member
    More actions

    Looks like ~duplicate of #221

  6. EgorkaKulikov
    closed this as completedon Oct 6, 2022
  7. Repository owner moved this from Todo to Done in UTBot Javaon Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @EgorkaKulikov
    EgorkaKulikov
  • @volivan239
    volivan239

Labels

ctg-bugIssue is a bugIssue is a bug

Type

No type

Projects

  • UTBot Java
    Status
    Done
    Show more project fields

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.