Return-Path: Delivered-To: apmail-cocoon-cvs-archive@www.apache.org Received: (qmail 2350 invoked from network); 2 Oct 2007 10:57:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Oct 2007 10:57:04 -0000 Received: (qmail 72744 invoked by uid 500); 2 Oct 2007 10:56:54 -0000 Delivered-To: apmail-cocoon-cvs-archive@cocoon.apache.org Received: (qmail 72697 invoked by uid 500); 2 Oct 2007 10:56:54 -0000 Mailing-List: contact cvs-help@cocoon.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@cocoon.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@cocoon.apache.org Received: (qmail 72686 invoked by uid 99); 2 Oct 2007 10:56:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Oct 2007 03:56:54 -0700 X-ASF-Spam-Status: No, hits=-96.0 required=10.0 tests=ALL_TRUSTED,URIBL_WS_SURBL X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Oct 2007 10:57:02 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 0244E1A984D; Tue, 2 Oct 2007 03:56:11 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r581188 [5/9] - in /cocoon/site/site: ./ community/ css/ devinfo/ images/ images/logos/ link/ news/ Date: Tue, 02 Oct 2007 10:56:05 -0000 To: cvs@cocoon.apache.org From: reinhard@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20071002105612.0244E1A984D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Added: cocoon/site/site/1414_1_1.html URL: http://svn.apache.org/viewvc/cocoon/site/site/1414_1_1.html?rev=581188&view=auto ============================================================================== --- cocoon/site/site/1414_1_1.html (added) +++ cocoon/site/site/1414_1_1.html Tue Oct 2 03:55:58 2007 @@ -0,0 +1,294 @@ + + + + + + + + + + + + + + Apache Cocoon + + + + + + + +
+

Apache » Cocoon »

+
+ + + +
+ + +

[Cocoon GetTogether 2007 - Rome] The program is out!

The CocoonGT team is pleased to announce the conference schedule has

+been finalized and is available at

+http://www.cocoongt.org/PROGRAM.html +

As usual, we had a great number of high-quality submissions. In

+keeping with the tradition of having a conference day packed full with

+great content, we managed to squeeze a lot of excellent speakers and

+talks ? from customer experience to hands-on core stuff, to

+tightly-coupled frameworks and solutions.

Be sure to visit the Web site for more details: the CocoonGT is just a

+few weeks away. Hurry and reserve your seat today ? we look forward to

+seeing you in Rome!

Errors and Improvements? If you see any errors or potential improvements in this document please help + us: View, Edit or comment on the latest development version (registration required). +
+
+ + + + + + Propchange: cocoon/site/site/1414_1_1.html ------------------------------------------------------------------------------ svn:eol-style = native Propchange: cocoon/site/site/1414_1_1.html ------------------------------------------------------------------------------ svn:mime-type = text/html Added: cocoon/site/site/1416_1_1.html URL: http://svn.apache.org/viewvc/cocoon/site/site/1416_1_1.html?rev=581188&view=auto ============================================================================== --- cocoon/site/site/1416_1_1.html (added) +++ cocoon/site/site/1416_1_1.html Tue Oct 2 03:55:58 2007 @@ -0,0 +1,300 @@ + + + + + + + + + + + + + + Apache Cocoon + + + + + + + +
+

Apache » Cocoon »

+
+ + + +
+ + +

Relaunch of cocoon.apache.org

We are pleased to announce the publishing of the new website of Apache +Cocoon. This relaunch comprises a new design for the main site and the Cocoon +2.2 documentation.

+The new documentation reflects the new structure of Cocoon +2.2 with a

The content was also cleaned up so that information which had become +irrelevant for 2.2 was removed, though this is a still ongoing process.

+We are happy to receive your feedback (dev[at]cocoon.apache.org) or your +additions and improvements (follow the 'edit' link on the bottom of a page).Enjoy!
Errors and Improvements? If you see any errors or potential improvements in this document please help + us: View, Edit or comment on the latest development version (registration required). +
+
+ + + + + + Propchange: cocoon/site/site/1416_1_1.html ------------------------------------------------------------------------------ svn:eol-style = native Propchange: cocoon/site/site/1416_1_1.html ------------------------------------------------------------------------------ svn:mime-type = text/html Added: cocoon/site/site/636_1_1.html URL: http://svn.apache.org/viewvc/cocoon/site/site/636_1_1.html?rev=581188&view=auto ============================================================================== --- cocoon/site/site/636_1_1.html (added) +++ cocoon/site/site/636_1_1.html Tue Oct 2 03:55:58 2007 @@ -0,0 +1,426 @@ + + + + + + + + + + + + + + Apache Cocoon + + + + + + + +
+

