×
  • Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
 

JUnit Goodness

by Senior Java Developer at Solnet Solutions on Nov 19, 2009

  • 5,149 views

Presentation on some JUnit 4 Goodness that developers who came to JUnit at version 3 may have let slip under the radar. Parameterized tests, matcher assertions and the @Ignore annotations are ...

Presentation on some JUnit 4 Goodness that developers who came to JUnit at version 3 may have let slip under the radar. Parameterized tests, matcher assertions and the @Ignore annotations are presented in this slideshow.

Statistics

Views

Total Views
5,149
Views on SlideShare
5,125
Embed Views
24

Actions

Likes
3
Downloads
101
Comments
3

1 Embed 24

http://www.slideshare.net 24

Accessibility

Categories

Upload Details

Uploaded via SlideShare as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

13 of 3 previous next Post a comment

  • srinivasreddy9674227 Srinivas Reddy at NCR Corporation This is my xml file(One_inTwo.xml)
    []
    1 year ago
    Are you sure you want to
    Your message goes here
    Processing…
  • srinivasreddy9674227 Srinivas Reddy at NCR Corporation package concurrent;
    import java.net.URL;
    import org.junit.Test;
    import org.junit.runner.RunWith;
    import org.junitext.XMLParameters;
    import org.openqa.selenium.By;
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.WebElement;
    import org.openqa.selenium.remote.DesiredCapabilities;
    import org.openqa.selenium.remote.RemoteWebDriver;
    import org.junitext.runners.XMLParameterizedRunner;
    @RunWith(XMLParameterizedRunner.class)
    public class One_inTwo {
    public String browser1;
    @XMLParameters('/concurrent/One_inTwo1.xml')
    public One_inTwo(String browser1) {
    this.browser1=browser1;
    }
    @Test
    public void test() throws Exception {
    WebDriver driver;
    URL server = new URL('http://localhost:8081/wd/hub');
    DesiredCapabilities capabilities = null;
    driver = new RemoteWebDriver(server, Common.getGridsettings(browser1, capabilities));
    driver.get('http://google.com');
    Thread.sleep(3000);
    WebElement search_editbox = driver.findElement(By.name('q'));
    WebElement search_button = driver.findElement(By.name('btnG'));
    search_editbox.clear();
    search_editbox.sendKeys('first');
    search_button.click();
    driver.quit();

    }
    }
    1 year ago
    Are you sure you want to
    Your message goes here
    Processing…
  • srinivasreddy9674227 Srinivas Reddy at NCR Corporation hello people
    I am getting the following error when working on XMLParameterized.class for getting input from an xml file


    java.lang.NoSuchMethodError: org.junit.internal.runners.MethodValidator.(Ljava/lang/Class;)V
    at org.junit.internal.runners.TestClassRunner.(TestClassRunner.java:26)
    at org.junitext.runners.XMLParameterizedRunner.(Unknown Source)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:31)
    at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:24)
    at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
    at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29)
    at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
    at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.(JUnit4TestReference.java:32)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.(JUnit4TestClassReference.java:25)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:41)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:31)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)




    and i am using junit4.8.1.jar,junitext0.2.4.jar in windows XP OS

    and my code files are attached below.
    1 year ago
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

JUnit Goodness JUnit Goodness Presentation Transcript