JBoss Tools SVN: r20179 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2010-02-08 10:11:24 -0500 (Mon, 08 Feb 2010)
New Revision: 20179
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfFacet.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5768
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfFacet.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfFacet.java 2010-02-08 15:09:12 UTC (rev 20178)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfFacet.java 2010-02-08 15:11:24 UTC (rev 20179)
@@ -10,15 +10,11 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.jsf.template;
-import java.util.List;
-
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.util.HTML;
-import org.jboss.tools.vpe.editor.util.VisualDomUtil;
-import org.jboss.tools.vpe.editor.util.XmlUtil;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.w3c.dom.Node;
@@ -51,22 +47,33 @@
*/
for (int i = 0; i < children.getLength(); i++) {
Node child = children.item(i);
- String sourcePrefix = child.getPrefix();
- if (XmlUtil.hasTaglib(sourceNode, pageContext, sourcePrefix)) {
- String sourceNodeUri = XmlUtil.getTaglibUri(sourceNode, pageContext, sourcePrefix);
- if ((child.getNodeType() == Node.ELEMENT_NODE)
- && (VisualDomUtil.JSF_CORE_URI.equalsIgnoreCase(sourceNodeUri)
- || VisualDomUtil.JSF_HTML_URI.equalsIgnoreCase(sourceNodeUri)
- || VisualDomUtil.RICH_FACES_URI.equalsIgnoreCase(sourceNodeUri)
- || VisualDomUtil.A4J_URI.equalsIgnoreCase(sourceNodeUri)
- || VisualDomUtil.FACELETS_URI.equalsIgnoreCase(sourceNodeUri))) {
+// String sourcePrefix = child.getPrefix();
+// if (XmlUtil.hasTaglib(sourceNode, pageContext, sourcePrefix)) {
+// String sourceNodeUri = XmlUtil.getTaglibUri(sourceNode, pageContext, sourcePrefix);
+ if( ((child.getNodeType()==Node.TEXT_NODE) &&
+ (child.getNodeValue()!=null)
+ && (child.getNodeValue().trim().length()>0)
+ ) ||(child.getNodeType() == Node.ELEMENT_NODE)) {
VpeChildrenInfo childrenInfo = new VpeChildrenInfo(div);
childrenInfo.addSourceChild(child);
creationData.addChildrenInfo(childrenInfo);
jsfComponentFound = true;
break;
}
- }
+ //commented by Maksim Areshkau as fix for https://jira.jboss.org/jira/browse/JBIDE-5744
+// if ((child.getNodeType() == Node.ELEMENT_NODE)){
+//// && (VisualDomUtil.JSF_CORE_URI.equalsIgnoreCase(sourceNodeUri)
+//// || VisualDomUtil.JSF_HTML_URI.equalsIgnoreCase(sourceNodeUri)
+//// || VisualDomUtil.RICH_FACES_URI.equalsIgnoreCase(sourceNodeUri)
+//// || VisualDomUtil.A4J_URI.equalsIgnoreCase(sourceNodeUri)
+//// || VisualDomUtil.FACELETS_URI.equalsIgnoreCase(sourceNodeUri))) {
+// VpeChildrenInfo childrenInfo = new VpeChildrenInfo(div);
+// childrenInfo.addSourceChild(child);
+// creationData.addChildrenInfo(childrenInfo);
+// jsfComponentFound = true;
+// break;
+//// }
+// }
}
if (!jsfComponentFound) {
14 years, 9 months
JBoss Tools SVN: r20178 - in trunk: vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: yzhishko
Date: 2010-02-08 10:09:12 -0500 (Mon, 08 Feb 2010)
New Revision: 20178
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/NaturesChecker_JBIDE5701.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeTest.java
Log:
Natures Checker disabled for tests
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/NaturesChecker_JBIDE5701.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/NaturesChecker_JBIDE5701.java 2010-02-08 15:00:12 UTC (rev 20177)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/NaturesChecker_JBIDE5701.java 2010-02-08 15:09:12 UTC (rev 20178)
@@ -7,7 +7,9 @@
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.part.FileEditorInput;
import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
+import org.jboss.tools.jst.jsp.JspEditorPlugin;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.jst.jsp.preferences.IVpePreferencesPage;
import org.jboss.tools.vpe.ui.test.TestUtil;
import org.jboss.tools.vpe.ui.test.VpeTest;
@@ -21,7 +23,7 @@
"Please use the Configure menu on the project to enable JSF if " + //$NON-NLS-1$
"you want all features of the editor working."; //$NON-NLS-1$
private static final String SECOND_TEST_PAGE_NAME = "components/commandButton.jsp"; //$NON-NLS-1$
-
+
public NaturesChecker_JBIDE5701(String name) {
super(name);
}
@@ -125,4 +127,16 @@
}
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ JspEditorPlugin.getDefault().getPreferenceStore().setValue(IVpePreferencesPage.INFORM_WHEN_PROJECT_MIGHT_NOT_BE_CONFIGURED_PROPERLY_FOR_VPE, true);
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ JspEditorPlugin.getDefault().getPreferenceStore().setValue(IVpePreferencesPage.INFORM_WHEN_PROJECT_MIGHT_NOT_BE_CONFIGURED_PROPERLY_FOR_VPE, false);
+ super.tearDown();
+ }
+
}
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeTest.java 2010-02-08 15:00:12 UTC (rev 20177)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeTest.java 2010-02-08 15:09:12 UTC (rev 20178)
@@ -35,7 +35,9 @@
import org.eclipse.wst.sse.ui.internal.reconcile.StructuredRegionProcessor;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
import org.jboss.tools.common.model.util.ClassLoaderUtil;
+import org.jboss.tools.jst.jsp.JspEditorPlugin;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.jst.jsp.preferences.IVpePreferencesPage;
import org.jboss.tools.vpe.editor.VpeController;
import org.jboss.tools.vpe.editor.mapping.VpeDomMapping;
import org.jboss.tools.vpe.editor.mapping.VpeElementMapping;
@@ -64,12 +66,13 @@
/** check warning log. */
private boolean checkWarning = false;
-
+
// FIX for JBIDE-1628
static {
ClassLoaderUtil.init();
// wait for initialization
TestUtil.delay(3000);
+ JspEditorPlugin.getDefault().getPreferenceStore().setValue(IVpePreferencesPage.INFORM_WHEN_PROJECT_MIGHT_NOT_BE_CONFIGURED_PROPERLY_FOR_VPE, false);
}
/**
@@ -93,7 +96,6 @@
@Override
protected void setUp() throws Exception {
super.setUp();
-
Platform.addLogListener(this);
// String jbossPath = System.getProperty(
// "jbosstools.test.jboss.home.4.2", "C:\\java\\jboss-4.2.2.GA");
14 years, 9 months
JBoss Tools SVN: r20177 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-02-08 10:00:12 -0500 (Mon, 08 Feb 2010)
New Revision: 20177
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractXMLFileImpl.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5802
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractXMLFileImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractXMLFileImpl.java 2010-02-08 14:57:32 UTC (rev 20176)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractXMLFileImpl.java 2010-02-08 15:00:12 UTC (rev 20177)
@@ -81,7 +81,9 @@
ln1 = "" + (iln - 1); //$NON-NLS-1$
}
} catch (NumberFormatException e) {
- ModelPlugin.getPluginLog().logError(e);
+// ignore, some errors found by entity resolver do not have coordinates
+// but use similar format to mention io exception.
+// ModelPlugin.getPluginLog().logError(e);
}
String ep = MessageFormat.format("ERROR: {0} {1}", FindObjectHelper.makeRef(getPath() + ":" + ln1, ln + ":" + pos), er); //$NON-NLS-2$ //$NON-NLS-3$
if(iln < 0) markers.lines.remove(ep);
14 years, 9 months
JBoss Tools SVN: r20176 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2010-02-08 09:57:32 -0500 (Mon, 08 Feb 2010)
New Revision: 20176
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768/test.xhtml.xml
Removed:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768/richDataTableFooterIsMissing.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768/richDataTableFooterIsMissing.xhtml.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-5768 junit tests
Deleted: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768/richDataTableFooterIsMissing.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768/richDataTableFooterIsMissing.xhtml 2010-02-08 14:22:52 UTC (rev 20175)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768/richDataTableFooterIsMissing.xhtml 2010-02-08 14:57:32 UTC (rev 20176)
@@ -1,17 +0,0 @@
-<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<ui:composition xmlns="http://www.w3.org/1999/xhtml"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:rich="http://richfaces.org/rich"
- xmlns:f="http://java.sun.com/jsf/core">
- <html>
- <head>
- <title>header footer don't render</title>
- </head>
- <body>
- <rich:dataTable id="footerIsMissing" border="1">
- <f:facet name="header">HEADER</f:facet>
- <f:facet name="footer">FOOTER</f:facet>
- </rich:dataTable>
- </body>
- </html>
-</ui:composition>
Deleted: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768/richDataTableFooterIsMissing.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768/richDataTableFooterIsMissing.xhtml.xml 2010-02-08 14:22:52 UTC (rev 20175)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768/richDataTableFooterIsMissing.xhtml.xml 2010-02-08 14:57:32 UTC (rev 20176)
@@ -1,49 +0,0 @@
-<tests>
-<test id="footerIsMissing">
-<TABLE BORDER="1" ID="footerIsMissing" CLASS="dr-table rich-table "
- TITLE="rich:dataTable
-id: footerIsMissing
-border: 1">
- <COLGROUP SPAN="0" TITLE="rich:dataTable
-id: footerIsMissing
-border: 1">
- </COLGROUP>
- <THEAD TITLE="rich:dataTable
-id: footerIsMissing
-border: 1">
- <TR CLASS="dr-table-header rich-table-header "
- STYLE="/background-image: url\(.*resources/common/background.gif\);/"
- TITLE="rich:dataTable
-id: footerIsMissing
-border: 1">
- <TD CLASS="dr-table-headercell rich-table-headercell " COLSPAN="100"
- SCOPE="colgroup" TITLE="rich:dataTable
-id: footerIsMissing
-border: 1">
- <SPAN CLASS="vpe-text">
- HEADER
-</SPAN>
- </TD>
- </TR>
- </THEAD>
- <TFOOT TITLE="rich:dataTable
-id: footerIsMissing
-border: 1">
- <TR CLASS="dr-table-footer rich-table-footer "
- STYLE="/background-image: url\(.*resources/common/background.gif\);/"
- TITLE="rich:dataTable
-id: footerIsMissing
-border: 1">
- <TD CLASS="dr-table-footercell rich-table-footercell " COLSPAN="100"
- SCOPE="colgroup" TITLE="rich:dataTable
-id: footerIsMissing
-border: 1">
- <SPAN CLASS="vpe-text">
- FOOTER
-</SPAN>
- </TD>
- </TR>
- </TFOOT>
-</TABLE>
-</test>
-</tests>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768/test.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768/test.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768/test.xhtml.xml 2010-02-08 14:57:32 UTC (rev 20176)
@@ -0,0 +1,8 @@
+<tests>
+<test id="footerIsMissing">
+
+</test>
+<test id="headermIsMissingAsWell">
+
+</test>
+</tests>
14 years, 9 months
JBoss Tools SVN: r20175 - trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-02-08 09:22:52 -0500 (Mon, 08 Feb 2010)
New Revision: 20175
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractComponent.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5765
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractComponent.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractComponent.java 2010-02-08 13:46:59 UTC (rev 20174)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractComponent.java 2010-02-08 14:22:52 UTC (rev 20175)
@@ -25,6 +25,7 @@
import org.jboss.tools.common.xml.XMLUtilities;
import org.jboss.tools.jst.web.kb.IPageContext;
import org.jboss.tools.jst.web.kb.KbQuery;
+import org.jboss.tools.jst.web.kb.PageProcessor;
import org.jboss.tools.jst.web.kb.internal.KbObject;
import org.jboss.tools.jst.web.kb.internal.KbXMLStoreConstants;
import org.jboss.tools.jst.web.kb.internal.taglib.composite.CompositeAttribute;
@@ -103,30 +104,30 @@
* @see org.jboss.tools.jst.web.kb.taglib.IComponent#getAttributes(java.lang.String)
*/
public IAttribute[] getAttributes(String nameTemplate) {
- return getAttributes(nameTemplate, null);
+ return getAttributes(nameTemplate, null, null);
}
- public IAttribute[] getAttributes(String nameTemplate, IPageContext context) {
+ public IAttribute[] getAttributes(String nameTemplate, IPageContext context, KbQuery query) {
List<IAttribute> list = new ArrayList<IAttribute>();
IAttribute[] atts = getAttributes();
for (int i = 0; i < atts.length; i++) {
if(ignoreCase) {
- if(atts[i].getName().toLowerCase().startsWith(nameTemplate.toLowerCase()) && (context==null || checkExtended(atts[i], context))) {
+ if(atts[i].getName().toLowerCase().startsWith(nameTemplate.toLowerCase()) && (context==null || checkExtended(atts[i], context, query))) {
list.add(atts[i]);
}
- } else if(atts[i].getName().startsWith(nameTemplate) && (context==null || checkExtended(atts[i], context))) {
+ } else if(atts[i].getName().startsWith(nameTemplate) && (context==null || checkExtended(atts[i], context, query))) {
list.add(atts[i]);
}
}
return list.toArray(new IAttribute[list.size()]);
}
- protected IAttribute[] getExtendedAttributes(IPageContext context) {
+ protected IAttribute[] getExtendedAttributes(IPageContext context, KbQuery query) {
if(hasExtendedAttributes) {
Set<IAttribute> attrs = new HashSet<IAttribute>();
synchronized(attributes) {
for (IAttribute attribute : attributes.values()) {
- if(checkExtended(attribute, context)) {
+ if(checkExtended(attribute, context, query)) {
attrs.add(attribute);
}
}
@@ -136,29 +137,22 @@
return getAttributes();
}
- protected boolean checkExtended(IAttribute attribute, IPageContext context) {
+ protected boolean checkExtended(IAttribute attribute, IPageContext context, KbQuery query) {
if(!attribute.isExtended()) {
return true;
}
IComponent parentComponent = attribute.getComponent();
+ IComponent[] parentComponents = null;
if(parentComponent==null) {
- return true;
+ parentComponents = PageProcessor.getInstance().getComponents(query, context, false);
+ } else {
+ parentComponents = new IComponent[]{parentComponent};
}
- ITagLibrary[] libs = context.getLibraries();
- for (int i = 0; i < libs.length; i++) {
- ITagLibrary thisLib = this.getTagLib();
- if(thisLib==null) {
+ for (IComponent component : parentComponents) {
+ IAttribute at = component.getAttribute(attribute.getName());
+ if(at!=null && !at.isExtended()) {
return true;
}
- if(libs[i].getURI().equals(thisLib.getURI())) {
- IComponent ac = libs[i].getComponent(parentComponent.getName());
- if(ac!=null && ac!=this) {
- IAttribute at = ac.getAttribute(attribute.getName());
- if(at!=null && !at.isExtended()) {
- return true;
- }
- }
- }
}
return false;
}
@@ -181,10 +175,10 @@
return null;
}
if(mask) {
- return getAttributes(attrName, context);
+ return getAttributes(attrName, context, query);
}
IAttribute attr = getAttribute(attrName);
- if(attr!=null && checkExtended(attr, context)) {
+ if(attr!=null && checkExtended(attr, context, query)) {
return new IAttribute[]{getAttribute(attrName)};
}
return EMPTY_ARRAY;
14 years, 9 months
JBoss Tools SVN: r20174 - trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-02-08 08:46:59 -0500 (Mon, 08 Feb 2010)
New Revision: 20174
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3125
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java 2010-02-08 12:56:55 UTC (rev 20173)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java 2010-02-08 13:46:59 UTC (rev 20174)
@@ -31,6 +31,7 @@
import org.eclipse.jface.text.hyperlink.IHyperlink;
import org.eclipse.ui.texteditor.ITextEditor;
import org.jboss.tools.cdi.core.CDIConstants;
+import org.jboss.tools.cdi.core.CDICorePlugin;
public class InjectedPointHyperlinkDetector extends AbstractHyperlinkDetector{
@@ -68,8 +69,9 @@
if(file == null)
return null;
+ if(CDICorePlugin.getCDI(file.getProject(), true) == null)
+ return null;
-
IJavaElement[] elements = null;
try {
14 years, 9 months
JBoss Tools SVN: r20173 - branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/tests.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2010-02-08 07:56:55 -0500 (Mon, 08 Feb 2010)
New Revision: 20173
Modified:
branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/tests/DriverDeleteTest.java
Log:
import delete fix -> synchronize with trunc
Modified: branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/tests/DriverDeleteTest.java
===================================================================
--- branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/tests/DriverDeleteTest.java 2010-02-08 12:38:38 UTC (rev 20172)
+++ branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/tests/DriverDeleteTest.java 2010-02-08 12:56:55 UTC (rev 20173)
@@ -15,19 +15,15 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.io.PrintWriter;
import java.io.Writer;
import java.lang.ref.WeakReference;
import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
import java.net.URL;
import java.net.URLClassLoader;
import java.security.AccessController;
import java.sql.Driver;
import java.security.PrivilegedAction;
-import java.sql.Connection;
import java.sql.DriverManager;
-import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
@@ -50,8 +46,6 @@
import org.hibernate.eclipse.console.test.utils.GarbageCollectionUtil;
import org.hibernate.util.ReflectHelper;
-import com.mysql.jdbc.Messages;
-
//import sun.reflect.FieldAccessor;
import junit.framework.TestCase;
14 years, 9 months
JBoss Tools SVN: r20172 - trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/tests.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2010-02-08 07:38:38 -0500 (Mon, 08 Feb 2010)
New Revision: 20172
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/tests/DriverDeleteTest.java
Log:
import delete fix
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/tests/DriverDeleteTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/tests/DriverDeleteTest.java 2010-02-08 09:37:50 UTC (rev 20171)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/tests/DriverDeleteTest.java 2010-02-08 12:38:38 UTC (rev 20172)
@@ -15,7 +15,6 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.io.PrintWriter;
import java.io.Writer;
import java.lang.ref.WeakReference;
import java.lang.reflect.Field;
@@ -25,22 +24,30 @@
import java.sql.Driver;
import java.security.PrivilegedAction;
import java.sql.DriverManager;
-import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
+import java.util.Locale;
+import java.util.PropertyResourceBundle;
+import java.util.ResourceBundle;
import java.util.Vector;
+import java.util.jar.JarFile;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.apt.core.internal.JarClassLoader;
+import org.hibernate.console.ConsoleConfigClassLoader;
import org.hibernate.console.execution.DefaultExecutionContext;
import org.hibernate.console.execution.ExecutionContext;
import org.hibernate.eclipse.console.test.HibernateConsoleTestPlugin;
import org.hibernate.eclipse.console.test.utils.GarbageCollectionUtil;
import org.hibernate.util.ReflectHelper;
+//import sun.reflect.FieldAccessor;
+
import junit.framework.TestCase;
/**
@@ -59,6 +66,7 @@
public static final String PUT_PATH = "res"; //$NON-NLS-1$
private WeakReference<ExecutionContext> executionContext = null;
+ private ClassLoader prevClassLoader = null;
protected ClassLoader getParentClassLoader() {
return Thread.currentThread().getContextClassLoader();
@@ -204,6 +212,61 @@
return urlClassLoader;
}
+ public ConsoleConfigClassLoader createJarClassLoader2() {
+ final URL[] customClassPathURLs = getCustomClassPathURLs();
+ ConsoleConfigClassLoader urlClassLoader = AccessController.doPrivileged(new PrivilegedAction<ConsoleConfigClassLoader>() {
+ public ConsoleConfigClassLoader run() {
+ return new ConsoleConfigClassLoader(customClassPathURLs, getParentClassLoader()) {
+ public InputStream getResourceAsStream(String name) {
+ InputStream is = super.getResourceAsStream(name);
+ return is;
+ }
+
+ public URL findResource(final String name) {
+ URL res = super.findResource(name);
+ return res;
+ }
+
+ public Enumeration<URL> findResources(final String name) throws IOException {
+ Enumeration<URL> res = super.findResources(name);
+ return res;
+ }
+
+ protected Class<?> findClass(String name) throws ClassNotFoundException {
+ Class<?> res = null;
+ try {
+ res = super.findClass(name);
+ } catch (ClassNotFoundException cnfe) {
+ throw cnfe;
+ }
+ return res;
+ }
+
+ protected synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
+ Class<?> res = null;
+ try {
+ res = super.loadClass(name, resolve);
+ } catch (ClassNotFoundException cnfe) {
+ throw cnfe;
+ }
+ return res;
+ }
+
+ public Class<?> loadClass(String name) throws ClassNotFoundException {
+ Class<?> res = null;
+ try {
+ res = super.loadClass(name);
+ } catch (ClassNotFoundException cnfe) {
+ throw cnfe;
+ }
+ return res;
+ }
+ };
+ }
+ });
+ return urlClassLoader;
+ }
+
public class StringWriter extends Writer {
public String res = new String();
@@ -246,12 +309,20 @@
drivers = null;
}
- @SuppressWarnings("unchecked")
+ static Object testStaticObj;
+
+ @SuppressWarnings({"unchecked", "unused", "nls"})
public void initExecutionContext() {
/**/
//URLClassLoader urlClassLoader = createClassLoader();
- JarClassLoader urlClassLoader = createJarClassLoader();
- /**/
+ //JarClassLoader urlClassLoader = createJarClassLoader();
+ final ConsoleConfigClassLoader urlClassLoader = createJarClassLoader2();
+ /** /
+ prevClassLoader = Thread.currentThread().getContextClassLoader();
+ Thread.currentThread().setContextClassLoader(urlClassLoader);
+ ClassLoader prevClassLoader22 = Thread.currentThread().getContextClassLoader();
+ //
+ Class<Driver> driverClass22 = null;
Class<Driver> driverClass = null;
try {
driverClass = (Class<Driver>)urlClassLoader.loadClass("com.mysql.jdbc.Driver"); //$NON-NLS-1$
@@ -261,21 +332,36 @@
assertNotNull(driverClass);
/**/
int numRedDrivers = 0;
- StringWriter wr = new StringWriter();
- PrintWriter pw = new PrintWriter(wr);
- DriverManager.setLogWriter(pw);
+ //StringWriter wr = new StringWriter();
+ //PrintWriter pw = new PrintWriter(wr);
+ //DriverManager.setLogWriter(pw);
Driver driver = null;
- /**/
+ /** /
+ Connection connection = null;
+ String test = ""; //$NON-NLS-1$
try {
driver = driverClass.newInstance();
- DriverManager.registerDriver(driver);
+ //DriverManager.registerDriver(driver);
+ //driverClass = ReflectHelper.classForName("com.mysql.jdbc.Driver"); //$NON-NLS-1$
+ //driver = driverClass.newInstance();
+ //DriverManager.registerDriver(driver);
//DriverManager.deregisterDriver(driver);
java.util.Enumeration<Driver> drEnum = DriverManager.getDrivers();
while (drEnum.hasMoreElements()) {
driver = drEnum.nextElement();
- DriverManager.deregisterDriver(driver);
+// DriverManager.deregisterDriver(driver);
numRedDrivers++;
}
+ java.util.Properties info = new java.util.Properties();
+ info.put("user", "root");
+ info.put("password", "p@ssw0rd2");
+ connection = driver.connect("jdbc:mysql://localhost:3306/jpa", info);
+ //connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/jpa", "root", "p@ssw0rd");
+ test = connection.getCatalog();
+ connection.close();
+ DriverManager.deregisterDriver(driver);
+ //} catch (ClassNotFoundException e) {
+ // e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
} catch (InstantiationException e) {
@@ -283,18 +369,23 @@
} catch (IllegalAccessException e) {
e.printStackTrace();
}
+ System.out.print(test);
+ System.out.print(numRedDrivers);
+ /** /
+ System.out.print(wr.res);
/**/
- System.out.print(wr.res);
- /** /
DefaultExecutionContext dec = new DefaultExecutionContext(getName(), urlClassLoader);
executionContext = new WeakReference<ExecutionContext>(dec);
- /** /
+ /**/
ExecutionContext.Command command = new ExecutionContext.Command() {
public Object execute() {
try {
Class<Driver> driverClass = null;
+ //Class.forName("com.mysql.jdbc.Driver"); //$NON-NLS-1$
//if (driverClass != null) {
- //driverClass = ReflectHelper.classForName("com.mysql.jdbc.Driver"); //$NON-NLS-1$
+ driverClass = ReflectHelper.classForName("com.mysql.jdbc.Driver"); //$NON-NLS-1$
+ Driver driver2 = driverClass.newInstance();
+ //DriverManager.registerDriver(driver2);
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
if (contextClassLoader != null) {
driverClass = (Class<Driver>)contextClassLoader.loadClass("com.mysql.jdbc.Driver"); //$NON-NLS-1$
@@ -303,13 +394,184 @@
//driverClass.newInstance();
//DriverManager.registerDriver(driverClass.newInstance());
//}
+ java.util.Properties info = new java.util.Properties();
+ info.put("user", "root");
+ info.put("password", "p@ssw0rd2");
+
+ /** /
+ try {
+ Connection connection = driver2.connect("jdbc:mysql://localhost:3306/jpa", info);
+ //Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/jpa", "root", "p@ssw0rd"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
+ //String test = connection.getCatalog();
+
+ //System.out.println(test);
+ //System.out.println(test);
+ connection.close();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+ /**/
+
+ Object obj = null;
+ Field f = null;
+
+ /**/
+ Class<com.mysql.jdbc.Connection> connClass = ReflectHelper.classForName("com.mysql.jdbc.Connection"); //$NON-NLS-1$
+ f = connClass.getDeclaredField("cancelTimer");
+ f.setAccessible(true);
+ java.util.Timer timer = (java.util.Timer)f.get(null);
+ if (timer != null) {
+ timer.cancel();
+ timer.purge();
+ }
+ f.set(null, null);
+
+ Class<com.mysql.jdbc.LoadBalancingConnectionProxy> classLoadBalancingConnectionProxyClass = ReflectHelper.classForName("com.mysql.jdbc.LoadBalancingConnectionProxy"); //$NON-NLS-1$
+ f = classLoadBalancingConnectionProxyClass.getDeclaredField("getLocalTimeMethod");
+ f.setAccessible(true);
+ obj = f.get(null);
+ f.set(null, null);
+
+ Class<com.mysql.jdbc.StandardSocketFactory> classStandardSocketFactory = ReflectHelper.classForName("com.mysql.jdbc.StandardSocketFactory"); //$NON-NLS-1$
+ f = classStandardSocketFactory.getDeclaredField("setTraficClassMethod");
+ f.setAccessible(true);
+ obj = f.get(null);
+ f.set(null, null);
+
+ Class<com.mysql.jdbc.StringUtils> classStringUtils = ReflectHelper.classForName("com.mysql.jdbc.StringUtils"); //$NON-NLS-1$
+ f = classStringUtils.getDeclaredField("toPlainStringMethod");
+ f.setAccessible(true);
+ obj = f.get(null);
+ f.set(null, null);
+ /**/
+
+ Class<com.mysql.jdbc.Util> classUtil = ReflectHelper.classForName("com.mysql.jdbc.Util"); //$NON-NLS-1$
+ f = classUtil.getDeclaredField("systemNanoTimeMethod");
+ f.setAccessible(true);
+ obj = f.get(null);
+ f.set(null, null);
+ /** /
+ //
+ f = classUtil.getDeclaredField("DEFAULT_TIMEZONE");
+ f.setAccessible(true);
+ obj = f.get(null);
+ setStaticFinalField(f, null);
+ //
+ f = classUtil.getDeclaredField("enclosingInstance");
+ f.setAccessible(true);
+ obj = f.get(null);
+ f.set(null, null);
+ /** /
+ testStaticObj = Locale.getDefault();
+ /**/
+ ResourceBundle temp = ResourceBundle.getBundle("com.mysql.jdbc.LocalizedErrorMessages", Locale.getDefault(),
+ urlClassLoader);
+ /**/
+ final String resName = "com.mysql.jdbc.LocalizedErrorMessages".replace('.', '/') + ".properties";
+ InputStream stream = (InputStream)java.security.AccessController.doPrivileged(
+ new java.security.PrivilegedAction() {
+ public Object run() {
+ if (urlClassLoader != null) {
+ return urlClassLoader.getResourceAsStream(resName);
+ } else {
+ return ClassLoader.getSystemResourceAsStream(resName);
+ }
+ }
+ }
+ );
+
+ if (stream != null) {
+ // make sure it is buffered
+ stream = new java.io.BufferedInputStream(stream);
+ java.util.PropertyResourceBundle prb = new PropertyResourceBundle(stream);
+ stream.close();
+ }
+ //
+ /**/
+ //
+ Class<com.mysql.jdbc.Messages> classMessages = ReflectHelper.classForName("com.mysql.jdbc.Messages"); //$NON-NLS-1$
+ f = classMessages.getDeclaredField("BUNDLE_NAME");
+ f.setAccessible(true);
+ obj = f.get(null);
+ setStaticFinalField(f, null);
+ //
+ f = classMessages.getDeclaredField("RESOURCE_BUNDLE");
+ f.setAccessible(true);
+ obj = f.get(null);
+ setStaticFinalField(f, null);
+ /**/
+ //Class<java.util.ResourceBundle> classResourceBundle = ReflectHelper.classForName("java.util.ResourceBundle"); //$NON-NLS-1$
+ //Class<java.util.PropertyResourceBundle> classPropertyResourceBundle = (Class<java.util.PropertyResourceBundle>)obj.getClass();
+ Class<java.util.PropertyResourceBundle> classPropertyResourceBundle = (Class<java.util.PropertyResourceBundle>)temp.getClass();
+ Class<java.util.ResourceBundle> classResourceBundle = (Class<ResourceBundle>)classPropertyResourceBundle.getSuperclass(); //$NON-NLS-1$
+ f = classResourceBundle.getDeclaredField("cacheKey");
+ f.setAccessible(true);
+ obj = f.get(null);
+ setStaticFinalField(f, null);
+ //
+ f = classResourceBundle.getDeclaredField("underConstruction");
+ f.setAccessible(true);
+ obj = f.get(null);
+ setStaticFinalField(f, null);
+ //
+ f = classResourceBundle.getDeclaredField("NOT_FOUND");
+ f.setAccessible(true);
+ obj = f.get(null);
+ setStaticFinalField(f, null);
+ //
+ f = classResourceBundle.getDeclaredField("cacheList");
+ f.setAccessible(true);
+ obj = f.get(null);
+ setStaticFinalField(f, null);
+ //
+ f = classResourceBundle.getDeclaredField("referenceQueue");
+ f.setAccessible(true);
+ obj = f.get(null);
+ setStaticFinalField(f, null);
+ /**/
+
+ /**/
+ //Class<sun.net.www.protocol.jar.JarURLConnection> classJarURLConnection = ReflectHelper.classForName("sun.net.www.protocol.jar.JarURLConnection"); //$NON-NLS-1$
+ //f = classJarURLConnection.getDeclaredField("factory");
+ //f.setAccessible(true);
+ //obj = f.get(null);
+ //f.set(null, null);
+ //
+ Class classJarFileFactory = obj.getClass();
+ f = classJarFileFactory.getDeclaredField("fileCache");
+ f.setAccessible(true);
+ obj = f.get(null);
+ HashMap fileCache = (HashMap)obj;
+ f.set(null, null);
+ //
+ f = classJarFileFactory.getDeclaredField("urlCache");
+ f.setAccessible(true);
+ obj = f.get(null);
+ HashMap urlCache = (HashMap)obj;
+ f.set(null, null);
+ //
+ Iterator it = urlCache.keySet().iterator();
+ while (it.hasNext()) {
+ JarFile jarFile = (JarFile)it.next();
+ if (jarFile.getName().equals(DRIVER_TEST_NAME)) {
+ jarFile.close();
+ }
+ }
+ /**/
+ //DriverManager.deregisterDriver(driver2);
//}
//contextClassLoader = null;
//driverClass = null;
- //} catch (InstantiationException e) {
- // e.printStackTrace();
- //} catch (IllegalAccessException e) {
- // e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ } catch (SecurityException e) {
+ e.printStackTrace();
+ } catch (NoSuchFieldException e) {
+ e.printStackTrace();
+ } catch (InstantiationException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
//} catch (SQLException e) {
@@ -333,7 +595,26 @@
urlClassLoader.close();
}
+ private static final String MODIFIERS_FIELD = "modifiers";
+
+ public static void setStaticFinalField(Field field, Object value)
+ throws NoSuchFieldException, IllegalAccessException {
+ /** /
+ field.setAccessible(true);
+ Field modifiersField = Field.class.getDeclaredField(MODIFIERS_FIELD);
+ modifiersField.setAccessible(true);
+ int modifiers = modifiersField.getInt(field);
+ modifiers &= ~Modifier.FINAL;
+ modifiersField.setInt(field, modifiers);
+ sun.reflect.ReflectionFactory reflection =
+ sun.reflect.ReflectionFactory.getReflectionFactory();
+ FieldAccessor fa = reflection.newFieldAccessor(field, false);
+ fa.set(null, value);
+ /**/
+ }
+
public void cleanupExecutionContext() {
+ /** /
if (executionContext != null && executionContext.get() != null) {
executionContext.get().execute(new ExecutionContext.Command() {
@@ -356,7 +637,12 @@
});
executionContext = null;
}
+ /**/
//
+ if (prevClassLoader != null) {
+ Thread.currentThread().setContextClassLoader(prevClassLoader);
+ }
+ //
GarbageCollectionUtil.forceCollectGarbage();
}
14 years, 9 months
JBoss Tools SVN: r20171 - in trunk/esb/tests/org.jboss.tools.esb.project.core.test/projects/esbTestProject/src: org and 7 other directories.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2010-02-08 04:37:50 -0500 (Mon, 08 Feb 2010)
New Revision: 20171
Added:
trunk/esb/tests/org.jboss.tools.esb.project.core.test/projects/esbTestProject/src/org/
trunk/esb/tests/org.jboss.tools.esb.project.core.test/projects/esbTestProject/src/org/jboss/
trunk/esb/tests/org.jboss.tools.esb.project.core.test/projects/esbTestProject/src/org/jboss/soa/
trunk/esb/tests/org.jboss.tools.esb.project.core.test/projects/esbTestProject/src/org/jboss/soa/esb/
trunk/esb/tests/org.jboss.tools.esb.project.core.test/projects/esbTestProject/src/org/jboss/soa/esb/samples/
trunk/esb/tests/org.jboss.tools.esb.project.core.test/projects/esbTestProject/src/org/jboss/soa/esb/samples/quickstart/
trunk/esb/tests/org.jboss.tools.esb.project.core.test/projects/esbTestProject/src/org/jboss/soa/esb/samples/quickstart/helloworld/
trunk/esb/tests/org.jboss.tools.esb.project.core.test/projects/esbTestProject/src/org/jboss/soa/esb/samples/quickstart/helloworld/MyJMSListenerAction.java
trunk/esb/tests/org.jboss.tools.esb.project.core.test/projects/esbTestProject/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/
trunk/esb/tests/org.jboss.tools.esb.project.core.test/projects/esbTestProject/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendEsbMessage.java
trunk/esb/tests/org.jboss.tools.esb.project.core.test/projects/esbTestProject/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendJMSMessage.java
Log:
JBIDE-5572:Add unit tests for ESB
Added: trunk/esb/tests/org.jboss.tools.esb.project.core.test/projects/esbTestProject/src/org/jboss/soa/esb/samples/quickstart/helloworld/MyJMSListenerAction.java
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.project.core.test/projects/esbTestProject/src/org/jboss/soa/esb/samples/quickstart/helloworld/MyJMSListenerAction.java (rev 0)
+++ trunk/esb/tests/org.jboss.tools.esb.project.core.test/projects/esbTestProject/src/org/jboss/soa/esb/samples/quickstart/helloworld/MyJMSListenerAction.java 2010-02-08 09:37:50 UTC (rev 20171)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.helloworld;
+
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+public class MyJMSListenerAction extends AbstractActionLifecycle
+{
+
+ protected ConfigTree _config;
+
+ public MyJMSListenerAction(ConfigTree config) { _config = config; }
+
+
+ public Message displayMessage(Message message) throws Exception{
+
+ System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
+ System.out.println("Body: " + message.getBody().get()) ;
+ System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
+ return message;
+
+ }
+
+
+}
\ No newline at end of file
Added: trunk/esb/tests/org.jboss.tools.esb.project.core.test/projects/esbTestProject/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendEsbMessage.java
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.project.core.test/projects/esbTestProject/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendEsbMessage.java (rev 0)
+++ trunk/esb/tests/org.jboss.tools.esb.project.core.test/projects/esbTestProject/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendEsbMessage.java 2010-02-08 09:37:50 UTC (rev 20171)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.soa.esb.samples.quickstart.helloworld.test;
+
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.client.ServiceInvoker;
+
+/**
+ * Standalone class with to send ESB messages to a 'known' [category,name].
+ * <p/> arg0 - service category
+ * <br/>arg1 - service name
+ * <br/>arg2 - Text of message to send
+ *
+ * @author <a href="mailto:schifest@heuristica.com.ar">schifest(a)heuristica.com.ar</a>
+ * @since Version 4.0
+ *
+ */
+public class SendEsbMessage
+{
+ public static void main(String args[]) throws Exception
+ {
+// Setting the ConnectionFactory such that it will use scout
+ System.setProperty("javax.xml.registry.ConnectionFactoryClass","org.apache.ws.scout.registry.ConnectionFactoryImpl");
+
+ if (args.length < 3)
+ {
+ System.out.println("Usage SendEsbMessage <category> <name> <text to send>");
+ }
+
+ Message esbMessage = MessageFactory.getInstance().getMessage();
+
+ esbMessage.getBody().add(args[2]);
+
+ new ServiceInvoker(args[0], args[1]).deliverAsync(esbMessage);
+
+ }
+
+}
Added: trunk/esb/tests/org.jboss.tools.esb.project.core.test/projects/esbTestProject/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendJMSMessage.java
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.project.core.test/projects/esbTestProject/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendJMSMessage.java (rev 0)
+++ trunk/esb/tests/org.jboss.tools.esb.project.core.test/projects/esbTestProject/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendJMSMessage.java 2010-02-08 09:37:50 UTC (rev 20171)
@@ -0,0 +1,87 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.helloworld.test;
+
+import java.util.Properties;
+
+import javax.jms.JMSException;
+import javax.jms.ObjectMessage;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+public class SendJMSMessage {
+ QueueConnection conn;
+ QueueSession session;
+ Queue que;
+
+
+ public void setupConnection() throws JMSException, NamingException
+ {
+ Properties properties1 = new Properties();
+ properties1.put(Context.INITIAL_CONTEXT_FACTORY,
+ "org.jnp.interfaces.NamingContextFactory");
+ properties1.put(Context.URL_PKG_PREFIXES,
+ "org.jboss.naming:org.jnp.interfaces");
+ properties1.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
+ InitialContext iniCtx = new InitialContext(properties1);
+
+ Object tmp = iniCtx.lookup("ConnectionFactory");
+ QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
+ conn = qcf.createQueueConnection();
+ que = (Queue) iniCtx.lookup("queue/quickstart_helloworld_Request_gw");
+ session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+ conn.start();
+ System.out.println("Connection Started");
+ }
+
+ public void stop() throws JMSException
+ {
+ conn.stop();
+ session.close();
+ conn.close();
+ }
+
+ public void sendAMessage(String msg) throws JMSException {
+
+ QueueSender send = session.createSender(que);
+ ObjectMessage tm = session.createObjectMessage(msg);
+
+ send.send(tm);
+ send.close();
+ }
+
+
+ public static void main(String args[]) throws Exception
+ {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(args[0]);
+ sm.stop();
+
+ }
+
+}
14 years, 9 months
JBoss Tools SVN: r20170 - trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-02-08 03:34:43 -0500 (Mon, 08 Feb 2010)
New Revision: 20170
Modified:
trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/SeamXMLFormLayoutData.java
Log:
temp fix for compilation errors in seam.xml.ui plugin
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/SeamXMLFormLayoutData.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/SeamXMLFormLayoutData.java 2010-02-08 04:12:35 UTC (rev 20169)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/SeamXMLFormLayoutData.java 2010-02-08 08:34:43 UTC (rev 20170)
@@ -22,11 +22,11 @@
public static String EMPTY_DESCRIPTION = ""; //$NON-NLS-1$
private final static IFormData[] FORM_LAYOUT_DEFINITIONS = new IFormData[] {
- SeamComponentsFileFormLayoutData.FILE_11_FORM_DEFINITION,
- SeamComponentsFileFormLayoutData.FILE_12_FORM_DEFINITION,
- SeamComponentsFileFormLayoutData.FILE_20_FORM_DEFINITION,
- SeamComponentsFileFormLayoutData.FILE_21_FORM_DEFINITION,
- SeamComponentsFileFormLayoutData.FILE_22_FORM_DEFINITION,
+// SeamComponentsFileFormLayoutData.FILE_11_FORM_DEFINITION,
+// SeamComponentsFileFormLayoutData.FILE_12_FORM_DEFINITION,
+// SeamComponentsFileFormLayoutData.FILE_20_FORM_DEFINITION,
+// SeamComponentsFileFormLayoutData.FILE_21_FORM_DEFINITION,
+// SeamComponentsFileFormLayoutData.FILE_22_FORM_DEFINITION,
SeamComponentFormLayoutData.SEAM_COMPONENT_FILE_FORM_DEFINITION,
SeamComponentFormLayoutData.SEAM_COMPONENT_FILE_20_FORM_DEFINITION,
SeamComponentFormLayoutData.SEAM_COMPONENT_FILE_21_FORM_DEFINITION,
14 years, 9 months