Apache » Cocoon »

+
+ + + +
+ + +

Apache Cocoon Tests

Overview of testing procedures

Since Apache Cocoon uses Apache Maven automatic unit +testing is very tighly integrated with build process. We also +use Continuum to ensure that +Apache Cocoon can run properly on your particular computing platform and that +the components do function properly.

You can build upon this infrastructure to add your own tests, and to ensure +that development work proceeds smoothly. The tests for each module (block) are +located in the src/test/ directory.

JUnit Tests

If you run mvn install JUnit test cases are executed automatically +and build procedure will fail if any test fails.  JUnit test cases cover:

    +
  • testing various pipeline/sitemap components (including trasformers, matcher, +generators, sources, etc.)
  • +
  • testing the methods for getting platform-dependent filesystem pathnames; +etc.
  • +
Note: It is important to pay attention to class'es package and name +because test's configuration setup seekes for files that follow convention. In +order to set up all needed components and execute test as expected you need to +follow proper directory structure that is shown in an example below.

How to add more JUnit tests for Avalon-managed class

As there is already a nice junit framework available, it is not that +difficult to add junit tests for any class. The process will be explained +step-by-step getting as an example +org.apache.cocoon.template.JXTemplateGenerator class from +cocoon-template-impl module.

Component configuration

You must create JXTemplateGeneratorTestCase.xtest file and put it at +src/test/resources/og/apache/cocoon/template. The file will contain +configuration for components that tested generator needs to work with. Example +file may look like this:
<testcase>
+    <roles>
+        <role name="org.apache.cocoon.generation.GeneratorSelector" shorthand="generators"
+              default-class="org.apache.cocoon.core.container.DefaultServiceSelector"/>
+        <role name="org.apache.excalibur.store.Store/TransientStore" shorthand="store" default-class="org.apache.excalibur.store.impl.MemoryStore"/>
+        <role name="org.apache.cocoon.template.expression.StringTemplateParserSelector" shorthand="string-template-parsers"
+              default-class="org.apache.cocoon.core.container.DefaultServiceSelector"/>
+    </roles>
+    <components>
+        <generators logger="test">
+            <component-instance class="org.apache.cocoon.template.JXTemplateGenerator" name="jx"/>
+        </generators>
+        <component role="org.apache.cocoon.template.script.ScriptManager" class="org.apache.cocoon.template.script.DefaultScriptManager"/>
+        <component role="org.apache.cocoon.template.script.InstructionFactory" class="org.apache.cocoon.template.script.DefaultInstructionFactory"/>
+        <string-template-parsers>
+          <component-instance class="org.apache.cocoon.template.expression.JXTGStringTemplateParser" name="jxtg"/>
+          <component-instance class="org.apache.cocoon.template.expression.DefaultStringTemplateParser" name="default"/>
+        </string-template-parsers>
+    </components>
+</testcase>

As you can see, several components and generator itself are set up.

Java test-case

Now you must create JXTemplateGeneratorTestCase.java file and put it +at src/test/java/org/apache/cocoon/template. The class should extend +org.apache.cocoon.SitemapComponentTestCase from cocoon-core +module so the Avalon's ServiceManager is set up properly and you can use lots of +helper methods. Next step is writing actual testing methods, example method +would look like:

public void testGenerate() throws Exception {
+  String inputURI = docBase + "generate.xml";
+
+  assertEqual(load(inputURI), generate(JX, inputURI, EMPTY_PARAMS));
+}
+

This simple method tests if generator reads simple input file (generate.xml) +and emits all SAX events properly.

Note: It useful to check SitemapComponentTestCase +and CocoonTestCase source code (or Javadocs) to find out what methods +are already provided for your convenience.

+For example, very convient method for use is lookup() that enables you +to look up for a new instance of Avalon component properly initialized according +to Avalon's lifecycle management.

Execute the test

As stated earlier Maven will execute all tests every time the build is +performed so if you want to check if everything is working you can go to root +directory of cocoon-template-impl and execute:

mvn clean install
+

As the output you should get something like this:

