List of usage examples for org.springframework.util Assert isTrue
@Deprecated public static void isTrue(boolean expression)
From source file:org.oncoblocks.centromere.jpa.test.JpaRepositoryTests.java
@Test public void findAllTest() { List<EntrezGene> genes = (List<EntrezGene>) geneRepository.findAll(); Assert.notNull(genes);//w w w. j a v a2s . c o m Assert.notEmpty(genes); Assert.isTrue(genes.size() == 5); EntrezGene gene = genes.get(0); Assert.notNull(gene); Assert.isTrue(gene.getEntrezGeneId().equals(1L)); Assert.isTrue("GeneA".equals(gene.getPrimaryGeneSymbol())); Assert.notNull(gene.getAliases()); Assert.notEmpty(gene.getAliases()); Assert.isTrue(gene.getAliases().size() == 1); System.out.println(gene.toString()); }
From source file:org.oncoblocks.centromere.mongodb.test.MongoImportTests.java
@Test public void repositoryWriterTest() throws Exception { repository.deleteAll();/*from w w w . j ava2 s.co m*/ RepositoryRecordWriter<EntrezGene> writer = new RepositoryRecordWriter<>(repository); for (EntrezGene gene : genes) { writer.writeRecord(gene); } List<EntrezGene> geneList = repository.findAll(); Assert.notNull(geneList); Assert.notEmpty(geneList); Assert.isTrue(geneList.size() == 5); }
From source file:org.oncoblocks.centromere.sql.test.SqlBuilderTests.java
@Test public void simpleOrQueryTest() { SqlBuilder sqlBuilder = new SqlBuilder(tableDescription); sqlBuilder.where(or(equal("name", "Joe"), equal("species", "human"))); String sql = sqlBuilder.toSql(); System.out.println(sql);//w w w. j a va2 s . c o m Assert.notNull(sql); List<Object> values = sqlBuilder.getQueryParameterValues(); Assert.notNull(values); Assert.notEmpty(values); Assert.isTrue(values.size() == 2); String name = (String) values.get(0); Assert.isTrue("Joe".equals(name)); }
From source file:org.appverse.web.framework.backend.persistence.services.integration.impl.test.UserRepositoryImplTest.java
@Override @Test//from w ww .ja v a 2s .co m public void deleteAll() throws Exception { retrieveAll(); List<UserDTO> list = userRepository.retrieveList(); Assert.notEmpty(list); userRepository.deleteAll(); list = userRepository.retrieveList(); Assert.isTrue(list.isEmpty()); }
From source file:com.jaxio.celerio.factory.PrimaryKeyFactory.java
private PrimaryKey buildCompositePrimaryKey(Entity entity) { Assert.isTrue(entity.isRoot()); Table table = config.getMetadata().getTableByName(entity.getTableName()); List<String> pkColumns = table.getPrimaryKeys(); List<Attribute> attributes = newArrayList(); for (String pkColumn : pkColumns) { Attribute pkAttribute = entity.getAttributeByTableAndColumnName(table.getName(), pkColumn); pkAttribute.setInCpk(true);//from ww w.j av a2 s . c o m attributes.add(pkAttribute); } return new CompositePrimaryKey(entity, attributes); }
From source file:org.opencredo.esper.EsperTemplate.java
public synchronized void destroyStatement(String statementId) { EsperStatement statement = findStatementById(statementId); statement.destroy();/*from ww w. j av a 2 s . c o m*/ Assert.isTrue(statement.getState().equals(EPStatementState.DESTROYED)); this.statements.remove(statement); }
From source file:org.oncoblocks.centromere.sql.test.GenericJdbcRepositoryTests.java
@Test public void findAllPaged() { PageRequest pageRequest = new PageRequest(1, 3); Page<Subject> page = subjectRepository.findAll(pageRequest); Assert.notNull(page);//from w w w.ja v a 2 s .com Assert.isTrue(page.getTotalPages() == 2); Assert.isTrue(page.getTotalElements() == 5); List<Subject> subjects = page.getContent(); Assert.isTrue(subjects.size() == 2); Subject subject = subjects.get(0); Assert.isTrue(subject.getId().equals(4L)); }
From source file:fr.rktv.iamcore.test.hibernate.AuthHibernateDAOTest.java
/** * Test case checking success case of checkValidLicense method of Authenticate DAO * @throws IllegalArgumentException//from w ww . j a va2 s . com * @throws IllegalAccessException */ @Test public void checkValidLicenseTestSucc() throws IllegalArgumentException, IllegalAccessException { Assert.isTrue(authenticationDAO.checkValidLicense(license)); }
From source file:edu.pitt.dbmi.ccd.anno.annotation.data.AnnotationDataResourceAssembler.java
/** * convert AnnotationDatas to AnnotationDataResources * * @param annotations entities// www . j a v a2 s. co m * @return List of resources */ @Override public List<AnnotationDataResource> toResources(Iterable<? extends AnnotationData> annotations) throws IllegalArgumentException { // Assert annotations is not empty Assert.isTrue(annotations.iterator().hasNext()); return StreamSupport.stream(annotations.spliterator(), false).map(this::toResource) .collect(Collectors.toList()); }
From source file:edu.pitt.dbmi.ccd.anno.vocabulary.attribute.AttributeResourceAssembler.java
/** * convert Attributes to AttributeResources * * @param attributes entities//from w w w .j a v a 2 s . c o m * @return List of resources */ @Override public List<AttributeResource> toResources(Iterable<? extends Attribute> attributes) { // Assert attributes is not empty Assert.isTrue(attributes.iterator().hasNext()); return StreamSupport.stream(attributes.spliterator(), false).map(this::toResource) .collect(Collectors.toList()); }