您的位置:軟件測試 > 開源軟件測試 > 開源性能測試工具 > TPTP接口
Eclipse的TPTP工具使用方法
作者:網(wǎng)絡(luò)轉(zhuǎn)載 發(fā)布時間:[ 2012/12/17 15:58:21 ] 推薦標(biāo)簽:

Eclipse的TPTP工具使用方法:
1.        TPTP是什么:
TPTP是Eclipse的一個工程(Top-Level Project),TPTP項(xiàng)目封裝了一大堆公共的操作接口與數(shù)據(jù),甚至一個遠(yuǎn)程執(zhí)行環(huán)境,以供其它的TPTP工具使用。另外,它還提供了擴(kuò)展點(diǎn)以方便進(jìn)行定制編碼。實(shí)際上是一個依托于Eclipse的JAVA的Profile與分析工具,還提供了整合SWT GUI的Record與Replay功能(另外的文章中進(jìn)行介紹)。

2.下載要安裝的各種plugin。

以TPTP4.1為例
   a.解決安裝信賴條件:
     Eclipse SDK 3.1.0
     JDK 1.4
     EMF SDK 2.1.0
     XSD 2.1.0

    b.Agent Controller安裝
      下載
       將下載完的安裝包解壓到想安裝的目錄。
       將<unzip directory>in加到系統(tǒng)PATH環(huán)境變量中,不能有雙引號。
      執(zhí)行<unzip directory>in下的SetConfig.bat生成基本配置環(huán)境。
      執(zhí)行RAServer.exe,運(yùn)行守護(hù)進(jìn)程。

  c.安裝TPTP,此處選擇手動安裝。
     下載TPTP4.1
      解壓到eclipseplugins下。

完成安裝。


測試。
新建一個工程(Java Project)
將下列類導(dǎo)入到工程中:

package com.yadong.testtptp;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class CarModel {

    /* Required car parts: 1 Engine, 4 wheels, and 2 doors */
    public Engine engine = new Engine();
    public Wheel[] wheel = new Wheel[4];         
    public Door left = new Door(), right = new Door();

 

    public CarModel() 
    {
      for(int i = 0; i  < 4; i++)
        wheel[i] = new Wheel();
    }
       
    /* Launcher */
    public static void main(String[] args) throws IOException
    {
        final String LINE_SEPARATOR =
        System.getProperty("line.separator");
        final int BORDER_CHAR_LENGTH = 40;
        final int UNREF_OBJ_CREATED = 10;
        StringBuffer menu = new StringBuffer();
        CarModel car = new CarModel(); 
               
        /* Create the menu */
        for (int i = 0;i < BORDER_CHAR_LENGTH; i++)
          menu.append('-');
        menu.append (LINE_SEPARATOR).append("   (1) Simulate car usage");
        menu.append (LINE_SEPARATOR).append("   (2) Create unreferenced objects");
        menu.append (LINE_SEPARATOR).append("   (q) Quit");
        menu.append (LINE_SEPARATOR);
        for (int i = 0;i < BORDER_CHAR_LENGTH; i++)
          menu.append('-');
                 
        /* Display the menu */
        System.out.println ("CarModel started" + LINE_SEPARATOR + "Menu:");
        System.out.println (menu.toString());
        System.out.println ("Choose an option:");
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String input = in.readLine().trim();

               
        /* Aclearcase/" target="_blank" >ccept input for the desired option */
        while (!input.equalsIgnoreCase("q")) 
        {                       
          /* Check for invalid entry */
          if (input == null || input.length() != 1 || !Character.isDigit(input.charAt(0)))
          {
            System.err.println ("Wrong option");
            input = in.readLine().trim();
            continue;
          }
                                                 
          switch(Integer.valueOf(input).intValue())
          {
            case 1:
              simulateCarUsage(car);
              break;
            case 2:
              for (int i = 0; i < UNREF_OBJ_CREATED; i++)
                new CarModel();
              System.out.println (UNREF_OBJ_CREATED + " unreferenced objects of CarModel has been created");
              break; 
            default:
              System.err.println ("Wrong option");                               
          }
        input = in.readLine().trim();
      }
                               
    }

上一頁12下一頁
軟件測試工具 | 聯(lián)系我們 | 投訴建議 | 誠聘英才 | 申請使用列表 | 網(wǎng)站地圖
滬ICP備07036474 2003-2017 版權(quán)所有 上海澤眾軟件科技有限公司 Shanghai ZeZhong Software Co.,Ltd