Quantcast

Input/output of test methods

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Input/output of test methods

Quantumuniverses
Is there a way to pass parameters to a test method?

For example I suppose something like this:

void testActionList(String mystr) {
    ...
    ... (using mystr) ...
    ...
}



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Input/output of test methods

sergiomichels
How about to make testActionList private and call this on your test method? Another way is to setup mystr in the startUp method.

On Thu, May 31, 2012 at 4:09 AM, QuantumUniverses <[hidden email]> wrote:
Is there a way to pass parameters to a test method?

For example I suppose something like this:

void testActionList(String mystr) {
  ...
  ... (using mystr) ...
  ...
}



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Input/output of test methods

Quantumuniverses
Just let me know to explain why I need to have input/ouput in my test methods..
 
If you have:
 
- void testSomething1()
- void testSomething2()
 
where:
 
testSomething2 performs its data check according to the result of the prev. test (testSomething1) then you need to pass that result out by testSomething1 and into testSomething2. So what I need is something like this:
 
- void testSomething1(Output result)
- void testSomething2(Input prevResult)
 
Then.. is there a way to pass parameters in Grails testing? (otherwise I should share data in some way, maybe in DB.. but it’s not a good choice in my opinion, in the sense I expect that Grails testing supports a sort of in/out parameters..)
 
 
"Sergio Michels" <[hidden email]> ha scritto nel messaggio news:[hidden email]...
How about to make testActionList private and call this on your test method? Another way is to setup mystr in the startUp method.

On Thu, May 31, 2012 at 4:09 AM, QuantumUniverses <[hidden email]> wrote:
Is there a way to pass parameters to a test method?

For example I suppose something like this:

void testActionList(String mystr) {
  ...
  ... (using mystr) ...
  ...
}



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email


 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Input/output of test methods

sergiomichels
Maybe a late response, but you can have private attributes to store the result of a test method and use this in another

class MyTest {

   private def myResult = [:]

   void testSomethingAndPutInResult() {
     ...
     myResult = [expect: 'something']
     ...
   }
   void testMyResult() {
     assert myResult == [expect: 'something']
   }
}



On Thu, May 31, 2012 at 10:52 AM, QuantumUniverses <[hidden email]> wrote:
Just let me know to explain why I need to have input/ouput in my test methods..
 
If you have:
 
- void testSomething1()
- void testSomething2()
 
where:
 
testSomething2 performs its data check according to the result of the prev. test (testSomething1) then you need to pass that result out by testSomething1 and into testSomething2. So what I need is something like this:
 
- void testSomething1(Output result)
- void testSomething2(Input prevResult)
 
Then.. is there a way to pass parameters in Grails testing? (otherwise I should share data in some way, maybe in DB.. but it’s not a good choice in my opinion, in the sense I expect that Grails testing supports a sort of in/out parameters..)
 
 
"Sergio Michels" <[hidden email]> ha scritto nel messaggio news:[hidden email]...
How about to make testActionList private and call this on your test method? Another way is to setup mystr in the startUp method.

On Thu, May 31, 2012 at 4:09 AM, QuantumUniverses <[hidden email]> wrote:
Is there a way to pass parameters to a test method?

For example I suppose something like this:

void testActionList(String mystr) {
  ...
  ... (using mystr) ...
  ...
}



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email


 

Loading...