You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by Dinesh N <gn...@india.com> on 2004/03/04 08:02:26 UTC

Is there any way To Test aruments of function ?

Hi,
     If i have a function,
      
        pubilc string testFun1(String s1,String s2)
          {
            return testFun1(s1,s2,false);
          } 
         
  public String testFun1(String s1,String s2, Boolean test)
      {
           calling some other fn which return String.
      }


 Now is there any way to Test which fn get called if arguments passed are two or three?


Thanking You,

Ragards,
Dinesh N.

-- 
India.com free e-mail - www.india.com. 
Check out our value-added Premium features, such as an extra 20MB for mail storage, POP3, e-mail forwarding, and ads-free mailboxes!

Powered by Outblaze

Re: Is there any way To Test aruments of function ?

Posted by "J. B. Rainsberger" <jb...@rogers.com>.
Kazuhito SUGURI wrote:

> Hi,
> 
> In article <40...@rogers.com>,
> Thu, 04 Mar 2004 11:36:05 -0500,
> "J. B. Rainsberger" <jb...@rogers.com> wrote: 
> jbrains> Why are you testing the compiler?
> 
> Dinesh may be wanting to check the expected methods are
> called with expected sequence while his/her process,
> or wanting to trace a method call chain.
> 
> Of cource, I may misunderstanding :-)

OK. There are two methods:

f(int a, int b, int c) {
     // something complex
}

f(int a, int b) {
     f(a, b, 0);
}

Test f(a,b,c), making sure to test the case c=0 in particular. f(a,b) is 
Too Simple to Break.
-- 
J. B. Rainsberger,
Diaspar Software Services
http://www.diasparsoftware.com :: +1 416 791-8603
Let's write software that people understand

Re: Is there any way To Test aruments of function ?

Posted by Kazuhito SUGURI <su...@lab.ntt.co.jp>.
Hi,

In article <40...@rogers.com>,
Thu, 04 Mar 2004 11:36:05 -0500,
"J. B. Rainsberger" <jb...@rogers.com> wrote: 
jbrains> Why are you testing the compiler?

Dinesh may be wanting to check the expected methods are
called with expected sequence while his/her process,
or wanting to trace a method call chain.

Of cource, I may misunderstanding :-)
----
Kazuhito SUGURI

Re: Is there any way To Test aruments of function ?

Posted by "J. B. Rainsberger" <jb...@rogers.com>.
Dinesh N wrote:

> Hi,
>      If i have a function,
>       
>         pubilc string testFun1(String s1,String s2)
>           {
>             return testFun1(s1,s2,false);
>           } 
>          
>   public String testFun1(String s1,String s2, Boolean test)
>       {
>            calling some other fn which return String.
>       }
> 
> 
>  Now is there any way to Test which fn get called if arguments passed are two or three?

Why are you testing the compiler?
-- 
J. B. Rainsberger,
Diaspar Software Services
http://www.diasparsoftware.com :: +1 416 791-8603
Let's write software that people understand

Re: Is there any way To Test aruments of function ?

Posted by Kazuhito SUGURI <su...@lab.ntt.co.jp>.
Hi Dinesh,

In article <20...@ws5-2.us4.outblaze.com>,
Thu, 04 Mar 2004 15:02:26 +0800,
"Dinesh N" <gn...@india.com> wrote: 
gnavsupe>  Now is there any way to Test which fn get called if arguments passed are two or three?

I cannot see any relation with Cacus....
If you want to test that, mock-object may helps you.

Regards,
----
Kazuhito SUGURI
mailto:suguri.kazuhito@lab.ntt.co.jp