konveyor / tackle-test-generator-core

Apache License 2.0
28 stars 21 forks source link

NullPointerException in CrawljaxRunner with Clickables Specification #134

Closed w3dkramer closed 2 years ago

w3dkramer commented 2 years ago

Describe the bug

I created a clickables spec with dont_click items but no click items and got this exception when running the UI generate command with the CLI:

Error creating Crawljax configuration: null 
java.lang.NullPointerException
        at org.konveyor.tackletest.ui.crawljax.CrawljaxRunner.updateClickablesConfiguration(CrawljaxRunner.java:237)
        at org.konveyor.tackletest.ui.crawljax.CrawljaxRunner.createCrawljaxConfiguration(CrawljaxRunner.java:497)
        at org.konveyor.tackletest.ui.crawljax.CrawljaxRunner.main(CrawljaxRunner.java:645)

I think if a user creates a clickables specification file, but does not include any click.element, or dont_click.element items, or both, this exception occurs.

// process click spec
TomlTable[] clickElementSpec = clickableSpec.getArray("click.element")
    .toList()
    .toArray(new TomlTable[0]);

// process don't click element spec
TomlTable[] dontclickElementSpec = clickableSpec.getArray("dont_click.element")
    .toList()
    .toArray(new TomlTable[0]);