Mockrunner is a lightweight framework for unit testing applications in the J2EE environment.
Questions tagged [mockrunner]
13 questions
5
votes
0 answers
How to unit test a JMS listener in spring boot?
I want to write unit test for a method which is annotated by @JmsListener. But I don't know how to do it. Anybody please help me.

Karthikeyan
- 123
- 2
- 2
- 7
5
votes
4 answers
Junit Mockito error on initialization
I have looked everywhere online. I have tried almost everything, from deleting STS to deleting all the code from my station and re-import everything back. I played with dependencies, build path, properties, etc. but still nothing works.
Running the…

eladyanai
- 1,063
- 2
- 15
- 34
5
votes
3 answers
Servlet unit test
Currently I'm using TestNG framework for testing application business logic, i added some Servlet classes recently.
How do I unit test these Servlet classes in TestNg framework?

Isabel Jinson
- 8,541
- 16
- 59
- 75
5
votes
2 answers
How do I set up a mock queue using mockrunner to test an xml filter?
I'm using the mockrunner package from http://mockrunner.sourceforge.net/ to set up a mock queue for JUnit testing an XML filter which operates like this:
sets recognized properties for an ftp server to put and get xml input and a jms queue server…

user23590632
- 91
- 1
- 3
2
votes
1 answer
Changing Mocked ResultSet value each time a SQL statement is run
I'm using Mockrunner to create a mock result set for a select statement. I have a loop that executes the select statement (which returns a single value). I want to have the result set return a different value each time, but I have been unable to…

Major
- 329
- 5
- 17
1
vote
1 answer
MockEJB fails when upgrade to jdk1.6
We are in the process of upgrading our J2EE application from jdk1.4 to jdk1.6 along with moving to a different application server. Yes, lots of moving parts. However, I had written a number of junit tests using Mockrunner and MockEjb where I call…

Bob
- 81
- 7
1
vote
1 answer
JUnit test for @JmsListener
I'm new in Spring JMS, I'm trying to test a method that uses @JMSListener.
Do you have idea how to test this using mockrunner or other tool you know?
I've seen this sample but I'm not sure if this is applicable for my…

charmae
- 1,080
- 14
- 38
0
votes
1 answer
Mockito unable to invoke Logger instance - "Actually, there were zero interactions with this mock." Wanted but not invoked
My Class:
public class Util {
private static final CustomLogger LOGGER = new CustomLogger(Util.class);
public static void commitToDB() {
try {
CommitToDB();
} catch (SQLException sqlException) {
…

Ramesh Gupta
- 21
- 5
0
votes
1 answer
JMS MockTopic message not picked up by message listener?
I am trying to write a jUnit test to show that a JMS Subscriber's start() function kicks off the message listener for a Topic (and that messages were not being consumed before start() was called).
I am running into an issue where messages placed on…

Liz Hesser
- 38
- 1
- 5
0
votes
1 answer
Why would I use MockRunner over normal/hand rolled dependency injection?
At our comapny, we have a service layer which takes in a some request XML, accesses various Stored Procecdures (SP's) via JDBC, processes the data and responds with some response XML. Lately people have begun to adopt MockRunner in their JUnit…

Chris Knight
- 24,333
- 24
- 88
- 134
0
votes
1 answer
Mockrunner(Java) query with Regex
I am using Mockrunner to mock Sql DB for my unit tests. Following is my query:-
"select * from table where userId in (" + userIds + ")"
Now my userIds is state dependent. I don't need my test cases dependent on the arrangement inside the list -…

Mangat Rai Modi
- 5,397
- 8
- 45
- 75
0
votes
1 answer
Spring JMS listener receives empty messages causing CPU consumption
I'm working on an application that uses a couple of jms queues to send/receive updates to/from an external system. In order to test my application I'm using Mockrunner and specifically the jms module.
I'm facing a strange behavior: when I start my…

fabpicca
- 285
- 1
- 3
- 16
0
votes
2 answers
mockrunner jdbc - no columns/rows in result set
I try to set up a test with mockrunner for the first time. The connection is established, but I only get an empty result set. Here is the condensed working example:
import com.mockrunner.jdbc.BasicJDBCTestCaseAdapter;
import…

phobic
- 914
- 10
- 24