[email protected] wrote:
> Project sipXecs
> New Revision 16640 <http://code.sipfoundry.org//changelog/sipXecs/?cs=16640>
> Committer rgdans
> Date 2009-09-28 08:46:21 -0500 (Mon, 28 Sep 2009)
>
>
> Log
>
>
> XX-6371 Jasper Report: Long distance report should contain all Long distance
> call types
>
> Add Toll Free, Restricted and International calls to Long Distance Report.
>
> XX-6384 Jasper Report: Call Direction Report - Remove calls from Paging
> Server to paging group from CDR.
>
>
This seems to be missing unit tests...
Functionality without unit tests *will be* broken.
Please consider adding more info to CallTag enum so that we do not have to
have a code that looks like this:
if ((calleeroute != null) && (calleeroute.endsWith(CallTag.LD.toString())
|| calleeroute.endsWith(CallTag.INTN.toString())
|| calleeroute.endsWith(CallTag.REST.toString())
|| calleeroute.endsWith(CallTag.TF.toString())))
or this:
public String getCallTypeName() {
String callType = CallTag.UNK.getName();
if (m_calleeRoute.endsWith(CallTag.AA.toString())) {
callType = CallTag.AA.getName();
}
if (m_calleeRoute.endsWith(CallTag.CUST.toString())) {
callType = CallTag.CUST.getName();
}
if (m_calleeRoute.endsWith(CallTag.EMERG.toString())) {
callType = CallTag.EMERG.getName();
}
... // about 10 more ifs follow
Much better way of implementing something like this is to add a single
static CallTag.fromType(String type) method and put all needed info in
properly initialized CallTag enum.
Please - consider starting implementation with unit tests. You'll end up
with much better code (since you will not write the code that is hard to test).
D.
_______________________________________________
sipx-dev mailing list [email protected]
List Archive: http://list.sipfoundry.org/archive/sipx-dev
Unsubscribe: http://list.sipfoundry.org/mailman/listinfo/sipx-dev
sipXecs IP PBX -- http://www.sipfoundry.org/