Package org.junit.runner

Examples of org.junit.runner.Description


        assertEquals(childless.hashCode(), anotherChildless.hashCode());
        assertFalse(childless.hashCode() == namedB.hashCode());
    }

    private Description descriptionWithTwoKids(String first, String second) {
        Description twoKids = Description.createSuiteDescription("a");
        twoKids.addChild(Description.createTestDescription(getClass(), first));
        twoKids.addChild(Description.createTestDescription(getClass(), second));
        return twoKids;
    }
View Full Code Here


    @Test
    public void eliminateUnnecessaryTreeBranches() throws Exception {
        Runner runner = Request.aClass(OneTwoSuite.class).filterWith(
                Description.createTestDescription(TestOne.class, "a"))
                .getRunner();
        Description description = runner.getDescription();
        assertEquals(1, description.getChildren().size());
    }
View Full Code Here

        );
    }

    @Test
    public void methodNameTest() throws Exception {
        Description description = Description.createTestDescription("some-class-name", methodName);
        assertNotNull("Method name should be not null", description.getMethodName());
        assertEquals(methodName, description.getMethodName());
    }
View Full Code Here

        }
    }

    @Test
    public void descriptionOfTestClassHasValuedAnnotation() {
        Description description = describe(ValueAnnotatedClass.class);
        assertEquals("hello", description.getAnnotation(ValuedAnnotation.class)
                .value());
    }
View Full Code Here

                .value());
    }

    @Test
    public void childlessCopyOfDescriptionStillHasAnnotations() {
        Description description = describe(ValueAnnotatedClass.class);
        assertEquals("hello", description.childlessCopy().getAnnotation(ValuedAnnotation.class)
                .value());
    }
View Full Code Here

    }

    @Override
    protected void runChild(final CompleteBehaviour child, final RunNotifier notifier) {
        try {
            Description childDescription = describeChild(child);
            notifier.fireTestStarted(childDescription);
            SpecificationReport report = child.playbackBehaviour();
            reportResults(notifier, report, childDescription);
        } catch (final Exception e) {
            notifier.fireTestFailure(new Failure(getDescription(), e));
View Full Code Here

    }

    @Override
    public void run( RunNotifier notifier ) {
         for(Scenario scenario : scenarios) {
             Description childDescription = Description.createTestDescription(getClass(),
                    scenario.getName());
             descr.addChild(childDescription);
            EachTestNotifier eachNotifier = new EachTestNotifier( notifier, childDescription );
            try {
                eachNotifier.fireTestStarted();
View Full Code Here

    }

    @Override
    public void run( RunNotifier notifier ) {
        for ( Scenario scenario : scenarios ) {
            Description childDescription = Description.createTestDescription( getClass(),
                                                                              scenario.getName() );
            descr.addChild( childDescription );
            EachTestNotifier eachNotifier = new EachTestNotifier( notifier,
                                                                  childDescription );
            try {
View Full Code Here

  /**
   * Returns a <code>{@link Description}</code> showing the tests to be run by the receiver.
   * @return a <code>Description</code> showing the tests to be run by the receiver.
   */
  public Description getDescription() {
    Description spec = createSuiteDescription(testClass.getName());
    for (Method method : testMethods)
      spec.addChild(descriptionOf(method));
    return spec;
  }
View Full Code Here

  }

  @Test
  public void plansNamedCorrectly() throws Exception {
    Runner runner = Request.aClass(RobotTest.class).getRunner();
    Description description = runner.getDescription();
    assertEquals("[0] Equal Robots", description.getChildren().get(0)
        .getDisplayName());
  }
View Full Code Here

TOP

Related Classes of org.junit.runner.Description

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.