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.ocpsoft.rewrite.faces.PhaseOperationTest.java

@Test
public void testPhaseBindingDefersValidationAndConversion() throws Exception {
    HttpAction<HttpGet> action = get("/defer_validation/true");
    String content = action.getResponseContent();
    Assert.assertTrue(content.contains("Empty"));
    Assert.assertEquals(200, action.getResponse().getStatusLine().getStatusCode());
}

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

@Test
public void testFilekPrefix() throws IOException {
    ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
    Resource[] resources = resolver.getResources("file:D:/*.txt");
    Assert.assertTrue(resources.length > 0);
}

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

void validateNewlyCreateLocalDocument(BasicDocumentRevision rev) {
    Assert.assertNotNull(rev);/*from  w  ww.  j  a v  a  2s  . com*/
    CouchUtils.validateDocumentId(rev.getId());
    Assert.assertEquals("1-local", rev.getRevision());
    Assert.assertTrue(rev.isCurrent());
}

From source file:ch.medshare.elexis_directories.TestElexisDirectories.java

@Test
public void test_atupri_bern() throws IOException {
    File base = get_ressource_path();
    Assert.assertTrue(base.exists());
    File to_test = new File(base, "atupri_bern.html");
    Assert.assertTrue(to_test.exists());
    KontaktEntry atupri = new KontaktEntry("Krankenkasse Direktion", "Atupri", "Krankenkasse, Versicherung",
            "Zieglerstrasse 29", "3007", "Bern", "031 555 09 11", "", "", true);
    List<KontaktEntry> expectedKontakte = new ArrayList<KontaktEntry>();
    expectedKontakte.add(atupri);/*from   ww w  .j  a va2  s.  co  m*/
    compare_file_to_kontacts(to_test, expectedKontakte);
}

From source file:org.xdi.oxd.license.client.LicenseClientTest.java

@Parameters({ "licenseServerEndpoint" })
@Test(enabled = false)//from w w w . j av a  2 s. com
public void generateLicenseIds(String licenseServerEndpoint, String umaDiscoveryEndpoint)
        throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException {
    final GenerateWS generateWS = LicenseClient.generateWs(licenseServerEndpoint);

    UmaConfiguration umaConfiguration = UmaClientFactory.instance()
            .createMetaDataConfigurationService(umaDiscoveryEndpoint, trustAllExecutor())
            .getMetadataConfiguration();

    CreateRptService rptService = UmaClientFactory.instance()
            .createRequesterPermissionTokenService(umaConfiguration, trustAllExecutor());
    String rpt = rptService.createRPT("aat", "https://idp.gluu.org").getRpt();

    List<LicenseIdItem> list = generateWS.generateLicenseId(5, "Bearer " + rpt, testMetadata());

    Assert.assertTrue(!list.isEmpty());
    System.out.println(list);
}

From source file:com.google.api.ads.adwords.awreporting.model.persistence.sql.SqlReportEntitiesPersisterTest.java

/**
 * Tests the persistence and retrieval of Report Entities.
 *///from  www  .ja  v  a2 s.  c o m
@Test
public void testTokenPersistence() {
    ReportBase report = new ReportAccount(123L, 456L);
    report.setAccountDescriptiveName("testAccount");
    report.setId();
    List<Report> reportList = Lists.newArrayList();
    reportList.add(report);
    reportEntitiesPersister.persistReportEntities(reportList);

    List<ReportAccount> reportAccountList = reportEntitiesPersister.listReports(ReportAccount.class);
    Assert.assertNotNull(reportAccountList);
    Assert.assertTrue(reportAccountList.size() == 1);
    Assert.assertTrue(reportAccountList.get(0).getTopAccountId().equals(123L));
    Assert.assertTrue(reportAccountList.get(0).getAccountId().equals(456L));
    Assert.assertTrue(reportAccountList.get(0).getAccountDescriptiveName().equals("testAccount"));

    report = new ReportAccount(789L, 456L);
    report.setAccountDescriptiveName("updatedTestAccount");
    reportList = Lists.newArrayList();
    reportList.add(report);
    reportEntitiesPersister.persistReportEntities(reportList);

    reportAccountList = reportEntitiesPersister.listReports(ReportAccount.class);
    Assert.assertNotNull(reportAccountList);
    Assert.assertTrue(reportAccountList.size() == 1);
    Assert.assertTrue(reportAccountList.get(0).getTopAccountId().equals(789L));
    Assert.assertTrue(reportAccountList.get(0).getAccountId().equals(456L));
    Assert.assertTrue(reportAccountList.get(0).getAccountDescriptiveName().equals("updatedTestAccount"));

    this.reportEntitiesPersister.remove(reportAccountList);
}

From source file:de.itsvs.cwtrpc.controller.config.AutowiredRemoteServiceGroupConfigBeanDefinitionParserTest.java

@Test
public void test2() {
    AutowiredRemoteServiceGroupConfig config;
    Iterator<String> packageNameIter;

    config = appContext.getBean("autowiredServiceGroup102", AutowiredRemoteServiceGroupConfig.class);
    Assert.assertTrue(config.getResponseCompressionEnabled());

    Assert.assertEquals(3, config.getBasePackages().size());
    packageNameIter = config.getBasePackages().iterator();
    Assert.assertEquals("de.itsvs.test.", packageNameIter.next());
    Assert.assertEquals("de.itsvs.test2.", packageNameIter.next());
    Assert.assertEquals("de.itsvs.test3", packageNameIter.next());
}

From source file:de.itsvs.cwtrpc.controller.config.RemoteServiceModuleConfigBeanDefinitionParserTest.java

@Test
public void test3() {
    RemoteServiceModuleConfig config;/*from w w w.j a  v  a  2 s. co m*/

    config = appContext.getBean("serviceModule103", RemoteServiceModuleConfig.class);
    Assert.assertTrue(config.getRpcTokenProtectionEnabled());
}

From source file:com.dare2date.kenikjounietergensvan.webservice.KenIkJouNietErgensVanEndpointTest.java

@Test
public void testAgreements() {
    OvereenkomstenUsersInput input = new OvereenkomstenUsersInput();
    input.setUsers(new OvereenkomstenUsersInput.Users());
    input.users.user = new ArrayList<String>();

    String username1 = "Theus";
    String username2 = "Klaas";

    FacebookService fbService = createFacebookServiceMock(username1, username2);
    LastfmService lfmService = createLastfmServiceMock(username1, username2);

    EasyMock.replay((fbService));//w w w .  jav a 2  s . c o m
    EasyMock.replay(lfmService);

    endpoint.setFacebookService(fbService);
    endpoint.setLastFmService(lfmService);

    input.users.user.add(username1);
    input.users.user.add(username2);

    OvereenkomstenUsersRequest request = new OvereenkomstenUsersRequest();
    request.setInput(input);

    OvereenkomstenUsersResponse response = endpoint.agreements(request);

    Assert.assertTrue(response.result.getData().getItems().contains("Test"));

    EasyMock.verify(fbService);
    EasyMock.verify(lfmService);
}

From source file:org.opencastproject.remotetest.server.perf.ConcurrentVideosegmenterTest.java

@Test
@PerfTest(invocations = 10, threads = 10)
public void testConcurrentVideoSegmentation() throws Exception {
    // Grab the receipt from the response
    HttpResponse postResponse = httpClient.execute(getPost());
    String postResponseXml = EntityUtils.toString(postResponse.getEntity());
    Assert.assertEquals(200, postResponse.getStatusLine().getStatusCode());
    Assert.assertTrue(postResponseXml.contains("receipt"));
}