[Deployers on JBoss (Deployers/JBoss)] - Re: Ordering of .ear subdeployments
by vickyk
I have been in a process of writing a test case for the change but there seems to be some more changes to be made if we need the automated test case . Here are my analysis
1) The DeploymentInfo needs to have a field as
public ArrayList actualEarlierDeployements ;
which will be set during the initi of the MainDeployer
2) The init of the MainDeployer have
// Changes for the JBAB-2904
ArrayList actualEarlierSortedSubs = new ArrayList(deployment.subDeployments);
Collections.sort(actualEarlierSortedSubs, infoSorter);
deployment.actualEarlierDeployements = actualEarlierSortedSubs;
boolean isSorted = deployment.getSortedSubDeployments();
if(!isSorted){
Collections.sort(sortedSubs, infoSorter);
}
// Changes for the JBAB-2904
3) The additional actualEarlierDeployements from the DeploymentInfo can be used in the UnitTest to see the variation in the ordering .
If we dont keep the UnitTest then we dont need to make the changes in the DeploymentInfo object .
Here is the UnitTest Code I have been in process of writing
| /*
| * JBoss, the OpenSource J2EE webOS
| *
| * Distributable under LGPL license.
| * See terms of license at gnu.org.
| */
| package org.jboss.test.deployers.ear.jbas2904;
|
| import java.util.ArrayList;
| import java.util.Collection;
| import java.util.HashSet;
| import java.util.Iterator;
| import java.util.Set;
| import java.util.StringTokenizer;
|
| import java.net.JarURLConnection;
| import java.net.URL;
|
| import java.io.InputStream;
| import java.io.File;
| import java.io.FileInputStream;
|
| import junit.framework.Test;
| import junit.framework.TestSuite;
|
| import org.jboss.deployment.DeploymentInfo;
| import org.jboss.deployment.EARDeployer;
| import org.jboss.test.deployers.AbstractDeploymentTest;
|
| import org.w3c.dom.Element;
| import org.w3c.dom.Node;
| import org.w3c.dom.NodeList;
|
| import org.jboss.metadata.XmlFileLoader;
|
| /**
| * A test that tests the JBAB2904
| *
| * build compile-classes-only
| * build -Dtest=org.jboss.test.deployers.ear.jbas2904.EARDeploymentUnitTestCase one-test
| * @author <a href="vicky.kak(a)jboss.com">Vicky Kak</a>
| * @version $Revision: 1.0 $
| */
| public class EARDeploymentUnitTestCase extends AbstractDeploymentTest
| {
|
| public EARDeploymentUnitTestCase(String test)
| {
| super(test);
| }
|
| public static Test suite() throws Exception
| {
| return getDeploySetup(EARDeploymentUnitTestCase.class, ear1Deployment);
| }
|
| public void testEARDeployment() throws Exception{
| //Expected Deployment Ordering
| DeploymentInfo topInfo = assertDeployed(ear1Deployment);
| ArrayList expectedList = new ArrayList();
| String urltoread = (topInfo.url).toString();
| URL applicationUrl = new URL("jar:"+urltoread+"!/META-INF/application.xml");
| JarURLConnection jarConnection = (JarURLConnection)applicationUrl.openConnection();
| InputStream is = jarConnection.getInputStream();
| System.out.println("Expected Ordering ------->");
| expectedList = getExpectedDeployedModules(is,"application.xml");
| is.close();
| applicationUrl = new URL("jar:"+urltoread+"!/META-INF/jboss-app.xml");
| jarConnection = (JarURLConnection)applicationUrl.openConnection();
| is = jarConnection.getInputStream();
| ArrayList expectedList1 = getExpectedDeployedModules(is,"jboss-app.xml");
| expectedList.addAll(expectedList1);
| is.close();
| Object expectedModules[] = expectedList.toArray();
|
| //Actual Results
| //Set subDeployments = topInfo.subDeployments;
| ArrayList subDeployments = topInfo.actualEarlierDeployements;
| //System.out.println("subDeployments : "+subDeployments.size());
| System.out.println("Actual Ordering -------->");
| ArrayList deployedModuleNames = new ArrayList(subDeployments.size());
| int index = 0;
| if (subDeployments != null )
| {
| //for (Iterator i = subDeployments.iterator(); i.hasNext(); )
| for(int count = 0;count<subDeployments.size();count++)
| {
| //DeploymentInfo child = (DeploymentInfo) i.next();
| DeploymentInfo child = (DeploymentInfo)subDeployments.get(count);
| URL url = child.url;
| String moduleName = getModuleDeployed(url.toString());
| deployedModuleNames.add(moduleName);
| System.out.println(getModuleDeployed(url.toString()));
| //assertEquals(((String)expectedModules[index]),moduleName);
| index++;
| }
| }
| }
|
| private String getModuleDeployed(String tempUrl){
| StringTokenizer st = new StringTokenizer(tempUrl,"/");
| String moduleName = "";
| while (st.hasMoreTokens()) {
| moduleName = st.nextToken();
| //System.out.println(moduleName);
| }
| return moduleName;
| }
|
| private ArrayList getExpectedDeployedModules(InputStream in,String xmlDDFileName) throws Exception{
|
| XmlFileLoader xfl = new XmlFileLoader(false);
| Element application = xfl.getDocument(in, xmlDDFileName).getDocumentElement();
| NodeList jeemoduleList = application.getElementsByTagName("module");
| int jeemoduleListCount = jeemoduleList.getLength();
| ArrayList list = new ArrayList(jeemoduleListCount);
| //System.out.println(" jeemoduleListCount :"+jeemoduleListCount);
| for(int count=0;count<jeemoduleListCount;count++)
| {
| Node node = jeemoduleList.item(count);
| if(node.getNodeType()== Node.ELEMENT_NODE)
| {
| String module = node.getNodeValue();
| Element mod = (Element) node;
| NodeList jeeNodeList = mod.getElementsByTagName("java");
| //System.out.println("Modules are >>>>-->"+jeeNodeList.getLength());
| int nodescount = jeeNodeList.getLength();
| if(nodescount==0)
| {
| jeeNodeList = mod.getElementsByTagName("ejb");
| nodescount = jeeNodeList.getLength();
| }
| if(nodescount==0)
| {
| jeeNodeList = mod.getElementsByTagName("web-uri");
| nodescount = jeeNodeList.getLength();
|
| }
| if(nodescount==0)
| {
| jeeNodeList = mod.getElementsByTagName("connector");
| nodescount = jeeNodeList.getLength();
| }
| if(nodescount==0)
| {
| jeeNodeList = mod.getElementsByTagName("service");
| nodescount = jeeNodeList.getLength();
| }
| Node checkNode = jeeNodeList.item(0);
| if(checkNode!=null){
| String nodeName = checkNode.getFirstChild().getNodeValue();
| System.out.println(nodeName);
| list.add(nodeName);
| }
| }
| }
| return list;
| }
| }
|
|
Any inputs here ?
Regards
Vicky
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961226#3961226
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961226
17 years, 10 months
[Design of JBoss jBPM] - Re: interested in contributing ?
by ikoblik
Hello, Tom.
That is the most important task for me now, but there is something more that I have to do. My company produces electronics, and usually production workflow is quite dim. So I have to provide some facility to SWITCH process instance from one definition to another. This is completely new development branch and doing this we could use GPD taht you already have. But there should be an interface to connect running server with GPD, for it to read information of all the processes instances and their definitions. And here comes new question: "What if we start developing Eclipse like client for jBPM which would incorporate it?".
Maybe later I'll post some thoughts on it in jira.
BTW: I've almost finished localization of the GPD, it uses standart resources algorithm, all the interface text data is kept in "messages[_??].properties" files, where ?? corresponds to language. I've posted it at GPD-1.
Best regards, Ivan
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961213#3961213
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961213
17 years, 10 months
[Design of JBoss Eclipse IDE (dev)] - Re: Max -- followup to our JBossWorld conversation re: SEAM
by max.andersen@jboss.com
"hxp" wrote :
| It was good to chat with you at JBossWorld, and I'm following up on our conversation about fixes/improvements to the SEAM CRUD FreeMarker Templates.
|
Cool :)
anonymous wrote :
| You mentioned that further progress was waiting on some bandwidth from Gavin, and I'm wondering what the current outlook is.
|
Gavin is busy doing other things; so feel free to attack it ;)
anonymous wrote :
| I've tracked JIRA tasks & roadmap, and except for the somewhat-related HBX-670, there doesn't appear to be much on the subject of the composite keys, or seam 1.0.x.GA compatibility.
|
i don't understand why 1.0.x.GA compability is still an issue...It works for me (or at least did during JBossWorld :)
composite keys is just a known issue.
Similar to the seam templates not being able to handle recursive associations.
anonymous wrote :
| Then I noticed JBIDE-337, and the forum discussion, and realized that you all have your focus on something far more ambitious that what we discussed.
|
yes, but this will not invalidate work on the crud code generation code.
anonymous wrote :
| So now it's not clear to me whether the fixup of the templates is going to happen prior a whole new SEAM IDE coming out... but it would be really good if there were a fixup to keep this wonderful tool operational in the interim :)
|
of course. Just need someone to step up and contribute ;)
anonymous wrote :
|
| seam/*:
|
| 1) compatible/compliant with jboss-seam-1.0.1.GA
|
I would like to be told what exactly is missing here.
anonymous wrote :
| 2) edit.jsp.ftl & find.jsp.ftl fixed for the composite key issue (+ any other files that need to be fixed to support compound keys?)... and for proper relationship traversal.
|
It might be interesting to simplify alot of the code in this CRUD generation to simply be REST'full and/or not be too fancy with using all of Seam features (like workspaces etc.) ...it's more important that the code is clean and understandable than being feature rich.
Note, if you can come up with simple generated code and still be feature rich then great ;)
anonymous wrote :
| 3) migration of *.jsp.ftl to *.xhtml.ftl, to support the Facelet model instead of the older JSP model (+ add faces-config.xml.ftl, and will need facelet jars)
|
ok. facelets would be a definite plus (amongst others we can validate the generated code better in the junittests for the codegenerator)
anonymous wrote :
| 3a) optionally, as much convergence with the structure of the (Facelets-based) Booking example as possible
|
Similarity is good.
anonymous wrote :
| 4) persistence.xml.ftl needs to be parameterized, at minimum to reflect the datasource that was reverse-engineered (later, good to have option to generate persistence.xml for a different intended target datasource than the rev-eng'd one).
|
yes for the persistence.xml to be more complete.
Changing the datasource for the output is *low* priority since that it would be better to just go change it manually or some other tool/wizard/editor than adding "complexity".
we actually need this persistence.xml generation to be an independent exporter like the hibernate cfg.xml and pojo exporter is.
anonymous wrote :
| 5) optionally, whatever else can quickly be built-into the CRUD templates to show-off the rich feature set of SEAM 1.0.1.GA (but should *not* require SEAM 1.1; when it's time to support more than 1.0.1.GA, consider having HibernateTools support multiple template sets, for output to different SEAM version targets).
|
I would be a little conservative here and focus on the previous 4 first.
But it of course depends on what features you are thinking about.
anonymous wrote :
| 6) *not* for now, by important soon: the template-generated SEAM project must match the layout structure contemplated in JBIDE-337, and the selected artifacts must be re/generatable into a pre-existing SEAM project without wrecking it.... plus the eventual JBIDE-337 design must take into account that many developers will prefer to clone & fork existing SEAM projects (such as from the examples, or from their own past work) rather than use a wizard... all of which leads to the need for tool-supported libraries of reusable work (including user-created FreeMarker templates), and open-ended easily-extensible library-aware wizards that support such reuse.
|
The current SeamExporter is basically a very crude "bundler" of alot of other templates and exporters. This was just intended for a "quick and dirty" seam generation.
I want to split these into more atomic parts which then can be (optionally) used individually to be used in both Ant and the Eclipse tools.
anonymous wrote :
| pojo/Ejb3TypeDeclaration.ftl
Need some way to turn off schema and/or catalog generation in the output, even if they exist in the input -- we want a test for something like "if clazz.table.catalog?exists AND is_desired_in_the_output" ---
| <#if clazz.table.schema?exists>
| ,schema="${clazz.table.schema}"
| </#if>
| <#if clazz.table.catalog?exists>
| ,catalog="${clazz.table.catalog}"
| </#if>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961207#3961207
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961207
17 years, 10 months
[Design of JBoss Eclipse IDE (dev)] - Max -- followup to our JBossWorld conversation re: SEAM CRUD
by hxp
Hi Max,
It was good to chat with you at JBossWorld, and I'm following up on our conversation about fixes/improvements to the SEAM CRUD FreeMarker Templates.
You mentioned that further progress was waiting on some bandwidth from Gavin, and I'm wondering what the current outlook is.
I've tracked JIRA tasks & roadmap, and except for the somewhat-related HBX-670, there doesn't appear to be much on the subject of the composite keys, or seam 1.0.x.GA compatibility.
Then I noticed JBIDE-337, and the forum discussion, and realized that you all have your focus on something far more ambitious that what we discussed.
So now it's not clear to me whether the fixup of the templates is going to happen prior a whole new SEAM IDE coming out... but it would be really good if there were a fixup to keep this wonderful tool operational in the interim :)
In particular, to recap what I believe is needed to bring the set of FreeMarker templates up to snuff:
seam/*:
1) compatible/compliant with jboss-seam-1.0.1.GA
2) edit.jsp.ftl & find.jsp.ftl fixed for the composite key issue (+ any other files that need to be fixed to support compound keys?)... and for proper relationship traversal.
3) migration of *.jsp.ftl to *.xhtml.ftl, to support the Facelet model instead of the older JSP model (+ add faces-config.xml.ftl, and will need facelet jars)
3a) optionally, as much convergence with the structure of the (Facelets-based) Booking example as possible
4) persistence.xml.ftl needs to be parameterized, at minimum to reflect the datasource that was reverse-engineered (later, good to have option to generate persistence.xml for a different intended target datasource than the rev-eng'd one).
5) optionally, whatever else can quickly be built-into the CRUD templates to show-off the rich feature set of SEAM 1.0.1.GA (but should *not* require SEAM 1.1; when it's time to support more than 1.0.1.GA, consider having HibernateTools support multiple template sets, for output to different SEAM version targets).
6) *not* for now, by important soon: the template-generated SEAM project must match the layout structure contemplated in JBIDE-337, and the selected artifacts must be re/generatable into a pre-existing SEAM project without wrecking it.... plus the eventual JBIDE-337 design must take into account that many developers will prefer to clone & fork existing SEAM projects (such as from the examples, or from their own past work) rather than use a wizard... all of which leads to the need for tool-supported libraries of reusable work (including user-created FreeMarker templates), and open-ended easily-extensible library-aware wizards that support such reuse.
pojo/Ejb3TypeDeclaration.ftl
Need some way to turn off schema and/or catalog generation in the output, even if they exist in the input -- we want a test for something like "if clazz.table.catalog?exists AND is_desired_in_the_output" ---
| <#if clazz.table.schema?exists>
| ,schema="${clazz.table.schema}"
| </#if>
| <#if clazz.table.catalog?exists>
| ,catalog="${clazz.table.catalog}"
| </#if>
A common use case, for example, would be rev-enging from MSSQLServer (3-part table names), and generating for MySQL (no 3-part table names).
Any way, no worries; just looking for the roadmap.
Best regards
Howard "hxp" Pearlmutter
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961200#3961200
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961200
17 years, 10 months