// Path: cm-schema/src/main/java/com/cloudera/csd/tools/impala/ImpalaMetricTypes.java
// public static enum ImpalaMetricType {
//   GAUGE,
//   COUNTER,
//   STATISTICAL
// }


import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.fail;
import com.cloudera.csd.tools.JsonUtil;
import com.cloudera.csd.tools.JsonUtil.JsonRuntimeException;
import com.cloudera.csd.tools.impala.ImpalaMetricTypes.ImpalaMetricType;
import java.io.InputStream;
import org.apache.commons.io.IOUtils;
import org.junit.Test;
    }
  }

  @Test
  public void testValidFixture() {
    InputStream in = null;
    try {
      in = this.getClass().getResourceAsStream(
          "/com/cloudera/csd/tools/impala/valid.json");
      ImpalaMetricDefinitionFixture fixture = JsonUtil.valueFromStream(
          ImpalaMetricDefinitionFixture.class,
          in);
      assertEquals("test_service", fixture.getServiceName());
      assertEquals(1, fixture.getServiceMetrics().size());
      assertEquals(2, fixture.getRolesMetrics().size());
      assertEquals(2,
                   fixture.getRolesMetrics().get("test_role1_metrics").size());
      ImpalaMetric metric =
          fixture.getRolesMetrics().get("test_role1_metrics").get(1);
      validateMetric(metric, "test_role1_metric2", ImpalaMetricType.GAUGE);
      assertEquals(1,
                   fixture.getRolesMetrics().get("test_role2_metrics").size());
      metric =
          fixture.getRolesMetrics().get("test_role2_metrics").get(0);
      validateMetric(metric, "test_role2_metric1", ImpalaMetricType.STATISTICAL);
      assertEquals(1, fixture.getAdditionalServiceEntityTypesMetrics().size());

      metric =
          fixture.getAdditionalServiceEntityTypesMetrics().get(
              "test_entity1_metrics").get(0);
// Path: cm-schema/src/main/java/com/cloudera/csd/tools/impala/ImpalaMetricTypes.java
// public static enum ImpalaMetricType {
//   GAUGE,
//   COUNTER,
//   STATISTICAL
// }


// Path: cm-schema/src/test/java/com/cloudera/csd/tools/impala/ImpalaMetricDefinitionFixtureTest.java
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.fail;
import com.cloudera.csd.tools.JsonUtil;
import com.cloudera.csd.tools.JsonUtil.JsonRuntimeException;
import com.cloudera.csd.tools.impala.ImpalaMetricTypes.ImpalaMetricType;
import java.io.InputStream;
import org.apache.commons.io.IOUtils;
import org.junit.Test;

    }
  }

  @Test
  public void testValidFixture() {
    InputStream in = null;
    try {
      in = this.getClass().getResourceAsStream(
          "/com/cloudera/csd/tools/impala/valid.json");
      ImpalaMetricDefinitionFixture fixture = JsonUtil.valueFromStream(
          ImpalaMetricDefinitionFixture.class,
          in);
      assertEquals("test_service", fixture.getServiceName());
      assertEquals(1, fixture.getServiceMetrics().size());
      assertEquals(2, fixture.getRolesMetrics().size());
      assertEquals(2,
                   fixture.getRolesMetrics().get("test_role1_metrics").size());
      ImpalaMetric metric =
          fixture.getRolesMetrics().get("test_role1_metrics").get(1);
      validateMetric(metric, "test_role1_metric2", ImpalaMetricType.GAUGE);
      assertEquals(1,
                   fixture.getRolesMetrics().get("test_role2_metrics").size());
      metric =
          fixture.getRolesMetrics().get("test_role2_metrics").get(0);
      validateMetric(metric, "test_role2_metric1", ImpalaMetricType.STATISTICAL);
      assertEquals(1, fixture.getAdditionalServiceEntityTypesMetrics().size());

      metric =
          fixture.getAdditionalServiceEntityTypesMetrics().get(
              "test_entity1_metrics").get(0);
      assertEquals("threads", metric.getNumeratorForCounterMetric());