/*
 * Copyright 2014 Cask Data, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

package co.cask.cdap.reactor.client;

import co.cask.cdap.client.ApplicationClient;
import co.cask.cdap.client.ProgramClient;
import co.cask.cdap.client.ServiceClient;
import co.cask.cdap.client.config.ClientConfig;
import co.cask.cdap.proto.ProgramType;
import co.cask.cdap.proto.ServiceMeta;
import co.cask.cdap.reactor.client.app.FakeApp;
import co.cask.cdap.reactor.client.app.FakeService;
import co.cask.cdap.reactor.client.common.ClientTestBase;
import co.cask.cdap.test.XSlowTests;
import org.apache.twill.discovery.Discoverable;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import java.util.List;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

/**
 * Tests for {@link ServiceClient}
 */
@Category(XSlowTests.class)
public class ServiceClientTestRun extends ClientTestBase {
  private ApplicationClient appClient;
  private ServiceClient serviceClient;
  private ProgramClient programClient;

  @Before
  public void setUp() throws Throwable {
    ClientConfig config = new ClientConfig("localhost");
    appClient = new ApplicationClient(config);
    serviceClient = new ServiceClient(config);
    programClient = new ProgramClient(config);
  }

  @Test
  public void testGetServiceMeta() throws Exception {
    appClient.deploy(createAppJarFile(FakeApp.class));
    programClient.start(FakeApp.NAME, ProgramType.SERVICE, FakeService.NAME);
    assertProgramRunning(programClient, FakeApp.NAME, ProgramType.SERVICE, FakeService.NAME);

    ServiceMeta serviceMeta = serviceClient.get(FakeApp.NAME, FakeService.NAME);
    assertEquals(serviceMeta.getName(), FakeService.NAME);
    assertEquals(serviceMeta.getRunnables().size(), 1);
  }
}

@@ -1082,56 +1082,8 @@
 ts;%0A
-import org.apache.twill.discovery.Discoverable;%0A
 impo
@@ -1103,16 +1103,16 @@
 Before;%0A
+
 import o
@@ -1182,32 +1182,8 @@
 y;%0A%0A
-import java.util.List;%0A%0A
 impo
@@ -1226,54 +1226,8 @@
 als;
-%0Aimport static org.junit.Assert.assertNotNull;
 %0A%0A/*

Remove unused imports