How can we catch the customized errors returned from the called class methods in the ABLUnit Test?
Customized errors like undo, throw new apperr " Error msg " or langerr " Error msg ".
any update guyz ?
Not sure what the question really is. I don't know much about ABLUnit, but the ABLUnit methods would have to throw any error that occurred. Then you would catch it as you normally would any other error with a CATCH block.
So are you asking how to catch an error? Are you asking how the ABLUnit methods can throw an error back to the caller?
If there is an error while executing the test the test is considered as a failure case. You may not catch the error raised.
But you can specify the exception by passing a expected parameter to the Test case as shown below.
@Test(expected="OpenEdge.Core.AssertionFailedError"). METHOD PUBLIC VOID TestPass(): Assert:IsTrue(FALSE). END METHOD.
In the above case the test is considered to be passed.
Let us know if you are looking for something else.
--
Regards,
Phani S.
if we pass this
@Test(expected="OpenEdge.Core.AssertionFailedError")
what it will do ?
The test case is considered pass if the error specified in expected attribute is raised.
That is a sample example. When you are testing application logic (a method for example), that might throw exceptions for certain input.
If you want to test your method is throwing an exception for certain input then you can specify that as part of expected attribute as showing in above snippet.
OK Gr8.
One of the method is throwing customized error like below . How do i catch this error in my test ? or have to use simple catch statement ?
DO:
UNDO, THROW NEW appError ("Error msg ").
END.
any update on this guys ?
Beg my pardon. But this is a community forum - not a place with a SLA.
On your last question. You are not very clear on why you want to catch that error. But most likely you have answered your own question. Or it was already replied by Phani Sajja: CATCH or annotate.
How can we change the Results.xml path for the test results ?
Currently it is generating under the tests folder as a default directory.
By default, it will be created in working directory.
If you want to change, you change the working directory from 'Run Configurations' -> 'Working directory' in the ABLUnit main page.
It always overwrite this file if you run a different test entity in the next run.
You can use the Export feature from ABLUnit results view rather than relying on this results.xml file.
--
Regards,
Phani S.
If you are using PDS OE to run ABLUnit tests, results will be generated under working directory mentioned in PDS OE's ABLUnit run configuration. Changing working directory to other might help.
If you are running from command-line, you can use outputdir parameter to generated results in custom location.
Thanks.
Now I am designing build.xml and adding DB names like
eg.
<dbinfo name="C:\OpenEdge\WRK114\s2000.db" host="localhost" port="4545" />
I am putting DB name, server name and port number but while running the build.xml using Ant Build i am getting error in console " DB xxx is not a valid DB name", not sure y. DB is on separate server.
All the parameters are correct. Using editor if I put the same parameters in CONNECT statement, it is working for me.
But through build.xml I am getting that error.
If the db specified in the given location with name attribute is not available it will raise exception.
Make sure that the db 's2000.db' present in the specified directory 'C:\OpenEdge\WRK114', which you have given.
My DB server is on another machine so i am giving only db name like "Test" not the whole path and passing other parameters like
<dbinfo name="Test.db" host="host007" port="4545" />
still not working .
You need to give the absolute path not simply 'Test.db'
what do u mean by the absolute path ?
The path is the full path where you created db. Eg, 'C:\SomeDir\Test.db'. You need to given the existing db in name field.
For example, if you created your db in C:\SomeDir with the name Test, your absolute path becomes 'C:\SomeDir\Test.db'.
At present, Ant expects that db to be presented locally.
So ABLUnit test framework will not work if we have DB on another server or machine
As I have mentioned the absolute path of the DB of our server and still I am getting the same error message.
You don't use an absolute path to connect to a DB on another server. You use the short DB name, the host name and the port number or service name.
Yes,I tried that also still I am getting the same error massage "Invalid DB name". The same parameters if I use in the CONNECT statement that works for me.
what is the exact error message? How does your connect statement look and how your startup parameters?
I don't see the error message yet. But I'd remove the ".db" part form the DB name. It is not part of the short DB name.
Error message is there in the console, check bottom side of the screenshot. I checked with removing .db, still getting the same error.
The error message seems to show a folder name. So I would question that the ant script you are showing on the screen is the same ant script that raised that error message.
Yes. one thing I observed here is that even after mentioning the remote host name and port it is searching DB in the working directory and raising this error message. In the console error is coming like
"{working directory path} \ stddb is not a valid DB name"
In which case you should report a bug with tech support.
is this really a issue / bug or m doing something wrong ?
Has anyone faced the same issue before ?
According to the docs you are doing everything right. Smells like a bug to me. Opening a tech-support case won't hurt.
Is there any alternative for this so that I can finish my framework design ?
Software products don't improve when users don't report bugs.
But an alternative was already given by Phani Sajja in this discussion. Use an absolute path and use a local DB.
don't know how do I report the bugs for progress tech supports, guide me on this so that I can report it.
I have mapped my DB server drive on the machine where we have this test framework and supplied the required parameters. Now its working for me. But now I am connecting to couple of Dbs and one of the DB required user id and password.
How can we pass username and password information in <dbinfo...> tag ?
Please note that if you're already using PCT (I think it was the case from previous messages), there's also an ABLUnit task ( github.com/.../ABLUnit ) in which you can reuse existing DBConnection.
No, I am running build.xml from the 11.6 studio only as a ANT task and so facing this issue. one of the DB is asking for the user id and password but in xml we can not provide this as <dbinfo..> tag is not supporting these attributes. Is there any alternative for this ?
Currently, username and password fields are also missing in the dbinfo tag.
Please report a bug for the same, or update in the previous one where it is missing remote db connection.
You may request a hotfix if you need immediate attention.
--
Regards,
Phani S.
Just to set your expectations... As you don't seem like someone who likes to wait. Progress is really fast with hot fixes when there is high urgency. But expect to wait for "a couple of weeks" at least. And you must make clear why there is urgency with your call.
Hi Mike,
There is no as such urgency but whatever mentioned in the document for this build.xml, I am following those steps and facing these couple of issues and so posting on this forum. If i get something alternative that will be great for me to accomplish my task within the timeline.
If you're looking for the alternative (or the standard way to build OE applications :-) ), you can use the ABLUnit task of PCT where username and passwords are already available.
Do we need to install this PCT tool separately ?
It's not bundled with Developer Studio, but it's just a JAR file to be copied in the right location
How do I install this jar, configure and run build.xml from 11.6 studio ?
Not much information available on the above link
Copy it in %DLC%\oeide\eclipse\plugins\org.apache.ant_1.8.4.v201303080030\lib
Ant version number can vary between versions.
from where i can get this .jar file ?
From the "Releases" tab ?
I have downloaded PCT jar and kept in the %DLC%\oeide\eclipse\plugins\org.apache.ant_1.8.4.v201303080030\lib.
I gone through the example of AblUnit for PCT but that is for the set of unit test files. I want to run only one suit program for my test. Is that possible in PCT XML ?
Normally we use <test> tag to run the individual test. Is that supported by PCT xml ?
Also can we run this xml from OE11.6 studio as a ANT task ?
I am running one sample PCT task for my testing from proenv and from Command line as mentioned on the URL site but its always giving me error on prompt like " The syntax of the command is incorrect ".
I defined these vars correctly ANT_HOME & JAVA_HOME and copied jar files in the %DLC%\oeide\eclipse\plugins\org.apache.ant_1.8.4.v201303080030\lib aswel.
From my MyProject folder I am simply running "ant build" command but m getting this error