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


Java AssertJUnit.assertFalse方法代碼示例

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


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

示例1: click

import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void click() {
    try {
        buttonClicked = false;
        EventQueueWait.requestFocus(button);
        driver.click(button, Buttons.LEFT, 1, 0, 0);
        new DeviceTest.WaitWithoutException("Waiting for events to be processed") {
            @Override public boolean until() {
                return buttonClicked;
            }
        };
        AssertJUnit.assertTrue(buttonClicked);
        AssertJUnit.assertEquals(MouseEvent.BUTTON1, clickedButton);
        AssertJUnit.assertFalse(altDown);
        AssertJUnit.assertFalse(metaDown);
        AssertJUnit.assertFalse(controlDown);
        AssertJUnit.assertFalse(shiftDown);
        AssertJUnit.assertFalse(altGraphDown);
        AssertJUnit.assertEquals(1, maxClickCount);
    } finally {
        Logger.getLogger(DeviceMouseTest.class.getName()).info(mouseText.toString());
        moveCursorAway();
    }
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:24,代碼來源:DeviceMouseTest.java

示例2: clickWithAlt

import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void clickWithAlt() throws Throwable {
    try {
        mouseText.setLength(0);
        EventQueueWait.requestFocus(button);
        driver.pressKey(button, JavaAgentKeys.ALT);
        driver.click(button, Buttons.LEFT, 1, 0, 0);
        driver.releaseKey(button, JavaAgentKeys.ALT);
        new DeviceTest.WaitWithoutException("Waiting for events to be processed") {
            @Override public boolean until() {
                return buttonClicked;
            }
        };
        AssertJUnit.assertTrue(buttonClicked);
        AssertJUnit.assertEquals(MouseEvent.BUTTON1, clickedButton);
        AssertJUnit.assertTrue(altDown);
        AssertJUnit.assertFalse(metaDown);
        AssertJUnit.assertFalse(controlDown);
        AssertJUnit.assertFalse(shiftDown);
        AssertJUnit.assertFalse(altGraphDown);
        AssertJUnit.assertEquals(1, maxClickCount);
    } finally {
        Logger.getLogger(DeviceMouseTest.class.getName()).info(mouseText.toString());
        moveCursorAway();
    }
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:26,代碼來源:DeviceMouseTest.java

示例3: doubleClick

import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void doubleClick() {
    try {
        mouseText.setLength(0);
        buttonClicked = false;
        EventQueueWait.requestFocus(button);
        driver.click(button, Buttons.LEFT, 2, 0, 0);
        new DeviceTest.WaitWithoutException("Waiting for events to be processed") {
            @Override public boolean until() {
                return maxClickCount == 2;
            }
        };
        AssertJUnit.assertTrue(buttonClicked);
        AssertJUnit.assertEquals(MouseEvent.BUTTON1, clickedButton);
        AssertJUnit.assertFalse(altDown);
        AssertJUnit.assertFalse(metaDown);
        AssertJUnit.assertFalse(controlDown);
        AssertJUnit.assertFalse(shiftDown);
        AssertJUnit.assertFalse(altGraphDown);
        AssertJUnit.assertEquals(2, maxClickCount);
    } finally {
        Logger.getLogger(DeviceMouseTest.class.getName()).info(mouseText.toString());
        moveCursorAway();
    }
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:25,代碼來源:DeviceMouseTest.java

示例4: mouseDown

import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void mouseDown() throws Throwable {
    try {
        mouseText.setLength(0);
        EventQueueWait.requestFocus(button);
        driver.buttonDown(button, Buttons.LEFT, 0, 0);
        new DeviceTest.WaitWithoutException("Waiting for events to be processed") {
            @Override public boolean until() {
                return buttonPressed;
            }
        };
        AssertJUnit.assertFalse(buttonClicked);
        AssertJUnit.assertTrue(buttonPressed);
        AssertJUnit.assertEquals(MouseEvent.BUTTON1, pressedButton);
        AssertJUnit.assertFalse(altDown);
        AssertJUnit.assertFalse(metaDown);
        AssertJUnit.assertFalse(controlDown);
        AssertJUnit.assertFalse(shiftDown);
        AssertJUnit.assertFalse(altGraphDown);
    } finally {
        Logger.getLogger(DeviceMouseTest.class.getName()).info(mouseText.toString());
        driver.buttonUp(button, Buttons.LEFT, 0, 0);
        moveCursorAway();
    }
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:25,代碼來源:DeviceMouseTest.java

示例5: altContextClick

import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void altContextClick() {
    try {
        buttonClicked = false;
        EventQueueWait.requestFocus(button);
        driver.pressKey(button, JavaAgentKeys.ALT);
        driver.click(button, Buttons.RIGHT, 1, 0, 0);
        driver.releaseKey(button, JavaAgentKeys.ALT);
        new DeviceTest.WaitWithoutException("Waiting for events to be processed") {
            @Override public boolean until() {
                return buttonClicked;
            }
        };
        AssertJUnit.assertTrue(buttonClicked);
        AssertJUnit.assertEquals(MouseEvent.BUTTON3, clickedButton);
        AssertJUnit.assertFalse(popupTriggerClicked);
        AssertJUnit.assertTrue(altDown);
        AssertJUnit.assertFalse(metaDown);
        AssertJUnit.assertFalse(controlDown);
        AssertJUnit.assertFalse(shiftDown);
        AssertJUnit.assertFalse(altGraphDown);
        AssertJUnit.assertEquals(1, maxClickCount);
    } finally {
        Logger.getLogger(DeviceMouseTest.class.getName()).info(mouseText.toString());
        moveCursorAway();
    }
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:27,代碼來源:DeviceMouseTest.java

示例6: isDisplayedTabItem

import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void isDisplayedTabItem() throws Throwable {
    SwingUtilities.invokeAndWait(new Runnable() {
        @Override public void run() {
            frame.setSize(100, frame.getHeight());
        }
    });
    driver = new JavaDriver();
    final List<WebElement> tabs = driver.findElements(By.cssSelector("tabbed-pane::nth-tab(4)"));
    AssertJUnit.assertEquals(1, tabs.size());
    new Wait("Wait for tab4 to non-displayable") {
        @Override public boolean until() {
            return !tabs.get(0).isDisplayed();
        }
    };
    AssertJUnit.assertFalse(tabs.get(0).isDisplayed());
    List<WebElement> tabs2 = driver.findElements(By.cssSelector("tabbed-pane::nth-tab(1)"));
    AssertJUnit.assertEquals(1, tabs.size());
    AssertJUnit.assertTrue(tabs2.get(0).isDisplayed());
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:20,代碼來源:JTabbedPaneTest.java

示例7: clickTabItem

import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void clickTabItem() throws Throwable {
    SwingUtilities.invokeAndWait(new Runnable() {
        @Override public void run() {
            frame.setSize(100, frame.getHeight());
        }
    });
    driver = new JavaDriver();
    final List<WebElement> tabs = driver.findElements(By.cssSelector("tabbed-pane::nth-tab(4)"));
    AssertJUnit.assertEquals(1, tabs.size());
    new Wait("Wait for tab4 to non-displayable") {
        @Override public boolean until() {
            return !tabs.get(0).isDisplayed();
        }
    };
    AssertJUnit.assertFalse(tabs.get(0).isDisplayed());
    tabs.get(0).click();
    AssertJUnit.assertTrue(tabs.get(0).isDisplayed());
    WebElement tabbedPane = driver.findElement(By.cssSelector("tabbed-pane"));
    AssertJUnit.assertEquals("" + 3, tabbedPane.getAttribute("selectedIndex"));
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:21,代碼來源:JTabbedPaneTest.java

示例8: isEnabled

import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void isEnabled() 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.assertTrue(element1.isEnabled());
    SwingUtilities.invokeAndWait(new Runnable() {
        @Override public void run() {
            button.setEnabled(false);
        }
    });
    EventQueueWait.waitTillDisabled(button);
    AssertJUnit.assertFalse(element1.isEnabled());
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:19,代碼來源:JavaDriverTest.java

示例9: getAttribute

import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void getAttribute() 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.assertTrue(Boolean.valueOf(element1.getAttribute("enabled")));
    SwingUtilities.invokeAndWait(new Runnable() {
        @Override public void run() {
            button.setEnabled(false);
        }
    });
    EventQueueWait.waitTillDisabled(button);
    AssertJUnit.assertFalse(Boolean.valueOf(element1.getAttribute("enabled")));
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:19,代碼來源:JavaDriverTest.java

示例10: isDisplayed

import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void isDisplayed() 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.assertTrue(element1.isDisplayed());
    SwingUtilities.invokeAndWait(new Runnable() {
        @Override public void run() {
            button.setVisible(false);
        }
    });
    EventQueueWait.waitTillInvisibled(button);
    AssertJUnit.assertFalse(element1.isDisplayed());
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:19,代碼來源:JavaDriverTest.java

示例11: click

import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void click() throws Throwable {
    AssertJUnit.assertFalse(buttonClicked);
    ejButton.click();
    new WaitWithoutException("Waiting for the button to be clicked") {
        @Override public boolean until() {
            return buttonClicked;
        }
    };
    AssertJUnit.assertTrue(buttonClicked);
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:11,代碼來源:JavaElementTest.java

示例12: isEnabled

import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void isEnabled() throws Throwable {
    AssertJUnit.assertTrue(ejButton.isEnabled());
    SwingUtilities.invokeAndWait(new Runnable() {
        @Override public void run() {
            button.setEnabled(false);
        }
    });
    AssertJUnit.assertFalse(ejButton.isEnabled());
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:10,代碼來源:JavaElementTest.java

示例13: isDisplayed

import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void isDisplayed() throws Throwable {
    AssertJUnit.assertTrue(ejButton.isDisplayed());
    SwingUtilities.invokeAndWait(new Runnable() {
        @Override public void run() {
            button.setVisible(false);
        }
    });
    AssertJUnit.assertFalse(ejButton.isDisplayed());
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:10,代碼來源:JavaElementTest.java

示例14: clickWithAltControl

import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void clickWithAltControl() throws Throwable {
    try {
        mouseText.setLength(0);
        EventQueueWait.requestFocus(button);
        driver.pressKey(button, JavaAgentKeys.ALT);
        driver.pressKey(button, JavaAgentKeys.CONTROL);
        driver.click(button, Buttons.LEFT, 1, 0, 0);
        driver.releaseKey(button, JavaAgentKeys.CONTROL);
        driver.releaseKey(button, JavaAgentKeys.ALT);
        new DeviceTest.WaitWithoutException("Waiting for events to be processed") {
            @Override public boolean until() {
                return buttonClicked;
            }
        };
        AssertJUnit.assertTrue(buttonClicked);
        AssertJUnit.assertEquals(MouseEvent.BUTTON1, clickedButton);
        AssertJUnit.assertTrue(altDown);
        AssertJUnit.assertFalse(metaDown);
        AssertJUnit.assertTrue(controlDown);
        AssertJUnit.assertFalse(shiftDown);
        AssertJUnit.assertFalse(altGraphDown);
        AssertJUnit.assertEquals(1, maxClickCount);
    } finally {
        Logger.getLogger(DeviceMouseTest.class.getName()).info(mouseText.toString());
        moveCursorAway();
    }
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:28,代碼來源:DeviceMouseTest.java

示例15: testPrefixAndUri1

import org.testng.AssertJUnit; //導入方法依賴的package包/類
@Test
public void testPrefixAndUri1() {
    boolean hasdc = false;
    boolean hasdc1 = false;
    boolean hasdc2 = false;
    boolean hasdcnew = false;
    NamespaceSupport nssupport = new NamespaceSupport();

    nssupport.pushContext();
    nssupport.declarePrefix("dc", "http://www.purl.org/dc");

    nssupport.pushContext();
    nssupport.declarePrefix("dc1", "http://www.purl.org/dc");
    nssupport.declarePrefix("dc2", "http://www.purl.org/dc2");
    nssupport.declarePrefix("dcnew", "http://www.purl.org/dcnew");

    Enumeration enu1 = nssupport.getDeclaredPrefixes();
    while (enu1.hasMoreElements()) {
        String str = (String) enu1.nextElement();
        if (str.equals("dc")) {
            hasdc = true;
        } else if (str.equals("dc1")) {
            hasdc1 = true;
        } else if (str.equals("dc2")) {
            hasdc2 = true;
        } else if (str.equals("dcnew")) {
            hasdcnew = true;
        }
    }
    AssertJUnit.assertTrue(hasdcnew && hasdc1 && hasdc2);
    AssertJUnit.assertFalse(hasdc);
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:33,代碼來源:NSSupportTest.java


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