¿ìËÙÒµÎñͨµÀ

ʹÓÃJavaÀ©Õ¹Rational Performance Tester - ±à³ÌÈëÃÅÍø

×÷Õß ØýÃû¼¼Êõ À´Ô´ NET±à³Ì ä¯ÀÀ ·¢²¼Ê±¼ä 2012-06-15
1-09-04 IBM Tim von Niessen

Ϊ SAMPLE_VAR2 ¶¨ÖÆ´úÂë½øÐÐ Add£¬ÒÔÌí¼Ó¶à¸öÖµ´´½¨Ò»¸öÊý×é¡£

ͼ 13. Ñ¡Ôñ»õ±ÒÂÛÌâ

ÔڼǼµÄ²âÊÔÖÐÀ©Õ¹¶Ô XE.com Conversion ÇëÇóµÄÈë¿Ú£¬²¢Ñ¡Ôñ URL www.xe.com/ucc/convert.cgi¡£

ͼ 14. Ñ¡Ôñ»õ±Ò URL

½«¼Ç¼£¨USD£©Öеڶþ¸ö»õ±ÒÀàÐÍÖµÌ滻ΪÀ´×Ô SAMPLE_VAR2 µÄ¶¨ÖÆ´ú Âë¡£

ͼ 15. ÏÔʾ»õ±ÒÖµ

ʹÓÃJavaÀ©Õ¹Rational Performance Tester(13)

ʱ¼ä:2011-09-04 IBM Tim von Niessen

SAMPLE_VAR2 ÖеĶ¨ÖÆ´úÂ룬½«»áÔÚ²âÊÔÔËÐÐÆÚ¼äͨ¹ý¶¨ÒåµÄÊý×飬ÔÚÖµµÄÄ© ¶ËÖØÐÂÆô¶¯¡£

ÓëÖ®ÏàÀàËÆ£¬PersistentVariableRandomTemplate ¿ÉÒÔÓà ÒÔÖ´ÐÐÒ»¸öËæ»ú·ÃÎʵÄÊý×é¡£

ʹÓö¨ÖÆ´úÂëÖеľ²Ì¬·½·¨

¾²Ì¬·½ ·¨µÄʹÓÿÉÄÜÊÇÒ»ÖÖÔã¸âµÄÃæÏò¶ÔÏóµÄ±à³Ì²Ù×÷¡£µ«ÊÇ£¬ÔÚÓÐЩÇé¿öÏÂÕâÊÇ´ïµ½ Ä¿±ê×î¿ìµÄÒ»ÖÖ·½Ê½¡£

À©Õ¹Ç°ÃæµÄ·¶Àý£¬¸ü¸Äת»¯µÄÖµ£¬Ê¹ÓÃÒ»¸ö com.ibm.rpt.util.NumericGenerator.java ÎļþÖмòµ¥µÄ¡¢¿ÉÔÙÓõÄ×**æ»úµÄÊý ×ÖÉú³ÉÆ÷¡£

ÔÚ³õʼµÄ URL ·ÃÎÊ֮ǰÌí¼ÓеĶ¨ÖÆ´úÂ룬ʹÓÃÒ»¸öÀàÃû£º com.yourco.example.var.SAMPLE_VAR3¡£µã»÷ Generate Code¡£

ͼ 16. »õ±Òת»¯

¸ü¸Ä SAMPLE_VAR3 ÖеĴúÂ룺

Çåµ¥ 9. ¸ü¸ÄÇ°µÄ´úÂë

