cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "bernhard huber" <bernhard.hu...@gmx.at>
Subject Re: Request headers
Date Mon, 26 Jul 2004 19:01:30 GMT
> 
>     >> How do I run the test case?
>     bernhard> you have to options
> 
>     bernhard> 1 - run "build test" runs all testcases, this shall run
>     bernhard> your test, too.
> 
> 
> I'm getting there.
> But one thing I can't work - out - and that is where I define the
> selector for the test. I think it must be in a sitemap.xmap somewhere,
> but I can't find out where.

Well, you define the selector for the test in xtest file.

Your testcase extends SitemapComponentTestCase, and
SitemapCompontentTestCase extends ExcaliburTestCase.
ExcaliburTestCase will load the xtest file having the same basename as
the testcase class.
Thus you need RegexpHeaderSelector.xtest, for your
RegexpHeaderSelectorTestCase.java

In the xtest file you define:
...
  <selectors logger="test">
   <component-instance 
     class="org.apache.cocoon.selection.RegexpHeaderSelector" 
     name="regexpheader">

     <!-- configuration your selector i assume: define the name of
       the header attribute name
     -->
      <header-name>accept</header-name>
    </component-instance>
  </selectors>
...
The snippet is taken from HeaderSelectorTestCase.xtest.

Now in your test case you can use regexpheader for getting the 
RegexpHeaderSelector.

i hope this short explanation helps you.

regards bernhard

-- 
NEU: WLAN-Router für 0,- EUR* - auch für DSL-Wechsler!
GMX DSL = supergünstig & kabellos http://www.gmx.net/de/go/dsl


Mime
View raw message