10 Testing Custom Applications

Learn how to test custom applications in Oracle Communications Billing and Revenue Management (BRM).

Topics in this document:

Testing New or Customized Components

The BRM architecture makes it possible to test new or customized components without having to physically move files. For example, to test a new policy FM, you can include it in a CM that you run locally on your development machine.

For testing, you need access to a test installation of BRM. For best results, the test installation should resemble very closely your production BRM environment.

The following sections provide basic instructions for common testing scenarios. Depending on the nature of your customizations and the architecture of your BRM system, these instructions might not fully describe your situation.

Testing Custom Applications

To test an application, connect it to a BRM system via its CM, in the same way you would under production conditions. To establish a connection, the application must specify a valid user name, password, port number, and database number. Depending on how the application is designed, this information can be included in a configuration file (pin.conf for C/C++ applications or Infranet.properties for Java applications) or specified by the user.

Testing New or Customized Policy FMs

To test a new or customized policy FM, you must add it to a CM that you then use with a BRM test installation.

  1. Add the FM to the CM in BRM SDK. See "Adding a New FM Module to the CM Configuration File".

  2. Use that CM in place of the default CM in a test installation of BRM. See "Configuring Your CM to Use the Custom DM".

  3. Use Opcode Workbench or testnap to run the opcodes in the new or customized FM. See "Using the testnap Utility to Test BRM".

    Keep in mind that if the opcodes in the FM require the use of new storable classes or fields, you must add those storable classes or fields to the database of the test BRM installation. See "Creating Custom Fields and Storable Classes".

See "Debugging FMs" for information about debugging new or customized policy FMs.

Testing New or Customized DMs

To test a new or customized DM, run a CM locally on your development machine. The CM should connect to the DM that you are testing and to any other DMs included in the BRM installation. For information about including the new or customized DM in the CM, see "Configuring Your CM to Use the Custom DM".

Changing the Virtual System Time to Test BRM

You can test some BRM functionality by using the pin_virtual_time utility. For example, you can test the billing impact of recurring charges by advancing the date within the BRM system and then running billing.

Caution:

Always use a test database when you test BRM functionality.

To test some aspects of billing, you must simulate the passage of time. The pin_virtual_time utility enables you to simulate changes in the BRM system time.

Note:

The pin_virtual_time utility works only on a single computer. Typically, you set up a test BRM system on just one computer. If you run pin_virtual_time on a system that is distributed across multiple computers, you must carefully coordinate time changes on all the computers.

To set up the pin_virtual_time utility:

  1. Go to the BRM_home/sys/test directory.

  2. Run this command to create a file that pin_virtual_time requires, called pin_virtual_time_file:

    pin_virtual_time -m 0 -f BRM_home/bin/pin_virtual_time_file 
    

    Note:

    BRM_home/lib/pin_virtual_time_file is the standard path and file name, but you can change it.

  3. Add the following entry to the configuration file in the BRM_home/sys/test directory:

    -  -  pin_virtual_time  pin_virtual_time_file
    

    Replace pin_virtual_time_file with the path and name of the mapped file created in the previous step.

    Adding the entry to the configuration file in sys/test enables you to run pin_virtual_time from that directory. The directory from which you run pin_virtual_time must contain a configuration file with the pin_virtual_time entry.

  4. Add the entry in step 3 to the configuration file for each program you want to respond to an altered time.

    To test your price list, edit the configuration files for at least the applications listed in Table 10-1:

    Table 10-1 Configuration Files for Testing Applications

    Application Configuration File Location

    CM

    sys/cm/

    Oracle DM

    sys/dm_oracle/

    Billing and invoice utilities

    apps/pin_billd/

    To ensure that all applications respond to pin_virtual_time changes, add the entry to all the configuration files in your test BRM system.

    Entry example:

    -  -  pin_virtual_time  BRM_home/bin/pin_virtual_time_file 
    

After you set up the pin_virtual_time utility, run pin_virtual_time to advance the BRM date and time.

To run pin_virtual_time, use the following syntax:

pin_virtual_time -m 2 MMDDHHMM[CC]YY.[SS]

For the string MMDDHHMM[CC]YY.[SS], enter the date and time you want BRM to use in this format: month, date, hour, minute, year, and seconds. You must enter at least two digits for the year, but you can enter four. Seconds are optional.

For example, to set the date and time to 9/3/99 and 11:30, respectively:

% pin_virtual_time -m 2 090311301999.00 

The command displays this message at the command prompt:

filename BRM_home/lib/pin_virtual_time_file, mode 2, time: Fri Sept 03 11:30:00 1999

The time then advances normally from the new reset time.

After you run pin_virtual_time, you must stop and restart BRM to read in the new time.