Author: scabanovich
Date: 2012-02-03 21:04:15 -0500 (Fri, 03 Feb 2012)
New Revision: 38427
Modified:
trunk/seam/tests/org.jboss.tools.seam.xml.test/projects/Test/components23.xml
trunk/seam/tests/org.jboss.tools.seam.xml.test/src/org/jboss/tools/seam/xml/test/SeamXMLModelTest.java
Log:
JBIDE-10678
https://issues.jboss.org/browse/JBIDE-10678
Tests.
Modified: trunk/seam/tests/org.jboss.tools.seam.xml.test/projects/Test/components23.xml
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.xml.test/projects/Test/components23.xml 2012-02-04
01:17:46 UTC (rev 38426)
+++
trunk/seam/tests/org.jboss.tools.seam.xml.test/projects/Test/components23.xml 2012-02-04
02:04:15 UTC (rev 38427)
@@ -25,7 +25,8 @@
<navigation:pages http-port="3" https-port="4"
login-view-id="2" no-conversation-view-id="1"/>
<remoting:remoting debug="false" poll-interval="1"
poll-timeout="2"/>
<framework:entity-query ejbql="abc" name="entityQuery"/>
- <framework:hibernate-entity-query ejbql="abc"
name="hibernateEntityQuery"/>
+ <framework:hibernate-entity-query cache-region="sss" ejbql="abc"
+ fetch-size="3" name="hibernateEntityQuery"
session="x"/>
<framework:entity-home entity-class="org.MyEntityHome"
name="entityHome"/>
<framework:hibernate-entity-home name="hibernateEntityHome"/>
<security:identity authenticate-method="#{m1}"
remember-me="true"/>
Modified:
trunk/seam/tests/org.jboss.tools.seam.xml.test/src/org/jboss/tools/seam/xml/test/SeamXMLModelTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.xml.test/src/org/jboss/tools/seam/xml/test/SeamXMLModelTest.java 2012-02-04
01:17:46 UTC (rev 38426)
+++
trunk/seam/tests/org.jboss.tools.seam.xml.test/src/org/jboss/tools/seam/xml/test/SeamXMLModelTest.java 2012-02-04
02:04:15 UTC (rev 38427)
@@ -94,8 +94,8 @@
public void testDebugAttribute() { //JBIDE-7362
XModelObject fileObject = getComponents22Object();
JobUtils.waitForIdle();
- XMarkerManager.getInstance();
assertNotNull("Cannot create XModel object for file components22.xml.",
fileObject);
+ XMarkerManager.getInstance().getErrorState(fileObject);
XModelObject coreInit0 =
fileObject.getChildByPath("org.jboss.seam.core.init");
assertNotNull("Cannot find component org.jboss.seam.core.init.", coreInit0);
@@ -111,6 +111,7 @@
}
+ @SuppressWarnings("nls")
public void testXML23Model() {
IFile f = project.getFile(new Path("components23.xml"));
assertTrue("File components23.xml is not accessible in Test project.",
f.isAccessible());
@@ -122,6 +123,255 @@
assertEquals("File components23.xml is incorrectly parsed by XModel.",
SeamComponentConstants.ENT_SEAM_COMPONENTS_23, entity);
//TODO continue test
+
+ XModelObject c = fileObject.getChildByPath("myComponent");
+ assertNotNull(c);
+
+ c = fileObject.getChildByPath("myFactory");
+ assertNotNull(c);
+ assertEquals("myFactory", c.getAttributeValue("value"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.navigation.pages");
+ assertNotNull(c);
+ assertEquals("3", c.getAttributeValue("http-port"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.remoting.remoting");
+ assertNotNull(c);
+ assertEquals("1", c.getAttributeValue("poll-interval"));
+ assertEquals("2", c.getAttributeValue("poll-timeout"));
+
+ c = fileObject.getChildByPath("entityQuery");
+ assertNotNull(c);
+ assertEquals("abc", c.getAttributeValue("ejbql"));
+
+ c = fileObject.getChildByPath("hibernateEntityQuery");
+ assertNotNull(c);
+ assertEquals("abc", c.getAttributeValue("ejbql"));
+ assertEquals("sss", c.getAttributeValue("cache-region"));
+ assertEquals("3", c.getAttributeValue("fetch-size"));
+ assertEquals("x", c.getAttributeValue("session"));
+
+ c = fileObject.getChildByPath("entityHome");
+ assertNotNull(c);
+ assertEquals("org.MyEntityHome",
c.getAttributeValue("entity-class"));
+
+ c = fileObject.getChildByPath("hibernateEntityHome");
+ assertNotNull(c);
+
+ c = fileObject.getChildByPath("org.jboss.seam.security.identity");
+ assertNotNull(c);
+ assertEquals("#{m1}", c.getAttributeValue("authenticate-method"));
+ assertEquals("true", c.getAttributeValue("remember-me"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.security.identityManager");
+ assertNotNull(c);
+ assertEquals("#{xyz}", c.getAttributeValue("identity-store"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.security.jpaIdentityStore");
+ assertNotNull(c);
+ assertEquals("myManager", c.getAttributeValue("entity-manager"));
+ assertEquals("org.MyStore", c.getAttributeValue("user-class"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.security.jpaTokenStore");
+ assertNotNull(c);
+ assertEquals("myEntityManager",
c.getAttributeValue("entity-manager"));
+ assertEquals("String", c.getAttributeValue("token-class"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.security.ldapIdentityStore");
+ assertNotNull(c);
+ assertEquals("777", c.getAttributeValue("server-address"));
+ assertEquals("555", c.getAttributeValue("server-port"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.security.permissionManager");
+ assertNotNull(c);
+ assertEquals("#{permissionStore}",
c.getAttributeValue("permission-store"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.security.jpaPermissionStore");
+ assertNotNull(c);
+ assertEquals("myEntityManager",
c.getAttributeValue("entity-manager"));
+ assertEquals("org.MyPermissionClass",
c.getAttributeValue("user-permission-class"));
+
+ c =
fileObject.getChildByPath("org.jboss.seam.security.ruleBasedPermissionResolver");
+ assertNotNull(c);
+ assertEquals("#{myRules}", c.getAttributeValue("security-rules"));
+
+ c =
fileObject.getChildByPath("org.jboss.seam.security.persistentPermissionResolver");
+ assertNotNull(c);
+ assertEquals("#{myPermissionStore}",
c.getAttributeValue("permission-store"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.security.rememberMe");
+ assertNotNull(c);
+ assertEquals("101", c.getAttributeValue("cookie-max-age"));
+ assertEquals("disabled", c.getAttributeValue("mode"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.transaction.transaction");
+ assertNotNull(c);
+ assertEquals("abc", c.getAttributeValue("jndi-name"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.ui.jpaEntityLoader");
+ assertNotNull(c);
+ assertEquals("myEntityManager",
c.getAttributeValue("entity-manager"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.ui.hibernateEntityLoader");
+ assertNotNull(c);
+ assertEquals("mySession", c.getAttributeValue("session"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.ui.entityConverter");
+ assertNotNull(c);
+ assertEquals("myEntityLoader",
c.getAttributeValue("entity-loader"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.web.contextFilter");
+ assertNotNull(c);
+ assertEquals("*", c.getAttributeValue("url-pattern"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.web.exceptionFilter");
+ assertNotNull(c);
+ assertEquals("*", c.getAttributeValue("url-pattern"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.web.multipartFilter");
+ assertNotNull(c);
+ assertEquals("*", c.getAttributeValue("url-pattern"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.web.ajax4jsfFilter");
+ assertNotNull(c);
+
+ c = fileObject.getChildByPath("org.jboss.seam.web.authenticationFilter");
+ assertNotNull(c);
+
+ c = fileObject.getChildByPath("org.jboss.seam.web.cacheControlFilter");
+ assertNotNull(c);
+
+ c =
fileObject.getChildByPath("org.jboss.seam.servlet.characterEncodingFilter");
+ assertNotNull(c);
+
+ c = fileObject.getChildByPath("org.jboss.seam.web.hotDeployFilter");
+ assertNotNull(c);
+
+ c = fileObject.getChildByPath("org.jboss.seam.web.identityFilter");
+ assertNotNull(c);
+
+ c = fileObject.getChildByPath("org.jboss.seam.web.loggingFilter");
+ assertNotNull(c);
+
+ c = fileObject.getChildByPath("org.jboss.seam.web.redirectFilter");
+ assertNotNull(c);
+
+ c = fileObject.getChildByPath("org.jboss.seam.web.rewriteFilter");
+ assertNotNull(c);
+
+ c = fileObject.getChildByPath("org.jboss.seam.web.session");
+ assertNotNull(c);
+
+ c = fileObject.getChildByPath("org.jboss.seam.web.wicketFilter");
+ assertNotNull(c);
+ assertEquals("myClass", c.getAttributeValue("application-class"));
+
+ c = fileObject.getChildByPath("myPersistentContext");
+ assertNotNull(c);
+ assertEquals("myname",
c.getAttributeValue("persistence-unit-jndi-name"));
+
+ c = fileObject.getChildByPath("myManagerFactory");
+ assertNotNull(c);
+ assertEquals("myName",
c.getAttributeValue("persistence-unit-name"));
+
+ c = fileObject.getChildByPath("myFilter");
+ assertNotNull(c);
+ assertEquals("myFilterName", c.getAttributeValue("filter name"));
+
+ c = fileObject.getChildByPath("mySession");
+ assertNotNull(c);
+
+ c = fileObject.getChildByPath("mySessionFactory");
+ assertNotNull(c);
+
+ c = fileObject.getChildByPath("org.jboss.seam.async.dispatcher");
+ assertNotNull(c);
+
+ c = fileObject.getChildByPath("myManagedWorkingMemory");
+ assertNotNull(c);
+
+ c = fileObject.getChildByPath("myRuleBase");
+ assertNotNull(c);
+ assertEquals("fff", c.getAttributeValue("rule-files"));
+
+ c = fileObject.getChildByPath("myRuleAgent");
+ assertNotNull(c);
+ assertEquals("fff", c.getAttributeValue("configuration-file"));
+
+ c =
fileObject.getChildByPath("org.jboss.seam.international.localeSelector");
+ assertNotNull(c);
+ assertEquals("ss", c.getAttributeValue("locale-string"));
+
+ c =
fileObject.getChildByPath("org.jboss.seam.international.timeZoneSelector");
+ assertNotNull(c);
+ assertEquals("22", c.getAttributeValue("time-zone-id"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.international.localeConfig");
+ assertNotNull(c);
+ assertEquals("ru", c.getAttributeValue("default-locale"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.wicket.webApplication");
+ assertNotNull(c);
+ assertEquals("org.MyApplication",
c.getAttributeValue("application-class"));
+
+ c = fileObject.getChildByPath("myKeyStore");
+ assertNotNull(c);
+ assertEquals("a", c.getAttributeValue("key-alias"));
+ assertEquals("p", c.getAttributeValue("key-password"));
+ assertEquals("keyStore", c.getAttributeValue("key-store"));
+ assertEquals("q", c.getAttributeValue("key-store-password"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.core.init");
+ assertNotNull(c);
+ assertEquals("pp", c.getAttributeValue("jndi-pattern"));
+ assertEquals("true", c.getAttributeValue("security-enabled"));
+ assertEquals("true",
c.getAttributeValue("transaction-management-enabled"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.core.manager");
+ assertNotNull(c);
+ assertEquals("1", c.getAttributeValue("conversation-timeout"));
+ assertEquals("1",
c.getAttributeValue("concurrent-request-timeout"));
+ assertEquals("p",
c.getAttributeValue("conversation-id-parameter"));
+ assertEquals("MANUAL", c.getAttributeValue("default-flush-mode"));
+ assertEquals("q",
c.getAttributeValue("parent-conversation-id-parameter"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.core.pojoCache");
+ assertNotNull(c);
+ assertEquals("nnn", c.getAttributeValue("cfg-resource-name"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.core.resourceLoader");
+ assertNotNull(c);
+ assertEquals("n1,n2", c.getAttributeValue("bundle-names"));
+
+ c = fileObject.getChildByPath("mySelector");
+ assertNotNull(c);
+ assertEquals("x", c.getAttributeValue("theme"));
+ assertEquals("x,y", c.getAttributeValue("available-themes"));
+ assertEquals("true", c.getAttributeValue("cookie-enabled"));
+ assertEquals("100", c.getAttributeValue("cookie-max-age"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.jms.queueConnection");
+ assertNotNull(c);
+ assertEquals("myName", c.getAttributeValue("factory-jndi-name"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.jms.topicConnection");
+ assertNotNull(c);
+ assertEquals("factory", c.getAttributeValue("factory-jndi-name"));
+
+ c = fileObject.getChildByPath("myTopicPublisher");
+ assertNotNull(c);
+ assertEquals("jjj", c.getAttributeValue("topic-jndi-name"));
+
+ c = fileObject.getChildByPath("mySender");
+ assertNotNull(c);
+ assertEquals("nn", c.getAttributeValue("queue-jndi-name"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.bpm.actor");
+ assertNotNull(c);
+ assertEquals("1", c.getAttributeValue("group-actor-ids"));
+
+ c = fileObject.getChildByPath("org.jboss.seam.bpm.jbpm");
+ assertNotNull(c);
}
protected void assertAttribute(XModelObject object, String name, String value) {