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 — String.join() with Enum.toString() inside - test generation fails · Issue #434 · UnitTestBot/UTBotJava

String.join() with Enum.toString() inside - test generation fails #434

New issue
Copy link
New issue
Copy link
Closed
Closed
String.join() with Enum.toString() inside - test generation fails#434
Copy link
Labels
ctg-bugIssue is a bugIssue is a bug

Description

@alisevych
alisevych
opened on Jul 6, 2022
Issue body actions

Description

Test generation fails for String.join() with Enum.toString() inside

To Reproduce

Steps to reproduce the behavior:

  1. IntelliJ IDEA with UTBotJava plugin installed
  2. A project with JDK 8/11 is opened
  3. Add the following class:
public class UsingEnum {

    public void execute() {
        String print = String.join("\n", 
                WorkDays.Monday.toString(), 
                WorkDays.Tuesday.toString());
    }

    public enum WorkDays {
        Monday,
        Tuesday,
        Wednesday,
        Thursday,
        Friday
    }
}
  1. Run Generating tests with UTBot... for this class

Expected behavior

Tests are supposed to be generated.

Actual behavior

"Failed to generate unit tests for class UsingEnum" error popup is shown in IDEA.
It is shown immediately after test generation is started.

Visual proofs (screenshots, logs, images)

String join with Enum toString()

Environment

Windows 10 Pro
IntelliJ IDEA 2022.1.3
checked on JDK 8 and 11, Gradle projects - same error

Additional context

Adding some input parameters to the method helps - fuzzer is generating tests.

Activity

  1. alisevych
    assigned
    dtim
    on Jul 6, 2022
  2. alisevych
    added
    ctg-bugIssue is a bugIssue is a bug
    on Jul 6, 2022
  3. alisevych
    added this to UTBot Javaon Jul 6, 2022
  4. alisevych
    moved this to Todo in UTBot Javaon Jul 6, 2022
  5. alisevych
    changed the title [-]Test generation fails for String.join() with Enum.toString() inside[/-] [+]String.join() with Enum.toString() inside - test generation fails[/+] on Jul 6, 2022
  6. alisevych
    unassigned
    dtim
    on Jul 6, 2022
  7. alisevych commented on Jul 6, 2022

    @alisevych
    alisevych
    on Jul 6, 2022
    MemberAuthor
    More actions

    The issue is NOT reproducing on the latest build - from here, with #425 fix

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

Metadata

Metadata

Assignees

No one assigned

    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 01402503 — 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.