Package net.thucydides.core.model.features

Examples of net.thucydides.core.model.features.ApplicationFeature


            writer.endNode();
        }
    }

    private void writeFeatureNode(HierarchicalStreamWriter writer, Story userStory) {
        ApplicationFeature feature = userStory.getFeature();// ApplicationFeature.from(userStory.getFeatureClass());
        writer.startNode(FEATURE);
        writer.addAttribute(ID_FIELD, feature.getId());
        writer.addAttribute(NAME_FIELD, feature.getName());
        writer.endNode();
    }
View Full Code Here


                               final TestOutcome testOutcome) {

        String storyId = reader.getAttribute(ID_FIELD);
        String storyName = reader.getAttribute(NAME_FIELD);
        String storyPath = reader.getAttribute(PATH_FIELD);
        ApplicationFeature feature = null;

        if (reader.hasMoreChildren()) {
            reader.moveDown();
            String childNode = reader.getNodeName();
            if (childNode.equals(FEATURE)) {
                feature = readFeature(reader);
            }
            reader.moveUp();
        }
        Story story;
        if (feature == null) {
            story = Story.withIdAndPath(storyId, storyName,storyPath);
        } else {
            story = Story.withIdAndPathAndFeature(storyId, storyName, storyPath, feature.getId(), feature.getName());
        }
        testOutcome.setUserStory(story);
    }
View Full Code Here

    private ApplicationFeature readFeature(final HierarchicalStreamReader reader) {

        String featureId = reader.getAttribute(ID_FIELD);
        String featureName = reader.getAttribute(NAME_FIELD);
        return new ApplicationFeature(featureId, featureName);
    }
View Full Code Here

    private boolean shouldAddStoryTags() {
        return environmentVariables.getPropertyAsBoolean(ThucydidesSystemProperty.USE_TEST_CASE_FOR_STORY_TAG,true);
    }

    private void addFeatureTagIfPresent(TestOutcome testOutcome, Set<TestTag> tags) {
        ApplicationFeature feature = testOutcome.getFeature();
        if (feature != null) {
            tags.add(TestTag.withName(feature.getName()).andType("feature"));
        }
    }
View Full Code Here

        steps.step_one();
        steps.step_two();
        StepEventBus.getEventBus().testFinished(testOutcome);

        TestOutcome outcome = stepListener.getTestOutcomes().get(0);
        ApplicationFeature feature = outcome.getFeature();
        assertThat(feature.getId(), is(MyFeature.class.getCanonicalName()));
    }
View Full Code Here

        steps.step_one();
        steps.step_two();
        StepEventBus.getEventBus().testFinished(testOutcome);

        TestOutcome outcome = stepListener.getTestOutcomes().get(0);
        ApplicationFeature feature = outcome.getFeature();
        assertThat(feature.getName(), is("My feature"));
    }
View Full Code Here

        return new Story(storyName, storyName, null, null, null);
    }

    public static Story withId(final String storyId, final String storyName,
                               final String featureClassName, final String featureName) {
        return new Story(storyId, storyName, new ApplicationFeature(featureClassName, featureName), null);
    }
View Full Code Here

    }


    public static Story withIdAndPathAndFeature(final String storyId, final String storyName, String storyPath,
                                                final String featureClassName, final String featureName) {
        return new Story(storyId, storyName, new ApplicationFeature(featureClassName, featureName), storyPath);
    }
View Full Code Here

        FileUtils.writeStringToFile(report, storedReportXML);

        Optional<TestOutcome> testOutcome = outcomeReporter.loadReportFrom(report);
        testOutcome.get().getFeature();

        ApplicationFeature expectedFeature = new ApplicationFeature("myapp.myfeatures.SomeFeature", "Some feature");
        assertThat(testOutcome.get().getFeature().getId(), is("myapp.myfeatures.SomeFeature"));
        assertThat(testOutcome.get().getFeature().getName(), is("Some feature"));
        assertThat(testOutcome.get().getPath(), is("net.thucydides.core.reports.integration.WhenGeneratingAnXMLReport"));
    }
View Full Code Here

    @Test
    public void a_user_story_can_belong_to_a_feature() {
        Class<?> userStoryClass = WidgetFeature.PurchaseNewWidget.class;

        net.thucydides.core.model.Story story = net.thucydides.core.model.Story.from(userStoryClass);
        ApplicationFeature feature = story.getFeature();
        assertThat(feature.getId(), is(WidgetFeature.class.getCanonicalName()));
    }
View Full Code Here

TOP

Related Classes of net.thucydides.core.model.features.ApplicationFeature

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.