[richfaces-svn-commits] JBoss Rich Faces SVN: r16006 - in root/cdk/trunk/plugins/maven-cdk-plugin/src/it/xml-configured-component: src/main/config and 6 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Wed Nov 25 17:53:45 EST 2009


Author: alexsmirnov
Date: 2009-11-25 17:53:45 -0500 (Wed, 25 Nov 2009)
New Revision: 16006

Added:
   root/cdk/trunk/plugins/maven-cdk-plugin/src/it/xml-configured-component/src/main/config/faces-config.xml
   root/cdk/trunk/plugins/maven-cdk-plugin/src/it/xml-configured-component/src/main/java/org/richfaces/
   root/cdk/trunk/plugins/maven-cdk-plugin/src/it/xml-configured-component/src/main/java/org/richfaces/cdk/
   root/cdk/trunk/plugins/maven-cdk-plugin/src/it/xml-configured-component/src/main/java/org/richfaces/cdk/component/
   root/cdk/trunk/plugins/maven-cdk-plugin/src/it/xml-configured-component/src/main/java/org/richfaces/cdk/component/AbstractTestPanel.java
   root/cdk/trunk/plugins/maven-cdk-plugin/src/it/xml-configured-component/src/main/java/org/richfaces/cdk/renderkit/
   root/cdk/trunk/plugins/maven-cdk-plugin/src/it/xml-configured-component/src/main/java/org/richfaces/cdk/renderkit/AbstractTestPanelRenderer.java
   root/cdk/trunk/plugins/maven-cdk-plugin/src/it/xml-configured-component/src/main/templates/testPanel.xml
   root/cdk/trunk/plugins/maven-cdk-plugin/src/it/xml-configured-component/verify.bsh
Log:
xml-based integration test

Added: root/cdk/trunk/plugins/maven-cdk-plugin/src/it/xml-configured-component/src/main/config/faces-config.xml
===================================================================
--- root/cdk/trunk/plugins/maven-cdk-plugin/src/it/xml-configured-component/src/main/config/faces-config.xml	                        (rev 0)
+++ root/cdk/trunk/plugins/maven-cdk-plugin/src/it/xml-configured-component/src/main/config/faces-config.xml	2009-11-25 22:53:45 UTC (rev 16006)
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
+	xmlns:cdk="http://richfaces.org/cdk/extensions" 
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:xi="http://www.w3.org/2001/XInclude"
+	version="2.0"
+	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd">
+	<faces-config-extension />
+	<component>
+		<component-type>org.richfaces.cdk.TestPanel</component-type>
+		<description>Test panel generated by CDK</description>
+		<display-name>Test Panel</display-name>
+        <component-class>org.richfaces.cdk.component.UITestPanel</component-class>
+		<facet>
+		   <facet-name>header</facet-name>
+		   <description>Panel header content.</description>
+		</facet>
+		<xi:include
+			xpointer="xmlns(cdk=http://richfaces.org/cdk/extensions)xpointer(/cdk:properties/*)"
+			href="urn:attributes:javax.faces.component.UIPanel.xml" />
+		<property>
+			<property-name>title</property-name>
+			<property-class>java.lang.String</property-class>
+			<suggested-value>Title</suggested-value>
+			<default-value>"No title"</default-value>
+			<property-extension>
+				<cdk:generate>true</cdk:generate>
+				<cdk:literal>false</cdk:literal>
+			</property-extension>
+		</property>
+		<component-extension>
+			<cdk:generate>true</cdk:generate>
+			<cdk:component-family>org.richfaces.cdk.TestPanel</cdk:component-family>
+			<cdk:base-class>org.richfaces.cdk.component.AbstractTestPanel</cdk:base-class>
+			<cdk:renderer-type>org.richfaces.cdk.TestPanelRenderer</cdk:renderer-type>
+		</component-extension>
+	</component>
+	<component>
+		<component-type>org.richfaces.cdk.HtmlTestPanel</component-type>
+		<description>Html panel generated by CDK</description>
+		<display-name>Html Test Panel</display-name>
+        <component-class>org.richfaces.cdk.component.html.HtmlTestPanel</component-class>
+		<xi:include
+			xpointer="xmlns(cdk=http://richfaces.org/cdk/extensions)xpointer(/cdk:properties/*)"
+			href="urn:attributes:events-props.xml" />
+		<property>
+			<property-name>onclick</property-name>
+			<property-extension>
+				<cdk:generate>true</cdk:generate>
+				<cdk:event default="true">action</cdk:event>
+			</property-extension>
+		</property>
+		<component-extension>
+			<cdk:generate>true</cdk:generate>
+			<cdk:base-class>org.richfaces.cdk.component.UITestPanel</cdk:base-class>
+			<cdk:renderer-type>org.richfaces.TestPanelRenderer</cdk:renderer-type>
+		</component-extension>
+	</component>
+</faces-config>


