当前位置: 首页>>代码示例>>Java>>正文


Java Issue类代码示例

本文整理汇总了Java中ru.yandex.qatools.allure.annotations.Issue的典型用法代码示例。如果您正苦于以下问题:Java Issue类的具体用法?Java Issue怎么用?Java Issue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Issue类属于ru.yandex.qatools.allure.annotations包,在下文中一共展示了Issue类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createIssuesArray

import ru.yandex.qatools.allure.annotations.Issue; //导入依赖的package包/类
private Issue[] createIssuesArray(List<String> issues) {
    ArrayList<Issue> values = new ArrayList<>();
    for (final String issue : issues) {
        values.add(new Issue() {
            @Override
            public Class<Issue> annotationType() {
                return Issue.class;
            }

            @Override
            public String value() {
                return issue;
            }
        });
    }

    return values.toArray(new Issue[values.size()]);
}
 
开发者ID:kirlionik,项目名称:allure-cucumber-plugin,代码行数:19,代码来源:AllureReporter.java

示例2: getIssueOrTestCaseIdValue

import ru.yandex.qatools.allure.annotations.Issue; //导入依赖的package包/类
/**
 * Get issue or test case ID for a method.
 *
 * @param method the method to check for test ID annotations.
 * @return Optional of the {@link TestCaseId} or {@link Issue} value.
 * @throws IllegalStateException if {@link TestCaseId} and {@link Issue}
 *                               are both specified inconstantly.
 */
public static Optional<String> getIssueOrTestCaseIdValue(Method method) {
    TestCaseId tcIdAnnotation = method.getAnnotation(TestCaseId.class);
    Issue issueAnnotation = method.getAnnotation(Issue.class);

    if (!isNull(issueAnnotation) && !isNull(tcIdAnnotation)
            && !issueAnnotation.value().equals(tcIdAnnotation.value())) {
        throw new IllegalStateException(
                "TestCaseId and Issue annotation are both specified but "
                        + "not equal for method: " + method.toString());
    }

    if (!isNull(issueAnnotation)) {
        return Optional.of(issueAnnotation.value());
    } else if (!isNull(tcIdAnnotation)) {
        return Optional.of(tcIdAnnotation.value());
    } else {
        return Optional.empty();
    }
}
 
开发者ID:Frameworkium,项目名称:frameworkium-core,代码行数:28,代码来源:TestIdUtils.java

示例3: component_example_test

import ru.yandex.qatools.allure.annotations.Issue; //导入依赖的package包/类
@Issue("CET-1")
@Test(description = "Simple test showing the use of components")
public final void component_example_test() {

    // Navigate to homepage then use the nav bar to go to the explore page
    ExplorePage explorePage = HomePage.open().then().with().theHeader().clickExplore();

    // not a great assertion, improving this is an exercise for the reader
    assertThat(explorePage.getTitle()).isEqualTo("Explore · GitHub");

    // Search for "Selenium" and check SeleniumHQ/selenium is one of the returned repos.
    List<String> searchResults = explorePage.with().theHeader()
            .search("Selenium")
            .getRepoNames();

    assertThat(searchResults).contains("SeleniumHQ/selenium");
}
 
开发者ID:Frameworkium,项目名称:frameworkium-core,代码行数:18,代码来源:ComponentExampleTest.java

示例4: testFilterRequestForwarded

import ru.yandex.qatools.allure.annotations.Issue; //导入依赖的package包/类
@Test
@Issue("issues/275")
public void testFilterRequestForwarded() throws IOException, ServletException, ParserConfigurationException, SAXException, ScriptException {

    SniffyFilter filter = new SniffyFilter();
    filter.init(getFilterConfig());

    answerWithContent("<html><head><title>Title</title></head><body>Hello, World!</body></html>");

    FilterChain outerFilterChain = mock(FilterChain.class);
    doAnswer(invocation -> {
        HttpServletRequest request = (HttpServletRequest) invocation.getArguments()[0];
        HttpServletResponse response = (HttpServletResponse) invocation.getArguments()[1];
        filter.doFilter(request, response, filterChain);
        return null;
    }).when(outerFilterChain).doFilter(any(), any());

    filter.doFilter(requestWithPathAndQueryParameter, httpServletResponse, outerFilterChain);

    String sniffyJsSrc = extractSniffyJsSrc(httpServletResponse.getContentAsString());
    assertTrue(sniffyJsSrc + " must be a relative path", sniffyJsSrc.startsWith("../" + SNIFFY_URI_PREFIX));

    String requestDetailsUrl = httpServletResponse.getHeader(HEADER_REQUEST_DETAILS);

    assertTrue(requestDetailsUrl + " must be a relative path", requestDetailsUrl.startsWith("../" + REQUEST_URI_PREFIX));
}
 
开发者ID:sniffy,项目名称:sniffy,代码行数:27,代码来源:SniffyFilterTest.java

示例5: testGetBestRelativeURIForPathMapping

