SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    Jan 2005
    Location
    Duisburg,Germany
    Posts
    89
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Code conversion from java to winrunner

    Hi all,
    Iam using WR7.6.
    I need to convert below Java program into WR to get the version number from it.

    In the below code I am able to do until line 6. Can any one tell me the how I can write line 7 into WR code?

    1.java.net.URL codeBase = object.getClass().getProtectionDomain().getCodeSou rce().getLocation();

    2.if(codeBase.getPath().endsWith(".jar"))
    3.{

    4.java.util.jar.JarInputStream jin = new java.util.jar.JarInputStream(codeBase.openStream() );

    5.java.util.jar.Manifest mf = jin.getManifest();

    6.jin.close();

    7.java.util.Map entries = mf.getMainAttributes();

    8.java.util.jar.Attributes.Name buildNumberKey = new java.util.jar.Attributes.Name("OpenIDE-Module-Build-Version");

    10.java.util.jar.Attributes.Name moduleKey = new java.util.jar.Attributes.Name("OpenIDE-Module");

    11.System.out.println("Module = " + entries.get(moduleKey));
    }


    Thanking you,
    cheers
    jai

  2. #2
    Senior Member
    Join Date
    May 2003
    Location
    Austria
    Posts
    1,480
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Code conversion from java to winrunner

    How did you come until line 6? Can you post the WR code for doing these steps?

    Thanks,
    Juergen

  3. #3
    Member
    Join Date
    Jan 2005
    Location
    Duisburg,Germany
    Posts
    89
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Code conversion from java to winrunner

    hi ,
    in the java code in place of object. I can have any gui object so in the below code i used Eventcounter as a object its a Jtable.
    jco_free_all();
    java_activate_method("Event counter","getClass",class_val);
    java_activate_method(class_val,"getProtectionDomai n",protect_val);
    java_activate_method(protect_val,"getCodeSource",c ode_val);
    java_activate_method(code_val,"getLocation",loc_va l);
    java_activate_method(loc_val,"toString",str);
    java_activate_method(loc_val,"openStream",instream );
    jco_create("NetAct Desktop 0.0",output,"java.util.jar.JarInputStream",instrea m);
    java_activate_method(output,"getManifest",mainfest );
    jco_free(output);

    Thanking you,
    cheers
    jai

  4. #4
    Member
    Join Date
    Jan 2005
    Location
    Duisburg,Germany
    Posts
    89
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Code conversion from java to winrunner

    Hi all,
    Can any one reply for my problem.Iam waiting for it from long time.

    Thanking you,
    cheers
    jai

  5. #5
    Senior Member
    Join Date
    May 2003
    Location
    Austria
    Posts
    1,480
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Code conversion from java to winrunner

    Sorry, that's out of my Java knowledge (and probably too specific to handle in a forum like this).

    If you have a service agreement with Mercury, you could open a SR. If your problem is difficult enough (and if you're persistent enough), you'll reach some really competent guys there (e.g. Jose Barranco, to name one specialist that really helped me with some tricky Java problems).

    Good luck!
    Juergen

  6. #6
    Member
    Join Date
    Jan 2005
    Location
    Duisburg,Germany
    Posts
    89
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Code conversion from java to winrunner

    Ok juergen .Thanks for the information

    cheers
    jai

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 10:25 AM.

Copyright BetaSoft Inc.