Originally posted by Jeanne Boyarsky:
Jason,
I'm glad you got past it. For the future, note that requires a clumsy hack in order to be made testable is often crying out to be refactored.
Originally posted by Eric Nielsen:
First it looks like you're using an ancient version of EasyMock... Is that intentional?
Seems like you're trying to do the wrong things in the setUp method. I'd suggest restructuring it like: (using the a more modern (but still ~2.5 years old EasyMock))
// Snipped out code
You're only testing are the correct calls proxied through to the DAO (and any other business logic/manipulation you need to do). Since you're mocking the DAO, there's no real need to build up a list of cbts anywhere, I haven't ripped it out yet, but its really not needed... Even for testing exceptions/duplicates, it won't be needed since all you need to do is set the expectation to be expect().andThrow().... to check if you handle those cases correctly.
Originally posted by Jeanne Boyarsky:
Jason,
Before you worry about the mail sender, can you write a test that calls the DAO and has the DAO return an empty list? This gets you set up with whatever mock objects library you are using with a simpler case since it skips the whole loop.
Once you have that, you have demonstrated mocking out an interface. org.springframework.mail.javamail.JavaMailSender is an interface too. Which means you can try using the same techniques. NOte that while MailSender is injected by Spring when you run "for real", it is not injected during unit testing. It is your unit test's responsibility to inject it.
Originally posted by chintan ramavat:
Hello friends ,
interesting question to all experts out there, I have one drop down and when user clicks i need to get data using ajax with java classes. but how to load data using ajax and place that using specific format.
the structure is using Ajax, JSON and JAvascript
- any help is much appreciated
- thanks
Originally posted by Henry Wong:
It shouldn't be that hard to write one... Just create a Comparator that takes strings, whose compare() method, converts the string to either int, float, or double, and then route the request to the Integer, Float, or Double class as the comparator.
Henry
Originally posted by Christophe Porteneuve:
Obviously, I would strongly recommend my book and its blog, too�
Originally posted by ujjwal soni:
Hi,
I am unable to display country list from database on my jsp page. Instead of the country values, i am getting the below output onm my jsp page
-----------Output Start---------------------
Project.Domain.Admin.CountryService@d6a0e0 Project.Domain.Admin.CountryService@dbf04d
-----------Output End-----------------------
The code on my jsp page is as under.
<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@ include file="/WEB-INF/jsp/Admin/include.jsp" %>
<core:forEach var="county" items="${CountryList}">
<core:out value="${county}"/>
</core:forEach>
I am using spring Controller & i am sending the List object in HttpRequest parameters of ModelAndView return type.
Regards,
Ujjwal Soni
Originally posted by ujjwal soni:
Hi,
I am unable to display country list from database on my jsp page. Instead of the country values, i am getting the below output onm my jsp page
-----------Output Start---------------------
Project.Domain.Admin.CountryService@d6a0e0 Project.Domain.Admin.CountryService@dbf04d
-----------Output End-----------------------
The code on my jsp page is as under.
<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@ include file="/WEB-INF/jsp/Admin/include.jsp" %>
<core:forEach var="county" items="${CountryList}">
<core:out value="${county}"/>
</core:forEach>
I am using spring Controller & i am sending the List object in HttpRequest parameters of ModelAndView return type.
Regards,
Ujjwal Soni