JBoss Tools SVN: r38215 - trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/appregister.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-01-26 14:27:16 -0500 (Thu, 26 Jan 2012)
New Revision: 38215
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/appregister/AppRegisterComponent.java
Log:
JBIDE-6132
https://issues.jboss.org/browse/JBIDE-6132
Do not create instance of preference XModel when it is not necessary .
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/appregister/AppRegisterComponent.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/appregister/AppRegisterComponent.java 2012-01-26 19:22:53 UTC (rev 38214)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/appregister/AppRegisterComponent.java 2012-01-26 19:27:16 UTC (rev 38215)
@@ -44,8 +44,8 @@
import org.jboss.tools.common.meta.action.XEntityData;
import org.jboss.tools.common.meta.action.impl.XEntityDataImpl;
import org.jboss.tools.common.meta.action.impl.handlers.HUtil;
-import org.jboss.tools.common.meta.constraint.XAttributeEditor;
import org.jboss.tools.common.meta.constraint.impl.XAttributeEditorImpl;
+import org.jboss.tools.common.meta.impl.XModelMetaDataImpl;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.options.PreferenceModelUtilities;
import org.jboss.tools.common.model.util.XModelObjectUtil;
@@ -135,7 +135,7 @@
}
void initDisablingContextRoot() {
- XModelEntity entity = PreferenceModelUtilities.getPreferenceModel().getMetaData().getEntity(ENTITY);
+ XModelEntity entity = XModelMetaDataImpl.getInstance().getEntity(ENTITY);
XAttribute attr = entity.getAttribute(ATTR_APP_NAME);
XAttributeEditorImpl ed = (XAttributeEditorImpl)attr.getEditor();
if(disableContextRoot) {
12 years, 11 months
JBoss Tools SVN: r38214 - 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: scabanovich
Date: 2012-01-26 14:22:53 -0500 (Thu, 26 Jan 2012)
New Revision: 38214
Modified:
trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/SeamComponentsFileFormLayoutData.java
Log:
JBIDE-6132
https://issues.jboss.org/browse/JBIDE-6132
Do not create instance of preference XModel when it is not necessary .
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/SeamComponentsFileFormLayoutData.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/SeamComponentsFileFormLayoutData.java 2012-01-26 19:20:49 UTC (rev 38213)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/SeamComponentsFileFormLayoutData.java 2012-01-26 19:22:53 UTC (rev 38214)
@@ -16,14 +16,14 @@
import org.jboss.tools.common.meta.XChild;
import org.jboss.tools.common.meta.XModelEntity;
import org.jboss.tools.common.meta.XModelMetaData;
-import org.jboss.tools.common.model.options.PreferenceModelUtilities;
+import org.jboss.tools.common.meta.impl.XModelMetaDataImpl;
import org.jboss.tools.common.model.ui.forms.*;
import org.jboss.tools.seam.xml.components.model.SeamComponentConstants;
public class SeamComponentsFileFormLayoutData implements SeamComponentConstants {
static IFormData createSeamComponentListDefinition(String parentEntity) {
- XModelMetaData meta = PreferenceModelUtilities.getPreferenceModel().getMetaData();
+ XModelMetaData meta = XModelMetaDataImpl.getInstance();
XModelEntity entity = meta.getEntity(parentEntity);
List<String> childEntities = new ArrayList<String>();
if(entity != null) {
@@ -39,7 +39,7 @@
IFormData result = new FormData(
"Components", //$NON-NLS-1$
SeamXMLFormLayoutData.EMPTY_DESCRIPTION,
- new FormAttributeData[]{new FormAttributeData(ATTR_NAME, 40), new FormAttributeData(ATTR_CLASS, 60)}, //$NON-NLS-1$
+ new FormAttributeData[]{new FormAttributeData(ATTR_NAME, 40), new FormAttributeData(ATTR_CLASS, 60)},
childEntities.toArray(new String[0]),
FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddComponent") //$NON-NLS-1$
);
12 years, 11 months
JBoss Tools SVN: r38213 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-01-26 14:20:49 -0500 (Thu, 26 Jan 2012)
New Revision: 38213
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3FormLayoutDataUtil.java
Log:
JBIDE-6132
https://issues.jboss.org/browse/JBIDE-6132
Do not create instance of preference XModel when it is not necessary .
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3FormLayoutDataUtil.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3FormLayoutDataUtil.java 2012-01-26 19:19:27 UTC (rev 38212)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3FormLayoutDataUtil.java 2012-01-26 19:20:49 UTC (rev 38213)
@@ -16,7 +16,7 @@
import org.jboss.tools.common.meta.XAttribute;
import org.jboss.tools.common.meta.XChild;
import org.jboss.tools.common.meta.XModelEntity;
-import org.jboss.tools.common.model.options.PreferenceModelUtilities;
+import org.jboss.tools.common.meta.impl.XModelMetaDataImpl;
import org.jboss.tools.common.model.ui.attribute.editor.TableStructuredEditor;
import org.jboss.tools.common.model.ui.forms.FormActionData;
import org.jboss.tools.common.model.ui.forms.FormAttributeData;
@@ -62,7 +62,7 @@
* @return
*/
public static IFormAttributeData[] createFormAttributeData(String entityName, String categoryName) {
- XModelEntity entity = PreferenceModelUtilities.getPreferenceModel().getMetaData().getEntity(entityName);
+ XModelEntity entity = XModelMetaDataImpl.getInstance().getEntity(entityName);
if(entity == null) return new IFormAttributeData[0];
List<FormAttributeData> list = new ArrayList<FormAttributeData>();
XAttribute[] as = entity.getAttributes();
@@ -90,7 +90,7 @@
* @return
*/
public static String[] getChildEntitiesWithAttribute(String entityName, String attributeName) {
- XModelEntity entity = PreferenceModelUtilities.getPreferenceModel().getMetaData().getEntity(entityName);
+ XModelEntity entity = XModelMetaDataImpl.getInstance().getEntity(entityName);
if(entity == null) return new String[0];
List<String> list = new ArrayList<String>();
XChild[] cs = entity.getChildren();
12 years, 11 months
JBoss Tools SVN: r38212 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-01-26 14:19:27 -0500 (Thu, 26 Jan 2012)
New Revision: 38212
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormLayoutDataUtil.java
Log:
JBIDE-6132
https://issues.jboss.org/browse/JBIDE-6132
Do not create instance of preference XModel when it is not necessary .
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormLayoutDataUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormLayoutDataUtil.java 2012-01-26 19:11:14 UTC (rev 38211)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormLayoutDataUtil.java 2012-01-26 19:19:27 UTC (rev 38212)
@@ -17,7 +17,6 @@
import org.jboss.tools.common.meta.XChild;
import org.jboss.tools.common.meta.XModelEntity;
import org.jboss.tools.common.meta.impl.XModelMetaDataImpl;
-import org.jboss.tools.common.model.options.PreferenceModelUtilities;
import org.jboss.tools.common.model.ui.forms.FormActionData;
import org.jboss.tools.common.model.ui.forms.FormAttributeData;
import org.jboss.tools.common.model.ui.forms.FormData;
@@ -46,7 +45,7 @@
}
public static IFormAttributeData[] createFormAttributeData(String entityName, String categoryName) {
- XModelEntity entity = PreferenceModelUtilities.getPreferenceModel().getMetaData().getEntity(entityName);
+ XModelEntity entity = XModelMetaDataImpl.getInstance().getEntity(entityName);
if(entity == null) return new IFormAttributeData[0];
List<IFormAttributeData> list = new ArrayList<IFormAttributeData>();
XAttribute[] as = entity.getAttributes();
12 years, 11 months
JBoss Tools SVN: r38211 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-01-26 14:11:14 -0500 (Thu, 26 Jan 2012)
New Revision: 38211
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormLayoutDataUtil.java
Log:
JBIDE-6132
https://issues.jboss.org/browse/JBIDE-6132
Do not create instance of preference XModel when it is not necessary .
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormLayoutDataUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormLayoutDataUtil.java 2012-01-26 18:19:04 UTC (rev 38210)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormLayoutDataUtil.java 2012-01-26 19:11:14 UTC (rev 38211)
@@ -16,6 +16,7 @@
import org.jboss.tools.common.meta.XAttribute;
import org.jboss.tools.common.meta.XChild;
import org.jboss.tools.common.meta.XModelEntity;
+import org.jboss.tools.common.meta.impl.XModelMetaDataImpl;
import org.jboss.tools.common.model.options.PreferenceModelUtilities;
import org.jboss.tools.common.model.ui.forms.FormActionData;
import org.jboss.tools.common.model.ui.forms.FormAttributeData;
@@ -69,7 +70,7 @@
}
public static String[] getChildEntitiesWithAttribute(String entityName, String attributeName) {
- XModelEntity entity = PreferenceModelUtilities.getPreferenceModel().getMetaData().getEntity(entityName);
+ XModelEntity entity = XModelMetaDataImpl.getInstance().getEntity(entityName);
if(entity == null) return new String[0];
List<String> list = new ArrayList<String>();
XChild[] cs = entity.getChildren();
12 years, 11 months
JBoss Tools SVN: r38210 - trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-01-26 13:19:04 -0500 (Thu, 26 Jan 2012)
New Revision: 38210
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/SingleFileZippedDeploymentIntegrationTest.java
Log:
UNIT TEST FAILURES!!!
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/SingleFileZippedDeploymentIntegrationTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/SingleFileZippedDeploymentIntegrationTest.java 2012-01-26 18:14:15 UTC (rev 38209)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/SingleFileZippedDeploymentIntegrationTest.java 2012-01-26 18:19:04 UTC (rev 38210)
@@ -6,6 +6,8 @@
import java.util.List;
import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.NullProgressMonitor;
12 years, 11 months
JBoss Tools SVN: r38209 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2012-01-26 13:14:15 -0500 (Thu, 26 Jan 2012)
New Revision: 38209
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ELResolver.java
Log:
https://issues.jboss.org/browse/JBIDE-9025 : Substituted EL variable is not properly evaulated
- fixed the issue
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ELResolver.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ELResolver.java 2012-01-26 18:13:41 UTC (rev 38208)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ELResolver.java 2012-01-26 18:14:15 UTC (rev 38209)
@@ -190,19 +190,22 @@
public String replaceElAndResources(String value) {
String rst = value;
- rst = ResourceUtil.getBundleValue(pageContext, value);
+ rst = ResourceUtil.getBundleValue(pageContext, rst);
+ rst = replaceEl(rst);
+
// replace custom attributes
rst = replaceCustomAttributes(rst);
- if (Jsf2ResourceUtil.isExternalContextPathString(value)) {
- rst = Jsf2ResourceUtil.processExternalContextPath(value);
+
+ if (Jsf2ResourceUtil.isExternalContextPathString(rst)) {
+ rst = Jsf2ResourceUtil.processExternalContextPath(rst);
}
- if (Jsf2ResourceUtil.isRequestContextPathString(value)) {
- rst = Jsf2ResourceUtil.processRequestContextPath(value);
+ if (Jsf2ResourceUtil.isRequestContextPathString(rst)) {
+ rst = Jsf2ResourceUtil.processRequestContextPath(rst);
}
if (Jsf2ResourceUtil.isJSF2ResourceString(rst)) {
rst = Jsf2ResourceUtil.processCustomJSFAttributes(pageContext, rst);
}
- rst = replaceEl(rst);
+
return rst;
}
12 years, 11 months
JBoss Tools SVN: r38208 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/9025.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2012-01-26 13:13:41 -0500 (Thu, 26 Jan 2012)
New Revision: 38208
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/9025/requestContextPath.jsp.xml
Log:
https://issues.jboss.org/browse/JBIDE-9025 : Substituted EL variable is not properly evaulated
- created JUnit, part2
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/9025/requestContextPath.jsp.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/9025/requestContextPath.jsp.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/9025/requestContextPath.jsp.xml 2012-01-26 18:13:41 UTC (rev 38208)
@@ -0,0 +1,5 @@
+<tests>
+ <test id="testId">
+ <IMG SRC="/.*contextPathFolder/RedHat.png/"/>
+ </test>
+</tests>
12 years, 11 months
JBoss Tools SVN: r38207 - in trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test: resources/jsfTest/WebContent/pages/JBIDE/9025 and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2012-01-26 13:13:02 -0500 (Thu, 26 Jan 2012)
New Revision: 38207
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/9025/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/9025/contextPathFolder/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/9025/contextPathFolder/RedHat.png
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/9025/requestContextPath.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/CustomRequestContextPathTest_JBIDE9025.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllImportantTests.java
Log:
https://issues.jboss.org/browse/JBIDE-9025 : Substituted EL variable is not properly evaulated
- created JUnit
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/9025/contextPathFolder/RedHat.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/9025/contextPathFolder/RedHat.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/9025/requestContextPath.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/9025/requestContextPath.jsp (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/9025/requestContextPath.jsp 2012-01-26 18:13:02 UTC (rev 38207)
@@ -0,0 +1,5 @@
+<html>
+<body>
+ <img id="testId" src="#{request.contextPath}/RedHat.png">
+</body>
+</html>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllImportantTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllImportantTests.java 2012-01-26 17:47:17 UTC (rev 38206)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllImportantTests.java 2012-01-26 18:13:02 UTC (rev 38207)
@@ -5,6 +5,7 @@
import org.jboss.tools.jsf.vpe.jsf.test.jbide.ChangeMessageBundleTest_JBIDE5818;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.ContextMenuDoubleInsertionTest_JBIDE3888;
+import org.jboss.tools.jsf.vpe.jsf.test.jbide.CustomRequestContextPathTest_JBIDE9025;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.EditFontFamilyTest_JBIDE5872;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.ExceptionInVPEComments_JBIDE5143;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.FacetProcessingTest;
@@ -101,6 +102,7 @@
public static Test suite() {
TestSuite suite = new TestSuite(JsfAllImportantTests.class.getName());
//$JUnit-BEGIN$
+ suite.addTestSuite(CustomRequestContextPathTest_JBIDE9025.class);
suite.addTestSuite(SourceDomUtilTest.class);
suite.addTestSuite(XulRunnerVpeUtilsTest.class);
suite.addTestSuite(UnclosedELExpressionTest.class);
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/CustomRequestContextPathTest_JBIDE9025.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/CustomRequestContextPathTest_JBIDE9025.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/CustomRequestContextPathTest_JBIDE9025.java 2012-01-26 18:13:02 UTC (rev 38207)
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.jsf.test.jbide;
+
+import org.eclipse.core.resources.IFile;
+import org.jboss.tools.common.el.core.ELReferenceList;
+import org.jboss.tools.common.resref.core.ResourceReference;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
+import org.jboss.tools.vpe.base.test.ComponentContentTest;
+import org.jboss.tools.vpe.base.test.TestUtil;
+
+/**
+ * @author Yahor Radtsevich (yradtsevich)
+ */
+public class CustomRequestContextPathTest_JBIDE9025 extends ComponentContentTest {
+
+ private static final String TEST_FILE_NAME = "JBIDE/9025/requestContextPath.jsp";
+
+ /**
+ * Test file
+ */
+ private IFile file;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ setException(null);
+ this.file = (IFile) TestUtil.getComponentPath(TEST_FILE_NAME, //$NON-NLS-1$
+ JsfAllTests.IMPORT_PROJECT_NAME);
+ ResourceReference[] entries = new ResourceReference[1];
+ entries[0] = new ResourceReference("request.contextPath", ResourceReference.FILE_SCOPE);
+ entries[0].setProperties("contextPathFolder");
+ ELReferenceList.getInstance().setAllResources(this.file, entries);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.vpe.ui.test.VpeTest#tearDown()
+ */
+ @Override
+ protected void tearDown() throws Exception {
+ ELReferenceList.getInstance().setAllResources(this.file, new ResourceReference[0]);
+ if(getException()!=null) {
+ throw new Exception(getException());
+ }
+ super.tearDown();
+ }
+
+ public CustomRequestContextPathTest_JBIDE9025(String name) {
+ super(name);
+ }
+
+ public void testJBIDE9025CustomRequestContextPath() throws Throwable {
+// IEditorInput input = new FileEditorInput(this.file);
+// JSPMultiPageEditor part = openEditor(input);
+// checkSourceSelection(part);
+ performContentTest(TEST_FILE_NAME); //$NON-NLS-1$
+ }
+
+ @Override
+ protected String getTestProjectName() {
+ return JsfAllTests.IMPORT_PROJECT_NAME;
+ }
+ }
12 years, 11 months
JBoss Tools SVN: r38206 - in trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples: xpl and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-01-26 12:47:17 -0500 (Thu, 26 Jan 2012)
New Revision: 38206
Added:
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/xpl/
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/xpl/UpdateMavenProjectJob.java
Modified:
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/MavenProjectExamplesActivator.java
Log:
JBIDE-10709 : copy UpdateMavenProjectJob from m2e 1.1 to ensure both forward (1.1) and backward (1.0) compatibility with m2e
Modified: trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/MavenProjectExamplesActivator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/MavenProjectExamplesActivator.java 2012-01-26 16:25:50 UTC (rev 38205)
+++ trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/MavenProjectExamplesActivator.java 2012-01-26 17:47:17 UTC (rev 38206)
@@ -19,8 +19,8 @@
import org.eclipse.m2e.core.embedder.IMaven;
import org.eclipse.m2e.core.project.MavenProjectInfo;
import org.eclipse.m2e.core.project.ProjectImportConfiguration;
-import org.eclipse.m2e.core.ui.internal.UpdateConfigurationJob;
import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.jboss.tools.maven.project.examples.xpl.UpdateMavenProjectJob;
import org.osgi.framework.BundleContext;
/**
@@ -78,6 +78,11 @@
getDefault().getLog().log(status);
}
+ public static void log(String message) {
+ IStatus status = new Status(IStatus.INFO, PLUGIN_ID, message);
+ getDefault().getLog().log(status);
+ }
+
public static String getProjectName(MavenProjectInfo projectInfo,
ProjectImportConfiguration configuration) throws CoreException {
IWorkspace workspace = ResourcesPlugin.getWorkspace();
@@ -136,7 +141,7 @@
// ignore
}
}
- Job updateJob = new UpdateConfigurationJob(selectedProjects , true, false);
+ Job updateJob = new UpdateMavenProjectJob(selectedProjects , true, false);
updateJob.schedule();
try {
updateJob.join();
Added: trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/xpl/UpdateMavenProjectJob.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/xpl/UpdateMavenProjectJob.java (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/xpl/UpdateMavenProjectJob.java 2012-01-26 17:47:17 UTC (rev 38206)
@@ -0,0 +1,160 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.jboss.tools.maven.project.examples.xpl;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.resources.WorkspaceJob;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.project.IMavenProjectRegistry;
+import org.eclipse.m2e.core.project.IProjectConfigurationManager;
+import org.eclipse.m2e.core.project.MavenUpdateRequest;
+import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
+import org.eclipse.m2e.core.ui.internal.Messages;
+import org.eclipse.m2e.core.ui.internal.actions.OpenMavenConsoleAction;
+import org.eclipse.m2e.core.ui.internal.util.M2EUIUtils;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.progress.IProgressConstants;
+import org.jboss.tools.maven.project.examples.MavenProjectExamplesActivator;
+
+/**
+ * Class copied from org.eclipse.m2e.core.ui.internal.UpdateMavenProjectJob in m2e 1.1
+ * to keep compatibility between m2e 1.0/1.1.
+ *
+ * @author Fred Bricon
+ *
+ * <ul>
+ * <li>added legacy constructor</li>
+ * <li>changed loggers</li>
+ * </ul>
+ */
+public class UpdateMavenProjectJob extends WorkspaceJob {
+
+ private final IProject[] projects;
+
+ private final boolean offline;
+
+ private final boolean forceUpdateDependencies;
+
+ private final boolean updateConfiguration;
+
+ private final boolean rebuild;
+
+ public UpdateMavenProjectJob(IProject[] projects, boolean offline, boolean forceUpdateDependencies) {
+ this(projects, offline, forceUpdateDependencies,
+ true /*updateConfiguration*/, true /*rebuild*/);
+ }
+
+ public UpdateMavenProjectJob(IProject[] projects) {
+ this(projects, MavenPlugin.getMavenConfiguration().isOffline(), false /*forceUpdateDependencies*/,
+ true /*updateConfiguration*/, true /*rebuild*/);
+ }
+
+ public UpdateMavenProjectJob(IProject[] projects, boolean offline, boolean forceUpdateDependencies,
+ boolean updateConfiguration, boolean rebuild) {
+
+ super(Messages.UpdateSourcesAction_job_update_conf);
+
+ this.projects = projects;
+ this.offline = offline;
+ this.forceUpdateDependencies = forceUpdateDependencies;
+ this.updateConfiguration = updateConfiguration;
+ this.rebuild = rebuild;
+
+ setRule(MavenPlugin.getProjectConfigurationManager().getRule());
+ }
+
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
+ IProjectConfigurationManager configurationManager = MavenPlugin.getProjectConfigurationManager();
+ IMavenProjectRegistry projectRegistry = MavenPlugin.getMavenProjectRegistry();
+ boolean autoBuilding = ResourcesPlugin.getWorkspace().isAutoBuilding();
+
+ setProperty(IProgressConstants.ACTION_PROPERTY, new OpenMavenConsoleAction());
+ monitor.beginTask(getName(), projects.length);
+
+ long l1 = System.currentTimeMillis();
+ MavenProjectExamplesActivator.log("Update started"); //$NON-NLS-1$
+
+ MultiStatus status = null;
+ //project names to the errors encountered when updating them
+ Map<String, Throwable> updateErrors = new HashMap<String, Throwable>();
+
+ for(IProject project : projects) {
+ if(monitor.isCanceled()) {
+ throw new OperationCanceledException();
+ }
+
+ monitor.subTask(project.getName());
+ SubProgressMonitor submonitor = new SubProgressMonitor(monitor, 1, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL);
+
+ try {
+ MavenUpdateRequest request = new MavenUpdateRequest(project, offline, forceUpdateDependencies);
+ if(updateConfiguration) {
+ configurationManager.updateProjectConfiguration(request, submonitor);
+ } else {
+ projectRegistry.refresh(request, submonitor);
+ }
+ // only rebuild projects that were successfully updated
+ if(rebuild) {
+ project.build(IncrementalProjectBuilder.CLEAN_BUILD, submonitor);
+ if(autoBuilding) {
+ // TODO this is not enough, in most cases we need to re-run the build several times
+ project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, submonitor);
+ }
+ }
+ } catch(CoreException ex) {
+ if(status == null) {
+ status = new MultiStatus(M2EUIPluginActivator.PLUGIN_ID, IStatus.ERROR, //
+ Messages.UpdateSourcesAction_error_cannot_update, null);
+ }
+ status.add(ex.getStatus());
+ updateErrors.put(project.getName(), ex);
+ } catch(IllegalArgumentException e) {
+ status = new MultiStatus(M2EUIPluginActivator.PLUGIN_ID, IStatus.ERROR, //
+ Messages.UpdateSourcesAction_error_cannot_update, null);
+ updateErrors.put(project.getName(), e);
+ }
+ }
+
+ if(updateErrors.size() > 0) {
+ handleErrors(updateErrors);
+ }
+ long l2 = System.currentTimeMillis();
+ MavenProjectExamplesActivator.log(NLS.bind("Update completed: {0} sec", ((l2 - l1) / 1000))); //$NON-NLS-1$
+
+ return status != null ? status : Status.OK_STATUS;
+ }
+
+ private void handleErrors(final Map<String, Throwable> updateErrors) {
+ final Display display = Display.getDefault();
+ if(display != null) {
+ display.asyncExec(new Runnable() {
+ public void run() {
+ M2EUIUtils.showErrorsForProjectsDialog(display.getActiveShell(), Messages.UpdateSourcesAction_error_title,
+ Messages.UpdateSourcesAction_error_message, updateErrors);
+ }
+ });
+ }
+ }
+}
12 years, 11 months