Určení místa, kde je test spuštěný

Třída ComputerSpecific určuje, kde je test spuštěný.
package customcode;

import com.ibm.rational.test.lt.kernel.services.ITestExecutionServices;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * Třída ComputerSpecific určí název hostitele, na kterém je test spuštěný, 
 * vytiskne název hostitele a adresu IP jako zprávu do protokolu testu a
 * vrátí různé řetězce dle názvu hostitele.
 */

/**
 * @author IBM Custom Code Samples
 */

public class ComputerSpecific implements
        com.ibm.rational.test.lt.kernel.custom.ICustomCode2 {

    /**
     * Instance tohoto se vytvoří pomocí konstruktoru no-arg.
     */
    public ComputerSpecific() {
    }

    public String exec(ITestExecutionServices tes, String[] args) {
        String hostName = "Unknown";
        String hostAddress = "Unknown";
                
        try {
            hostName = InetAddress.getLocalHost().getHostName();
            hostAddress = InetAddress.getLocalHost().getHostAddress();
        } catch (UnknownHostException e) {
            tes.getTestLogManager().reportMessage(
                                        "Not able to obtain host information");
            return null;
        }
        tes.getTestLogManager().reportMessage("The hostname is " + hostName +
                                             "; IP address is " + hostAddress);
        if (hostName.equals("host-1234"))
            return "Special";
        else
            return "Normal";
    }
}

Váš názor