Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

How do I get the name of the datasource in Groovy?

Options
jefftuckerbofa
jefftuckerbofa Posts: 234

What's the best way to get the name of the datasource associated with the responder in a Groovy script. Is there a reference to it in the context or do I need to put it there?

Thanks,

JT

Comments

  • williammccusker
    williammccusker Posts: 645 ✭✭✭
    Options

    Hi,

    I found this method that might be what you are looking for, context.getDefaultDataSourceName()

  • jefftuckerbofa
    jefftuckerbofa Posts: 234
    Options

    Thanks works great. Is there some documentation available that shows this type of thing? I have been unable to find something like that. JT

  • benken_parasoft
    benken_parasoft Posts: 1,235 ✭✭✭
    Options

    "getDefaultDataSourceName" is not API. It is not part of the ScriptingContext interface which is documented. Instead, it is internal API that just happens to return what you asked.

  • jefftuckerbofa
    jefftuckerbofa Posts: 234
    Options

    Thanks. I'll steer clear of that type of thing. JT