-------------------------------------------------------
+ T E S T S
+-------------------------------------------------------
+Running org.apache.cocoon.template.jxtg.JXTemplateGeneratorTestCase
+[DEBUG] XMLizer: Default parser is 'org.apache.excalibur.xml.sax.SAXParser'.
+[DEBUG] Resolved to systemID : resource://org/apache/cocoon/template/jxtg/generate.xml
+[DEBUG] Creating source object for resource://org/apache/cocoon/template/jxtg/generate.xml
+[DEBUG] JaxpParser: validating: false, namespace-prefixes: false, reuse parser: true, stop on warning: true, stop on recoverable-error: true, saxParserFactory: javax.xml.parsers.SAXParserFactory, documentBuilderFactory: javax.xml.parsers.DocumentBuilderFactory, resolver hint: null
+[DEBUG] Releasing source object for resource://org/apache/cocoon/template/jxtg/generate.xml
+[DEBUG] Resolving 'resource://org/apache/cocoon/template/jxtg/generate.xml' with base 'null' in context 'file:/home/grek/asf/cocoon-trunk/blocks/cocoon-template/cocoon-template-impl/'
+[DEBUG] Resolved to systemID : resource://org/apache/cocoon/template/jxtg/generate.xml
+[DEBUG] Creating source object for resource://org/apache/cocoon/template/jxtg/generate.xml
+[DEBUG] Releasing source object for resource://org/apache/cocoon/template/jxtg/generate.xml
+Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.524 sec
+

Which indicates that everything went just fine.

How to add more JUnit tests for Spring-managed class

I suggest to read a section above describing how to write tests for Avalon +components because I will show only focus on differences in particular steps. +This time, we will examine how to write test for classes handling expression +evaluation from cocoon-expression-language-impl. Let's assume we create +test named "Expression".

Components configuration

Instead of creating *.xtest file you must create +*.spring.xml file to configure Spring beans. First we create +ExpressionTestCase.spring.xml file with contents like this:

<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:p="http://www.springframework.org/schema/p"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+  
+  <import resource="classpath:META-INF/cocoon/spring/DefaultExpressionFactory.xml"/>
+  <import resource="classpath:META-INF/cocoon/spring/JavaScriptCompiler.xml"/>
+  <import resource="classpath:META-INF/cocoon/spring/JexlCompiler.xml"/>
+  <import resource="classpath:META-INF/cocoon/spring/JXPathCompiler.xml"/>
+  
+</beans>
+

As you can see we only import other configuration files that are, in a fact, +ordinar configuration files used in development. This approach is much cleaner +than one used for Avalon class testing because you have to configure particular +bean only one time and reuse this configuration while testing.

Java test-case

As writing test-case class for Spring bean is not much different from writing +corresponding class for Avalon component I'm not going to describe it in detail. +

The only difference that I would like to point out is how you should get an +instance of Spring bean. Instead of using lookup method you should use +getFactoryBean().getBean() method.

Take a look at this method as an example:

public void testFactoryJexl() throws ExpressionException {
+  ExpressionFactory factory = (ExpressionFactory) this.getBeanFactory().getBean(ExpressionFactory.ROLE);
+  assertNotNull("Test lookup of expression factory", factory);
+
+  Expression expression = factory.getExpression("jexl", "1+2");
+  assertNotNull("Test expression compilation", expression);
+
+  assertEquals(new Long(3), expression.evaluate(new ExpressionContext()));
+}
+

Execute the test

Tests for Spring beans should be executed exactly the same way that tests for +Avalon components are executed so I point you to instructions +above.

htmlunit Tests

Fixme: I do not know what is the status of htmlunit tests in trunk, +JIRA issue +COCOON-1488 +contains more information

Other tests

Samples web application can be used to perform manual testing. Of course, +contributions to automate these tests are welcome!

Errors and Improvements? If you see any errors or potential improvements in this document please help + us: View, Edit or comment on the latest development version (registration required). +
+
+ + + + + + Propchange: cocoon/site/site/636_1_1.html ------------------------------------------------------------------------------ svn:eol-style = native Propchange: cocoon/site/site/636_1_1.html ------------------------------------------------------------------------------ svn:mime-type = text/html Added: cocoon/site/site/696_1_1.html URL: http://svn.apache.org/viewvc/cocoon/site/site/696_1_1.html?rev=581188&view=auto ============================================================================== --- cocoon/site/site/696_1_1.html (added) +++ cocoon/site/site/696_1_1.html Tue Oct 2 03:55:58 2007 @@ -0,0 +1,339 @@ + + + + + + + + + + + + + + Apache Cocoon + + + + + + + +
+

Apache » Cocoon »

+
+ + + +
+ + +

Live Site Template

TitleOfTheSite

Date added: <yyyy-mm-dd to avoid any misunderstandings in date +format>

Short summary comes here

URL: http://urlOfSite <clickable link>

+Contact: <spam-prone email here>

Additional information

Note: Note to committer: please remove any unanswered questions. And +this note of course. ;-)
How much time did it take to build the site from design to publication?

<answer here>

How many people were involved in the project?

<answer here>

How much traffic does this site handle?

<answer here>

What made you choose Cocoon to build the site?

