Example usage for junit.framework Assert assertTrue

List of usage examples for junit.framework Assert assertTrue

Introduction

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

Prototype

static public void assertTrue(boolean condition) 

Source Link

Document

Asserts that a condition is true.

Usage

From source file:org.obiba.onyx.core.service.impl.AnyPasswordValidationStrategyImplTest.java

/**
 * Ensure that even null passwords validate. This validator performs no validation.
 */// w w w .  j  a  v  a  2 s .  c om
@Test
public void testValidateNullPassword() {
    List<MessageSourceResolvable> messageList = anyPasswordStrategy.validatePassword(user, null);
    Assert.assertTrue(messageList.size() == 0);
}

From source file:com.cloudant.sync.datastore.BasicDBBodyTest.java

@Test(expected = IllegalArgumentException.class)
public void constructor_invalidInput_objectWithEmptyJsonShouldBeCreated() {
    DocumentBody body = new BasicDocumentBody("[]".getBytes());
    Assert.assertTrue(Arrays.equals("{}".getBytes(), body.asBytes()));
    Assert.assertNotNull(body.asMap());//from   ww w  .  j a v a2s . c o m
    Assert.assertTrue(body.asMap().size() == 0);
}

From source file:org.atemsource.atem.impl.common.attribute.ListAssociationAttributeTest.java

@Test
public void testAttributeType() {
    EntityA entity = new EntityA();
    Assert.assertTrue(entityTypeRepository.getEntityType(entity)
            .getAttribute(PROPERTY) instanceof ListAssociationAttribute);
}

From source file:com.comcast.cats.jenkins.service.JobServiceIT.java

@Test
@Ignore//from  w ww . ja  v a 2  s  . co m
public void createProject() throws HttpException, IOException {
    File input = new File("config.xml");
    boolean status = jobService.createJob("NewProject", input);
    LOGGER.info(" status is " + status);
    Assert.assertTrue(status);
}

From source file:boutique.test.MappingTest.java

public void test() {

    Utilisateur u = new Utilisateur();
    u.setNom("BlaBla");
    u.setEmail("agathe");
    u.setMdp("agathe");
    utilisateurService.save(u);/*from ww w. j  a v a  2s.c o m*/

    Utilisateur admin = new Utilisateur();
    u.setNom("admin");
    u.setEmail("admin");
    u.setMdp("admin");
    u.setTypeUtil(TypeUtil.Administrateur);
    utilisateurService.save(u);

    Utilisateur u5 = utilisateurService.findByEmailAndMdp("agathe", "agath");
    Assert.assertTrue(u5 == null);
    //        System.out.println(utilisateurService.findByEmailAndMdp("agathe", "agath").getNom());

    //        for (Utilisateur u : utilisateurService.findAll()){
    //            System.out.println(u);
}

From source file:cn.javass.spring.chapter4.ResourcePatternTest.java

@Test
public void testClasspathAsteriskPrefix() throws IOException {
    ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();

    //??Resource//from ww w . ja  v a2s. com
    //ClassLoader.getResources("META-INF")??
    //?????
    Resource[] resources = resolver.getResources("classpath*:META-INF/INDEX.LIST");
    Assert.assertTrue(resources.length > 1);

    //??Resource
    resources = resolver.getResources("classpath*:META-INF/*.LIST");
    Assert.assertTrue(resources.length > 1);

}

From source file:com.minimalgap.transformer.subtitles.SubtilesSAXParserTest.java

@BeforeMethod
public void createParser() {
    saxParserExample = new SubtilesSAXParser(FILE_DEST);

    File sourceFile = FileUtils.toFile(getClass().getClassLoader().getResource(FILE_SOURCE));
    Assert.assertTrue(sourceFile.exists());
    sourcePath = sourceFile.getAbsolutePath();
}

From source file:org.envirocar.app.test.dao.TrackDecoderTest.java

public void testTotalTrackCount() throws TrackRetrievalException {
    BasicHttpResponse response = new BasicHttpResponse(createStatusLine());
    response.setHeader("Link",
            "<https://envirocar.org/api/stable/users/matthes/tracks?limit=1&page=7>;rel=last;type=application/json, <https://envirocar.org/api/stable/users/matthes/tracks?limit=1&page=2>;rel=next;type=application/json");
    Integer count = new TrackDecoder().resolveTrackCount(response);

    Assert.assertTrue(count.intValue() == 7);

    response = new BasicHttpResponse(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 204, ""));
    response.setHeader("Link", "<https://envirocar.org/api/stable/users/matthes/tracks?page=6>;rel=last");
    count = new TrackDecoder().resolveTrackCount(response);

    Assert.assertTrue(count.intValue() == 6);

}

From source file:com.mycompany.dvdmvc.DVDSQLTest.java

@Test
public void tester() {
    DVD testGet = dao.get(dvd.getId());//from   w  w w . j  av  a2  s.  co  m
    boolean exists = true;
    if (testGet == null) {
        exists = false;
    }
    Assert.assertTrue(exists);

    String testUpdate = ("Bill");
    dvd.setDirectorsName(testUpdate);
    dao.update(dvd);
    Assert.assertTrue(dvd.getDirectorsName().equals(testUpdate));
    dao.delete(dvd);

    List<DVD> mpaaRatings = dao.getMPAA("M");
    if (mpaaRatings == null) {
        exists = false;
    }
    Assert.assertTrue(exists);

    List<DVD> studios = dao.getStudio("Universal");
    if (studios == null) {
        exists = false;
    }
    Assert.assertTrue(exists);

    List<DVD> dvdsInXYears = dao.findDvdsInXYears(5);
    if (dvdsInXYears == null) {
        exists = false;
    }
    Assert.assertTrue(exists);

    DVD oldest = dao.findOldest();
    if (oldest == null) {
        exists = false;
    }
    Assert.assertTrue(exists);

    DVD newest = dao.findNewest();
    if (newest == null) {
        exists = false;
    }
    Assert.assertTrue(exists);

    List<DVD> dvds = dao.getDvds();
    if (dvds == null) {
        exists = false;
    }
    Assert.assertTrue(exists);

}

From source file:cc.redberry.core.tensor.random.RandomTensorTest.java

@Test
public void testSum1() {
    RandomTensor rp = new RandomTensor(4, 10, new int[] { 4, 0, 0, 0 }, new int[] { 10, 0, 0, 0 }, false,
            new Well19937c());
    Tensor t = rp.nextSum(5, 4, ParserIndices.parseSimple("_nm"));
    Assert.assertTrue(t.getIndices().equalsRegardlessOrder(ParserIndices.parseSimple("_nm")));
}