Forum Discussion

agreen53's avatar
agreen53
Occasional Contributor
13 years ago

Programmatically generating assertions.

Okay this is an issue I am have trouble figuring out on my own.

I am attempting to Programmatically add an assertion and the problem I am running into is that when I open the AddAssertionPanel for a RestTestRequestStep, Valid and Invalid HTTP Status Codes are disabled as a selectable option. Running the same library with the UI, these options are available. Could someone please help me to understand why this is happening?

My code is as Follows:

         public static Object addAssertionToTestStep(WsdlTestStep teststep) {
if (!(teststep instanceof Assertable))
return null;
else {
Assertable a = (Assertable) teststep;
Map<String, TestAssertionFactory> map = getAssertionFactories();
final AddAssertionPanel addAssertionPanel = new AddAssertionPanel( a );
addAssertionPanel.setVisible(true);
return null;
}
}


If anyone knows the answer it would be much appreciated if you could share.

1 Reply

  • agreen53's avatar
    agreen53
    Occasional Contributor
    For now I have overridden the behavior to match to the UI (Created a factory with the same references to the appropriate classes and overridden target classes) to gain access to the assertions that I want to use. Still am very much interested in figuring out why this supposed error exists though. Any help is appreciated.