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


Java SkipException類代碼示例

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


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

示例1: whetherMenusAreAccessible

import org.testng.SkipException; //導入依賴的package包/類
@Override public void whetherMenusAreAccessible() throws Throwable {
    Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
        @Override public void eventDispatched(AWTEvent event) {
            System.err.println(event);
        }
    }, AWTEvent.KEY_EVENT_MASK);
    if (Platform.getCurrent() == Platform.MAC && System.getProperty("java.version", "").matches("1.[78].*")) {
        throw new SkipException("Menu mneomonics are not handled on Mac under Java 1.7+");
    }
    exitItemCalled = false;
    driver.sendKeys(textField, JavaAgentKeys.chord(JavaAgentKeys.ALT, "f"));
    new WaitWithoutException("Waiting for exit item to be shown") {
        @Override public boolean until() {
            return exitItem.isShowing();
        }
    };
    driver.click(exitItem, Buttons.LEFT, 1, 0, 0);
    new WaitWithoutException("Waiting for exit item to be called") {
        @Override public boolean until() {
            return exitItemCalled;
        }
    };
    AssertJUnit.assertEquals(true, exitItemCalled);
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:25,代碼來源:EventQueueDeviceKBTest.java

示例2: whetherMenusAreAccessible

import org.testng.SkipException; //導入依賴的package包/類
@Override public void whetherMenusAreAccessible() throws Throwable {
    if (Platform.getCurrent() == Platform.MAC && System.getProperty("java.version", "").matches("1.[78].*")) {
        throw new SkipException("Menu mneomonics are not handled on Mac under Java 1.7+");
    }
    exitItemCalled = false;
    driver.sendKeys(textField, JavaAgentKeys.chord(JavaAgentKeys.ALT, "f"));
    new WaitWithoutException("Waiting for exit item to be called") {
        @Override public boolean until() {
            return menu.isPopupMenuVisible();
        }
    };
    driver.sendKeys(exitItem, JavaAgentKeys.ENTER);
    new WaitWithoutException("Waiting for exit item to be called") {
        @Override public boolean until() {
            return exitItemCalled;
        }
    };
    AssertJUnit.assertEquals(true, exitItemCalled);
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:20,代碼來源:RobotDeviceKBTest.java

示例3: contextclickOnTextfield

import org.testng.SkipException; //導入依賴的package包/類
public void contextclickOnTextfield() throws Throwable {
    if (Platform.getCurrent().is(Platform.MAC)) {
        throw new SkipException("Context clicking a textfield on mac and java 1.7+ doesn't work and don't know why!!!");
    }
    try {
        Thread.sleep(10000);
        textFieldClicked = false;
        driver.click(textField, Buttons.RIGHT, 1, 1, 1);
        new DeviceTest.WaitWithoutException("Waiting for the text field to be clicked") {
            @Override public boolean until() {
                return textFieldClicked;
            }
        };
        AssertJUnit.assertTrue(textFieldClicked);
    } finally {
        Logger.getLogger(DeviceMouseTest.class.getName()).info(tfMouseText.toString());
    }
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:19,代碼來源:DeviceMouseTest.java

示例4: sendKeysKeyboardMap

import org.testng.SkipException; //導入依賴的package包/類
public void sendKeysKeyboardMap() throws Throwable {
    if (System.getProperty("java.version", "").matches("1.7.*") && isRobot()) {
        throw new SkipException("Fails on Java 1.7, looks like some problem with Robot in 1.7");
    }
    kss.clear();
    driver.sendKeys(textField, "A");
    new WaitWithoutException("Waiting for the keypress") {
        @Override public boolean until() {
            try {
                return kss.toString().contains(KeyStroke.getKeyStroke("released SHIFT").toString());
            } catch (Throwable t) {
                return false;
            }
        }
    };
    List<KeyStroke> expected = Arrays.asList(KeyStroke.getKeyStroke("shift pressed SHIFT"),
            KeyStroke.getKeyStroke("shift pressed A"), KeyStroke.getKeyStroke("shift typed A"),
            KeyStroke.getKeyStroke("shift released A"), KeyStroke.getKeyStroke("released SHIFT"));
    AssertJUnit.assertEquals(expected.toString(), kss.toString());
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:21,代碼來源:DeviceKBTest.java

示例5: sendKeysSelectAll

import org.testng.SkipException; //導入依賴的package包/類
public void sendKeysSelectAll() throws Throwable {
    if (System.getProperty("java.version", "").matches("1.7.*") && isRobot()) {
        throw new SkipException("Fails on Java 1.7, looks like some problem with Robot in 1.7");
    }
    driver.sendKeys(textField, "Hello World");
    driver.sendKeys(textField, getOSKey(), "a");
    driver.sendKeys(textField, JavaAgentKeys.NULL);
    new WaitWithoutException("Waiting for the select event") {
        @Override public boolean until() {
            try {
                Object text = EventQueueWait.call(textField, "getSelectedText");
                return text != null && text.equals("Hello World");
            } catch (NoSuchMethodException e) {
                e.printStackTrace();
                return false;
            }
        }
    };
    String expected = "Hello World";
    AssertJUnit.assertEquals(expected, EventQueueWait.<String> call(textField, "getSelectedText"));
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:22,代碼來源:DeviceKBTest.java

示例6: whetherMenusAreAccessible

import org.testng.SkipException; //導入依賴的package包/類
public void whetherMenusAreAccessible() throws Throwable {
    if (Platform.getCurrent() == Platform.MAC && System.getProperty("java.version", "").matches("1.[78].*")) {
        throw new SkipException("Menu mneomonics are not handled on Mac under Java 1.7+");
    }
    exitItemCalled = false;
    driver.sendKeys(textField, JavaAgentKeys.chord(JavaAgentKeys.ALT, "f"));
    new WaitWithoutException("Waiting for exit item to be called") {
        @Override public boolean until() {
            return menu.isPopupMenuVisible();
        }
    };
    driver.sendKeys(exitItem, JavaAgentKeys.ENTER);
    new WaitWithoutException("Waiting for exit item to be called") {
        @Override public boolean until() {
            return exitItemCalled;
        }
    };
    AssertJUnit.assertEquals(true, exitItemCalled);
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:20,代碼來源:DeviceKBTest.java

示例7: executeWSCommand

import org.testng.SkipException; //導入依賴的package包/類
public void executeWSCommand() throws Throwable {
    if (OS.isFamilyWindows()) {
        throw new SkipException("Test not valid for Windows");
    }
    JavaProfile profile = new JavaProfile(LaunchMode.JAVA_WEBSTART).addWSArgument("-verbose").addVMArgument("-Dx.y.z=hello");
    final CommandLine commandLine = profile.getCommandLine();
    AssertJUnit.assertNotNull(commandLine);
    AssertJUnit.assertTrue(commandLine.toString().contains("-javaagent:"));
    AssertJUnit.assertTrue(commandLine.toString().contains("-verbose"));
    AssertJUnit.assertTrue(commandLine.toString().contains("-Dx.y.z=hello"));
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    commandLine.copyOutputTo(baos);
    commandLine.executeAsync();
    new Wait("Waiting till the command is complete") {
        @Override public boolean until() {
            return !commandLine.isRunning();
        }
    };
    BufferedReader reader = new BufferedReader(new StringReader(new String(baos.toByteArray())));
    String line = reader.readLine();
    while (line != null && !line.contains("Web Start")) {
        line = reader.readLine();
    }
    AssertJUnit.assertTrue(line.contains("Web Start"));
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:26,代碼來源:JavaProfileTest.java

示例8: shouldThrowHiddenMalformedURLException

import org.testng.SkipException; //導入依賴的package包/類
@Test
public void shouldThrowHiddenMalformedURLException() {
    XmlConfig config = new XmlConfig(new HashMap<String, String>() {
        {
            put(BROWSER_NAME, "firefox");
            put(PLATFORM_NAME, "ANY");
        }
    });

    Browser browser = spy(firefox);
    doReturn("localhost").when(browser).url();

    assertThat(catchThrowable(() -> defaultFactory.createDriver(browser, config)))
            .isInstanceOf(SkipException.class)
            .hasStackTraceContaining("java.net.MalformedURLException");
}
 
開發者ID:sskorol,項目名稱:webdriver-supplier,代碼行數:17,代碼來源:CoreTests.java

示例9: testIndexedCorola

import org.testng.SkipException; //導入依賴的package包/類
@Test
public void testIndexedCorola() throws IOException, SAXException, ParserConfigurationException, GGSException {
    IndexedLuceneCorpus t;
    try {
        t = new IndexedLuceneCorpus(new File("TestData/inputCorpora/corola.index"));
    } catch (IOException e) {
        throw new SkipException("indexed corola not present");
    }
    Grammar g = new Grammar();
    //g.load(new FileInputStream("TestData/inputGrammars/roNPchunker_grammar.ggf"));
    //g.load(new FileInputStream("TestData/inputGrammars/npexample.ggf"));
    g.load(new FileInputStream("TestData/inputGrammars/verysimplegrammar.ggf"));

    SparseBitSet.compressionPolicy = SparseBitSet.SparseBitSetCompressionPolicy.none;
    CompiledGrammar compiledGrammar = new CompiledGrammar(g);
    List<Match> matches = compiledGrammar.GetMatches(t, true);

    assert (matches.size() == matches.size());
}
 
開發者ID:radsimu,項目名稱:UaicNlpToolkit,代碼行數:20,代碼來源:GrammarTest.java

示例10: testOnPingIncorrect

import org.testng.SkipException; //導入依賴的package包/類
public void testOnPingIncorrect(boolean fin, boolean rsv1, boolean rsv2,
                                boolean rsv3, ByteBuffer data) {
    if (fin && !rsv1 && !rsv2 && !rsv3 && data.remaining() <= 125) {
        throw new SkipException("Correct frame");
    }
    CompletableFuture<WebSocket> webSocket = new CompletableFuture<>();
    MockChannel channel = new MockChannel.Builder()
            .provideFrame(fin, rsv1, rsv2, rsv3, Opcode.PING, data)
            .expectClose((code, reason) ->
                    Integer.valueOf(1002).equals(code) && "".equals(reason))
            .build();
    MockListener listener = new MockListener.Builder()
            .expectOnOpen((ws) -> true)
            .expectOnError((ws, error) -> error instanceof ProtocolException)
            .build();
    webSocket.complete(newWebSocket(channel, listener));
    checkExpectations(500, TimeUnit.MILLISECONDS, channel, listener);
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:19,代碼來源:PingTest.java

示例11: setup

import org.testng.SkipException; //導入依賴的package包/類
@BeforeClass
public void setup() throws DrmaaException, IOException {
    if (System.getProperty("org.ggf.drmaa.SessionFactory") == null) {
        throw new SkipException(
            "Could not find system property org.ggf.drmaa.SessionFactory."
        );
    }

    executorService = Executors.newScheduledThreadPool(4);

    drmaaSession = SessionFactory.getFactory().getSession();
    drmaaSession.init("");

    tempDir = Files.createTempDirectory(getClass().getSimpleName());
    drmaaExecutor = new DrmaaSimpleModuleExecutor.Builder(drmaaSession, tempDir, DummyCommandProvider.INSTANCE,
            executorService, executorService)
        .build();
}
 
開發者ID:cloudkeeper-project,項目名稱:cloudkeeper,代碼行數:19,代碼來源:ITDrmaaSimpleModuleExecutor.java

示例12: canFilterImages

import org.testng.SkipException; //導入依賴的package包/類
@Test(dependsOnMethods = "canListImages")
public void canFilterImages() throws IOException {
    try (CloudApiConnectionContext context = cloudApi.createConnectionContext()) {
        final String expectedOs = "linux";
        ImageFilter pf = new ImageFilter()
                .setOs(expectedOs);

        final Collection<Image> images = imagesApi.list(context, pf);

        if (images.isEmpty()) {
            String msg = "Verify that there is at least a single image";
            throw new SkipException(msg);
        }

        for (Image pkg : images) {
            logger.debug("Found image: {}", pkg.getName());

            assertEquals(pkg.getOs(), expectedOs,
                    "OS didn't match filter. Images:\n" + images);
        }
    }
}
 
開發者ID:joyent,項目名稱:java-triton,代碼行數:23,代碼來源:ImagesIT.java

示例13: setUp

import org.testng.SkipException; //導入依賴的package包/類
/**
 * Setup TestNG method to create Rapture login object and objects.
 *
 * @param RaptureURL
 *            Passed in from <env>_testng.xml suite file
 * @param RaptureUser
 *            Passed in from <env>_testng.xml suite file
 * @param RapturePassword
 *            Passed in from <env>_testng.xml suite file
 * @return none
 */
@BeforeClass(groups = { "structured", "postgres","nightly"  })
@Parameters({ "RaptureURL", "RaptureUser", "RapturePassword" })
public void setUp(@Optional("http://localhost:8665/rapture") String url, @Optional("rapture") String username, @Optional("rapture") String password) {

    // If running from eclipse set env var -Penv=docker or use the following
    // url variable settings:
    // url = "http://192.168.99.100:8665/rapture"; // docker
    // url="http://localhost:8665/rapture";

    try {
        helper = new IntegrationTestHelper(url, username, password);
    } catch (Exception e) {
        throw new SkipException("Cannot connect to IntegrationTestHelper " + e.getMessage());
    }
    structApi = helper.getStructApi();
    admin = helper.getAdminApi();
    pluginApi = helper.getPluginApi();
    if (!admin.doesUserExist(user)) {
        admin.addUser(user, "Another User", MD5Utils.hash16(user), "[email protected]");
    }
    repoUri = helper.getRandomAuthority(Scheme.DOCUMENT);
    helper.configureTestRepo(repoUri, "MONGODB"); // TODO Make this configurable
}
 
開發者ID:RapturePlatform,項目名稱:Rapture,代碼行數:35,代碼來源:StructuredApiIntegrationTests.java

示例14: testVisit_reference

import org.testng.SkipException; //導入依賴的package包/類
@Test
public void testVisit_reference() throws Exception {
    String testInput =
            "Here's a [link] [1] with an ampersand in the URL.\n\n" +
            "Here's a link with an amersand in the link text: [AT&T] [2].\n\n" +
            "Here's an inline [link](</script?foo=1&bar=2>).\n\n\n" +
            "[1]: http://example.com/?foo=1&bar=2\n" +
            "[2]: http://att.com/  \"AT&T\"\n";
    List<String> expected = new ArrayList<>();
    expected.add("Here's a [link] [1] with an ampersand in the URL.");
    expected.add("Here's a link with an amersand in the link text: [AT&T] [2].");
    expected.add("Here's an inline [link](</script?foo=1&bar=2>).");
    expected.add("[1]: http://example.com/?foo=1&bar=2");
    expected.add("[2]: http://att.com/  \"AT&T\"");
    MockFilter filter = new MockFilter();
    filter.process(testInput);
    throw new SkipException("Skip acceptance test.(known bug)");
    // FIXME:
    //  Entry[2] becomes "Here's an inline [link](/script?foo=1&bar=2)."
    //
    //assertEquals(filter.getEntries(), expected);
    //assertEquals(filter.getOutbuf(), testInput);
}
 
開發者ID:miurahr,項目名稱:omegat-markdown-plugin,代碼行數:24,代碼來源:Reference.java

示例15: nativeMatcherExactTest

import org.testng.SkipException; //導入依賴的package包/類
@Test(dataProvider = "pathMatcherData")
public static void nativeMatcherExactTest(@NotNull String pattern, @NotNull String path, @Nullable Boolean ignored, @Nullable Boolean expectedMatch) throws InvalidPatternException, IOException, InterruptedException {
  Path temp = Files.createTempDirectory("git-matcher");
  try {
    if (new ProcessBuilder()
        .directory(temp.toFile())
        .command("git", "init", ".")
        .start()
        .waitFor() != 0) {
      throw new SkipException("Can't find git");
    }
    Files.write(temp.resolve(".gitattributes"), (pattern + " test\n").getBytes(StandardCharsets.UTF_8));
    byte[] output = ByteStreams.toByteArray(
        new ProcessBuilder()
            .directory(temp.toFile())
            .command("git", "check-attr", "-a", "--", path)
            .start()
            .getInputStream()
    );
    Assert.assertEquals(output.length > 0, expectedMatch == Boolean.TRUE);
  } finally {
    Files.walkFileTree(temp, new DeleteTreeVisitor());
  }
}
 
開發者ID:bozaro,項目名稱:git-lfs-migrate,代碼行數:25,代碼來源:WildcardTest.java


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