List of usage examples for junit.framework Assert assertTrue
static public void assertTrue(boolean condition)
From source file:com.google.api.ads.adwords.awreporting.model.definitions.ReportCampaignNegativeKeywordDefinitionTest.java
/** * @see com.google.api.ads.adwords.awreporting.model.definitions. * AbstractReportDefinitionTest#testFirstEntry( * com.google.api.ads.adwords.awreporting.model.entities.Report) *///from w ww . j a v a 2s . c om @Override protected void testFirstEntry(ReportCampaignNegativeKeyword first) { Assert.assertEquals(11533780L, first.getKeywordId().longValue()); Assert.assertEquals(116981433L, first.getCampaignId().longValue()); Assert.assertEquals("Broad", first.getKeywordMatchType()); Assert.assertEquals("gratuite", first.getKeywordText()); Assert.assertTrue(first.isNegative()); }
From source file:cc.redberry.core.tensor.random.RandomTensorTest.java
@Test public void testProduct1() { RandomTensor random = new RandomTensor(5, 20, new int[] { 2, 0, 0, 0 }, new int[] { 10, 0, 0, 0 }, true, 76543L);//from w ww.ja v a 2s .c o m for (int i = 0; i < 100; ++i) { Tensor t = random.nextProduct(5, ParserIndices.parseSimple("_mnab^cd")); Assert.assertTrue( t.getIndices().getFree().equalsRegardlessOrder(ParserIndices.parseSimple("_mnab^cd"))); } }
From source file:com.github.ipaas.ideploy.agent.handler.BackupCodeHandlerTest.java
@Test public void executeTest() throws Exception { BackupCodeHandler handler = new BackupCodeHandler(); Map<String, Object> params = new HashMap<String, Object>(); params.put("srcPath", SRC_PATH); params.put("targetPath", TARGET_PATH); // ?/*from www . j a v a 2s . c om*/ handler.execute(null, null, params, null); for (int i = 0; i < 20; i++) { Assert.assertTrue(new File(TARGET_PATH + "/" + i).exists()); } }
From source file:azkaban.crypto.DecryptionTest.java
@Test public void testV1() throws IOException { BasicConfigurator.configure();/*from w w w . ja v a 2 s . com*/ Logger.getRootLogger().setLevel(Level.DEBUG); String expected = "test"; String ciphered = "eyJ2ZXIiOiIxLjAiLCJ2YWwiOiJOd1hRejdOMjBXUU05SXEzaE94RVZnPT0ifQ=="; String passphrase = "test1234"; Crypto crypto = new Crypto(); String actual = crypto.decrypt(ciphered, passphrase); Assert.assertEquals(expected, actual); try { new CryptoV1_1().decrypt(ciphered, passphrase); Assert.fail("Should have failed when decrypt v1 ciphered text with v1.1 decryption."); } catch (Exception e) { Assert.assertTrue(e instanceof RuntimeException); } }
From source file:org.jasig.ssp.util.importer.job.BatchInitializerCopyTest.java
@SuppressWarnings("unchecked") @Test//w ww . j a v a 2 s . com public void testCopyToProcessDirectory() throws Exception { deleteDirectory(this.getProcessDirectoryPath()); deleteDirectory(getUpsertDirectoryPath()); createFiles(getInputDirectoryPath()); Assert.assertTrue(!directoryExists(getProcessDirectoryPath())); Assert.assertTrue(!directoryExists(getUpsertDirectoryPath())); Assert.assertTrue(directoryExists(getInputDirectoryPath())); Assert.assertTrue(directoryContainsFiles(getInputDirectoryPath(), 2)); BatchStatus exitStatus = jobLauncherTestUtils.launchJob().getStatus(); Assert.assertTrue(directoryExists(getProcessDirectoryPath())); Assert.assertTrue(directoryExists(getUpsertDirectoryPath())); Assert.assertTrue(directoryExists(getInputDirectoryPath())); Assert.assertTrue(directoryContainsFiles(getProcessDirectoryPath(), 2)); Assert.assertTrue(directoryContainsFiles(getUpsertDirectoryPath(), 0)); Assert.assertTrue(directoryContainsFiles(getInputDirectoryPath(), 2)); Assert.assertEquals(BatchStatus.COMPLETED, exitStatus); }
From source file:org.springsource.examples.expenses.TestDatabaseChargeService.java
@Test public void testCreatingCharges() throws Throwable { Assert.assertTrue(charges.size() == 2); long c1Id = charges.get(0); long c2Id = charges.get(1); Charge c1 = chargeService.getCharge(c1Id); Charge c2 = chargeService.getCharge(c2Id); Assert.assertEquals(c1.getAmount(), chargeAmt1); Assert.assertEquals(c2.getAmount(), chargeAmt2); Assert.assertEquals(c1.getCategory(), chargeVendor1); Assert.assertEquals(c2.getCategory(), chargeVendor2); Assert.assertEquals(c1.getId(), (Long) c1Id); Assert.assertEquals(c2.getId(), (Long) c2Id); }
From source file:org.jasig.ssp.util.importer.job.BatchPartialUploadTest.java
@SuppressWarnings("unchecked") @Test/*from www . jav a2 s. co m*/ public void testNoDirectory() throws Exception { deleteDirectory(inputDirectoryPath); Assert.assertTrue(!directoryExists(inputDirectoryPath)); JobExecution jobExecution = jobLauncherTestUtils.launchJob(); BatchStatus exitStatus = jobExecution.getStatus(); Map<String, ReportEntry> report = (Map<String, ReportEntry>) jobExecution.getExecutionContext() .get("report"); Assert.assertNull(report); Assert.assertEquals(BatchStatus.FAILED, exitStatus); Assert.assertTrue(!directoryExists(inputDirectoryPath)); }
From source file:com.hp.security.jauth.core.util.RuleTest.java
@Test public void testAccessiblePage() { String s = "jauth-admin-example/login!loginPage"; Assert.assertTrue(s.matches("[\\w\\W]*/login!loginPage")); }
From source file:org.ocpsoft.rewrite.faces.PhaseOperationTest.java
@Test public void testDeferOperationRenderResponse() throws Exception { HttpAction<HttpGet> action = get("/render_response"); String content = action.getResponseContent(); Assert.assertTrue(content == null || content.isEmpty()); Assert.assertEquals(204, action.getResponse().getStatusLine().getStatusCode()); }
From source file:org.ocpsoft.rewrite.servlet.container.ContainerSecurityTest.java
@Test public void testContainerSecurityFunctionsWithRewriteJoin() throws Exception { HttpAction<HttpGet> action = get("/user/home"); Assert.assertEquals(200, action.getResponse().getStatusLine().getStatusCode()); Assert.assertTrue(action.getResponseContent().contains("LOGIN PAGE")); }