2012-02-14 93 views
0

我正在嘗試運行海洋測試框架測試,在此處打開Petrel 2011演示項目。然而,當我打開該項目與PetrelSystem.ProjectService.OpenPrimaryProject()我收到以下錯誤消息,並且測試被中止:如何使用Petrel演示項目運行海洋測試

Error: File EclipseNamesToPropertyTypeCatalog.xml not found in the installation 
File EclipseNamesToPropertyTypeCatalog.xml not found in the installation 
Slb.Ocean.Petrel.ProjectOpenException : Could not open the project. 
----> Petrel_Framework_NS.TestAssertionException : File EclipseNamesToPropertyTypeCatalog.xml not found in the installation 
at Slb.Ocean.Petrel.Core.Impl.Core.ProjectService.OpenPrimaryProject(String projectPath) 
at Slb.Ocean.Petrel.ProjectService.OpenPrimaryProject(String path) 

是否有此問題的方法?

回答

0

EclipseNamesToPropertyTypeCatalog.xml與Petrel一起部署在xml文件夾下。顯然,工作目錄是不同的,所以找不到文件。

+0

我正在使用Resharper運行測試。在Resharper選項對話框中,我指定測試應該從C:\ Program Files \ Schlumberger \ Petrel 2011運行。我已經在代碼中驗證了這實際上是Environment.CurrentDirectory。 xml文件如何定位? Ocean2011Home使用了嗎?還有其他建議嗎? – blue01 2012-02-15 08:21:16

1

這只是一個評論,但我需要50代表第一。

當使用nunit.exe直接運行測試(來自Petrel安裝文件夾)時它工作嗎?

您的測試或項目是否涉及Eclipse?如果沒有,您可以從petrel.exe.config註釋掉與Eclipse相關的模塊。不是一種解決方案,而是一種建議的解決方法。

0

你不需要工作。爲了運行演示項目,您需要正確配置petrel環境變量,以便打開預配置的演示項目。

這可以通過在PetrelTestProjectRoot和PetrelTestProject環境變量設置爲適當的路徑

0

這回答做的是有關Visual Studio的測試(未驗證上ReSharper的測試儀,但本質上應該是相似的)。

看起來Petrel根據調用程序集路徑加載這些.xml文件,例如,如果測試人員加載Petrel,這些文件需要與測試人員位於同一路徑中。

解決方法之一是將文件複製(或製作符號鏈接)到測試人員exe文件夾。例如。在VS2012:

image: Files copied to the tester exe path

這適用於Visual Studio中的其他版本了。