Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1.  This is the most common way to create the rule. There are two more variations of it

    Code Block
    languagejava
    // this will use a temporary folder for the working dir of the locator/server created by this rule.
    // use this if you want to examine the content of the workingdir of the server/locator and do not 
    // want it to be contaminated with dunit test launcher's own logs.
    public LocatorServerStartupRule lsRule = new LocatorServerStartupRule().withTempWorkingDir();
     
    // Or
    // this will have the server/locators logs go into the log file instead of go into the console.
     public LocatorServerStartupRule lsRule = new LocatorServerStartupRule().withLogFile();
    
    //or both.
  2.  When you start up a locator/server, you can also pass in a properties object that would configure the server/locator

    Code Block
    languagejava
    Properties locatorProps = new Properties();
    locatorProps.setProperty(ConfigurationProperties.GROUPS, "group1,group2");
    locatorProps.setProperty(ConfigurationProperties.HTTP_SERVICE_PORT, "8080");
    locatorProps.setProperty(ConfigurationProperties.ANY_PROPERTIES, value); // set any gemfire properties that are in ConfigurationPropertiesMemberVMConfigurationProperties
    MemberVM locator = lsRule.startLocatorVM(0, locatorProps);
     
    Properties serverProps = new Properties();// set any gemfire properties that are in ConfigurationPropertiesMemberVMConfigurationProperties
    locatorProps.setProperty(ConfigurationProperties.ANY_PROPERTIES, value);
    MemberVM server = lsRule.startServer(1, serverProps, locator.getPort);

...