Ocean Wizards and Developers Tools 2018
Ocean Wizards and Developers Tools 2018
Security Notice
The software described herein is configured to operate with at least the
minimum specifications set out by Schlumberger. You are advised that such
minimum specifications are merely recommendations and not intended to be
limiting to configurations that may be used to operate the
software. Similarly, you are advised that the software should be operated in
a secure environment whether such software is operated across a network,
on a single system and/or on a plurality of systems. It is up to you to
configure and maintain your networks and/or system(s) in a secure
manner. If you have further questions as to recommendations regarding
recommended specifications or security, please feel free to contact your local
Schlumberger representative.
iii
TABLE OF CONTENTS
The Ocean for Petrel Wizards ..................................................................... 5
Installing the Ocean for Petrel Wizards ......................................................... 6
Creating an Ocean for Petrel Plug-in Project .............................................. 10
Adding a New Process ................................................................................. 18
Adding New Command ................................................................................ 24
Adding a New Petrel Tree Extension ........................................................... 30
Adding a New Window ................................................................................ 34
Adding a New Workstep .............................................................................. 36
Adding an Ocean Settings Page ................................................................... 39
Adding Ocean Data Sources ........................................................................ 41
Adding an Ocean Seismic Attribute ............................................................. 46
Adding an ECLIPSE Format Simulator Plug-in .............................................. 49
Adding a Plug-in project .............................................................................. 56
Adding a New Property Modeling Algorithm .............................................. 60
Geometrical modeling algorithm ................................................................ 60
Facies modeling algorithm .......................................................................... 62
Petrophysical modeling algorithm .............................................................. 64
Adding a PIP Project .................................................................................... 65
Editing the DeployList.xml ........................................................................... 68
Adding Ocean Wix Plug-in Installer Project ................................................. 71
iii
Customizing the PluginInstallInfo.xml ........................................................ 78
Creating an Ocean Plug-in Test Project ....................................................... 80
The Ocean Developers Tools.................................................................... 85
Ocean Quality Assistant............................................................................... 86
Accessing Ocean Quality Assistant ............................................................. 86
Accessing Ocean Quality Assistant Summary ............................................. 88
Run all tests ................................................................................................. 88
Running Automated Acceptance Tests ....................................................... 89
Managing Manual Acceptance Tests .......................................................... 91
Running fixed set of Sanity Unit Tests ........................................................ 93
Ocean NUnit Test Adapter .......................................................................... 97
Creating a Test Project ................................................................................ 97
Test Explorer ............................................................................................... 98
Selecting Petrel Version .............................................................................. 99
Running the tests ...................................................................................... 100
Code coverage........................................................................................... 102
Ocean Plug-in Upgrade Tool ...................................................................... 104
Running the Upgrade Tool ........................................................................ 104
What to expect.......................................................................................... 105
Ocean for Petrel API Documentation in Help Viewer ............................... 108
Ocean Controls .......................................................................................... 110
5
The Ocean for Petrel Wizards
The Ocean for Petrel Wizard is installed as part of the Ocean for Petrel SDK installation
process. Installation of the Wizard is an option and requires some disk space. Although it
is part of the typical installation, it might not have been part of your installation. If the
Wizard has not been installed, you will need to install it before you can go any further.
To install the Wizard:
1. Run your Ocean SDK installation executable again.
2. Select Modify.
3. Add the Wizard using the settings in the associated boxes.
To check whether the Ocean Wizard has been installed, run Visual Studio and select
New Project from the File menu. The project dialog should show Ocean as an option in
the list of new project types as shown in the following figure.
If these icons are not shown, run the Ocean SDK installer again and select the Wizard
installation option.
If you try to add a new project item to an existing project (as shown in Figure 4), then
you can see the Ocean project item types (as shown in Figure 5).
Figure 5: New Project Item Dialog Showing the Ocean Wizard Installed Options
If you want to create a new plug-in project, choose File > New Project in Visual Studio.
The following screen opens.
Ocean project
types
Ocean Plugin
Project name
The following figure shows the Step 1 window of the plug-in project or plug-in file
wizard:
In this page, you can specify the plug-in metadata information such as the author,
contact information, and a small description. This information is redundant if you use
the old IModuleAppearance on your modules, but the information given in the plug-in
will be the main source.
If you check the Register existing modules in the solution checkbox, then you can select
which modules want to register from the detected module list:
In order to use the plug-in, there must be at least one module registered in it.
You also have the option to generate a new module together with the new plug-in. If
you choose to generate a new module, you will get the same module-generator wizard
pages you are already familiar with.
During the building of your plug-in, as a post build event, the plug-in gets registered in
Petrel, so you need to build your plug-in at least once, and after that, the plug-in is
usable from Petrel.
Module namespace
Plugin registration
2. Click Next.
The Step 2 screen of the Wizard dialog opens as shown in
the following figure.
If you chose Ocean Process in the Add / New Item dialog (Figure 4), then the following
screen opens:
Module
Namespace of the selection
selected module dropdown
Add workstep
Workstep list
Edit the selected workstep
Remove workstep
o Workstep data: This tab is similar to the main page of the process.
You can set the name, description, and other settings. This tab is
exactly the same as on the second page of the Ocean Workstep
project item wizard; see Adding a New Workstep on page 36. for
details.
o Argument data: This tab is used for setting the arguments of the
workstep. See Adding a New Workstep on page 36, because it is
exactly the same as the third page of the Ocean Workstep project
item wizard.
5. After you set the workstep, click OK to return to Ocean Process Details.
In this example, the newly created “HelloWorldWorkstep”
is added to the workstep list as shown in the following
figure.
6. Click Next.
The Wizard generates a file with the Process class and a file
with the Workstep class and adds them to the process
diagram and workflow editor respectively. The Wizard also
adds the following code in the Integrate method of your
Ocean module class:
public void Integrate()
{
// Registrations:
// Register HelloWorldProcess
HelloWorldProcess helloworldprocessInstance = new
HelloWorldProcess();
PetrelSystem.ProcessDiagram.Add(helloworldprocessInstance,
"Plug-ins");
// Register HelloWorldWorkstep
HelloWorldWorkstep helloworldworkstepInstance = new
HelloWorldWorkstep();
PetrelSystem.WorkflowEditor.Add(helloworldworkstepInstance);
PetrelSystem.ProcessDiagram.Add(new
Slb.Ocean.Petrel.Workflow.WorkstepProcessWrapper(helloworldwor
kstepInstance), "Plug-ins");
}
The following figure shows a preview of the process as well as the workstep files in the
Ocean Plug-in project.
Figure 16: Preview of Solution Explorer with Process and Workstep Files
To add your own button to Petrel ribbon UI, chose Ocean Command from the Add/New
Item option from the Visual Studio context menu, or if you checked the option to add a
new command in Step 1 of the Wizard dialog, then you will see the following wizard
screen:
From this screen, you can add new command, create new ribbon or ribbon tab, or
extend existing Petrel command group with commands. You must always select the
parent item to which the new item will be added.
The types of the menu items that can be added include the following, this wizard will
create basic container and register these commands to make them visible in the ribbon.
For detail guide and sample on how to implement your logic for these command refer to
Ocean for Petrel CHM under Slb.Ocean.Petrel.Commands namespace:
24 The Ocean for Petrel Wizards and Developers Tools in
Visual Studio
The Ocean for Petrel Wizards
To create a new command, select Commands parent item in the tree and click “Add New
Command”. Command id, caption and type can be change as shown in below:
Configuration caption
Command item id
Command caption
Command type
To include the new command you created above, select ribbon parent item and click
“Add new ribbon to tab”. Then click “Add new ribbon tabgroup”. Finally to add your
command to tabgroup, click “Add command to tabgroup” and your ribbon tree will
apear as below:
Once plugin is installed, developer can also manage more advance command
appearance properties and ribbon settings using configuration designer in Petrel. Launch
configuration designer use CTRL + F2. Configuration designer is available with Ocean
Marketing License. Refer to Quick Start for Ocean UX white paper in Ocean for Petrel
CHM for detail on how to use configuration designer.
Output in Petrel will be ribbon labelled Ocean, ribbon tab and a command. Note: In this
example the command created is a simple command
Ocean Ribbon
If you chose Ocean Tree extension from the Add/New Item option from the Visual
Studio context menu (Figure 4), or if you checked the Input tree extension option in
Step 1 of the Wizard dialog (Figure 21), then you will see the following Wizard screen:
Delete button
3. Click Next.
The following figure shows a preview of files created by the Wizard in Solution Explorer.
In the module file, the Integrate method will be extended with the following lines:
public void Integrate()
{
// Registrations:
CoreSystem.Services.AddService(typeof(HelloWorldTreefolder),
typeof(Slb.Ocean.Petrel.UI.INameInfoFactory),
HelloWorldTreefolderFactory.Instance);
CoreSystem.Services.AddService(typeof(HelloWorldTreefolder),
typeof(Slb.Ocean.Petrel.UI.IImageInfoFactory),
HelloWorldTreefolderFactory.Instance);
CoreSystem.Services.AddService(typeof(HelloWorldTreeitem),
typeof(Slb.Ocean.Petrel.UI.INameInfoFactory),
HelloWorldTreeitemFactory.Instance);
CoreSystem.Services.AddService(typeof(HelloWorldTreeitem),
typeof(Slb.Ocean.Petrel.UI.IImageInfoFactory),
HelloWorldTreeitemFactory.Instance);
}
If you chose Ocean Window from the Add/New Item option from the Visual Studio
context menu (Figure 4), or if you checked the option to add a window in Step 1 the
Wizard dialog (Figure 21), then the Wizard generates a file with Window class. In
addition to the class file, Ocean Wizard also generates a default UserControl with the
same name as the Window field (Figure 21) and appended by ‘UI’ as the class name.
In this example, you entered “HelloWorldWindow” in the “New Window” field (Figure
21), and the wizard generated the following files:
• HelloWorldWindow.cs: contains the Window class which
implements IImageInfoSource, INameInfoSource interfaces and
inherits from ToggleWindow base class.
• HelloWorldWindowImageInfo.cs: contains ImageInfo class.
• HelloWorldWindowNameInfo.cs: contains NameInfo class.
• HelloWorldWindowUI.cs: contains UserControl class.
The following figure shows a preview of files created by the Wizard in Solution Explorer.
If you chose Ocean Workstep from the Add/New Item option from the Visual Studio
context menu (Figure 4), or if you checked the option to add a window in Step 1 of the
Wizard dialog (Figure 21), then you will see the following Wizard page.
This page is similar to the general settings page of the Ocean process (see Page 18).
1. Enter the appropriate information.
The name will be displayed in the process tree of Petrel, and the descriptions
will be displayed on the default process UI.
2. Click Next.
3. On the next page (shown below), set the arguments of the workstep. These
arguments are input and output variables that will be used by the workstep
during its work.
New Borehole
argument
// Register HelloWorldWorkstep
HelloWorldWorkstep helloworldworkstepInstance = new
HelloWorldWorkstep();
PetrelSystem.WorkflowEditor.Add(helloworldworkstepInstance);
PetrelSystem.ProcessDiagram.Add(new
Slb.Ocean.Petrel.Workflow.WorkstepProcessWrapper(helloworldwor
kstepInstance), "Plug-ins");
}
You can use the Wizard to generate custom Settings Pages by choosing Ocean Settings
Page on the Add New Item dialog of Visual Studio (Figure 5). After completing the
Wizard steps, you will see the following files:
The Wizard generates a UserControl, which will be the SettingPage class, and a
SettingPageFactory class.
In this example, you provided the default “DialogPage1” as the name in the Visual Studio
Item dialog, and the Wizard generated the following files:
• HelloWorldDialogPage.cs
• HelloWorldDialogPageFactory.cs
If you checked the Register new classes in module option in the Visual Studio Item
dialog (Figure 12), then the Wizard adds the following code in the IntegratePresentation
method of the selected module class.
public void IntegratePresentation()
{
// Registrations:
The Ocean Wizard allows you to add custom data sources or the recommended
structured archived data source only to existing Ocean module projects. (See Figure 4
and Figure 5.). Refer to the Ocean Developers Guide and CHM documentation on
Managed Persistence.
The first option to add framework to handle structured archive data source with option
to create custom domain object.
The following figure shows a preview of the Solution Explorer with the generated data
structure archive data source class file and sample custom domain object class file.
Figure 31: The Solution Explorer showing structure archive data source class file and custom domain
object class file
To simulate a custom domain object that will save to Petrel project using structured
archive data source, the simplest implementation would be to implement a command
that will create a new instance of custom domain object to input pane.
PetrelProject.Inputs.Add(createDomainObject1_);
}
Figure 32: Simple command execute method to create sample custom domain object in input pane and
will save to stuctured archive data source
Lastly, the generated structured archive data source framework code will output to
message log pane as the custom domain object is being save to data source.
Figure 33: Output from OnSerialized event in custom domain object generated code
The second option only adds the framework to handle a data source. For additional
details on adding data sources, refer to the Ocean Developers Guide.
The following figure shows a preview of the Solution Explorer with the generated data
source class file.
Figure 34: The Solution Explorer showing the New Data Source Class File
If you checked the Register new classes in module option in the Visual Studio Item
dialog (Figure 12), then the Wizard adds the following code in the Integrate method of
the selected module class.
public void Integrate()
{
// Registrations:
PetrelSystem.AddDataSourceFactory(HelloWorldDataSourceFactory.
Instance);
}
If you chose Ocean Process in the Add/New Item dialog (Figure 4), then the following
screen opens:
The following source lines are added to the Integrate method of the module if the
register option is enabled on the first page of the Wizard:
public void Integrate()
{
// Registrations:
PetrelSystem.SeismicAttributeService.AddSeismicAttribute(new
HelloWorldAttribute());
}
This Ocean Wizard allows you to generate an ECLIPSE Format Simulator plug-in into
your Ocean module. All files generated via this Wizard will be located under the
SimulatorPlugin folder in your project.
1. Enter your plug-in simulator file name in the Add New Item dialog box (Figure
37). Note that if you use an existing file name, the old file will be overwritten by
the new one. Click Add to proceed.
Figure 37: Ocean ECLIPSE Format Simulator template in Add New Item dialog box
2. In this step, you can decide whether to register your plug-in to the Ocean module
or not.
3. In this wizard page (Figure 39), you can choose the ECLIPSE deck type and
whether you want to export keywords or not. Click Next to proceed or click
Cancel to quit the wizard.
Figure 39: Deck Type and Export Keywords Option dialog box
4. All Grid Formats are supported by default. You can change the supported grid
formats here (Figure 40).
5. From the Custom Tab Option dialog box , you can set an option whether to
create a custom tab or not. This custom tab will appear in the Petrel ‘Define
Simulation Case’ dialog when your simulator is selected. You can input the class
and tab names but the added custom tab will use a default icon image. This icon
can be changed by overriding the IAppearance::Image property once the wizard
has finished.
If the check box is ticked then the following files will be generated (where Xxx is
your class name) and added along with the EclipseFormatSimulator1.cs file:
• XxxTabArguments.cs,
• XxxTabControl.cs,
• XxxTabLogic.cs
• XxxTabUIFactory.cs
6. The last step of the Wizard (Figure 42) shows a summary of the files which will be
added to the project. In this example, only one file named
EclipseFormatSimulator1.cs has been added (since the custom tab option was
not ticked). If you tick the custom tab option, the appropriate files mentioned in
step 4 will be also added to the SimulatorPlugin folder. You can also add
additional references (assemblies) by ticking the Additional Reference settings
check box.
More than one plug-in project can be added to the same solution. The plug-in project
allows you to generate a basic plug-in implementation with additional project settings to
help developing the plug-in. Basically, a plug-in groups multiple modules together, and
lets you set up dependency between plug-ins.
There are some rules and recommendations using the plug-ins. These are checked by
Wizard:
o In a solution there should be only one plug-in. If there are 2 or more, then
they should contain only different modules. One module must belong to only
one plug-in. The wizard warns you when you try to create a new plug-in when
there is another one already:
o In one project there has to be one (and only one) plug-in. This is a very strict
rule; do not create more than one plug-in class into a project. The wizard lets
you do it, but we warn you, that the registration of such a plug-in will fail; you
will not be able to use any of those plug-ins.
In this page, you can specify the plug-in metadata information such as the author,
contact information and a description. This information is redundant if you use the old
IModuleAppearance on your modules, but the information given in the plug-in will be
the main source.
If you check the Register existing modules in the solution checkbox, then you can select
which modules want to register from the detected module list:
In order to use the plug-in, there must be at least one module registered in it.
You also have the option to generate a new module together with the new plug-in. If
you choose to generate a new module, you will get the same module-generator wizard
pages you are already familiar with.
During the building of your plug-in, as a post build event, the plug-in gets registered in
Petrel, so you need to build your plug-in at least once, and after that, the plug-in is
usable from Petrel.
If you chose Ocean Property Modeling algorithm in the Add / New Item dialog then you
will see the following Wizard page.
After building the project and starting Petrel start geometrical modeling process. You
will see the algorithm in the geometrical modeling UI (Figure 47). It can be executed but
will do nothing. //TODO sections in the code must be filled to get a meaningful
algorithm.
After building the project and starting Petrel start facies modeling process. You will see
the algorithm in the facies modeling UI (Figure 49). It can be executed but will do
nothing. //TODO sections in the code must be filled to get a meaningful algorithm.
This project type generates an installation package, what the Petrel application can
consume. Instead of using the operating system to install and manage extensions, let
Petrel do the work, and manage its extensions by itself. This is the way to deploy
modules and plug-ins. However, the PIP package cannot cover special use cases such as
pre/post installation steps, custom actions, installation of 3rd party prerequisites, etc. In
case your plug-in package needs such installation steps, please see the Ocean Plug-in
Installer project.
Prerequisite: the solution has to contain at least one plug-in project (project with a plug-
in class).
In the wizard page, you can specify the main plug-in for this PIP file. The PIP file must
have one and only one plug-in in it, this plug-in will be detected by the PluginPackager,
and it will be registered into the PluginManager during the installation of the PIP.
In the checklistbox, you can add additional projects from the actual solution. The output
of the selected projects will be added to the PIP file together with the plug-in container
assembly.
Note: currently the wizard does not support dependency detection for the plug-in
assembly. It means, that in case the plug-in assembly (or any other assembly selected in
the checklistbox) has a dependency to another project, then it will not be added to the
PIP file automatically. You have to add all of the required dependencies.
In step 2 of the wizard page, you can add help file for classic and UX mode for your plug-
in. You can drag and drop help files from Windows Explorer into this wizard.
The DeployList.xml describes the internal structure of the PIP file. This XML is loaded
during the build of the project, and the DeployCopier command line tool (placed to the
project directory by the Wizard) will copy all the files and project outputs registered in
this xml to a temporary folder. It also keeps their folder hierarchy settings. From this
temporary folder, the PluginPackager tool (deployed by the Petrel installer to the petrel
root folder) will pack them to the target folder of the PIP project. (By default: bin\debug
and bin\release)
The temporary folder can be changed by editing the Pre and PostBuild events of this
project, and changing the paths containing the “copytemp” folder.
Deploylist.xml can contain files and project outputs
The files are normal files, they can be resources (pictures, sounds, videos, databases,
etc). They will not be processed, only copied and packed.
The project outputs are project files, preferably from the same solution as the PIP
builder project itself. The project files will be processed by the DeployCopier tool, the
output path and compiled binary file name will be retrieved using the actual platform
and configuration settings. At the end the project output will be copied to the temporary
folder.
The OceanSDK installs a new context menu item into Visual Studio. It can be reached by
right clicking on the DeployList.xml file in the Solution Explorer:
In the tree view on the left side contains the folders and files of the Pip file in the same
hierarchy it will be installed on the target machine. Use drag and drop from either the
Solution Explorer, or Windows Explorer to add new files to it.
If you want to add a project output from the existing solution, just drag that project
from the Solution Explorer. The editor detects if the dragged item is a project, and it
automatically adds Project dependencies to that project, so building the Pip file will
build that project also.
You can rename the files and folders with F2 key or with clicking on the item again.
These settings will be applied to the target name; it will not change the actual name of
the file.
This project can be used when a simple PIP file installation with PluginManager does not
meet the needs. The result of this project template is an MSI installer project that can be
further customized by adding extra installer actions. It is also possible to combine more
than one plug-ins (PIP files) into one MSI installer as Plug-in bundle. Please note
however plug-ins installed together as bundle cannot be uninstalled individually.
We recommend using the Ocean Wix Plug-in Installer in case you have a special need
which the PIP project cannot handle, e.g.: custom actions, pre/post installation steps,
installation of 3rd party prerequisites, etc.
The recommended way of using this Ocean Wix Plug-in Installer template is to first add
one or more Ocean Plug-in project(s) to the solution then add a PIP Builder project for
each plug-in, compile the PIP builder project(s) then add this Ocean Plug-in Installer
project for the PIP file(s).
To add a new Ocean Wix Plug-in Installer to the project:
1. Once you have Ocean Plug-in and PIP Builder project in the solution, compile
the PIP builder project and make the selections shown in the following figure.
2. Choose the Ocean Wix Plug-in Installer on the displayed project dialog.
Remember to set the Project Name. (See Figure 4.)
3. Click Next.
The Step 2 window opens:
o Title: The text entered here is displayed on the title bar of the
installation kit. In this example, enter
“HelloOceanWixPluginInstaller”. This will be displayed in the
installed programs list at Control Panel -> Add Remove Programs.
o Company: The text typed here is added to the properties of the
MSI kit. This information can viewed in the summary tab under the
properties of install kit.
o Description: The text typed here is added to the properties of the
MSI kit. This information can be viewed in the comments section
under the properties of the install kit.
5. Click Next.
The Wizard opens the Step 3 window as shown in the
following figure.
The PIP files from the PIP builder projects selected in the
previous step are listed here. If you selected the PIP
Builder project at previous step but the PIP file is still not
listed here, please compile the PIP builder project (the
“HelloOceanPIPPackage” project in this example) and start
the wizard again. Only existing PIP files can be added to the
installer project.
The “HelloOceanWixPluginInstaller” project has been created and ready to compile. Its
output is a HelloOceanWixPluginInstaller.msi that can be shipped to the users (or upload
to Ocean Store). Please check the ReadMe.txt file added the project for more options.
There is no “Primary project output” in the installer project instead, the PIP files are
added to the project that you selected in the wizard. MSI installer will call
PluginManager to install these PIP files. There is one more file worth mentioning, the
PluginInstallInfo.xml.
The Plug-in Manager (that eventually installs the plug-ins) will install what is in the pip
files and ignores all other files deployed by MSI. If you need something extra to what
PluginManager does then you might need to add a Custom Installer step.
The Plug-in Test Project is used for unit testing an existing Ocean Plug-in through
the Ocean Testing Framework. Before starting to write the unit tests, Ocean
Testing Framework demands several configuration steps in order to create a test
project, as follows:
• The test project has to contain a reference to the assembly of the
plug-in to be tested;
• The test project assembly has to be named with the same
assembly name of the plug-in to be tested plus the suffix .Test.
Example: if the assembly name of the plug-in to be tested is
MyCompany.MyPlugin, then the test assembly name must be
MyCompany.MyPlugin.Test;
• The test project output path (destination where assembly and
compilation artifacts are stored) must be set to Petrel installation
folder;
• Reference paths must be pointed to Petrel installation and Public
(PETREL_HOME/Public) folders as well as to any additional
required folder;
• A reference to the Ocean Testing Framework assembly
(Slb.Ocean.Petrel.Testing.dll) must be added to the test project;
• The Petrel configuration file (petrel.exe.config) must be copied
into test project, renamed with the same test project assembly
name (Ex.: MyCompany.MyPlugin.Test.dll.config), and have its
property Copy to Output Directory to Copy always;
• Add references to assemblies of the used unit testing framework
(NUnit).
Note: Due Petrel implementation restrictions, the Ocean Testing Framework supports
only NUnit as test framework.
There is clearly a big time consuming and manual effort only for configuring a test
project. To overcome such overhead and to boost the developer productivity, the Ocean
Plug-in Test Project wizard wraps up all of the above steps in a few clicks. In a solution
containing the plug-in project to be tested:
1. Click on File > New… > Project…;
2. Under Ocean templates, select Ocean Plug-in Test, provide
a project name and mark the option Add to solution;
Ocean
Templates
85
The Ocean Developers Tools
Ocean Quality Assistant is a Visual Studio extension that offers 3 main features,
• Run Automated Acceptance Tests;
• Manage Manual Acceptance Tests;
• Run the fixed set of Sanity Unit Tests.
Acceptance rules are updated for every release as per rules from Ocean Store
acceptance criteria. Updated version of the rules is available from Ocean Portal (click on
link from Ocean Quality Assistant to Ocean Portal to download latest acceptance criteria
check list)
Ocean Quality Assistant will be deployed by OceanSDK installer.
Figure 64: Access Ocean Quality Assistant from the main menu
Figure 65: Access Ocean Quality Assistant from Solution Explorer window
After the tests are run the result of each test is updated in the table, and a summary is
shown below the Run tests button.
During the execution of Acceptance Tests additional tests are executed to verify the
occurrence of uses of internal Ocean APIs and calls by reflection.
Those occurrences are listed in the warning box between the Acceptance Tests table and
the test execution summary.
Note: As the recorded result is persisted in text/xml file, it is easy to share and use
version control on these results.
Note 1: Only installed Petrel and supported versions will be listed in Petrel version
combobox.
Note 2: All test target objects have to be resolvable in the test project, and all
corresponding plug-ins have to be registered.
During the execution of the tests, a status message is show below the Run tests button,
and the log is displayed in the Output window.
After the tests are run the result of each test is updated in the table, and a summary is
shown below the Run tests button.
Ocean NUnit Test Adapter for Visual Studio 2015 (VS2015) and Visual Studio 2017
(VS2017) is a test adapter that enables Ocean developers to seamlessly run integration
tests using Ocean Testing Framework in Visual Studio.
This test adapter can be install separately after Ocean for Petrel SDK installation. Get the
installer from \\Program Files\Common Files\Schlumberger\Ocean\Petrel\Common
components\Visual Studio Extensions\Slb.OceanSdk.Petrel.TestAdapter.vsix.
In the following sections we will present the adapter’s usage and the steps necessary to
have these tests executed.
For further information about how to use Ocean NUnit Test Adapter in Team
Foundation Server 2012 (TFS 2012) see “Testing Framework” in Ocean Help.
Test Explorer
With your test project created, the next step is to open the Test Explorer window in
VS2015/VS2017. This can be accomplished by selecting the menu TEST > Windows > Test
Explorer. As result, a window will be displayed and it will be responsible to manage your
tests.
After you build the projects, the tests should be displayed in the Test Explorer as
depicted in Figure 76.
Note that this is a native VS2015 window and there are several run options and filters
like Run failed tests, Run Not Run tests, and others.
Ocean NUnit Test Adapter requires the test assembly to be located inside the Petrel’s
root folder in order to resolve the dependencies. For this reason, besides selecting the
correct Petrel version and platform, it is necessary to set the projects’ outputs to Petrel’s
root folder.
It is important to watch this output, because if anything goes wrong, it will give some
advice on how to execute the tests properly or explain why the Ocean Testing
Framework could not be ran.
After the test execution finishes, the tests are updated in the Test Explorer with the
details of each test case (Figure 79).
Code coverage
Test Explorer also supports code coverage analysis. This can be accessed by running the
commands “Analyze Code Coverage for All Tests” or “Analyze Code Coverage for
Selected Tests” in the window. The result will be displayed as depicted in Figure 80.
The source code will also be colored with respect to the coverage results.
Ocean Plug-in Upgrade Tool is a Visual Studio Extension that upgrades assembly
references to the current version given a C# Plug-in project.
When the Ocean Upgrade Tool is accessed through Ocean Menu or Solution context
menu all loaded projects under the opened solution will be upgraded.
Otherwise, only the selected project(s) will be affected.
Figure 81: Accessing Ocean Plug-in Upgrade Tool through Visual Studio Project context menu
Figure 82 Ocean Plug-in Upgrade Tool is also available in the OCEAN Menu
What to expect
• After selecting the “Upgrade Project(s) to Ocean 201x.1” a confirmation
dialog will be shown;
• After selecting “Yes” in the confirmation dialog, the upgrade process will
be started over the selected project(s) or solution;
Remarks:
1. During the last phase of the upgrade the projects will be reloaded;
2. The Upgrade Tool will affect only Ocean and Open Inventor assembly
references;
3. No source code is modified;
4. The user might remove obsolete API calls manually.
This will enable access to any API documentation from code editor by placing cursor on
the API member and pressing F1 key.
Ocean Controls