import ru.yandex.qatools.allure.annotations.Issue; //导入依赖的package包/类
@Test
@Issue("issues/272")
public void testGetBestRelativeURIForPathMapping() {

    HttpServletRequest req = mock(HttpServletRequest.class);

    when(req.getRequestURI()).thenReturn("/application/bar/baz");
    when(req.getContextPath()).thenReturn("/application");
    when(req.getServletPath()).thenReturn("/bar");
    when(req.getPathInfo()).thenReturn("/baz");

    ServletContext sc = mock(ServletContext.class);
    when(req.getServletContext()).thenReturn(sc);

    Map<String,ServletRegistration> servletRegistrations = new HashMap<>();
    when(sc.getServletRegistrations()).thenAnswer(inv -> servletRegistrations);

    ServletRegistration sr = mock(ServletRegistration.class);
    when(sr.getMappings()).thenReturn(Collections.singletonList("/bar/*"));
    servletRegistrations.put("ServletName", sr);

    assertEquals("/baz", SniffyRequestProcessor.getBestRelativeURI(req));

}
 
开发者ID:sniffy,项目名称:sniffy,代码行数:25,代码来源:SniffyRequestProcessorTest.java

示例6: testGetBestRelativeURIForPathMappingWithoutTrailingSlash

import ru.yandex.qatools.allure.annotations.Issue; //导入依赖的package包/类
@Test
@Issue("issues/272")
public void testGetBestRelativeURIForPathMappingWithoutTrailingSlash() {

    HttpServletRequest req = mock(HttpServletRequest.class);

    when(req.getRequestURI()).thenReturn("/application/bar");
    when(req.getContextPath()).thenReturn("/application");
    when(req.getServletPath()).thenReturn("/bar");
    when(req.getPathInfo()).thenReturn(null);

    ServletContext sc = mock(ServletContext.class);
    when(req.getServletContext()).thenReturn(sc);

    Map<String,ServletRegistration> servletRegistrations = new HashMap<>();
    when(sc.getServletRegistrations()).thenAnswer(inv -> servletRegistrations);

    ServletRegistration sr = mock(ServletRegistration.class);
    when(sr.getMappings()).thenReturn(Collections.singletonList("/bar/*"));
    servletRegistrations.put("ServletName", sr);

    assertEquals("", SniffyRequestProcessor.getBestRelativeURI(req));

}
 
开发者ID:sniffy,项目名称:sniffy,代码行数:25,代码来源:SniffyRequestProcessorTest.java

示例7: testGetBestRelativeURIForExactMatch

import ru.yandex.qatools.allure.annotations.Issue; //导入依赖的package包/类
@Test
@Issue("issues/272")
public void testGetBestRelativeURIForExactMatch() {

    HttpServletRequest req = mock(HttpServletRequest.class);

    when(req.getRequestURI()).thenReturn("/application/bar/");
    when(req.getContextPath()).thenReturn("/application");
    when(req.getServletPath()).thenReturn("/bar/");
    when(req.getPathInfo()).thenReturn(null);

    ServletContext sc = mock(ServletContext.class);
    when(req.getServletContext()).thenReturn(sc);

    Map<String,ServletRegistration> servletRegistrations = new HashMap<>();
    when(sc.getServletRegistrations()).thenAnswer(inv -> servletRegistrations);

    ServletRegistration sr = mock(ServletRegistration.class);
    when(sr.getMappings()).thenReturn(Collections.singletonList("/bar/"));
    servletRegistrations.put("ServletName", sr);

    assertEquals("/", SniffyRequestProcessor.getBestRelativeURI(req));

}
 
开发者ID:sniffy,项目名称:sniffy,代码行数:25,代码来源:SniffyRequestProcessorTest.java

示例8: testGetBestRelativeURIForExtensionMapping

import ru.yandex.qatools.allure.annotations.Issue; //导入依赖的package包/类
@Test
@Issue("issues/272")
public void testGetBestRelativeURIForExtensionMapping() {

    HttpServletRequest req = mock(HttpServletRequest.class);

    when(req.getRequestURI()).thenReturn("/application/bar/baz.do");
    when(req.getContextPath()).thenReturn("/application");
    when(req.getServletPath()).thenReturn("/bar/baz.do");
    when(req.getPathInfo()).thenReturn(null);

    ServletContext sc = mock(ServletContext.class);
    when(req.getServletContext()).thenReturn(sc);

    Map<String,ServletRegistration> servletRegistrations = new HashMap<>();
    when(sc.getServletRegistrations()).thenAnswer(inv -> servletRegistrations);

    ServletRegistration sr = mock(ServletRegistration.class);
    when(sr.getMappings()).thenReturn(Collections.singletonList("*.do"));
    servletRegistrations.put("ServletName", sr);

    assertEquals("/bar/baz.do", SniffyRequestProcessor.getBestRelativeURI(req));

}
 
