List of usage examples for junit.framework Assert assertTrue
static public void assertTrue(boolean condition)
From source file:com.ibm.team.build.internal.hjplugin.tests.BuildConfigurationIT.java
@Override public void setUp() throws Exception { if (Config.DEFAULT.isConfigured()) { // DO NOT initialize Hudson/Jenkins because its slow and we don't need it for the tests testingFacade = RTCFacadeFactory.newTestingFacade(Config.DEFAULT.getToolkit()); File tempDir = new File(System.getProperty("java.io.tmpdir")); File buildTestDir = new File(tempDir, "HJPluginTests"); sandboxDir = new File(buildTestDir, getTestName()); sandboxDir.mkdirs();// w w w. j a v a2 s .com sandboxDir.deleteOnExit(); Assert.assertTrue(sandboxDir.exists()); } }
From source file:com.intellij.struts2.dom.struts.StrutsHighlightingSpringTest.java
public void testStrutsSpringCompletionVariants() throws Throwable { @NonNls/*from ww w . j a va2 s . com*/ final String strutsXml = "struts-completionvariants-spring.xml"; createStrutsFileSet(strutsXml); createSpringFileSet(SPRING_XML); // TODO <alias> does not appear here, see com.intellij.spring.impl.SpringModelImpl#myOwnBeans final List<String> variants = myFixture.getCompletionVariants(strutsXml); Assert.assertTrue(CollectionUtils.isSubCollection( Arrays.asList("MyClass", "bean1", "bean2", "springInterceptor", "springResultType"), variants)); }
From source file:com.facebook.TestUtils.java
public static void assertSamePermissions(final Collection<String> expected, final Collection<String> actual) { if (expected == null) { Assert.assertEquals(null, actual); } else {/* w w w . j a v a2 s. com*/ for (String p : expected) { Assert.assertTrue(actual.contains(p)); } for (String p : actual) { Assert.assertTrue(expected.contains(p)); } } }
From source file:com.amazonaws.services.kinesis.clientlibrary.lib.worker.ShardSequenceVerifier.java
void verify() { for (String message : validationFailures) { LOG.error(message); } Assert.assertTrue(validationFailures.isEmpty()); }
From source file:com.google.api.ads.adwords.awreporting.model.definitions.ReportCampaignNegativeKeywordDefinitionTest.java
/** * @see com.google.api.ads.adwords.awreporting.model.definitions. * AbstractReportDefinitionTest#testLastEntry( * com.google.api.ads.adwords.awreporting.model.entities.Report) *///from w w w. j a va 2s .c om @Override protected void testLastEntry(ReportCampaignNegativeKeyword last) { Assert.assertEquals(11679830L, last.getKeywordId().longValue()); Assert.assertEquals(116996313L, last.getCampaignId().longValue()); Assert.assertEquals("Broad", last.getKeywordMatchType()); Assert.assertEquals("gratuit", last.getKeywordText()); Assert.assertTrue(last.isNegative()); }
From source file:net.padaf.xmpbox.parser.XMLValueTypeDescriptionManagerTest.java
@Test public void testPropDesc() throws Exception { List<String> types = new ArrayList<String>(); types.add("type1"); types.add("type2"); List<String> uris = new ArrayList<String>(); uris.add("nsURI1"); uris.add("nsURI2"); List<String> prefixs = new ArrayList<String>(); prefixs.add("pref1"); prefixs.add("pref2"); List<String> descProps = new ArrayList<String>(); descProps.add("descProp1"); descProps.add("descProp2"); XMLValueTypeDescriptionManager xmlParser = new XMLValueTypeDescriptionManager(); xmlParser.addValueTypeDescription(types.get(0), uris.get(0), prefixs.get(0), descProps.get(0)); xmlParser.addValueTypeDescription(types.get(1), uris.get(1), prefixs.get(1), descProps.get(1)); ByteArrayOutputStream bos = new ByteArrayOutputStream(); xmlParser.toXML(bos);//from w w w.j a va2 s. c om IOUtils.closeQuietly(bos); XMLValueTypeDescriptionManager propRetrieve = new XMLValueTypeDescriptionManager(); InputStream is = new ByteArrayInputStream(bos.toByteArray()); propRetrieve.loadListFromXML(is); List<ValueTypeDescription> vtList = propRetrieve.getValueTypesDescriptionList(); Assert.assertEquals(types.size(), vtList.size()); for (int i = 0; i < vtList.size(); i++) { Assert.assertTrue(types.contains(vtList.get(i).getType())); Assert.assertTrue(uris.contains(vtList.get(i).getNamespaceURI())); Assert.assertTrue(prefixs.contains(vtList.get(i).getPrefix())); Assert.assertTrue(descProps.contains(vtList.get(i).getDescription())); Assert.assertNull(vtList.get(i).getFields()); } }
From source file:org.ocpsoft.rewrite.prettyfaces.encoding.URLEncodingTest.java
/** * Test a rewrite rule using the 'url' attribute to create a completely new URL. * //from ww w.ja va 2s. c om * @see http://code.google.com/p/prettyfaces/issues/detail?id=76 */ @Test public void testRewriteEncodingUrl() throws Exception { String target = "/virtual/rewrite/url"; String expected = "/virtu%C3%A1ln%C3%AD"; HttpAction<HttpGet> action = get(target); Assert.assertTrue(action.getCurrentURL().endsWith(expected)); Assert.assertTrue(action.getResponseContent().contains(expected)); }
From source file:de.hybris.platform.integration.cis.tax.strategies.impl.DefaultCisCalculateExternalTaxesFallbackStrategyTest.java
@Test public void shouldCalculateTaxesWithFallback() { final ExternalTaxDocument taxDocument = defaultCisCalculateExternalTaxesFallbackStrategy .calculateExternalTaxes(abstractOrder); Assert.assertNotNull(taxDocument);/*from w w w . j a va2 s . c o m*/ Assert.assertTrue(taxDocument.getAllTaxes().size() > 0); Assert.assertTrue(taxDocument.getShippingCostTaxes().size() > 0); }
From source file:org.atemsource.atem.impl.common.attribute.ListAssociationAttributeTest.java
@Test public void testSetter() { EntityA entity = new EntityA(); final ArrayList<EntityB> list = new ArrayList<EntityB>(); list.add(createEntity("Hallo", 2)); list.add(createEntity("tst", 3)); ListAssociationAttribute<?> attribute = (ListAssociationAttribute<?>) getAttribute(PROPERTY); Assert.assertNotNull(attribute);/*from w ww.ja v a2s . c o m*/ attribute.setValue(entity, list); List<EntityB> value = entity.getList(); assertEquals(list, value); Assert.assertTrue(list == value); }
From source file:com.couchbase.lite.BlobStoreTest.java
private void verifyRawBlob(BlobKey key, byte[] clearText) throws IOException { String path = store.getRawPathForKey(key); byte[] raw;//from w w w . ja va2 s . c om InputStream is = new FileInputStream(path); try { raw = TextUtils.read(is); } finally { is.close(); } Assert.assertNotNull(raw); if (store.getEncryptionKey() == null) { Assert.assertTrue(Arrays.equals(raw, clearText)); } else { Assert.assertTrue(!Arrays.equals(raw, clearText)); } }