package me.haosdent.cgroup.manage;

import me.haosdent.cgroup.util.Constants;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;

import static org.junit.Assert.*;

public class AdminTest {

  private static final Logger LOG = LoggerFactory
          .getLogger(AdminTest.class);

  @Before
  public void setUp() {
  }

  @After
  public void tearDown() {}

  @Test
  public void testUmount() {
    try {
      Admin admin = new Admin(Constants.SUBSYS_CPU);
      admin.umount();
    } catch (IOException e) {
      LOG.error("Create Admin error.", e);
      assertTrue(false);
    }
  }

  @Test
  public void testCreateGroup() {}
}

@@ -36,16 +36,23 @@
 %0Aimport 
+static 
 me.haosd
@@ -76,16 +76,18 @@
 onstants
+.*
 ;%0Aimport
@@ -544,26 +544,16 @@
 w Admin(
-Constants.
 SUBSYS_C
@@ -557,16 +557,16 @@
 S_CPU);%0A
+
       ad
@@ -688,32 +688,32 @@
  %7D%0A  %7D%0A%0A  @Test%0A
-
   public void te
@@ -729,12 +729,238 @@
 roup() %7B
+%0A    try %7B%0A      Admin admin = new Admin(SUBSYS_CPU);%0A      admin.createGroup(%22one%22, SUBSYS_CPU);%0A      admin.umount();%0A    %7D catch (IOException e) %7B%0A      LOG.error(%22Create Admin error.%22, e);%0A      assertTrue(false);%0A    %7D%0A  
 %7D%0A%7D%0A

Complete AdminTest#testCreateGroup test case.