Author: scabanovich
Date: 2010-03-19 10:51:18 -0400 (Fri, 19 Mar 2010)
New Revision: 20932
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/WEB-INF/web30.xml
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/testCases.xml
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JSFModelTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5975
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/WEB-INF/web30.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/WEB-INF/web30.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/WEB-INF/web30.xml 2010-03-19
14:51:18 UTC (rev 20932)
@@ -0,0 +1,476 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="3.0"
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+ metadata-complete="false">
+
+ <description>Web Descriptor</description>
+ <display-name>MyWeb</display-name>
+
+ <icon>
+ <small-icon>/small.gif</small-icon>
+ <large-icon>/large.gif</large-icon>
+ </icon>
+
+ <distributable/>
+
+ <module-name>myModule</module-name>
+
+ <absolute-ordering>
+ <name>name1</name>
+ <name>name2</name>
+ <others/>
+ </absolute-ordering>
+
+ <context-param>
+ <description>param 1 description</description>
+ <param-name>param_1</param-name>
+ <param-value>value_1</param-value>
+ </context-param>
+ <context-param>
+ <description>param 2 description</description>
+ <param-name>param_2</param-name>
+ <param-value>value_2</param-value>
+ </context-param>
+
+ <data-source>
+ <description>data source description</description>
+ <name>dataSourceName</name>
+ <class-name>data.source.ClassName</class-name>
+ <server-name>serverName</server-name>
+ <port-number>1</port-number>
+ <database-name>dbName</database-name>
+ <url>jdbc:a:b</url>
+ <user>user</user>
+ <password>password</password>
+ <property>
+ <name>property_1</name>
+ <value>property 1 value</value>
+ </property>
+ <property>
+ <name>property_2</name>
+ <value>property 2 value</value>
+ </property>
+ <login-timeout>2</login-timeout>
+ <transactional>false</transactional>
+ <isolation-level>TRANSACTION_READ_UNCOMMITTED</isolation-level>
+ <initial-pool-size>1</initial-pool-size>
+ <max-pool-size>30</max-pool-size>
+ <min-pool-size>10</min-pool-size>
+ <max-idle-time>100</max-idle-time>
+ <max-statements>10</max-statements>
+ </data-source>
+
+ <filter>
+ <description>filter description</description>
+ <display-name>My Filter</display-name>
+ <icon>
+ <small-icon>/small.gif</small-icon>
+ <large-icon>/large.gif</large-icon>
+ </icon>
+ <filter-name>myFilter</filter-name>
+ <filter-class>x.MyFilter</filter-class>
+ <async-supported>true</async-supported>
+ <init-param>
+ <description>param 1 description</description>
+ <param-name>initParam1</param-name>
+ <param-value>int param 1 value</param-value>
+ </init-param>
+ <init-param>
+ <description>param 2 description</description>
+ <param-name>initParam2</param-name>
+ <param-value>int param 2 value</param-value>
+ </init-param>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>myFilter</filter-name>
+ <servlet-name>myServlet</servlet-name>
+ <url-pattern>*.jsp</url-pattern>
+ <dispatcher>ASYNC</dispatcher>
+ <dispatcher>ERROR</dispatcher>
+ </filter-mapping>
+
+ <listener>
+ <description>listener description</description>
+ <display-name>My Listener</display-name>
+ <icon>
+ <small-icon>/small.gif</small-icon>
+ <large-icon>/large.gif</large-icon>
+ </icon>
+ <listener-class>x.MyListener</listener-class>
+ </listener>
+
+ <mime-mapping>
+ <extension>xml</extension>
+ <mime-type>mmm/hhh</mime-type>
+ </mime-mapping>
+
+ <error-page>
+ <error-code>400</error-code>
+ <location>/error1.jsp</location>
+ </error-page>
+ <error-page>
+ <exception-type>java.lang.Exception</exception-type>
+ <location>/error2.jsp</location>
+ </error-page>
+
+ <jsp-config>
+ <taglib>
+ <taglib-uri>http://mytaglib</taglib-uri>
+ <taglib-location>mytaglip.tld</taglib-location>
+ </taglib>
+ <jsp-property-group>
+ <description>JSP property group description</description>
+ <display-name>JSP Property Group</display-name>
+ <icon>
+ <small-icon>/small.gif</small-icon>
+ <large-icon>/large.gif</large-icon>
+ </icon>
+ <url-pattern>*.jsp</url-pattern>
+ <el-ignored>true</el-ignored>
+ <page-encoding>UTF-8</page-encoding>
+ <scripting-invalid>true</scripting-invalid>
+ <is-xml>true</is-xml>
+ <include-prelude>prelude</include-prelude>
+ <include-coda>coda</include-coda>
+
<deferred-syntax-allowed-as-literal>true</deferred-syntax-allowed-as-literal>
+ <trim-directive-whitespaces>true</trim-directive-whitespaces>
+ <default-content-type>html</default-content-type>
+ <buffer>buffer</buffer>
+ <error-on-undeclared-namespace>true</error-on-undeclared-namespace>
+ </jsp-property-group>
+ </jsp-config>
+
+ <security-constraint>
+ <display-name>MySecurityConstraint</display-name>
+ <web-resource-collection>
+ <web-resource-name>webResource1</web-resource-name>
+ <description>web resource collection 1 description</description>
+ <url-pattern>*.jsp</url-pattern>
+ <url-pattern>*.html</url-pattern>
+ <http-method>m1</http-method>
+ <http-method>m2</http-method>
+ </web-resource-collection>
+ <web-resource-collection>
+ <web-resource-name>webResource2</web-resource-name>
+ <description>web resource collection 2 description</description>
+ <url-pattern>*.jsp</url-pattern>
+ <url-pattern>*.html</url-pattern>
+ <http-method-omission>m3</http-method-omission>
+ <http-method-omission>m4</http-method-omission>
+ </web-resource-collection>
+ <auth-constraint>
+ <description>auth constraint description</description>
+ <role-name>role1</role-name>
+ <role-name>role2</role-name>
+ </auth-constraint>
+ <user-data-constraint>
+ <description>user data constraint description</description>
+ <transport-guarantee>CONFIDENTIAL</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+
+ <login-config>
+ <auth-method>xxx</auth-method>
+ <realm-name>realm</realm-name>
+ <form-login-config>
+ <form-login-page>/page.jsp</form-login-page>
+ <form-error-page>/error.jsp</form-error-page>
+ </form-login-config>
+ </login-config>
+
+ <security-role>
+ <description>role 1 description</description>
+ <role-name>role1</role-name>
+ </security-role>
+ <security-role>
+ <description>role 2 description</description>
+ <role-name>role2</role-name>
+ </security-role>
+
+ <env-entry>
+ <description>ENV entry description</description>
+ <env-entry-name>ENVEntry</env-entry-name>
+ <env-entry-type>envEntryType</env-entry-type>
+ <env-entry-value>envEntryValue</env-entry-value>
+ <mapped-name>mappedName</mapped-name>
+ <injection-target>
+ <injection-target-class>x.InjectionTarget</injection-target-class>
+ <injection-target-name>myInjectionJarget</injection-target-name>
+ </injection-target>
+ <lookup-name>lookupName</lookup-name>
+ </env-entry>
+
+ <ejb-local-ref>
+ <description>EJB local ref description</description>
+ <ejb-ref-name>EJBLocalRef</ejb-ref-name>
+ <ejb-ref-type>Entity</ejb-ref-type>
+ <local-home>localHome</local-home>
+ <local>x.Local</local>
+ <ejb-link>link2</ejb-link>
+ <mapped-name>mappedName</mapped-name>
+ <injection-target>
+ <injection-target-class>x.InjectionTarget</injection-target-class>
+ <injection-target-name>myInjectionJarget</injection-target-name>
+ </injection-target>
+ <lookup-name>lookupName</lookup-name>
+ </ejb-local-ref>
+
+ <ejb-ref>
+ <description>EJB ref description</description>
+ <ejb-ref-name>EJBRef</ejb-ref-name>
+ <ejb-ref-type>Session</ejb-ref-type>
+ <home>home</home>
+ <remote>x.Remote</remote>
+ <ejb-link>link3</ejb-link>
+ <mapped-name>mappedName</mapped-name>
+ <injection-target>
+ <injection-target-class>x.InjectionTarget</injection-target-class>
+ <injection-target-name>myInjectionJarget</injection-target-name>
+ </injection-target>
+ <lookup-name>lookupName</lookup-name>
+ </ejb-ref>
+
+ <service-ref>
+ <description>service ref description</description>
+ <display-name>My Service Ref</display-name>
+ <icon>
+ <small-icon>/small.gif</small-icon>
+ <large-icon>/large.gif</large-icon>
+ </icon>
+ <service-ref-name>myServiceRef</service-ref-name>
+ <service-interface>x.Service</service-interface>
+ <jaxrpc-mapping-file>/a.txt</jaxrpc-mapping-file>
+ <port-component-ref>
+
<service-endpoint-interface>x.ServiceEndpoint</service-endpoint-interface>
+ <enable-mtom>true</enable-mtom>
+ <mtom-threshold>7</mtom-threshold>
+ <addressing>
+ <enabled>true</enabled>
+ <required>true</required>
+ <responses>ALL</responses>
+ </addressing>
+ <respect-binding>
+ <enabled>true</enabled>
+ </respect-binding>
+ <port-component-link>link4</port-component-link>
+ </port-component-ref>
+ <handler>
+ <description>handler descrription</description>
+ <display-name>My Handler</display-name>
+ <icon>
+ <small-icon>/small.gif</small-icon>
+ <large-icon>/large.gif</large-icon>
+ </icon>
+ <handler-name>myHandler</handler-name>
+ <handler-class>x.MyHandler</handler-class>
+ <init-param>
+ <description>param description</description>
+ <param-name>param</param-name>
+ <param-value>value</param-value>
+ </init-param>
+ <soap-header>header1</soap-header>
+ <soap-header>header2</soap-header>
+ <soap-role>role1</soap-role>
+ <soap-role>role2</soap-role>
+ <port-name>port1</port-name>
+ <port-name>port2</port-name>
+ </handler>
+ </service-ref>
+
+ <resource-env-ref>
+ <description>resource env ref description</description>
+ <resource-env-ref-name>myResourceEnvRef</resource-env-ref-name>
+ <resource-env-ref-type>type</resource-env-ref-type>
+ <mapped-name>mappedName</mapped-name>
+ <injection-target>
+ <injection-target-class>x.InjectionTarget</injection-target-class>
+ <injection-target-name>myInjectionJarget</injection-target-name>
+ </injection-target>
+ <lookup-name>lookupName</lookup-name>
+ </resource-env-ref>
+
+ <resource-ref>
+ <description>resource ref description</description>
+ <res-ref-name>myResourceRef</res-ref-name>
+ <res-type>type</res-type>
+ <res-auth>Application</res-auth>
+ <res-sharing-scope>Shareable</res-sharing-scope>
+ <mapped-name>mappedName</mapped-name>
+ <injection-target>
+ <injection-target-class>x.InjectionTarget</injection-target-class>
+ <injection-target-name>myInjectionJarget</injection-target-name>
+ </injection-target>
+ <lookup-name>lookupName</lookup-name>
+ </resource-ref>
+
+ <message-destination-ref>
+ <description>message destination ref description</description>
+
<message-destination-ref-name>myMessageDestinationRef</message-destination-ref-name>
+ <message-destination-type>type</message-destination-type>
+ <message-destination-usage>Consumes</message-destination-usage>
+ <message-destination-link>link5</message-destination-link>
+ <mapped-name>mappedName</mapped-name>
+ <injection-target>
+ <injection-target-class>x.InjectionTarget</injection-target-class>
+ <injection-target-name>myInjectionJarget</injection-target-name>
+ </injection-target>
+ <lookup-name>lookupName</lookup-name>
+ </message-destination-ref>
+
+ <message-destination>
+ <description>message destination description</description>
+ <display-name>MyMessageDestination</display-name>
+ <icon>
+ <small-icon>/small.gif</small-icon>
+ <large-icon>/large.gif</large-icon>
+ </icon>
+ <message-destination-name>myMessageDestination</message-destination-name>
+ <mapped-name>mappedName</mapped-name>
+ <lookup-name>lookupName</lookup-name>
+ </message-destination>
+ <locale-encoding-mapping-list>
+ <locale-encoding-mapping>
+ <locale>en</locale>
+ <encoding>UTF-8</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>de</locale>
+ <encoding>UTF-8</encoding>
+ </locale-encoding-mapping>
+ </locale-encoding-mapping-list>
+
+ <persistence-context-ref>
+ <description>persistence context ref description</description>
+
<persistence-context-ref-name>myPersistenceContextRef</persistence-context-ref-name>
+ <persistence-unit-name>unit</persistence-unit-name>
+ <persistence-context-type>Extended</persistence-context-type>
+ <persistence-property>
+ <name>property_1</name>
+ <value>property 1 value</value>
+ </persistence-property>
+ <persistence-property>
+ <name>property_2</name>
+ <value>property 2 value</value>
+ </persistence-property>
+ <mapped-name>mappedName</mapped-name>
+ <injection-target>
+ <injection-target-class>x.InjectionTarget</injection-target-class>
+ <injection-target-name>myInjectionJarget</injection-target-name>
+ </injection-target>
+ </persistence-context-ref>
+
+ <persistence-unit-ref>
+ <description>persistence unit ref description</description>
+
<persistence-unit-ref-name>myPersistenceUnitRef</persistence-unit-ref-name>
+ <persistence-unit-name>unit</persistence-unit-name>
+ <mapped-name>mappedName</mapped-name>
+ <injection-target>
+ <injection-target-class>x.InjectionTarget</injection-target-class>
+ <injection-target-name>myInjectionJarget</injection-target-name>
+ </injection-target>
+ </persistence-unit-ref>
+
+ <post-construct>
+
<lifecycle-callback-class>x.LifecycleCallbackClass</lifecycle-callback-class>
+ <lifecycle-callback-method>construct</lifecycle-callback-method>
+ </post-construct>
+
+ <pre-destroy>
+
<lifecycle-callback-class>x.LifecycleCallbackClass</lifecycle-callback-class>
+ <lifecycle-callback-method>destroy</lifecycle-callback-method>
+ </pre-destroy>
+
+ <servlet>
+ <description>sevlet description</description>
+ <display-name>My Servlet</display-name>
+ <icon>
+ <small-icon>/small.gif</small-icon>
+ <large-icon>/large.gif</large-icon>
+ </icon>
+ <servlet-name>myServlet</servlet-name>
+ <servlet-class>x.MyServlet</servlet-class>
+ <init-param>
+ <description>param description</description>
+ <param-name>param</param-name>
+ <param-value>value</param-value>
+ </init-param>
+ <load-on-startup>2</load-on-startup>
+ <enabled>true</enabled>
+ <async-supported>true</async-supported>
+ <run-as>
+ <description>run as description</description>
+ <role-name>role1</role-name>
+ </run-as>
+ <security-role-ref>
+ <description>security role ref description</description>
+ <role-name>role2</role-name>
+ <role-link>role2</role-link>
+ </security-role-ref>
+ <multipart-config>
+ <location>/a.xml</location>
+ <max-file-size>1000</max-file-size>
+ <max-request-size>100</max-request-size>
+ <file-size-threshold>1</file-size-threshold>
+ </multipart-config>
+ </servlet>
+
+ <servlet>
+ <description>sevlet description</description>
+ <display-name>My Servlet 2</display-name>
+ <icon>
+ <small-icon>/small.gif</small-icon>
+ <large-icon>/large.gif</large-icon>
+ </icon>
+ <servlet-name>myServlet2</servlet-name>
+ <jsp-file>/x.jsp</jsp-file>
+ <init-param>
+ <description>param description</description>
+ <param-name>param</param-name>
+ <param-value>value</param-value>
+ </init-param>
+ <load-on-startup>3</load-on-startup>
+ <enabled>false</enabled>
+ <async-supported>true</async-supported>
+ <run-as>
+ <description>run as description</description>
+ <role-name>role1</role-name>
+ </run-as>
+ <security-role-ref>
+ <description>security role ref description</description>
+ <role-name>role2</role-name>
+ <role-link>role2</role-link>
+ </security-role-ref>
+ <multipart-config>
+ <location>/a.xml</location>
+ <max-file-size>1000</max-file-size>
+ <max-request-size>100</max-request-size>
+ <file-size-threshold>1</file-size-threshold>
+ </multipart-config>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>myServlet</servlet-name>
+ <url-pattern>*.jsp</url-pattern>
+ </servlet-mapping>
+
+ <session-config>
+ <session-timeout>1</session-timeout>
+ <cookie-config>
+ <name>cookieConfig</name>
+ <domain>domain</domain>
+ <path>path</path>
+ <comment>comment</comment>
+ <http-only>true</http-only>
+ <secure>false</secure>
+ <max-age>3</max-age>
+ </cookie-config>
+ <tracking-mode>COOKIE</tracking-mode>
+ <tracking-mode>SSL</tracking-mode>
+ </session-config>
+
+ <welcome-file-list>
+ <welcome-file>/index.jsp</welcome-file>
+ <welcome-file>/hello.jsp</welcome-file>
+ </welcome-file-list>
+</web-app>
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/WEB-INF/web30.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/testCases.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/testCases.xml 2010-03-19
14:18:28 UTC (rev 20931)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/testCases.xml 2010-03-19
14:51:18 UTC (rev 20932)
@@ -678,5 +678,296 @@
<test name="JSFModelTest:testPaths">
<property name="path"
value="/faces-config-2.xml/Orderings/ordering/Before/n2"/>
</test>
+
+ <!-- Test Web Descriptor 3.0 -->
+ <!-- <web-app> -->
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path" value="/web30.xml"/>
+ <property name="attributeName" value="description"/>
+ <property name="attributeValue" value="Web Descriptor"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path" value="/web30.xml"/>
+ <property name="attributeName" value="display-name"/>
+ <property name="attributeValue" value="MyWeb"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path" value="/web30.xml"/>
+ <property name="attributeName" value="small-icon"/>
+ <property name="attributeValue" value="/small.gif"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path" value="/web30.xml"/>
+ <property name="attributeName" value="large-icon"/>
+ <property name="attributeValue" value="/large.gif"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path" value="/web30.xml"/>
+ <property name="attributeName" value="distributable"/>
+ <property name="attributeValue" value="yes"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path" value="/web30.xml"/>
+ <property name="attributeName" value="module-name"/>
+ <property name="attributeValue" value="myModule"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path" value="/web30.xml"/>
+ <property name="attributeName" value="metadata-complete"/>
+ <property name="attributeValue" value="false"/>
+ </test>
+ <!-- <absolute-ordering> -->
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path" value="/web30.xml/Absolute
Orderings/name1,name2"/>
+ <property name="attributeName" value="names"/>
+ <property name="attributeValue" value="name1,name2"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path" value="/web30.xml/Absolute
Orderings/name1,name2"/>
+ <property name="attributeName" value="others"/>
+ <property name="attributeValue" value="true"/>
+ </test>
+
+ <!-- <context-param> -->
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path" value="/web30.xml/Context
Params/param_1"/>
+ <property name="attributeName" value="param-name"/>
+ <property name="attributeValue" value="param_1"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path" value="/web30.xml/Context
Params/param_1"/>
+ <property name="attributeName" value="param-value"/>
+ <property name="attributeValue" value="value_1"/>
+ </test>
+
+ <!-- <data-source> -->
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path" value="/web30.xml/Data
Sources/dataSourceName"/>
+ <property name="attributeName" value="name"/>
+ <property name="attributeValue" value="dataSourceName"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path" value="/web30.xml/Data
Sources/dataSourceName"/>
+ <property name="attributeName" value="description"/>
+ <property name="attributeValue" value="data source
description"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path" value="/web30.xml/Data
Sources/dataSourceName"/>
+ <property name="attributeName" value="class-name"/>
+ <property name="attributeValue"
value="data.source.ClassName"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path" value="/web30.xml/Data
Sources/dataSourceName"/>
+ <property name="attributeName" value="server-name"/>
+ <property name="attributeValue" value="serverName"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path" value="/web30.xml/Data
Sources/dataSourceName"/>
+ <property name="attributeName" value="port-number"/>
+ <property name="attributeValue" value="1"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path" value="/web30.xml/Data
Sources/dataSourceName"/>
+ <property name="attributeName" value="database-name"/>
+ <property name="attributeValue" value="dbName"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path" value="/web30.xml/Data
Sources/dataSourceName"/>
+ <property name="attributeName" value="url"/>
+ <property name="attributeValue" value="jdbc:a:b"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path" value="/web30.xml/Data
Sources/dataSourceName"/>
+ <property name="attributeName" value="user"/>
+ <property name="attributeValue" value="user"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path" value="/web30.xml/Data
Sources/dataSourceName"/>
+ <property name="attributeName" value="password"/>
+ <property name="attributeValue" value="password"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path" value="/web30.xml/Data
Sources/dataSourceName"/>
+ <property name="attributeName" value="login-timeout"/>
+ <property name="attributeValue" value="2"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path" value="/web30.xml/Data
Sources/dataSourceName"/>
+ <property name="attributeName" value="transactional"/>
+ <property name="attributeValue" value="false"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path" value="/web30.xml/Data
Sources/dataSourceName"/>
+ <property name="attributeName" value="isolation-level"/>
+ <property name="attributeValue"
value="TRANSACTION_READ_UNCOMMITTED"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path" value="/web30.xml/Data
Sources/dataSourceName"/>
+ <property name="attributeName" value="initial-pool-size"/>
+ <property name="attributeValue" value="1"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path" value="/web30.xml/Data
Sources/dataSourceName"/>
+ <property name="attributeName" value="max-pool-size"/>
+ <property name="attributeValue" value="30"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path" value="/web30.xml/Data
Sources/dataSourceName"/>
+ <property name="attributeName" value="min-pool-size"/>
+ <property name="attributeValue" value="10"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path" value="/web30.xml/Data
Sources/dataSourceName"/>
+ <property name="attributeName" value="max-idle-time"/>
+ <property name="attributeValue" value="100"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path" value="/web30.xml/Data
Sources/dataSourceName"/>
+ <property name="attributeName" value="max-statements"/>
+ <property name="attributeValue" value="10"/>
+ </test>
+
+ <!-- <data-source/property> -->
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path" value="/web30.xml/Data
Sources/dataSourceName/property_1"/>
+ <property name="attributeName" value="value"/>
+ <property name="attributeValue" value="property 1 value"/>
+ </test>
+
+ <!-- <filter> -->
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path"
value="/web30.xml/Filters/filter:myFilter"/>
+ <property name="attributeName" value="description"/>
+ <property name="attributeValue" value="filter description"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path"
value="/web30.xml/Filters/filter:myFilter"/>
+ <property name="attributeName" value="display-name"/>
+ <property name="attributeValue" value="My Filter"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path"
value="/web30.xml/Filters/filter:myFilter"/>
+ <property name="attributeName" value="filter-name"/>
+ <property name="attributeValue" value="myFilter"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path"
value="/web30.xml/Filters/filter:myFilter"/>
+ <property name="attributeName" value="filter-class"/>
+ <property name="attributeValue" value="x.MyFilter"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path"
value="/web30.xml/Filters/filter:myFilter"/>
+ <property name="attributeName" value="async-supported"/>
+ <property name="attributeValue" value="true"/>
+ </test>
+ <!-- <filter/init-param> -->
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path"
value="/web30.xml/Filters/filter:myFilter/initParam1"/>
+ <property name="attributeName" value="param-value"/>
+ <property name="attributeValue" value="int param 1 value"/>
+ </test>
+
+ <!-- <filter-mapping> -->
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path"
value="/web30.xml/Filters/myFilter:*.jsp"/>
+ <property name="attributeName" value="filter-name"/>
+ <property name="attributeValue" value="myFilter"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path"
value="/web30.xml/Filters/myFilter:*.jsp"/>
+ <property name="attributeName" value="servlet-name"/>
+ <property name="attributeValue" value="myServlet"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path"
value="/web30.xml/Filters/myFilter:*.jsp"/>
+ <property name="attributeName" value="url-pattern"/>
+ <property name="attributeValue" value="*.jsp"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path"
value="/web30.xml/Filters/myFilter:*.jsp"/>
+ <property name="attributeName" value="dispatchers"/>
+ <property name="attributeValue" value="ASYNC,ERROR"/>
+ </test>
+
+ <!-- <listener> -->
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path"
value="/web30.xml/Listeners/x.MyListener"/>
+ <property name="attributeName" value="display-name"/>
+ <property name="attributeValue" value="My Listener"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path"
value="/web30.xml/Listeners/x.MyListener"/>
+ <property name="attributeName" value="listener-class"/>
+ <property name="attributeValue" value="x.MyListener"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path"
value="/web30.xml/Listeners/x.MyListener"/>
+ <property name="attributeName" value="description"/>
+ <property name="attributeValue" value="listener
description"/>
+ </test>
+
+ <!-- <servlet> -->
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path"
value="/web30.xml/Servlets/myServlet"/>
+ <property name="attributeName" value="display-name"/>
+ <property name="attributeValue" value="My Servlet"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path"
value="/web30.xml/Servlets/myServlet"/>
+ <property name="attributeName" value="servlet-name"/>
+ <property name="attributeValue" value="myServlet"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path"
value="/web30.xml/Servlets/myServlet"/>
+ <property name="attributeName" value="servlet-class"/>
+ <property name="attributeValue" value="x.MyServlet"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path"
value="/web30.xml/Servlets/myServlet"/>
+ <property name="attributeName" value="load-on-startup"/>
+ <property name="attributeValue" value="2"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path"
value="/web30.xml/Servlets/myServlet"/>
+ <property name="attributeName" value="enabled"/>
+ <property name="attributeValue" value="true"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path"
value="/web30.xml/Servlets/myServlet"/>
+ <property name="attributeName" value="async-supported"/>
+ <property name="attributeValue" value="true"/>
+ </test>
+
+ <!-- <servlet/init-param> -->
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path"
value="/web30.xml/Servlets/myServlet/param"/>
+ <property name="attributeName" value="param-value"/>
+ <property name="attributeValue" value="value"/>
+ </test>
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path"
value="/web30.xml/Servlets/myServlet/param"/>
+ <property name="attributeName" value="description"/>
+ <property name="attributeValue" value="param description"/>
+ </test>
+
+ <!-- <servlet/init-param> -->
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path"
value="/web30.xml/Servlets/myServlet/param"/>
+ <property name="attributeName" value="param-value"/>
+ <property name="attributeValue" value="value"/>
+ </test>
+ <!-- <servlet/security-role-ref> -->
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path"
value="/web30.xml/Servlets/myServlet/role2"/>
+ <property name="attributeName" value="role-name"/>
+ <property name="attributeValue" value="role2"/>
+ </test>
+
+ <!-- <servlet/multipart-config> -->
+ <test name="WebAppModelTest:testPaths:attribute">
+ <property name="path"
value="/web30.xml/Servlets/myServlet/#a.xml"/>
+ <property name="attributeName" value="location"/>
+ <property name="attributeValue" value="/a.xml"/>
+ </test>
</tests>
\ No newline at end of file
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JSFModelTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JSFModelTest.java 2010-03-19
14:18:28 UTC (rev 20931)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JSFModelTest.java 2010-03-19
14:51:18 UTC (rev 20932)
@@ -18,7 +18,9 @@
import org.jboss.tools.common.test.util.TestDescription;
import org.jboss.tools.common.test.util.TestProjectProvider;
+import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.filesystems.impl.AbstractXMLFileImpl;
import org.jboss.tools.common.model.loaders.EntityRecognizer;
import org.jboss.tools.common.model.loaders.EntityRecognizerContext;
import org.jboss.tools.common.model.project.IModelNature;
@@ -66,14 +68,33 @@
assertTrue("Cannot find objects at " + errorCount + " paths\n" +
sb.toString(), errorCount == 0);
testName = "JSFModelTest:testPaths:attribute";
- tests = provider.getTestDescriptions(testName);
+ doAttributeTest(n.getModel(), testName);
+ }
+
+ public void testWebApp() {
+ String testName = "WebAppModelTest:testPaths:attribute";
+ IModelNature n = EclipseResourceUtil.getModelNature(project);
+ doAttributeTest(n.getModel(), testName);
+ XModelObject o = n.getModel().getByPath("/web30.xml");
+ printPaths(o);
+ }
+
+ public void testWebAppLoader() {
+ IModelNature n = EclipseResourceUtil.getModelNature(project);
+ XModelObject o = n.getModel().getByPath("/web30.xml");
+ String error = ((AbstractXMLFileImpl)o).getLoaderError();
+ assertNull("Loader reported an error.", error);
+ }
+
+ void doAttributeTest(XModel model, String testName) {
+ ArrayList<TestDescription> tests = provider.getTestDescriptions(testName);
System.out.println(testName + " " + (tests == null ? -1 : tests.size()));
- sb = new StringBuffer();
- errorCount = 0;
+ StringBuffer sb = new StringBuffer();
+ int errorCount = 0;
if(tests != null) for (int i = 0; i < tests.size(); i++) {
TestDescription t = tests.get(i);
String path = t.getProperty("path");
- XModelObject o = n.getModel().getByPath(path);
+ XModelObject o = model.getByPath(path);
if(o == null) {
sb.append("Cannot find object at " + path).append("\n");
errorCount++;
@@ -99,10 +120,6 @@
}
}
assertTrue(sb.toString(), errorCount == 0);
-
- XModelObject o = n.getModel().getByPath("/faces-config-2.xml");
-// printPaths(o);
-
}
void printPaths(XModelObject o) {