// Path: themis-client/src/main/java/org/apache/hadoop/hbase/themis/lockcleaner/ClientName.java
// public static class ClientNameWithProcessId extends ClientName {
//     
//   public static String getProcessId() {
//     RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
//     String name = runtime.getName();
//     return name.substring(0, name.indexOf("@"));
//   }
//     
//   public ClientNameWithProcessId() throws IOException {
//     super(getProcessId());
//   }
// }
// 
// Path: themis-client/src/main/java/org/apache/hadoop/hbase/themis/lockcleaner/ClientName.java
// public static class ClientNameWithThreadId extends ClientName {
//     
//   public ClientNameWithThreadId() throws IOException {
//     super(String.valueOf(Thread.currentThread().getId()));
//   }
// }


import java.io.IOException;
import org.apache.hadoop.hbase.themis.lockcleaner.ClientName.ClientNameWithProcessId;
import org.apache.hadoop.hbase.themis.lockcleaner.ClientName.ClientNameWithThreadId;
import org.junit.Assert;
import org.junit.Test;
package org.apache.hadoop.hbase.themis.lockcleaner;



public class TestClientName {
  
  public static class ClientNameById extends ClientName {
    public ClientNameById(String id) throws IOException {
      super(id);
    }
  }
  
  public static class ClientNameFromThread extends Thread {
    public String clientNameCls;
    public ClientName clientName;
    
    public ClientNameFromThread(String cls) {
      this.clientNameCls = cls;
    }
    
    @Override
    public void run() {
      try {
        clientName = (ClientName)(Class.forName(clientNameCls).newInstance());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
  }
  
  @Test
  public void testClientNameWithProcessId() throws Exception {
// Path: themis-client/src/main/java/org/apache/hadoop/hbase/themis/lockcleaner/ClientName.java
// public static class ClientNameWithProcessId extends ClientName {
//     
//   public static String getProcessId() {
//     RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
//     String name = runtime.getName();
//     return name.substring(0, name.indexOf("@"));
//   }
//     
//   public ClientNameWithProcessId() throws IOException {
//     super(getProcessId());
//   }
// }
// 
// Path: themis-client/src/main/java/org/apache/hadoop/hbase/themis/lockcleaner/ClientName.java
// public static class ClientNameWithThreadId extends ClientName {
//     
//   public ClientNameWithThreadId() throws IOException {
//     super(String.valueOf(Thread.currentThread().getId()));
//   }
// }


// Path: themis-client/src/test/java/org/apache/hadoop/hbase/themis/lockcleaner/TestClientName.java
import java.io.IOException;
import org.apache.hadoop.hbase.themis.lockcleaner.ClientName.ClientNameWithProcessId;
import org.apache.hadoop.hbase.themis.lockcleaner.ClientName.ClientNameWithThreadId;
import org.junit.Assert;
import org.junit.Test;

package org.apache.hadoop.hbase.themis.lockcleaner;



public class TestClientName {
  
  public static class ClientNameById extends ClientName {
    public ClientNameById(String id) throws IOException {
      super(id);
    }
  }
  
  public static class ClientNameFromThread extends Thread {
    public String clientNameCls;
    public ClientName clientName;
    
    public ClientNameFromThread(String cls) {
      this.clientNameCls = cls;
    }
    
    @Override
    public void run() {
      try {
        clientName = (ClientName)(Class.forName(clientNameCls).newInstance());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
  }
  
  @Test
  public void testClientNameWithProcessId() throws Exception {
    ClientNameWithProcessId expect = new ClientNameWithProcessId();