开发者ID:sniffy,项目名称:sniffy,代码行数:25,代码来源:SniffyRequestProcessorTest.java

示例9: getLinks

import ru.yandex.qatools.allure.annotations.Issue; //导入依赖的package包/类
public List<Link> getLinks() {
    final Method method = getMethod();
    final List<Link> links = new ArrayList<>();
    links.addAll(Allure1Utils.getLinks(method, TestCaseId.class, Allure1Utils::createLinks));
    links.addAll(Allure1Utils.getLinks(method, Issue.class, Allure1Utils::createLinks));
    links.addAll(Allure1Utils.getLinks(method, Issues.class, Allure1Utils::createLinks));
    return links;
}
 
开发者ID:allure-framework,项目名称:allure-java,代码行数:9,代码来源:Allure1Annotations.java

示例10: testSomething

import ru.yandex.qatools.allure.annotations.Issue; //导入依赖的package包/类
@Title("testcase")
@Description("testcase description")
@Issue("ISSUE-2")
@Issues(@Issue("ISSUE-22"))
@TestCaseId("TEST-1")
@Stories("story2")
@Features("feature2")
@Severity(SeverityLevel.CRITICAL)
@org.testng.annotations.Test
public void testSomething() {

}
 
开发者ID:allure-framework,项目名称:allure-java,代码行数:13,代码来源:Allure1TestCaseAspectsTest.java

示例11: testAddTodoItem

import ru.yandex.qatools.allure.annotations.Issue; //导入依赖的package包/类
@Issue("TODOMVC-1")
@Stories("Add a Todo Item")
@Test(description = "Add an item")
public void testAddTodoItem() {

    boolean iResult =  BasicTodoMvcPage.open().then()
            .addTodoItem("FirstItem");

    Assert.assertTrue("1. I want to add a To-do item", iResult);

}
 
开发者ID:AdyKalra,项目名称:ToDoMVCEmberJS,代码行数:12,代码来源:TodoMVCTests.java

示例12: testEditTodoItem

import ru.yandex.qatools.allure.annotations.Issue; //导入依赖的package包/类
@Issue("TODOMVC-2")
@Stories("Edit a Todo Item")
@Test(description = "Edit an item")
public void testEditTodoItem() {
    itemName = "Item to be edited";
    BasicTodoMvcPage.open().then().addTodoItem(itemName);
    Assert.assertTrue("2. I want to edit the content of an existing To-do item", BasicTodoMvcPage.open().editTodoItem(itemName, "Item updated"));

}
 
开发者ID:AdyKalra,项目名称:ToDoMVCEmberJS,代码行数:10,代码来源:TodoMVCTests.java

示例13: testCompleteTodoItem

import ru.yandex.qatools.allure.annotations.Issue; //导入依赖的package包/类
@Issue("TODOMVC-3")
@Stories("testCompleteTodoItem")
@Test(description = "testCompleteTodoItem")
public void testCompleteTodoItem(){
    itemName = "Item created for completion";
    BasicTodoMvcPage.open().then().addTodoItem(itemName);
    Assert.assertTrue("3. I can complete a To-do by clicking inside the circle UI to the left of the To-do", BasicTodoMvcPage.open().completeTodoItem(itemName));
    BasicTodoMvcPage.open().clearAllCompletedTodoItems();
}
 
开发者ID:AdyKalra,项目名称:ToDoMVCEmberJS,代码行数:10,代码来源:TodoMVCTests.java

示例14: testReactivateTodoItem

import ru.yandex.qatools.allure.annotations.Issue; //导入依赖的package包/类
@Issue("TODOMVC-4")
@Stories("testReactivateTodoItem")
@Test(description = "testReactivateTodoItem")
public void testReactivateTodoItem(){
    itemName = "Item created for completion";
    BasicTodoMvcPage.open().then().addTodoItem(itemName);
    BasicTodoMvcPage.open().completeTodoItem("Item created for completion");
    Assert.assertTrue("4. I can re-activate a completed To-do by clicking inside the circle UI", BasicTodoMvcPage.open().reActivateItem(itemName));

}
 
开发者ID:AdyKalra,项目名称:ToDoMVCEmberJS,代码行数:11,代码来源:TodoMVCTests.java

示例15: testAddSecondTodoItem

import ru.yandex.qatools.allure.annotations.Issue; //导入依赖的package包/类
@Issue("TODOMVC-5")
@Stories("testAddSecondTodoItem")
@Test(description = "testAddSecondTodoItem")
public void testAddSecondTodoItem(){
    Assert.assertTrue(BasicTodoMvcPage.open().then().addTodoItem("FirstItem"));
    Assert.assertTrue("5. I can add a second To-do", BasicTodoMvcPage.open().addTodoItem("SecondItem"));
}
 
开发者ID:AdyKalra,项目名称:ToDoMVCEmberJS,代码行数:8,代码来源:TodoMVCTests.java


注:本文中的ru.yandex.qatools.allure.annotations.Issue类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。