public¡¡class¡¡SAMPLE_VAR3¡¡extends ¡¡ com.ibm.rational.test.lt.kernel.custom.ICustomCode2¡¡{ ¡¡/** ¡¡*¡¡Instances¡¡of¡¡this¡¡will¡¡be¡¡created¡¡using¡¡the¡¡no-arg¡¡ constructor. ¡¡*/ ¡¡public¡¡SAMPLE_VAR3()¡¡{ ¡¡} ¡¡public¡¡String¡¡exec(ITestExecutionServices¡¡tes,¡¡String[]¡¡ args)¡¡{ ¡¡return¡¡null; ¡¡}

±ä¸üΪ£º

Çåµ¥ 10. ±ä¸üºóµÄ´úÂë

public¡¡class¡¡SAMPLE_VAR3¡¡extends ¡¡com.ibm.rpt.util.SuperObject¡¡{ ¡¡/** ¡¡*¡¡Instances¡¡of¡¡ this¡¡will¡¡be¡¡created¡¡using¡¡the¡¡no-arg¡¡constructor. ¡¡*/ ¡¡public¡¡SAMPLE_VAR3()¡¡{ ¡¡} ¡¡public¡¡String¡¡ exec(ITestExecutionServices¡¡tes,¡¡String[]¡¡args)¡¡{ ¡¡return¡¡ NumericGenerator.getRandomCurrency("5000"); ¡¡} }

ʹÓÃJavaÀ©Õ¹Rational Performance Tester(14)

ʱ¼ä:2011-09-04 IBM Tim von Niessen

NumericGenerator.getRandomCurrency£¨×Ö·û´®£©·½·¨½ÓÊÜÁËÒ» ¸öÊý×ÖµÄ×Ö·û´®´ú±í£¬Ö¸Ê¾ÁËÉú³ÉµÄ×î¸ßÖµ£¬·´¹ýÀ´ÌṩÁËÒ»¸ö×**æ»úµÄÖµ£¬Ëü »ùÓÚÒ»ÖÖ»õ±Ò£¨$.¢¢£©¸ñʽµÄ DecimalFormat¡£Êý×ÖµÄËæ»úÐÔʹÓà java.util.Random À´ËÑË÷£¬·´¹ýÀ´ÓÖʹÓÃÀ´×Ô System.currentTimeMillis() µÄ ÖµÀ´Ñ°ÕÒ¡£

Çåµ¥ 11. Éú³ÉËæ»ú»õ±ÒµÄ´úÂë

public¡¡static ¡¡String¡¡getRandomCurrency(String¡¡high)¡¡{ ¡¡refreshRandom(); ¡¡double¡¡randomDouble¡¡= ¡¡Math.round(random.nextDouble()¡¡*¡¡ Double.parseDouble(high)); ¡¡return¡¡currencyDecimalFormat.format (randomDouble).toString(); } private¡¡static¡¡void¡¡ refreshRandom()¡¡{ ¡¡random.setSeed(System.currentTimeMillis ()); }

Ò»¸ö´íÎóÏÔʾ³öÀ´£¬Ö¸Ê¾ NumericGenerator cannot be resolved¡£ÓÒ»÷´íÎóָʾÆ÷£¬²¢Ñ¡Ôñ Quick Fix > Import NumericGenerator(com.ibm.rpt.util)¡£

ͼ 17. ´íÎóµÄ¿ìËÙÐÞ¸´

ÔÚ www.xe.com/ucc/convert.cgi µÄÇëÇóÊý¾ÝÖУ¬Ç¿µ÷ÏÔʾλÓÚ Amount= Ö® ºóµÄ 1£¬²¢Óɶ¨ÖÆ´úÂë SAMPLE_VAR3 ËùÈ¡´ú¡£1 ºÍ 0 Ö®¼äµÄ×¼Ëæ»úÊý×Ö½«Ïòÿ Ò»´Î²âÊÔÔËÐжøÌṩ¡£

·ÖÎö

±¾ÎÄÖÐÌṩµÄ·¶ÀýÊǼòµ¥µÄ£¬µ«ÊÇËü ÃÇÈ´ÏÔʾÁËÔõÑùͨ¹ýʹÓà Java ²Ù×÷À´À©Õ¹²âÊÔ¹¦ÄÜ¡£½µµÍÈßÓàµÄ´úÂ룬Òò´Ë¼õ ÉÙÁ˳¤ÆڵĴúÂëά»¤·ÑÓã¬Í¨³£ÊÇÒ»¸öÓÅÐãµÄÄ¿±ê¡£

Rational Performance Tester ²úÆ·ÖÐÌṩµÄ¼òµ¥¶¨ÖÆ´úÂëÄ£ÐÍ£¬¿ÉÒÔÇáËɵصõ½À©Õ¹£¬ÒÔ Ê¹Óà Java ³¬ÀàºÍÔÙʹÓõĴúÂë¹¹¼þÀ´

ÁèÖڿƼ¼×¨ÒµÌṩ·þÎñÆ÷×âÓᢷþÎñÆ÷Íйܡ¢ÆóÒµÓʾ֡¢ÐéÄâÖ÷»úµÈ·þÎñ£¬¹«Ë¾ÍøÕ¾£ºhttp://www.lingzhong.cn ΪÁ˸ø¹ã´ó¿Í»§Á˽â¸ü¶àµÄ¼¼ÊõÐÅÏ¢£¬±¾¼¼ÊõÎÄÕÂÊÕ¼¯À´Ô´ÓÚÍøÂç,ÁèÖڿƼ¼×ðÖØÎÄÕÂ×÷ÕߵİæȨ£¬Èç¹ûÓÐÉæ¼°ÄãµÄ°æȨÓбØҪɾ³ýÄãµÄÎÄÕ£¬ÇëºÍÎÒÃÇÁªÏµ¡£ÒÔÉÏÐÅÏ¢ÓëÎÄÕÂÕýÎÄÊDz»¿É·Ö¸îµÄÒ»²¿·Ö,Èç¹ûÄúҪתÔر¾ÎÄÕÂ,Çë±£ÁôÒÔÉÏÐÅÏ¢£¬Ð»Ð»!

·ÖÏíµ½£º ¸ü¶à

Copyright ©1999-2011 ÏÃÃÅÁèÖڿƼ¼ÓÐÏÞ¹«Ë¾ ÏÃÃÅÓÅͨ»¥Áª¿Æ¼¼¿ª·¢ÓÐÏÞ¹«Ë¾ All rights reserved

µØÖ·(ADD)£ºÏÃÃÅÈí¼þÔ°¶þÆÚÍûº£Â·63ºÅ701E£¨¶«ÄÏÈÚͨÅÔ£© Óʱà(ZIP)£º361008

µç»°£º0592-5908028 ´«Õ棺0592-5908039 ×ÉѯÐÅÏ䣺web@lingzhong.cn ×ÉѯOICQ£º173723134

¡¶ÖлªÈËÃñ¹²ºÍ¹úÔöÖµµçÐÅÒµÎñ¾­ÓªÐí¿ÉÖ¤¡·ÃöB2-20100024  ICP±¸°¸:ÃöICP±¸05037997ºÅ