Property changes on: root/cdk/trunk/plugins/maven-cdk-plugin/src/it/xml-configured-component/src/main/config/faces-config.xml
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: root/cdk/trunk/plugins/maven-cdk-plugin/src/it/xml-configured-component/src/main/java/org/richfaces/cdk/component/AbstractTestPanel.java
===================================================================
--- root/cdk/trunk/plugins/maven-cdk-plugin/src/it/xml-configured-component/src/main/java/org/richfaces/cdk/component/AbstractTestPanel.java	                        (rev 0)
+++ root/cdk/trunk/plugins/maven-cdk-plugin/src/it/xml-configured-component/src/main/java/org/richfaces/cdk/component/AbstractTestPanel.java	2009-11-25 22:53:45 UTC (rev 16006)
@@ -0,0 +1,35 @@
+/*
+ * $Id$
+ *
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
+ */
+
+package org.richfaces.cdk.component;
+
+import javax.faces.component.UIPanel;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov at exadel.com
+ *
+ */
+public abstract class AbstractTestPanel extends UIPanel {
+
+}


Property changes on: root/cdk/trunk/plugins/maven-cdk-plugin/src/it/xml-configured-component/src/main/java/org/richfaces/cdk/component/AbstractTestPanel.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: root/cdk/trunk/plugins/maven-cdk-plugin/src/it/xml-configured-component/src/main/java/org/richfaces/cdk/renderkit/AbstractTestPanelRenderer.java
===================================================================
--- root/cdk/trunk/plugins/maven-cdk-plugin/src/it/xml-configured-component/src/main/java/org/richfaces/cdk/renderkit/AbstractTestPanelRenderer.java	                        (rev 0)
+++ root/cdk/trunk/plugins/maven-cdk-plugin/src/it/xml-configured-component/src/main/java/org/richfaces/cdk/renderkit/AbstractTestPanelRenderer.java	2009-11-25 22:53:45 UTC (rev 16006)
@@ -0,0 +1,41 @@
+/*
+ * $Id$
+ *
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
+ */
+
+package org.richfaces.cdk.renderkit;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.render.Renderer;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov at exadel.com
+ *
+ */
+public abstract class AbstractTestPanelRenderer extends Renderer {
+    
+    protected String foo(FacesContext context, UIComponent component){
+        return "foo";
+    }
+
+}


