本文整理匯總了Java中org.junit.Assert.assertFalse方法的典型用法代碼示例。如果您正苦於以下問題:Java Assert.assertFalse方法的具體用法?Java Assert.assertFalse怎麽用?Java Assert.assertFalse使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.junit.Assert
的用法示例。
在下文中一共展示了Assert.assertFalse方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testJoinUntilEmptyWithOne
import org.junit.Assert; //導入方法依賴的package包/類
@Test
public void testJoinUntilEmptyWithOne() {
AsyncManualResetEvent evt = new AsyncManualResetEvent();
JoinableFuture<Void> joinable = getJoinableFactory().runAsync(() -> Async.awaitAsync(evt.waitAsync()));
CompletableFuture<Void> waiter = joinableCollection.joinUntilEmptyAsync();
Assert.assertFalse(waiter.isDone());
Futures.runAsync(() -> {
evt.set();
return Async.awaitAsync(
waiter,
() -> {
this.testFrame.setContinue(false);
return Futures.completedNull();
});
});
pushFrame();
}
示例2: testRenameDirectoryAsNonExistentDirectory
import org.junit.Assert; //導入方法依賴的package包/類
private void testRenameDirectoryAsNonExistentDirectory(Rename... options) throws Exception {
if (!renameSupported()) return;
Path src = getTestRootPath(fc, "test/hadoop/dir");
fc.mkdir(src, FileContext.DEFAULT_PERM, true);
createFile(getTestRootPath(fc, "test/hadoop/dir/file1"));
createFile(getTestRootPath(fc, "test/hadoop/dir/subdir/file2"));
Path dst = getTestRootPath(fc, "test/new/newdir");
fc.mkdir(dst.getParent(), FileContext.DEFAULT_PERM, true);
rename(src, dst, true, false, true, options);
Assert.assertFalse("Nested file1 exists",
exists(fc, getTestRootPath(fc, "test/hadoop/dir/file1")));
Assert.assertFalse("Nested file2 exists",
exists(fc, getTestRootPath(fc, "test/hadoop/dir/subdir/file2")));
Assert.assertTrue("Renamed nested file1 exists",
exists(fc, getTestRootPath(fc, "test/new/newdir/file1")));
Assert.assertTrue("Renamed nested exists",
exists(fc, getTestRootPath(fc, "test/new/newdir/subdir/file2")));
}
示例3: removeHeader
import org.junit.Assert; //導入方法依賴的package包/類
@Test
public void removeHeader() {
BlockStore store = new BlockStore();
BlockHeader blockHeader = new BlockHeader(new byte[]{},
new byte[]{},
new byte[]{},
new Bloom().getData(),
new byte[]{},
1,
new byte[]{},
0,
0,
new byte[]{},
new byte[]{},
new byte[]{},
new byte[]{},
new byte[]{},
0
);
store.saveHeader(blockHeader);
store.removeHeader(blockHeader);
Assert.assertFalse(store.hasHeader(blockHeader.getHash()));
}
示例4: testSendAllNonSuspendingMessagesWithOrgsBillingType
import org.junit.Assert; //導入方法依賴的package包/類
@Test
public void testSendAllNonSuspendingMessagesWithOrgsBillingType()
throws Exception {
List<TriggerDefinition> triggerDefs = new ArrayList<>();
TriggerDefinition td = new TriggerDefinition();
td.setType(TriggerType.START_BILLING_RUN);
td.setSuspendProcess(false);
triggerDefs.add(td);
organization.setTriggerDefinitions(triggerDefs);
TriggerMessage tm = new TriggerMessage(TriggerType.START_BILLING_RUN,
null, organizations);
tqs.sendAllNonSuspendingMessages(Collections.singletonList(tm));
Assert.assertFalse(storedObjects.isEmpty());
Assert.assertTrue(storedObjects.get(0) instanceof TriggerProcess);
TriggerProcess storedProcess = (TriggerProcess) storedObjects.get(0);
Assert.assertEquals(TriggerProcessStatus.INITIAL,
storedProcess.getStatus());
}
示例5: testAutoCommitFalse
import org.junit.Assert; //導入方法依賴的package包/類
@Test
public void testAutoCommitFalse() throws Exception {
DataSourceProxy d1 = this.createDefaultDataSource();
d1.setMaxActive(1);
d1.setMinIdle(1);
d1.setMaxIdle(1);
d1.setJdbcInterceptors(ConnectionState.class.getName());
d1.setDefaultAutoCommit(Boolean.FALSE);
Connection c1 = d1.getConnection();
Assert.assertFalse("Auto commit should be false",c1.getAutoCommit());
c1.setAutoCommit(true);
Assert.assertTrue("Auto commit should be true",c1.getAutoCommit());
c1.close();
c1 = d1.getConnection();
Assert.assertFalse("Auto commit should be false for a reused connection",c1.getAutoCommit());
d1.close(true);
Assert.assertTrue("Connection should be closed",c1.isClosed());
}
示例6: returnDataCopyTest
import org.junit.Assert; //導入方法依賴的package包/類
@Test
public void returnDataCopyTest() {
TestContract contract = TestContract.returnDataTest();
ProgramResult result = contract.executeFunction("testCopy", BigInteger.ZERO);
Assert.assertFalse(result.isRevert());
Assert.assertNull(result.getException());
Assert.assertArrayEquals(
new Object[] {LOREM_IPSUM},
contract.functions.get("testCopy").decodeResult(result.getHReturn()));
}
示例7: testAddRemoveInsert
import org.junit.Assert; //導入方法依賴的package包/類
@Test
public void testAddRemoveInsert() throws org.eclipse.rdf4j.RDF4JException {
Statement stmt = vf.createStatement(micah, homeTel, micahhomeTel);
testAdminCon.add(stmt);
try {
testAdminCon.begin();
testAdminCon.remove(stmt);
Assert.assertEquals("The size of repository must be zero", 0, testAdminCon.size());
testAdminCon.prepareUpdate(
"INSERT DATA " + " { <" + micah.stringValue() + "> <#homeTel> \"" + micahhomeTel.doubleValue()
+ "\"^^<http://www.w3.org/2001/XMLSchema#double>} ",
"http://marklogicsparql.com/addressbook").execute();
testAdminCon.commit();
} catch (Exception e) {
if (testAdminCon.isActive())
testAdminCon.rollback();
Assert.assertTrue("Failed within transaction", 1 > 2);
} finally {
if (testAdminCon.isActive())
testAdminCon.rollback();
}
Assert.assertFalse(testAdminCon.isEmpty());
Assert.assertEquals(1L, testAdminCon.size());
}
示例8: testJoinUntilEmptyUsesConfigureAwaitFalse
import org.junit.Assert; //導入方法依賴的package包/類
@Test
public void testJoinUntilEmptyUsesConfigureAwaitFalse() throws Exception {
AsyncManualResetEvent evt = new AsyncManualResetEvent();
JoinableFuture<Void> joinable = getJoinableFactory().runAsync(() -> Async.awaitAsync(Async.configureAwait(evt.waitAsync(), false)));
CompletableFuture<Void> waiter = joinableCollection.joinUntilEmptyAsync();
Assert.assertFalse(waiter.isDone());
evt.set();
waiter.get(UNEXPECTED_TIMEOUT.toMillis(), TimeUnit.MILLISECONDS);
}
示例9: testCheckConditionsFalseDoNotMatchStringIPADSL5
import org.junit.Assert; //導入方法依賴的package包/類
@Test
public void testCheckConditionsFalseDoNotMatchStringIPADSL5() {
gherkinCondition.setExpected(DO_NOT_MATCH_STRING);
gherkinCondition.setActual("IPADSL");
conditions.add(gherkinCondition);
Assert.assertFalse(ci.checkConditions(conditions));
}
示例10: doesNotContainIPV4WithAlteredByte
import org.junit.Assert; //導入方法依賴的package包/類
@Test
public void doesNotContainIPV4WithAlteredByte() throws UnknownHostException {
InetAddress address = generateIPAddressV4();
InetAddress address2 = alterByte(address, 2);
InetAddressBlock mask = new InetAddressBlock(address, 8);
Assert.assertFalse(mask.contains(address2));
}
示例11: isExplicitAttributeDefinitionMissing
import org.junit.Assert; //導入方法依賴的package包/類
@Test
public void isExplicitAttributeDefinitionMissing() throws Exception {
JsonFileExplicitAttributeDecider decider =
new JsonFileExplicitAttributeDecider(new InputStreamReader(getClass().getResourceAsStream("JsonFileExplicitAttributeDeciderTest2.json")));
Table tableMock = Mockito.mock(Table.class);
Mockito.when(tableMock.getName()).thenReturn("TABLENAME");
Column columnMock = Mockito.mock(Column.class);
Mockito.when(columnMock.getName()).thenReturn("EXPLICIT");
Mockito.when(columnMock.getParent()).thenReturn(tableMock);
Assert.assertFalse(decider.isExplicitAttribute(columnMock));
Mockito.when(columnMock.getName()).thenReturn("NONEXPLICIT");
Assert.assertFalse(decider.isExplicitAttribute(columnMock));
}
示例12: noParentBlock
import org.junit.Assert; //導入方法依賴的package包/類
@Test
public void noParentBlock() {
Block block = Mockito.mock(Block.class);
Mockito.when(block.getParentHash()).thenReturn(PARENT_HASH);
Mockito.when(block.getMinGasPriceAsInteger()).thenReturn(BLOCK_MGP);
PrevMinGasPriceRule pmgpv = new PrevMinGasPriceRule();
Assert.assertFalse(pmgpv.isValid(block, null));
}
示例13: test38
import org.junit.Assert; //導入方法依賴的package包/類
@Test
public void test38() throws Exception {
String data = "1\r\n\r\n\"\"\r\n \r\n2";
CsvReader reader = CsvReader.parse(data);
Assert.assertTrue(reader.readRecord());
Assert.assertEquals("1", reader.get(0));
Assert.assertEquals(0L, reader.getCurrentRecord());
Assert.assertEquals(1, reader.getColumnCount());
Assert.assertEquals("1", reader.getRawRecord());
Assert.assertTrue(reader.readRecord());
Assert.assertEquals("", reader.get(0));
Assert.assertEquals(1L, reader.getCurrentRecord());
Assert.assertEquals(1, reader.getColumnCount());
Assert.assertEquals("\"\"", reader.getRawRecord());
Assert.assertTrue(reader.readRecord());
Assert.assertEquals("", reader.get(0));
Assert.assertEquals(2L, reader.getCurrentRecord());
Assert.assertEquals(1, reader.getColumnCount());
Assert.assertEquals(" ", reader.getRawRecord());
Assert.assertTrue(reader.readRecord());
Assert.assertEquals("2", reader.get(0));
Assert.assertEquals(3L, reader.getCurrentRecord());
Assert.assertEquals(1, reader.getColumnCount());
Assert.assertEquals("2", reader.getRawRecord());
Assert.assertFalse(reader.readRecord());
reader.close();
}
示例14: checkPresenterNotRetained
import org.junit.Assert; //導入方法依賴的package包/類
@AfterClass
public static void checkPresenterNotRetained(){
// TODO is there a better way to test after onDestroy() has been called?
Assert.assertNotNull(presenter);
Assert.assertEquals(2, presenter.detachViewInvokations);
Assert.assertFalse(presenter.onDettachViewRetainInstance);
}
示例15: testInvalidBecauseEmptyDefaultUrlRuleStatement
import org.junit.Assert; //導入方法依賴的package包/類
@Test
public void testInvalidBecauseEmptyDefaultUrlRuleStatement() throws Exception {
URLRules urlRules = new URLRules();
Default defaultUrlRule = new Default();
defaultUrlRule.setUrlRule(new UrlRule());
urlRules.setDefaultStatement(defaultUrlRule);
Assert.assertFalse(testee.validate(urlRules).isSuccessValidation());
}