<commit_before>/*
 * IndexTest.java
 * JUnit based test
 *
 * Created on March 9, 2005, 3:30 PM
 */

package com.gemstone.gemfire.internal;

import java.util.Properties;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

import com.gemstone.gemfire.cache.CacheException;
import com.gemstone.gemfire.cache.PartitionAttributesFactory;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.RegionFactory;
import com.gemstone.gemfire.cache.RegionShortcut;
import com.gemstone.gemfire.cache.client.ClientCache;
import com.gemstone.gemfire.cache.client.ClientCacheFactory;
import com.gemstone.gemfire.cache.client.ClientRegionFactory;
import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
import com.gemstone.gemfire.cache.server.CacheServer;
import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
import com.gemstone.gemfire.cache30.CacheTestCase;
import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil;
import com.gemstone.gemfire.internal.stats50.VMStats50;

import dunit.Host;
import dunit.SerializableCallable;
import dunit.SerializableRunnable;
import dunit.VM;

/**
 * 
 * @author jhuynh
 *
 */
public class FDDUnitTest extends CacheTestCase {

  VM vm0;
  VM vm1;
  VM vm2;

  
  public FDDUnitTest(String name) {
    super(name);
  }

  public void setUp() throws Exception {
    super.setUp();
    //getSystem();
   
    Host host = Host.getHost(0);
    vm0 = host.getVM(0);
    vm1 = host.getVM(1);
    vm2 = host.getVM(2);
  }
  
  public void tearDown2() throws Exception {
    vm0.invoke(cleanup());
    vm1.invoke(cleanup());
    vm2.invoke(cleanup());
    vm0.invoke(CacheServerTestUtil.class, "closeCache");
    vm1.invoke(CacheServerTestUtil.class, "closeCache");
    vm2.invoke(CacheServerTestUtil.class, "closeCache");
  }
  
  public void testFDSocketFixOnlyServers() throws Exception {
    String os = System.getProperty("os.name");
    if (os != null) {
      if (os.indexOf("Windows") != -1) {
        System.out.println("This test is disabled on Windows");
        //we are running this test on windows.  fd stats are not available in windows so let's
        //just not run this test
        return;
      }
    }
    try {
      StringBuffer incaseOfFailure = new StringBuffer();
      final int[] port = AvailablePortHelper.getRandomAvailableTCPPorts(3);
      final int mcastPort = AvailablePortHelper.getRandomAvailableUDPPort();
      int numThreads = 30;

      startCacheServer(vm0, port[0], mcastPort);
      startCacheServer(vm1, port[1], mcastPort);
      startCacheServer(vm2, port[2], mcastPort);<commit_msg>[GEODE-338] Disable FDDUnitTest for now, due to invalid test<commit_after>/*
 * IndexTest.java
 * JUnit based test
 *
 * Created on March 9, 2005, 3:30 PM
 */

package com.gemstone.gemfire.internal;

import java.util.Properties;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

import com.gemstone.gemfire.cache.CacheException;
import com.gemstone.gemfire.cache.PartitionAttributesFactory;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.RegionFactory;
import com.gemstone.gemfire.cache.RegionShortcut;
import com.gemstone.gemfire.cache.client.ClientCache;
import com.gemstone.gemfire.cache.client.ClientCacheFactory;
import com.gemstone.gemfire.cache.client.ClientRegionFactory;
import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
import com.gemstone.gemfire.cache.server.CacheServer;
import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
import com.gemstone.gemfire.cache30.CacheTestCase;
import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil;
import com.gemstone.gemfire.internal.stats50.VMStats50;

import dunit.Host;
import dunit.SerializableCallable;
import dunit.SerializableRunnable;
import dunit.VM;

/**
 * 
 * @author jhuynh
 *
 */
public class FDDUnitTest extends CacheTestCase {

  VM vm0;
  VM vm1;
  VM vm2;

  
  public FDDUnitTest(String name) {
    super(name);
  }

  public void setUp() throws Exception {
    super.setUp();
    //getSystem();
   
    Host host = Host.getHost(0);
    vm0 = host.getVM(0);
    vm1 = host.getVM(1);
    vm2 = host.getVM(2);
  }
  
  public void tearDown2() throws Exception {
    vm0.invoke(cleanup());
    vm1.invoke(cleanup());
    vm2.invoke(cleanup());
    vm0.invoke(CacheServerTestUtil.class, "closeCache");
    vm1.invoke(CacheServerTestUtil.class, "closeCache");
    vm2.invoke(CacheServerTestUtil.class, "closeCache");
  }

  public void testEmpty() {
    //Ticket #GEODE-338.  Disable the test for now and rewrite as a junit test.
  }
  
  public void disable_testFDSocketFixOnlyServers() throws Exception {
    String os = System.getProperty("os.name");
    if (os != null) {
      if (os.indexOf("Windows") != -1) {
        System.out.println("This test is disabled on Windows");
        //we are running this test on windows.  fd stats are not available in windows so let's
        //just not run this test
        return;
      }
    }
    try {
      StringBuffer incaseOfFailure = new StringBuffer();
      final int[] port = AvailablePortHelper.getRandomAvailableTCPPorts(3);
      final int mcastPort = AvailablePortHelper.getRandomAvailableUDPPort();
      int numThreads = 30;

      startCacheServer(vm0, port[0], mcastPort);
      startCacheServer(vm1, port[1], mcastPort);
      startCacheServer(vm2, port[2], mcastPort);
{'fraction_non_alphanumeric': 0.11073598919648886, 'fraction_numerical': 0.015530047265361242, 'mean_word_length': 4.183727034120735, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4334758', 'n_tokens_mistral': 1908, 'n_tokens_neox': 1851, 'n_words': 379}