Package br.com.objectos.rio.kdo.eclipse

Source Code of br.com.objectos.rio.kdo.eclipse.KdoEclipsePrepareTest

/*
* Copyright 2014 Objectos, Fábrica de Software LTDA.
*
* 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 br.com.objectos.rio.kdo.eclipse;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThan;

import java.io.File;
import java.util.List;

import org.testng.annotations.BeforeClass;
import org.testng.annotations.Guice;
import org.testng.annotations.Test;

import br.com.objectos.rio.RioTestModule;
import br.com.objectos.way.base.io.Directory;

/**
* @author marcio.endo@objectos.com.br (Marcio Endo)
*/
@Test
@Guice(modules = { RioTestModule.class })
public class KdoEclipsePrepareTest extends AbstractKdoEclipseTest {

  @BeforeClass
  public void setUp() {
    eclipseVar.deleteContents();
  }

  public void download() {
    execute("kdo", "eclipse", "prepare", "--download");

    List<File> res = listFiles(eclipseVar);
    assertThat(res.size(), equalTo(1));
  }

  @Test(dependsOnMethods = "download")
  public void extract() {
    execute("kdo", "eclipse", "prepare", "--extract");

    Directory res = eclipseVar.dirAt("eclipse");
    assertThat(res.exists(), equalTo(true));
  }

  @Test(dependsOnMethods = "extract")
  public void plugins() {
    execute("kdo", "eclipse", "prepare", "--plugins");

    Directory eclipse = eclipseVar.dirAt("eclipse");
    List<File> res = eclipse.find()
        .typed()
        .name("org.testng.*")
        .list();
    assertThat(res.size(), greaterThan(0));
  }

  @Test(dependsOnMethods = "plugins")
  public void objectos() {
    execute("kdo", "eclipse", "prepare", "--objectos");
  }

}
TOP

Related Classes of br.com.objectos.rio.kdo.eclipse.KdoEclipsePrepareTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.