Property changes on: root/cdk/trunk/plugins/maven-cdk-plugin/src/it/xml-configured-component/src/main/java/org/richfaces/cdk/renderkit/AbstractTestPanelRenderer.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: root/cdk/trunk/plugins/maven-cdk-plugin/src/it/xml-configured-component/src/main/templates/testPanel.xml
===================================================================
--- root/cdk/trunk/plugins/maven-cdk-plugin/src/it/xml-configured-component/src/main/templates/testPanel.xml	                        (rev 0)
+++ root/cdk/trunk/plugins/maven-cdk-plugin/src/it/xml-configured-component/src/main/templates/testPanel.xml	2009-11-25 22:53:45 UTC (rev 16006)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<cdk:root xmlns="http://www.w3.org/1999/xhtml" xmlns:cdk="http://richfaces.org/cdk"
+	xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:cc="http://java.sun.com/jsf/composite">
+	<cc:interface>
+		<cdk:class>org.richfaces.cdk.renderkit.html.TestPanelRenderer</cdk:class>
+		<cdk:superclass>org.richfaces.cdk.renderkit.AbstractTestPanelRenderer</cdk:superclass>
+		<cdk:component-family>org.richfaces.cdk.TestPanel</cdk:component-family>
+		<cdk:component-type>org.richfaces.cdk.HtmlTestPanel</cdk:component-type>
+		<cdk:renderer-type>org.richfaces.cdk.TestPanelRenderer</cdk:renderer-type>
+		<cdk:renderkit-id>HTML_BASIC</cdk:renderkit-id>
+		<cdk:renders-children>true</cdk:renders-children>
+		<cc:attribute name="onclick" />
+		<cc:attribute name="mode" default="ajax" />
+		<cc:attribute name="action" method-signature="void action()" />
+		<cc:attribute name="changeListener"
+			method-signature="void changeListener(ValueChangeEvent)" targets="changes changes1" />
+		<cc:attribute name="disabled" type="boolean" />
+		<cc:attribute name="delay" type="java.lang.Integer" />
+		<cc:attribute name="id" required="true" />
+		<cc:attribute name="experts" shortDescription="For use by experts"
+			displayName="Expert attribute" expert="true" />
+		<cc:attribute name="preferred" shortDescription="It's a preferred attribute"
+			displayName="Preferred attribute" preferred="true" />
+		<cdk:resource-dependencies>
+			<cdk:resource-dependency name="jquery.js" />
+			<cdk:resource-dependency name="richfaces.css"
+				library="org.richfaces" />
+			<cdk:resource-dependency name="richfaces.js"
+				library="org.richfaces" target="body" />
+		</cdk:resource-dependencies>
+
+	</cc:interface>
+	<cc:implementation>
+                start
+                <c:if test="#{cc.attributes['ifTest'] != null}">if content</c:if>
+                <c:choose>
+                    <c:when test="#{cc.attributes['anotherTest'] != null}">when content</c:when>
+                    <c:when test="#{cc.attributes['coolTest'] != null}"> 
+                        <c:if test="#{cc.attributes['nestedIfTest'] != null}">nested if content</c:if>
+                    </c:when>
+                    <c:otherwise>otherwise content</c:otherwise>
+                </c:choose>
+                <c:forEach items="#{cc.children}" var="iterationVar">
+                    forEach content
+                </c:forEach>
+                finish 
+	</cc:implementation>
+</cdk:root>
\ No newline at end of file


Property changes on: root/cdk/trunk/plugins/maven-cdk-plugin/src/it/xml-configured-component/src/main/templates/testPanel.xml
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: root/cdk/trunk/plugins/maven-cdk-plugin/src/it/xml-configured-component/verify.bsh
===================================================================
--- root/cdk/trunk/plugins/maven-cdk-plugin/src/it/xml-configured-component/verify.bsh	                        (rev 0)
+++ root/cdk/trunk/plugins/maven-cdk-plugin/src/it/xml-configured-component/verify.bsh	2009-11-25 22:53:45 UTC (rev 16006)
@@ -0,0 +1,42 @@
+import java.io.*;
+import java.util.*;
+import java.util.regex.*;
+
+try
+{
+    File generatedPackage = new File( basedir, "target/generated-sources/main/java" );
+    System.out.println( "Checking for existence of generated package directory: " + generatedPackage );
+    if ( !generatedPackage.isDirectory() )
+    {
+        System.out.println( "FAILED" );
+        return false;
+    }
+
+    File classesDirectory = new File( basedir, "target/classes" );
+
+    String[] classes = { "org/richfaces/cdk/component/UITestPanel","org/richfaces/cdk/renderkit/html/TestPanelRenderer" };
+    for ( String generatedClass : classes )
+    {
+        File generatedClassFile = new File( generatedPackage, generatedClass + ".java" );
+        System.out.println( "Checking for existence of generated Class: " + generatedClassFile );
+        if ( !generatedClassFile.isFile() )
+        {
+            System.out.println( "FAILED" );
+            return false;
+        }
+        File compiledClassFile = new File( classesDirectory, generatedClass + ".class" );
+        System.out.println( "Checking for existence of compiled Class: " + compiledClassFile );
+        if ( !compiledClassFile.isFile() )
+        {
+            System.out.println( "FAILED" );
+            return false;
+        }
+    }
+}
+catch( Throwable t )
+{
+    t.printStackTrace();
+    return false;
+}
+
+return true;



More information about the richfaces-svn-commits mailing list