Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test generation for an abstract class fails #873

Closed
sergeypospelov opened this issue Sep 8, 2022 · 1 comment
Closed

Test generation for an abstract class fails #873

sergeypospelov opened this issue Sep 8, 2022 · 1 comment
Assignees
Labels
ctg-bug Issue is a bug

Comments

@sergeypospelov
Copy link
Member

sergeypospelov commented Sep 8, 2022

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

@korifey korifey moved this to Todo in UTBot Java Sep 8, 2022
@sergeypospelov sergeypospelov added the ctg-bug Issue is a bug label Sep 9, 2022
@Vassiliy-Kudryashov
Copy link
Member

Looks like ~duplicate of #221

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ctg-bug Issue is a bug
Projects
Archived in project
Development

No branches or pull requests

4 participants