當前位置: 首頁>>代碼示例>>Java>>正文


Java AssertJUnit.assertNull方法代碼示例

本文整理匯總了Java中org.testng.AssertJUnit.assertNull方法的典型用法代碼示例。如果您正苦於以下問題:Java AssertJUnit.assertNull方法的具體用法?Java AssertJUnit.assertNull怎麽用?Java AssertJUnit.assertNull使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.testng.AssertJUnit的用法示例。


在下文中一共展示了AssertJUnit.assertNull方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: executeAsyncScriptWithNullReturn

import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void executeAsyncScriptWithNullReturn() throws Throwable {
    try {
        driver = new JavaDriver();
        SwingUtilities.invokeAndWait(new Runnable() {
            @Override public void run() {
                frame.setLocationRelativeTo(null);
                frame.setVisible(true);
            }
        });
        WebElement element1 = driver.findElement(By.name("text-field"));
        WebElement element2 = (WebElement) ((JavascriptExecutor) driver).executeAsyncScript("$2.call(null);", element1);
        AssertJUnit.assertNull(element2);
    } finally {
        JavaElementFactory.reset();
    }
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:17,代碼來源:JavaDriverTest.java

示例2: clickHeaderItem

import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void clickHeaderItem() throws Throwable {
    driver = new JavaDriver();
    WebElement header = driver.findElement(By.cssSelector("table::header"));
    final WebElement firstItem = header.findElement(By.cssSelector(".::nth-item(1)"));
    AssertJUnit.assertNull(firstItem.getAttribute("icon"));
    firstItem.click();
    new WebDriverWait(driver, 3).until(new Function<WebDriver, Boolean>() {
        @Override public Boolean apply(WebDriver input) {
            return firstItem.getAttribute("icon") != null;
        }
    });
    AssertJUnit.assertTrue(firstItem.getAttribute("icon").length() > 0);
    WebElement secondItem = header.findElement(By.cssSelector(".::nth-item(2)"));
    AssertJUnit.assertNull(secondItem.getAttribute("icon"));
    secondItem.click();
    AssertJUnit.assertTrue(secondItem.getAttribute("icon").length() > 0);
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:18,代碼來源:JTableTest.java

示例3: testMax

import org.testng.AssertJUnit; //導入方法依賴的package包/類
@Test
public void testMax(){
	AssertJUnit.assertNull(max((Integer)null, null));
	AssertJUnit.assertEquals(new Integer(0), max(null, 0));
	AssertJUnit.assertEquals(new Integer(0), max(0, null));
	AssertJUnit.assertEquals(new Integer(0), max(0, 0));
	AssertJUnit.assertEquals(new Integer(3), max(0, 3));
	AssertJUnit.assertEquals(new Integer(3), max(3, 0));
	AssertJUnit.assertEquals(null, max((Double)null));
	AssertJUnit.assertEquals(null, max((Double)null, null));
	AssertJUnit.assertEquals(null, max((Double)null, null, null));
	AssertJUnit.assertEquals(new Double(3), max(null, null, 3d));
	AssertJUnit.assertEquals(new Double(3), max(3d, null));
	AssertJUnit.assertEquals(new Double(3), max(3d, 1d));
	AssertJUnit.assertEquals(new Double(3), max(1d, 3d));
	AssertJUnit.assertEquals(new Double(3), max(1d, 2d, 3d));
	AssertJUnit.assertEquals(new Double(3), max(1d, 3d, 2d));
	AssertJUnit.assertEquals(new Double(3), max(1d, 3d, null, 2d));
	AssertJUnit.assertEquals(new Double(2), max(1d, null, 2d));
}
 
開發者ID:hotpads,項目名稱:datarouter,代碼行數:21,代碼來源:ComparableTool.java

示例4: getAttributeUnsupportedAttribute

import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void getAttributeUnsupportedAttribute() throws Throwable {
    driver = new JavaDriver();
    SwingUtilities.invokeAndWait(new Runnable() {
        @Override public void run() {
            frame.setLocationRelativeTo(null);
            frame.setVisible(true);
        }
    });
    WebElement element1 = driver.findElement(By.name("click-me"));
    AssertJUnit.assertNull(element1.getAttribute("enabledX"));
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:12,代碼來源:JavaDriverTest.java

示例5: assertMenuItem

import org.testng.AssertJUnit; //導入方法依賴的package包/類
private void assertMenuItem(List<WebElement> menuItems, int i, String text, String iconFileName, String mnemonic) {
    WebElement menuItem = menuItems.get(i);
    AssertJUnit.assertEquals(text, menuItem.getText());
    if ("".equals(iconFileName)) {
        AssertJUnit.assertNull(menuItem.getAttribute("icon"));
    } else {
        AssertJUnit.assertTrue("Icon mismatch", menuItem.getAttribute("icon").endsWith(iconFileName));
    }
    AssertJUnit.assertEquals("Mnemonic mismatch", mnemonic, menuItem.getAttribute("mnemonic"));
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:11,代碼來源:JMenuTest.java

示例6: getAttributeNotAvailable

import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void getAttributeNotAvailable() throws Throwable {
    AssertJUnit.assertNull(ejText.getAttribute("sizeX"));
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:4,代碼來源:JavaElementTest.java

示例7: getCommandLine

import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void getCommandLine() {
    JavaProfile profile = new JavaProfile();
    AssertJUnit.assertNull(profile.getCommandLine());
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:5,代碼來源:JavaProfileTest.java

示例8: quit

import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void quit() {
    driver = new JavaDriver();
    driver.quit();
    AssertJUnit.assertNull(((RemoteWebDriver) driver).getSessionId());
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:6,代碼來源:JavaDriverTest.java


注:本文中的org.testng.AssertJUnit.assertNull方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。