Junit : How can I get the method name (say testMyAddress) that failed

My code is below
          TestSuite masterSuite = new TestSuite(testClass);
          TestResult result = new TestResult();
          masterSuite.run(result);
               Enumeration errors = result.errors();
               while (errors.hasMoreElements())
                    TestFailure error = (TestFailure)errors.nextElement();
                    Test test = error.failedTest();
/*will give me the class name but how can I get the method that threw the exception.
I can get fName (that contains the method name) field to get the method,but being private I cannot hold of the field.
Wondering if there is any easy way to get the method name that threw exception,without writing unneccessary code
                    Class c1 = test.getClass();
thx
m

getting all methods is no good!
My test class looks like this
MyTestClass{
testGoodData(){
asserttrue(.....);
testBadData(){
asserttrue(.....);
testNullData(){
asserttrue(.....);
someHelperMethod(){
thx
m

Similar Messages

  • How can I get the infoset name by giving the name of a program of a query?

    How can I get the infoset name by giving the name of a program of a SAP Query?
    Regards,
    Subho

    Use FM RSAQ_DECODE_REPORT_NAME.
    You can also use AQLQCAT table.

  • C Programming: How can we get the filesystem name for a given file-path?

    C Programming: How can we get the filesystem name for a given file-path?
    Say I have a filepath=/mnt1/file1
    Using some OS API like stat, can I get the Filesystem /mnt ?
    Thanks in advance,
    -V

    Enter the command up to the point of entering the file path and add a space, then drag the file into the terminal window. It will fill out the path.
    If you need to go further into the contents of the Application package, you can continue with /Contents...
    Another way is to start typing and then hit Tab to auto-complete. It will stop where it can't determine the next letter.
    So, type /App tab and it will fill in /Applications. Type a / and start with the name of the app, then tab and it should complete. Continue till you have the correct path.
    Spaces will be replaced with \<space>, so, App Store would end up as /Applications/App\ Store.app

  • How can I get the ip addres of computers that log into my Applet?

    How can I get the ip addres of computers that log into my Applet?
    Thanks
    REuven

    Try using method getAddress of class InetAddress.

  • I accidentally erased a music album that I purchased on iTunes. How can I get the iTunes store to recognize that it is no longer in my iTunes library and download it again?

    I accidentally erased a music album that I purchased on iTunes. How can I get the iTunes store to recognize that it is no longer in my iTunes library and download it again?

    Delete the broken links in iTunes then look at your purchased list to redownload.
    If this happened because you were deleting files from the iTunes folder in Finder, don't.  You have to let iTunes do all the deleting and moving or you will end up with broken links.

  • How can I get the amount of free space that is on my drive to show at the bottom of the drive in Lion.

    How can I get the amount of free space that is on my drive to show at the bottom of the drive in Lion.
    This is a must feature for me and I may have to go back to Snow Leopard.
    Please help!

    Right click on your desktop and choose "viewer options". Adjust the spacing and the size of your icons and you should be able to see the size of your drive(s) and the free space available on each drive with the exception of your bootcamp drive which will only show the overall size of the drive you have it on.  This may be different if you only have one system drive (like on a Mac Book Pro) with a partition containing bootcamp on it. this may only show you the overall capacity, I can't say for sure though as I only use a Mac Pro with 4 seperate Hard Drives which are showing both overall capacity and free space available. Hope this helps
    Denisimo

  • How can I get the query name in webitem method ?

    Hello,
    I have defined a new web item but I can't retrieved parameter of my webitem in the RENDER method for instance. I have declared a parameter in the RSRRENDERATR table like this :
    REN_NAME : MY_WEBITEM
    ATR_NAME : MY_PARAM
    ATR TYP : TEXT
    CHR MAX LEN : 50
    How can I do this ? How can I get the MY_PARAM value in the RENDER method ?
    Thanks a lot
    GC.
    Edited by: CoGr on Feb 11, 2008 12:10 PM

    Hi ,
    data l_r_view type ref cl_rsr_www_view.
    data l_t_text_symbols type rrx1_t_txt_symbols.
    l_r_view =? n_r_data_provider.
    CALL METHOD L_R_VIEW->n_r_request->TEXT_ELEMENTS_GET
      IMPORTING
        E_T_TXT_ELEMENTS = l_t_text_symbols.
    l_t_text_symbols contains all DP information like Query technical name, or Report text last load etc.
    best regards,
    kai

  • How can we get the table name...

    Hi All,
    How can we get the actual table name for an argument if its datatype is %ROWTYPE.
    For Ex :
    function ACCOUNT_UPDATE (account_no number,
    person person%rowtype,
    amounts dbms_describe.number_table,
    trans_date date)
    return accounts.balance%type;
    In the above function 'ACCOUNT_UPDATE', for argument person the datatype is 'person%rowtype'.
    Is there any way to get the name from Data Dictionary tables.
    I tried using All_Arguments and DBMS_DESCRIBE, I can able to get all the individual fields of %ROWTYPE by I could not able to know the exact table name thru the DD.
    my requirement is dynamically I need to declare a variable for the argument datatype.
    Your help is highly appreciated.
    Thanks

    hi vinay,
    this is the easiest way to find the tablename of a particular field.
    t.code:XD01.
    enter.
    select the kunnr field.
    press F1.
    the top of the screen u will get 'Technical setting icon.
    select that one.then u will get tablename,fieldname,parameter id also.
    if helps give the rewards.
    regards,
    akash.k

  • How can I get the inbox name of exchange?

    I wanna get the letters from exchange server, the code i writed below:
    Session session1 = Session.getInstance(new Properties(), null);
    session1.setDebug(true);
    Store store = session1.getStore("pop3");
    store.connect(pop,-1,popuser,poppwd);
    Folder folder = store.getDefaultFolder();
    folder = folder.getFolder("INBOX");
    folder.open(Folder.READ_WRITE);
    the erro report displayed:
    "no such mailbox in this server"
    and i don't know how can i know the mailbox name in my exchange server? is it "INBOX"?
    any idea?
    thank you!

    You can use the following to get a list of the folders that are on the server. I don't know what rules Exchange uses when accessed through POP3 to name its inbox but you should be able to get a complete list this way.
    =======================================================================
    Folder rf = store.getDefaultFolder();
    if ((rf.getType() & Folder.HOLDS_FOLDERS) != 0)
    Folder[] f = rf.list("%");
    int count1 = 0;
    for (int i = 0; i < f.length; i++)
    System.out.println(f.getName);

  • How can i get  the column name   for assigned constraint name  from  the  user_constraints   table?????

    Hi  ,
    I  have a table  so  many constraints   on so  many  columns. I  need to  know  which column has which  constraint plsql dev?? like below...
    table_name -------- col_name ------ constraint_name_of_that_col
        xxxxxx              xxxxxxx              xxxxxxxxxxxxxxxx
    or else please let me know  how can i  get the  corresponding col_name for a particular  constraint name???

    My be this can give you a help:
    [code]
    SELECT *
    FROM   ALL_CONSTRAINTS
    WHERE  R_CONSTRAINT_NAME IN (SELECT CONSTRAINT_NAME
                                                               FROM   ALL_CONSTRAINTS
                                                               WHERE  TABLE_NAME = 'TABLE_NAME'
    [/code]

  • How can I get the administrators name and password so I can download the latest os this is a refurbished iMac

    How can i find the administrator name and password for my  iMac .
    This was a refurbished product purchased online and i need this info to download new things form the apple store ?

    See #5
    Step by Step to fix your Mac

  • How can I get the host name from Email address?

    hi
    When I using socket to develope an email-sending servlet,I don't know how to get the host name from emial address.can you help me,thanks

    Stripping off the user name will give you the domain of from field in the message. This is not the same as the host. Take a look at:
    http://www.stopspam.org/email/headers/headers.html
    Theres a pretty good discussion about email headers and how to use the information. You probably want to check the information here against the RFC.
    Sean

  • How can I get the path name and rename it?

    I Hope someone who knows more about automator than I can help me out here. What I'm trying to do is get the path file name, while also changing part of it. Here is my example:
    I can get the path name with this "Get Path" script I found http://automatorworld.com/archives/get-path/all-comments/
    It does half the job so I just need to tweak it but know how. When I get the path this is what I'll get: /Volumes/Public/Creative Services/Campaigns/2010/NCDDiv-32CDV Upgrade/NCDDIV-32Versions.xls
    I need to remove the beginning part"/volumes" to "file://///nhmanmkt01"
    This is so I can send the path from our sever where we keep our files to my windows friends so they can open it.
    Thanks for any help you can provide!

    ok, make the following workflow.
    1. get selected finder items.
    2. run shell script
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #ADD8E6;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    for f in "$@"
    do
    echo "$f"|sed 's%/Volumes%file://///nhmanmkt01%'
    done</pre>
    set the script to accept input as arguments
    3. copy to clipboard
    save it as a finder plugin.

  • How can i get the column names in CSV file.

    Hi,
    After execution of infospoke i can not see the column names in that file.How can i get column of respective infoprovider?
    Thanks,
    Gananadha Lenka

    Hello Gana,
    Actually while exporting the data using Info Spoke, we have the possibility to modify the data that we send. This is possible using transformations.
    In your Info Spoke, you have a tab called Transformations.
    Here you need to create an implementation and then use BADi to populate data.
    Check if you can write a start routine sort of thing here and insert a new record into the internal table by hardcoding with your field headings.
    Let me know if you dont know how to create transformations.
    Kris...

  • How can I get the query name/aggregationslevel in my planning function?

    Hi,
    is it possiable to get the query name/aggregationslevel in a planning fuction?
    thanks for your idea.
    hongwei

    Hi,
    The interface IF_RSPLFA_INFOPROV_DESC
    provides methods for retrieving the most important properties of an InfoProvider from the point of view of the implementation class of a planning function type.
    Methods GET_T_CHARNM and GET_T_KEYFNM return the names of the characteristics and key figures in the InfoProvider.
    You can get the properties of the InfoObjects and compound information by calling method GET_TAB_IOBJ_PRO and GET_TAB_IOBJ_CMP .
    Does this help?
    Best Regards
    Shyam

Maybe you are looking for

  • Launching from desktop shortcuts results in shared JInitiator sessions?

    Hello, I've been looking into how best to give users a route into my Forms 10gR2 application, and had set up a desktop shortcut. This is just a URL to an intermediate htm file, which then uses window.open() Javascript to run the URL for the applicati

  • ISA570 - SPAM and Web Filtering Only

    I want to use my new IAS570 for SPAM and Web filtering but not as a firewall or VPN endpoint at this time.  I want to contune to use my existing firewall for the other 2 services.  Is it possible to do this and does the ISA570 need an external IP add

  • Date o/p probelm when download into flat file inf110 tcode in fi

    hi,   when im create payment transaction in f110 tcode in fi , and selct the record and down load into flat file in flat file first line it shows run date same as we given in transaction,but in second line it shows same date as before but it shows di

  • Need help upgrading a B/W G3

    I haven't done a thing to upgrade my computer since I bought it in 1999. It is a 350mhz blue and white G3 with 192 mb RAM, 6 GB hard drive and Mac OS 8.6. I can't afford to buy a new computer yet and would like to get a little more mileage from this

  • Load form created by screen painter

    hello every one, i've a problem. What are the steps to be followed to load a form created by screen painter?  might i have any  sample code In order to understand the various phases? thank a lot