Example usage for junit.framework Assert assertFalse

List of usage examples for junit.framework Assert assertFalse

Introduction

In this page you can find the example usage for junit.framework Assert assertFalse.

Prototype

static public void assertFalse(boolean condition) 

Source Link

Document

Asserts that a condition is false.

Usage

From source file:net.sourceforge.seqware.common.metadata.MetadataWSTest.java

/**
 * Test of findSamplesAssociatedWithAStudy method, of class MetadataWS.
 *//*from  ww  w.  j a v a  2  s  . c  o m*/
//@Test
public void testFindSamplesAssociatedWithAStudy() {
    logger.info("findSamplesAssociatedWithAStudy");
    String studyName = "AbcCo_Tumour_Sequencing";
    List<ReturnValue> result = instance.findFilesAssociatedWithAStudy(studyName);
    logger.debug("Sample size: " + result.size());
    Assert.assertEquals("No results", true, (result.size() > 0));
    for (ReturnValue ret : result) {
        Assert.assertNotNull(ret.getAlgorithm());
        Assert.assertFalse(ret.getAttributes().isEmpty());
        for (String key : ret.getAttributes().keySet()) {
            logger.debug(key + "->" + ret.getAttribute(key));
        }
    }

    //        assertEquals(expResult, result);
}

From source file:net.sourceforge.seqware.common.metadata.MetadataWSTest.java

@Test
public void testGetIUSFromLane() {
    Log.info("testGetIUSFromLane");
    List<IUS> iuses = instance.getIUSFrom(4764);
    Assert.assertFalse(iuses.isEmpty());
}

From source file:net.sourceforge.seqware.common.metadata.MetadataWSTest.java

@Test
public void testGetIUSFromSample() {
    Log.info("testGetIUSFromSample");
    List<IUS> iuses = instance.getIUSFrom(4783);
    Assert.assertFalse(iuses.isEmpty());
}

From source file:net.sourceforge.seqware.common.metadata.MetadataWSTest.java

@Test
public void testGetExperimentsFrom() {
    Log.info("testGetExperimentsFrom");
    List<Experiment> experiments = instance.getExperimentsFrom(120);
    Assert.assertFalse(experiments.isEmpty());
}

From source file:net.sourceforge.seqware.common.metadata.MetadataWSTest.java

@Test
public void testGetSamplesFromExperiment() {
    Log.info("testGetSamplesFromExperiment");
    List<Sample> samples = instance.getSamplesFrom(6157);
    Assert.assertFalse(samples.isEmpty());
}

From source file:net.sourceforge.seqware.common.metadata.MetadataWSTest.java

@Test
public void testGetChildSamplesFrom() {
    Log.info("testGetChildSamplesFrom");
    List<Sample> samples = instance.getChildSamplesFrom(1940);
    Assert.assertFalse(samples.isEmpty());
}

From source file:net.sourceforge.seqware.common.metadata.MetadataWSTest.java

@Test
public void testGetParentSamplesFrom() {
    Log.info("testGetParentSamplesFrom");
    List<Sample> samples = instance.getParentSamplesFrom(1944);
    Assert.assertFalse(samples.isEmpty());
}

From source file:org.apache.ambari.server.bootstrap.BootStrapTest.java

@Test
public void testRun() throws Exception {
    Properties properties = new Properties();
    String bootdir = temp.newFolder("bootdir").toString();
    String metadetadir = temp.newFolder("metadetadir").toString();
    String serverVersionFilePath = temp.newFolder("serverVersionFilePath").toString();
    LOG.info("Bootdir is " + bootdir);
    LOG.info("Metadetadir is " + metadetadir);
    LOG.info("ServerVersionFilePath is " + serverVersionFilePath);

    String sharedResourcesDir = "src/test/resources/";
    if (System.getProperty("os.name").contains("Windows")) {
        sharedResourcesDir = ClassLoader.getSystemClassLoader().getResource("").getPath();
    }/*  www .  j  av  a  2  s. c  o m*/

    properties.setProperty(Configuration.BOOTSTRAP_DIR, bootdir);
    properties.setProperty(Configuration.BOOTSTRAP_SCRIPT, "echo");
    properties.setProperty(Configuration.SRVR_KSTR_DIR_KEY, "target" + File.separator + "classes");
    properties.setProperty(Configuration.METADETA_DIR_PATH, metadetadir);
    properties.setProperty(Configuration.SERVER_VERSION_FILE, serverVersionFilePath);
    properties.setProperty(Configuration.SHARED_RESOURCES_DIR_KEY, sharedResourcesDir);

    Configuration conf = new Configuration(properties);
    AmbariMetaInfo ambariMetaInfo = new AmbariMetaInfo(conf);
    BootStrapImpl impl = new BootStrapImpl(conf, ambariMetaInfo);
    impl.init();
    SshHostInfo info = new SshHostInfo();
    info.setSshKey("xyz");
    ArrayList<String> hosts = new ArrayList<String>();
    hosts.add("host1");
    hosts.add("host2");
    info.setUserRunAs("root");
    info.setHosts(hosts);
    info.setUser("user");
    info.setPassword("passwd");
    BSResponse response = impl.runBootStrap(info);
    LOG.info("Response id from bootstrap " + response.getRequestId());
    /* do a query */
    BootStrapStatus status = impl.getStatus(response.getRequestId());
    LOG.info("Status " + status.getStatus());
    int num = 0;
    while ((status.getStatus() == BSStat.RUNNING) && (num < 500)) {
        status = impl.getStatus(response.getRequestId());
        Thread.sleep(100);
        num++;
    }
    LOG.info("Status: log " + status.getLog() + " status=" + status.getStatus());
    /* Note its an echo command so it should echo host1,host2 */
    Assert.assertTrue(status.getLog().contains("host1,host2"));
    Assert.assertEquals(BSStat.SUCCESS, status.getStatus());
    Assert.assertFalse(new File(bootdir + File.separator + "1" + File.separator + "sshKey").exists());
    Assert.assertFalse(new File(bootdir + File.separator + "1" + File.separator + "host_pass").exists());
}

From source file:org.apache.ambari.server.configuration.ConfigurationTest.java

/**
 * tbds.properties doesn't contain "security.server.two_way_ssl" option
 * @throws Exception//from   w  ww.  j ava  2 s  . c  o  m
 */
@Test
public void testDefaultTwoWayAuthNotSet() throws Exception {
    Assert.assertFalse(config.getTwoWaySsl());
}

From source file:org.apache.ambari.server.configuration.ConfigurationTest.java

/**
 * tbds.properties contains "security.server.two_way_ssl=false" option
 * @throws Exception/*from   w  ww.ja  va  2s .  c  om*/
 */
@Test
public void testTwoWayAuthTurnedOff() throws Exception {
    Properties ambariProperties = new Properties();
    ambariProperties.setProperty("security.server.two_way_ssl", "false");
    Configuration conf = new Configuration(ambariProperties);
    Assert.assertFalse(conf.getTwoWaySsl());
}