Failed to connect to binary FirefoxBinary with Selenium in Maven

When I encounter this error it’s usually one of two things. The Selenium version does not support the browser version Double check the Selenium/browser versions are the same when ran from Eclipse vs Maven. Double check Eclipse and Maven are configured to use the same Selenium version. This occurred for me when my browser auto … Read more

JUnit java.lang.NoSuchMethodError: junit.framework.ComparisonFailure.getExpected()Ljava/lang/String

The getExpected() method on junit.framework.ComparisonFailure was only added in JUnit 3.8.2 (remember, junit.framework package is from JUnit 3.8, whereas JUnit 4 uses org.junit). The method wasn’t there in 3.8.1, which is the most common version of 3.x still out there. I think the method was added for easier migration to JUnit 4 tooling, and occasionally … Read more

How to test DAO methods using Mockito?

Here is a good start using Mockito to test your UserDAO. This code uses a good amount of the Mockito features, so you can see how to use them. Let me know if you have questions. import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import javax.sql.DataSource; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import … Read more

Run all tests in Junit 4

Though it does not really solve your immediate problem, I find it a very useful general practice to create suites and suites of suites, e.g. for a package something like PackageFooSuite etc. and assemble these suites in one or more suites again, like ModuleFooSuite and have one top-level suite, like AllTestsSuite. That way it’s easy … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)