<answer here>

What other information do you want to disclose (e.g. how does it work, how +did you build it, what parts of Cocoon did you use)?

<answer here>

Errors and Improvements? If you see any errors or potential improvements in this document please help + us: View, Edit or comment on the latest development version (registration required). +
+
+ + + + + + Propchange: cocoon/site/site/696_1_1.html ------------------------------------------------------------------------------ svn:eol-style = native Propchange: cocoon/site/site/696_1_1.html ------------------------------------------------------------------------------ svn:mime-type = text/html Added: cocoon/site/site/697_1_1.html URL: http://svn.apache.org/viewvc/cocoon/site/site/697_1_1.html?rev=581188&view=auto ============================================================================== --- cocoon/site/site/697_1_1.html (added) +++ cocoon/site/site/697_1_1.html Tue Oct 2 03:55:58 2007 @@ -0,0 +1,376 @@ + + + + + + + + + + + + + + Apache Cocoon + + + + + + + +
+

Apache » Cocoon »

+
+ + + +
+ + +

Live Sites - 2.1

This is a list of live sites proudly powered by Apache Cocoon.

Cocoon 2.1

    +
  • ebigchina.com - A B2B marketplace in +Chinese and English with more than 300 thousand users
  • +
  • World Stay - worldwide hotel +booking system (in 5 languages)
  • +
  • Frontage Inc. - The branding agency, +Tokyo (Japanese, English)
  • +
  • BK s.r.l. - ITC company (Italian, English) +
  • +
  • The Connecticut Tutorials +(offline generated)
  • +
  • Cell-X - high standard computer +components (in 7 languages)
  • +
  • Lestar - leading polish manufacturer of +power protection equipment (in 4 languages)
  • +

Cocoon 2.1-dev

Errors and Improvements? If you see any errors or potential improvements in this document please help + us: View, Edit or comment on the latest development version (registration required). +
+
+ + + + + + Propchange: cocoon/site/site/697_1_1.html ------------------------------------------------------------------------------ svn:eol-style = native Propchange: cocoon/site/site/697_1_1.html ------------------------------------------------------------------------------ svn:mime-type = text/html Added: cocoon/site/site/698_1_1.html URL: http://svn.apache.org/viewvc/cocoon/site/site/698_1_1.html?rev=581188&view=auto ============================================================================== --- cocoon/site/site/698_1_1.html (added) +++ cocoon/site/site/698_1_1.html Tue Oct 2 03:55:58 2007 @@ -0,0 +1,346 @@ + + + + + + + + + + + + + + Apache Cocoon + + + + + + + +
+

Apache » Cocoon »

+
+ + + +
+ + +

Live Sites - 2.1.1

This is a list of live sites proudly powered by Apache Cocoon.

Cocoon 2.1.1

Errors and Improvements? If you see any errors or potential improvements in this document please help + us: View, Edit or comment on the latest development version (registration required). +
+
+ + + + + + Propchange: cocoon/site/site/698_1_1.html ------------------------------------------------------------------------------ svn:eol-style = native Propchange: cocoon/site/site/698_1_1.html ------------------------------------------------------------------------------ svn:mime-type = text/html Added: cocoon/site/site/699_1_1.html URL: http://svn.apache.org/viewvc/cocoon/site/site/699_1_1.html?rev=581188&view=auto ============================================================================== --- cocoon/site/site/699_1_1.html (added) +++ cocoon/site/site/699_1_1.html Tue Oct 2 03:55:58 2007 @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + Apache Cocoon + + + + + + + +
+

Apache » Cocoon »

+
+ + + +
+ + +

Live Sites - 2.1.2

This is a list of live sites proudly powered by Apache Cocoon.

Cocoon 2.1.2

SIL Journal of Translation

Date added: 2005-10-24

The SIL Journal of Translation is an online, peer-reviewed journal of +translation theory and practice. The Journal of Translation aims to publish +articles reflecting recent trends in translation theory and practice, including +but not limited to exegesis, communication, text-linguistics, and cognitive +linguistics.

The Journal of Translation is published three times per year by SIL +International. The Journal is distributed without subscription via the World +Wide Web. Articles are distributed in the form of PDF files that may be freely +downloaded.

URL: +http://www.sil.org/siljot/

Other sites

Errors and Improvements? If you see any errors or potential improvements in this document please help + us: View, Edit or comment on the latest development version (registration required). +
+
+ + + + + + Propchange: cocoon/site/site/699_1_1.html ------------------------------------------------------------------------------ svn:eol-style = native Propchange: cocoon/site/site/699_1_1.html ------------------------------------------------------------------------------ svn:mime-type = text/html