JBoss Tools SVN: r24992 - in trunk: jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2010-09-17 10:51:48 -0400 (Fri, 17 Sep 2010)
New Revision: 24992
Added:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/selection/bar/ISelectionBarController.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.properties
trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorPart.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/preferences/IVpePreferencesPage.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/preferences/VpePreferencesInitializer.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/selection/bar/SelectionBar.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/selection/bar/handlers/SelectionBarHandler.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/VpePreferencesPage.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java
Log:
JBIDE-7059
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.properties
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.properties 2010-09-17 14:35:05 UTC (rev 24991)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.properties 2010-09-17 14:51:48 UTC (rev 24992)
@@ -16,4 +16,6 @@
proposalCategory.xmlEL= JBoss JSF/SEAM EL Proposals
proposalCategory.xmlTag= JBoss JSF/SEAM Tag Proposals
-Show.Selection.Bar=Show Selection Bar
\ No newline at end of file
+Show.Selection.Bar=Show Selection Bar
+Toggle.Selection.Bar=Toggle Selection Bar
+
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml 2010-09-17 14:35:05 UTC (rev 24991)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml 2010-09-17 14:51:48 UTC (rev 24992)
@@ -311,18 +311,19 @@
locationURI="menu:navigate?endof=show.ext">
<command label="%Show.Selection.Bar"
commandId="org.jboss.tools.jst.jsp.commands.showSelectionBar"
- id="org.jboss.tools.jst.jsp.menus.sampleCommand"
+ id="org.jboss.tools.jst.jsp.menus.showSelectionBar"
+ style="toggle"
mnemonic="S">
</command>
</menuContribution>
<menuContribution
locationURI="toolbar:org.eclipse.ui.workbench.navigate?after=forwardHistory">
<command
-
commandId="org.jboss.tools.jst.jsp.commands.showSelectionBar"
icon="icons/selbar.gif"
- id="org.jboss.tools.jst.jsp.toolbars.sampleCommand"
- tooltip="%Show.Selection.Bar">
+ id="org.jboss.tools.jst.jsp.toolbars.showSelectionBar"
+ style="toggle"
+ tooltip="%Toggle.Selection.Bar">
</command>
</menuContribution>
</extension>
@@ -684,12 +685,16 @@
</command>
<category
id="org.jboss.tools.jst.jsp.commands.category"
- name="Sample Category">
+ name="Visual Page Editor Category">
</category>
<command
categoryId="org.jboss.tools.jst.jsp.commands.category"
id="org.jboss.tools.jst.jsp.commands.showSelectionBar"
- name="Sample Command">
+ name="Show Selection Bar">
+ <state
+ class="org.eclipse.ui.handlers.RegistryToggleState:true"
+ id="org.eclipse.ui.commands.toggleState">
+ </state>
</command>
</extension>
<extension
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorPart.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorPart.java 2010-09-17 14:35:05 UTC (rev 24991)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorPart.java 2010-09-17 14:51:48 UTC (rev 24992)
@@ -46,16 +46,19 @@
import org.eclipse.ui.part.MultiPageSelectionProvider;
import org.eclipse.wst.sse.ui.StructuredTextEditor;
import org.jboss.tools.common.core.resources.XModelObjectEditorInput;
+import org.jboss.tools.jst.jsp.selection.bar.ISelectionBarController;
import org.jboss.tools.jst.jsp.selection.bar.SelectionBar;
/**
*
*/
-public abstract class JSPMultiPageEditorPart extends EditorPart {
+public abstract class JSPMultiPageEditorPart extends EditorPart implements ISelectionBarController {
private CTabFolder container;
private ArrayList nestedEditors = new ArrayList(3);
+
+ private SelectionBar selectionBar;
protected JSPMultiPageEditorPart() {
super();
@@ -90,12 +93,8 @@
editor.createPartControl(parent2);
parent2.setLayout(new GridLayout(2, false));
- SelectionBar selBar = new SelectionBar(sourcePart);
- selBar.createToolBarComposite(parent2, true);
-// GridData gridData = new GridData();
-// gridData.horizontalAlignment = GridData.FILL;
-// gridData.horizontalSpan = 2;
-// but.setLayoutData(gridData);
+ selectionBar = new SelectionBar(sourcePart);
+ selectionBar.createToolBarComposite(parent2, true);
editor.addPropertyListener(new IPropertyListener() {
public void propertyChanged(Object source, int propertyId) {
JSPMultiPageEditorPart.this
@@ -157,6 +156,7 @@
IEditorPart editor = (IEditorPart) nestedEditors.get(i);
disposePart(editor);
}
+ selectionBar.dispose();
nestedEditors.clear();
}
@@ -348,4 +348,18 @@
getItem(pageIndex).setText(text);
}
+ @Override
+ public void showSelectionBar() {
+ selectionBar.setVisible(true);
+ }
+
+ @Override
+ public void hideSelectionBar() {
+ selectionBar.setVisible(false);
+ }
+
+ @Override
+ public boolean isSelectionBarAvailable() {
+ return selectionBar.isVisible();
+ }
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/preferences/IVpePreferencesPage.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/preferences/IVpePreferencesPage.java 2010-09-17 14:35:05 UTC (rev 24991)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/preferences/IVpePreferencesPage.java 2010-09-17 14:51:48 UTC (rev 24992)
@@ -17,7 +17,6 @@
static final String SHOW_TEXT_FORMATTING = "Show Text Formatting bar"; //$NON-NLS-1$
static final String SHOW_RESOURCE_BUNDLES_USAGE_AS_EL = "Show Resource Bundles Usage as EL Expressions"; //$NON-NLS-1$
static final String ASK_TAG_ATTRIBUTES_ON_TAG_INSERT = "Ask for tag attributes during tag insert"; //$NON-NLS-1$
- static final String ASK_CONFIRMATION_ON_CLOSING_SELECTION_BAR = "Ask for confirmation when closing Selection Bar"; //$NON-NLS-1$
static final String INFORM_WHEN_PROJECT_MIGHT_NOT_BE_CONFIGURED_PROPERLY_FOR_VPE = "Inform when a project might not be configured properly for Visual Page Editor"; //$NON-NLS-1$
static final String DEFAULT_VPE_TAB = "Default VPE Tab"; //$NON-NLS-1$
static final String VISUAL_SOURCE_EDITORS_SPLITTING = "Visual/Source Editors Splitting"; //$NON-NLS-1$
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/preferences/VpePreferencesInitializer.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/preferences/VpePreferencesInitializer.java 2010-09-17 14:35:05 UTC (rev 24991)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/preferences/VpePreferencesInitializer.java 2010-09-17 14:51:48 UTC (rev 24992)
@@ -27,7 +27,6 @@
defaultPreferences.putBoolean(IVpePreferencesPage.SHOW_TEXT_FORMATTING, true);
defaultPreferences.putBoolean(IVpePreferencesPage.SHOW_RESOURCE_BUNDLES_USAGE_AS_EL, false);
defaultPreferences.putBoolean(IVpePreferencesPage.ASK_TAG_ATTRIBUTES_ON_TAG_INSERT, true);
- defaultPreferences.putBoolean(IVpePreferencesPage.ASK_CONFIRMATION_ON_CLOSING_SELECTION_BAR, true);
defaultPreferences.putBoolean(IVpePreferencesPage.INFORM_WHEN_PROJECT_MIGHT_NOT_BE_CONFIGURED_PROPERLY_FOR_VPE, true);
defaultPreferences.put(IVpePreferencesPage.DEFAULT_VPE_TAB, IVpePreferencesPage.DEFAULT_VPE_TAB_VISUAL_SOURCE_VALUE);
defaultPreferences.put(IVpePreferencesPage.VISUAL_SOURCE_EDITORS_SPLITTING, IVpePreferencesPage.SPLITTING_VERT_TOP_SOURCE_VALUE);
Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/selection/bar/ISelectionBarController.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/selection/bar/ISelectionBarController.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/selection/bar/ISelectionBarController.java 2010-09-17 14:51:48 UTC (rev 24992)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.jsp.selection.bar;
+
+/**
+ * Controller to control state of selection bar
+ *
+ * @author mareshkau
+ *
+ */
+public interface ISelectionBarController {
+ /**
+ * Shows selection bar
+ */
+ public void showSelectionBar();
+ /**
+ * Hides selection bar
+ */
+ public void hideSelectionBar();
+ /**
+ * retry the availability of selection bar
+ */
+ public boolean isSelectionBarAvailable();
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/selection/bar/ISelectionBarController.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/selection/bar/SelectionBar.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/selection/bar/SelectionBar.java 2010-09-17 14:35:05 UTC (rev 24991)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/selection/bar/SelectionBar.java 2010-09-17 14:51:48 UTC (rev 24992)
@@ -130,21 +130,6 @@
final Listener closeListener = new Listener() {
public void handleEvent(Event event) {
- if (askConfirmationOnClosingSelectionBar()) {
- MessageDialogWithToggle dialog = MessageDialogWithToggle
- .openOkCancelConfirm(
- PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow()
- .getShell(),
- JstUIMessages.CONFIRM_SELECTION_BAR_DIALOG_TITLE,
- JstUIMessages.CONFIRM_SELECTION_BAR_DIALOG_MESSAGE,
- JstUIMessages.ASK_CONFIRMATION_ON_CLOSING_SELECTION_BAR,
- askConfirmationOnClosingSelectionBar(), null, null);
- if (dialog.getReturnCode() != IDialogConstants.OK_ID) {
- return;
- }
- setAskConfirmationOnClosingSelectionBar(dialog.getToggleState());
- }
/*
* Hide the selection bar
*/
@@ -174,17 +159,6 @@
return splitter;
}
- public void setAskConfirmationOnClosingSelectionBar(boolean askConfirmation) {
- JspEditorPlugin.getDefault().getPreferenceStore().setValue(
- IVpePreferencesPage.ASK_CONFIRMATION_ON_CLOSING_SELECTION_BAR,
- askConfirmation);
- }
-
- public boolean askConfirmationOnClosingSelectionBar() {
- return JspEditorPlugin.getDefault().getPreferenceStore().getBoolean(
- IVpePreferencesPage.ASK_CONFIRMATION_ON_CLOSING_SELECTION_BAR);
- }
-
/**
* Sets {@code visible} state to this {@code SelectionBar} and fires
* all registered {@code VisibilityListener}s.
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/selection/bar/handlers/SelectionBarHandler.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/selection/bar/handlers/SelectionBarHandler.java 2010-09-17 14:35:05 UTC (rev 24991)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/selection/bar/handlers/SelectionBarHandler.java 2010-09-17 14:51:48 UTC (rev 24992)
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
package org.jboss.tools.jst.jsp.selection.bar.handlers;
import org.eclipse.core.commands.AbstractHandler;
@@ -3,12 +14,12 @@
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.handlers.HandlerUtil;
import org.eclipse.jface.dialogs.MessageDialog;
+import org.jboss.tools.jst.jsp.selection.bar.ISelectionBarController;
/**
- * Our sample handler extends AbstractHandler, an IHandler base class.
- * @see org.eclipse.core.commands.IHandler
- * @see org.eclipse.core.commands.AbstractHandler
+ * Selection bar handler
*/
public class SelectionBarHandler extends AbstractHandler {
@@ -24,11 +35,14 @@
* from the application context.
*/
public Object execute(ExecutionEvent event) throws ExecutionException {
- IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
- MessageDialog.openInformation(
- window.getShell(),
- "Jsp Editor Plug-in",
- "Hello, Selection Bar Handler");
+ IEditorPart activeEditor = HandlerUtil.getActiveEditorChecked(event);
+ boolean togleState = HandlerUtil.toggleCommandState(event.getCommand());
+ if(!togleState){
+ ((ISelectionBarController)activeEditor).showSelectionBar();
+ }else{
+ ((ISelectionBarController)activeEditor).hideSelectionBar();
+ }
return null;
}
+
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/VpePreferencesPage.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/VpePreferencesPage.java 2010-09-17 14:35:05 UTC (rev 24991)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/VpePreferencesPage.java 2010-09-17 14:51:48 UTC (rev 24992)
@@ -144,10 +144,6 @@
addField(new BooleanFieldEditor(ASK_TAG_ATTRIBUTES_ON_TAG_INSERT,
VpeUIMessages.ASK_TAG_ATTRIBUTES_ON_TAG_INSERT,
confirmationGroup));
- addField(new BooleanFieldEditor(
- ASK_CONFIRMATION_ON_CLOSING_SELECTION_BAR,
- VpeUIMessages.ASK_CONFIRMATION_ON_CLOSING_SELECTION_BAR,
- confirmationGroup));
addField(new BooleanFieldEditor(INFORM_WHEN_PROJECT_MIGHT_NOT_BE_CONFIGURED_PROPERLY_FOR_VPE,
VpeUIMessages.INFORM_WHEN_PROJECT_MIGHT_NOT_BE_CONFIGURED_PROPERLY_FOR_VPE,
confirmationGroup));
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java 2010-09-17 14:35:05 UTC (rev 24991)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java 2010-09-17 14:51:48 UTC (rev 24992)
@@ -132,7 +132,6 @@
public static String SHOW_BUNDLES_AS_MESSAGES;
public static String EXTERNALIZE_STRINGS;
public static String ASK_TAG_ATTRIBUTES_ON_TAG_INSERT;
- public static String ASK_CONFIRMATION_ON_CLOSING_SELECTION_BAR;
public static String INFORM_WHEN_PROJECT_MIGHT_NOT_BE_CONFIGURED_PROPERLY_FOR_VPE;
public static String DEFAULT_VPE_TAB;
public static String VISUAL_SOURCE_EDITORS_SPLITTING;
15 years, 7 months
JBoss Tools SVN: r24991 - trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2010-09-17 10:35:05 -0400 (Fri, 17 Sep 2010)
New Revision: 24991
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java
Log:
JBIDE-6529 : jsf test failures
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java 2010-09-17 14:26:27 UTC (rev 24990)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java 2010-09-17 14:35:05 UTC (rev 24991)
@@ -1,5 +1,7 @@
package org.jboss.tools.jst.jsp.test.ca;
+import java.util.List;
+
import junit.framework.Test;
import junit.framework.TestSuite;
@@ -59,29 +61,19 @@
JobUtils.waitForIdle();
- ICompletionProposal[] result= null;
+// ICompletionProposal[] result= null;
String errorMessage = null;
- TestUtil.prepareCAInvokation(contentAssistant, viewer, offsetToTest);
-
- IContentAssistProcessor p= TestUtil.getProcessor(viewer, offsetToTest, contentAssistant);
- if (p != null) {
- try {
- result= p.computeCompletionProposals(viewer, offsetToTest);
- } catch (Throwable x) {
- x.printStackTrace();
- }
- errorMessage= p.getErrorMessage();
- }
+ List<ICompletionProposal> res = TestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
- assertTrue("Content Assistant returned no proposals", (result != null && result.length > 0));
+ assertTrue("Content Assistant returned no proposals", (res != null && res.size() > 0));
boolean bPropoosalToApplyFound = false;
- for (int i = 0; i < result.length; i++) {
- if (!(result[i] instanceof AutoContentAssistantProposal))
+ for (ICompletionProposal p : res) {
+ if (!(p instanceof AutoContentAssistantProposal))
continue;
- AutoContentAssistantProposal proposal = (AutoContentAssistantProposal)result[i];
+ AutoContentAssistantProposal proposal = (AutoContentAssistantProposal)p;
String proposalString = proposal.getReplacementString();
if (PROPOSAL_TO_APPLY_STRING.equals(proposalString)) {
15 years, 7 months
JBoss Tools SVN: r24990 - trunk/jst/tests/org.jboss.tools.jst.jsp.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-09-17 10:26:27 -0400 (Fri, 17 Sep 2010)
New Revision: 24990
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/META-INF/MANIFEST.MF
Log:
JBIDE-7091
https://jira.jboss.org/browse/JBIDE-7091 fixed CDI core tests
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/META-INF/MANIFEST.MF 2010-09-17 14:20:39 UTC (rev 24989)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/META-INF/MANIFEST.MF 2010-09-17 14:26:27 UTC (rev 24990)
@@ -15,14 +15,8 @@
org.jboss.tools.jst.jsp,
org.jboss.tools.common.text.ext,
org.jboss.tools.jst.web,
- org.jboss.tools.common.text.xml;bundle-version="2.0.0",
- org.jboss.tools.jst.web.kb;bundle-version="3.1.0",
- org.jboss.tools.jmx.core;bundle-version="1.2.0",
- org.jboss.tools.jsf;bundle-version="3.2.0",
- org.jboss.tools.seam.core;bundle-version="3.2.0",
- org.jboss.tools.seam.pages.xml;bundle-version="3.1.0",
- org.jboss.tools.seam.xml;bundle-version="3.2.0",
- org.jboss.tools.struts;bundle-version="3.2.0"
+ org.jboss.tools.common.text.xml,
+ org.jboss.tools.jst.web.kb
Export-Package:
org.jboss.tools.jst.jsp.test,
org.jboss.tools.jst.jsp.test.ca
15 years, 7 months
JBoss Tools SVN: r24989 - in trunk/jst/plugins/org.jboss.tools.jst.web.kb: src/org/jboss/tools/jst/web/kb/internal and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-09-17 10:20:39 -0400 (Fri, 17 Sep 2010)
New Revision: 24989
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/MyFacesScanner.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/myfaces/
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/myfaces/MyFacesAttribute.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/myfaces/MyFacesComponent.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/myfaces/MyFacesTagLibrary.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbXMLStoreConstants.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/LibraryScanner.java
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/AbstractTagLib.java
Log:
JBIDE-7086
https://jira.jboss.org/browse/JBIDE-7086
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF 2010-09-17 14:18:00 UTC (rev 24988)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF 2010-09-17 14:20:39 UTC (rev 24989)
@@ -37,6 +37,7 @@
org.jboss.tools.jst.web.kb.internal.scanner,
org.jboss.tools.jst.web.kb.internal.taglib,
org.jboss.tools.jst.web.kb.internal.taglib.composite,
+ org.jboss.tools.jst.web.kb.internal.taglib.myfaces,
org.jboss.tools.jst.web.kb.internal.validation,
org.jboss.tools.jst.web.kb.refactoring,
org.jboss.tools.jst.web.kb.taglib,
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java 2010-09-17 14:18:00 UTC (rev 24988)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java 2010-09-17 14:20:39 UTC (rev 24989)
@@ -49,6 +49,7 @@
import org.jboss.tools.jst.web.kb.internal.taglib.FacesConfigTagLibrary;
import org.jboss.tools.jst.web.kb.internal.taglib.TLDLibrary;
import org.jboss.tools.jst.web.kb.internal.taglib.composite.CompositeTagLibrary;
+import org.jboss.tools.jst.web.kb.internal.taglib.myfaces.MyFacesTagLibrary;
import org.jboss.tools.jst.web.kb.internal.validation.ProjectValidationContext;
import org.jboss.tools.jst.web.kb.taglib.ICustomTagLibrary;
import org.jboss.tools.jst.web.kb.taglib.ITagLibrary;
@@ -504,6 +505,8 @@
tagLib = new FacesConfigTagLibrary();
} else if(KbXMLStoreConstants.CLS_COMPOSITE_LIBRARY.equals(cls)) {
tagLib = new CompositeTagLibrary();
+ } else if(KbXMLStoreConstants.CLS_MYFACES_LIBRARY.equals(cls)) {
+ tagLib = new MyFacesTagLibrary();
} else {
//consider other cases;
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbXMLStoreConstants.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbXMLStoreConstants.java 2010-09-17 14:18:00 UTC (rev 24988)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbXMLStoreConstants.java 2010-09-17 14:20:39 UTC (rev 24989)
@@ -27,6 +27,7 @@
public String CLS_FACELET_LIBRARY = "facelet"; //$NON-NLS-1$
public String CLS_FACESCONFIG_LIBRARY = "faces-config"; //$NON-NLS-1$
public String CLS_COMPOSITE_LIBRARY = "composite"; //$NON-NLS-1$
+ public String CLS_MYFACES_LIBRARY = "myfaces"; //$NON-NLS-1$
public String ATTR_URI = "uri"; //$NON-NLS-1$
public String ATTR_SHORT_NAME = "short-name"; //$NON-NLS-1$
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/LibraryScanner.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/LibraryScanner.java 2010-09-17 14:18:00 UTC (rev 24988)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/LibraryScanner.java 2010-09-17 14:20:39 UTC (rev 24989)
@@ -15,6 +15,7 @@
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.XModelObjectConstants;
+import org.jboss.tools.common.model.filesystems.impl.FileAnyImpl;
import org.jboss.tools.common.model.filesystems.impl.FileSystemsImpl;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.jst.web.kb.IKbProject;
@@ -97,6 +98,10 @@
JSF2ResourcesScanner s = new JSF2ResourcesScanner();
LoadedDeclarations ds1 = s.parse(tld, path, sp);
if(ds1 != null) ds.add(ds1);
+ } else if(isMyFacesMetadata(tld)) {
+ MyFacesScanner s = new MyFacesScanner();
+ LoadedDeclarations ds1 = s.parse(tld, path, sp);
+ if(ds1 != null) ds.add(ds1);
}
}
}
@@ -121,6 +126,10 @@
} else if(tld.getFileType() == XModelObject.FOLDER) {
LoadedDeclarations ds1 = parseInPackages(tld, path, sp);
ds = add(ds, ds1);
+ } else if(isMyFacesMetadata(tld)) {
+ MyFacesScanner s = new MyFacesScanner();
+ LoadedDeclarations ds1 = s.parse(tld, path, sp);
+ ds = add(ds, ds1);
}
}
return ds;
@@ -159,6 +168,13 @@
if(entity.startsWith(JSF2ResourcesScanner.ENT_COMPOSITE_COMPONENT)) return true;
return false;
}
+
+ public static boolean isMyFacesMetadata(XModelObject o) {
+ if("myfaces-metadata.xml".equals(o.getPathPart())) { //$NON-NLS-1$
+ return true;
+ }
+ return false;
+ }
}
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/MyFacesScanner.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/MyFacesScanner.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/MyFacesScanner.java 2010-09-17 14:20:39 UTC (rev 24989)
@@ -0,0 +1,250 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jst.web.kb.internal.scanner;
+
+import java.io.ByteArrayInputStream;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.filesystems.impl.FileAnyImpl;
+import org.jboss.tools.common.model.project.ext.IValueInfo;
+import org.jboss.tools.common.model.project.ext.impl.ValueInfo;
+import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
+import org.jboss.tools.common.xml.XMLEntityResolver;
+import org.jboss.tools.common.xml.XMLUtilities;
+import org.jboss.tools.jst.web.kb.IKbProject;
+import org.jboss.tools.jst.web.kb.internal.taglib.myfaces.MyFacesAttribute;
+import org.jboss.tools.jst.web.kb.internal.taglib.myfaces.MyFacesComponent;
+import org.jboss.tools.jst.web.kb.internal.taglib.myfaces.MyFacesTagLibrary;
+import org.jboss.tools.jst.web.kb.taglib.IAttribute;
+import org.w3c.dom.Element;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class MyFacesScanner implements IFileScanner {
+ static String F_PREFIX = "f"; //$NON-NLS-1$
+ static String F_URI = "http://java.sun.com/jsf/core"; //$NON-NLS-1$
+
+ static String H_PREFIX = "h"; //$NON-NLS-1$
+ static String H_URI = "http://java.sun.com/jsf/html"; //$NON-NLS-1$
+
+ static String UI_PREFIX = "ui"; //$NON-NLS-1$
+ static String UI_URI = "http://java.sun.com/jsf/facelets"; //$NON-NLS-1$
+
+ static String C_PREFIX = "c"; //$NON-NLS-1$
+ static String C_URI = "http://java.sun.com/jsp/jstl/core"; //$NON-NLS-1$
+
+ static String COMPOSITE_PREFIX = "composite"; //$NON-NLS-1$
+ static String COMPOSITE_URI = "http://java.sun.com/jsf/composite"; //$NON-NLS-1$
+
+ static Map<String, String> prefixToURI = new HashMap<String, String>();
+
+ static {
+ prefixToURI.put(F_PREFIX, F_URI);
+ prefixToURI.put(H_PREFIX, H_URI);
+ prefixToURI.put(UI_PREFIX, UI_URI);
+ prefixToURI.put(C_PREFIX, C_URI);
+ prefixToURI.put(COMPOSITE_PREFIX, COMPOSITE_URI);
+ }
+
+ static String TAG_PROPERTY = "property"; //$NON-NLS-1$
+ static String TAG_ATTRIBUTE = "attribute"; //$NON-NLS-1$
+ static String ATTR_NAME = "name.#text"; //$NON-NLS-1$
+ static String ATTR_DESCRIPTION = "desc.#text"; //$NON-NLS-1$
+ static String ATTR_REQUIRED = "required.#text"; //$NON-NLS-1$
+ static String ATTR_PARENT_CLASS = "parentClassName.#text"; //$NON-NLS-1$
+
+
+ public boolean isRelevant(IFile resource) {
+ return false;
+ }
+
+ public boolean isLikelyComponentSource(IFile f) {
+ return false;
+ }
+
+ public LoadedDeclarations parse(IFile f, IKbProject sp)
+ throws ScannerException {
+ return null;
+ }
+
+ public LoadedDeclarations parse(XModelObject o, IPath source, IKbProject sp) {
+ if(o == null) return null;
+
+ String text = ((FileAnyImpl)o).getAsText();
+
+ Element model = XMLUtilities.getElement(new ByteArrayInputStream(text.getBytes()), XMLEntityResolver.getInstance());
+ if(model == null) return null;
+
+ Map<String, MyFacesTagLibrary> libraries = new HashMap<String, MyFacesTagLibrary>();
+ for (String p: prefixToURI.keySet()) {
+ String uri = prefixToURI.get(p);
+ MyFacesTagLibrary library = new MyFacesTagLibrary();
+ library.setId(o.getPath() + "/" + p); //$NON-NLS-1$
+ library.setURI(createValueInfo(uri));
+ libraries.put(p, library);
+ }
+
+ String[] tagnames = {"component", "tag", "faceletTag"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ Map<String, MyFacesComponent> componentsByClass = new HashMap<String, MyFacesComponent>();
+ for (String tag: tagnames) {
+ Element[] cs = XMLUtilities.getChildren(model, tag);
+ for (Element c : cs) {
+ processComponent(c, libraries, componentsByClass);
+ }
+ }
+
+ Set<MyFacesComponent> processed = new HashSet<MyFacesComponent>();
+ for (String cls: componentsByClass.keySet()) {
+ MyFacesComponent component = componentsByClass.get(cls);
+ loadParents(component, componentsByClass, processed);
+ }
+
+ LoadedDeclarations ds = new LoadedDeclarations();
+
+ for (MyFacesTagLibrary library: libraries.values()) {
+ if(library.getComponents().length > 0) {
+ ds.getLibraries().add(library);
+ }
+ }
+
+
+ return ds;
+ }
+
+ void processComponent(Element c, Map<String, MyFacesTagLibrary> libraries, Map<String, MyFacesComponent> componentsByClass) {
+ String name = util.getAttribute(c, ATTR_NAME);
+ String className = util.getAttribute(c, "className.#text");
+ MyFacesComponent component = null;
+ MyFacesTagLibrary library = null;
+ boolean isNew = false;
+
+ if(!isEmpty(name)) {
+ String componentName = name.trim();
+ int pi = componentName.indexOf(":"); //$NON-NLS-1$
+ if(pi < 0) return;
+ String prefix = componentName.substring(0, pi);
+ library = libraries.get(prefix);
+ if(library == null) {
+// System.out.println("Cannot find library for " + prefix);
+ return;
+ }
+ componentName = componentName.substring(pi + 1);
+ component = (MyFacesComponent)library.getComponent(componentName);
+ if(component == null) {
+ component = new MyFacesComponent();
+ component.setId(componentName);
+ component.setName(createValueInfo(componentName));
+ isNew = true;
+ }
+ } else if(!isEmpty(className)) {
+ component = componentsByClass.get(className);
+ if(component == null) {
+ component = new MyFacesComponent();
+ }
+ }
+
+ if(!isEmpty(className)) {
+ component.setComponentClass(createValueInfo(className.trim()));
+ componentsByClass.put(className, component);
+ }
+ String type = util.getAttribute(c, "type.#text");
+ if(!isEmpty(type)) {
+ component.setComponentType(createValueInfo(type.trim()));
+ }
+ String bodyContent = util.getAttribute(c, "bodyContent.#text");
+ if(!isEmpty(bodyContent)) {
+ component.setCanHaveBody(createValueInfo(bodyContent.trim()));
+ }
+ String description = util.getAttribute(c, ATTR_DESCRIPTION);
+ if(!isEmpty(description) && !description.trim().equals("no description")) { //$NON-NLS-1$
+ component.setDescription(createValueInfo(description.trim()));
+ }
+ String parentClass = util.getAttribute(c, ATTR_PARENT_CLASS);
+ if(!isEmpty(parentClass)) {
+ component.setParentClass(createValueInfo(parentClass.trim()));
+ }
+
+ Element[] attributes = XMLUtilities.getChildren(c, TAG_PROPERTY);
+ if(attributes == null || attributes.length == 0) {
+ attributes = XMLUtilities.getChildren(c, TAG_ATTRIBUTE);
+ }
+ if(attributes != null) for (Element a: attributes) {
+ processAttribute(a, component);
+ }
+
+ if(isNew && library != null) {
+ library.addComponent(component);
+ }
+ }
+
+ void processAttribute(Element a, MyFacesComponent component) {
+ String name = util.getAttribute(a, "jspName.#text");
+ if(isEmpty(name)) name = util.getAttribute(a, ATTR_NAME);
+ if(isEmpty(name)) return;
+ name = name.trim();
+ MyFacesAttribute attribute = (MyFacesAttribute)component.getAttribute(name);
+ boolean isNew = false;
+ if(attribute == null) {
+ attribute = new MyFacesAttribute();
+ attribute.setId(name);
+ attribute.setName(createValueInfo(name));
+ isNew = true;
+ }
+ String description = util.getAttribute(a, ATTR_DESCRIPTION);
+ if(!isEmpty(description) && !description.trim().equals("no description")) {
+ attribute.setDescription(createValueInfo(description.trim()));
+ }
+ String required = util.getAttribute(a, ATTR_REQUIRED);
+ if(!isEmpty(required)) {
+ attribute.setRequired(createValueInfo(required.trim()));
+ }
+ if(isNew) {
+ component.addAttribute(attribute);
+ }
+ }
+
+ void loadParents(MyFacesComponent current, Map<String, MyFacesComponent> componentsByClass, Set<MyFacesComponent> processed) {
+ if(processed.contains(current)) return;
+ processed.add(current);
+ String parentClass = current.getParentClass();
+ MyFacesComponent parent = componentsByClass.get(parentClass);
+ if(parent == null) return;
+ loadParents(parent, componentsByClass, processed);
+ IAttribute[] as = parent.getAttributes();
+ for (IAttribute a: as) {
+ if(current.getAttribute(a.getName()) == null) {
+ current.addAttribute(a);
+ }
+ }
+ }
+
+ private boolean isEmpty(String s) {
+ return s == null || s.trim().length() == 0;
+ }
+ private IValueInfo createValueInfo(String value) {
+ ValueInfo v = new ValueInfo();
+ v.setValue(value);
+ return v;
+ }
+
+ static XModelObjectLoaderUtil util = new XModelObjectLoaderUtil();
+
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/MyFacesScanner.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
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-09-17 14:18:00 UTC (rev 24988)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractComponent.java 2010-09-17 14:20:39 UTC (rev 24989)
@@ -29,6 +29,7 @@
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;
+import org.jboss.tools.jst.web.kb.internal.taglib.myfaces.MyFacesAttribute;
import org.jboss.tools.jst.web.kb.taglib.Facet;
import org.jboss.tools.jst.web.kb.taglib.IAttribute;
import org.jboss.tools.jst.web.kb.taglib.IComponent;
@@ -560,6 +561,8 @@
c = new CompositeAttribute();
} else if(KbXMLStoreConstants.CLS_FACELET_LIBRARY.equals(cls)) {
c = new FaceletAttribute();
+ } else if(KbXMLStoreConstants.CLS_MYFACES_LIBRARY.equals(cls)) {
+ c = new MyFacesAttribute();
} else {
//consider other cases;
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java 2010-09-17 14:18:00 UTC (rev 24988)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java 2010-09-17 14:20:39 UTC (rev 24989)
@@ -33,6 +33,7 @@
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.CompositeComponent;
+import org.jboss.tools.jst.web.kb.internal.taglib.myfaces.MyFacesComponent;
import org.jboss.tools.jst.web.kb.taglib.IAttribute;
import org.jboss.tools.jst.web.kb.taglib.IComponent;
import org.jboss.tools.jst.web.kb.taglib.INameSpace;
@@ -602,6 +603,8 @@
c = new FacesConfigComponent();
} else if(KbXMLStoreConstants.CLS_COMPOSITE_LIBRARY.equals(cls)) {
c = new CompositeComponent();
+ } else if(KbXMLStoreConstants.CLS_MYFACES_LIBRARY.equals(cls)) {
+ c = new MyFacesComponent();
} else {
//consider other cases;
}
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/myfaces/MyFacesAttribute.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/myfaces/MyFacesAttribute.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/myfaces/MyFacesAttribute.java 2010-09-17 14:20:39 UTC (rev 24989)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jst.web.kb.internal.taglib.myfaces;
+
+import org.jboss.tools.jst.web.kb.internal.KbXMLStoreConstants;
+import org.jboss.tools.jst.web.kb.internal.taglib.AbstractAttribute;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class MyFacesAttribute extends AbstractAttribute {
+
+ public MyFacesAttribute clone() throws CloneNotSupportedException {
+ return (MyFacesAttribute)super.clone();
+ }
+
+ public String getXMLClass() {
+ return KbXMLStoreConstants.CLS_MYFACES_LIBRARY;
+ }
+
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/myfaces/MyFacesAttribute.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/myfaces/MyFacesComponent.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/myfaces/MyFacesComponent.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/myfaces/MyFacesComponent.java 2010-09-17 14:20:39 UTC (rev 24989)
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jst.web.kb.internal.taglib.myfaces;
+
+import java.util.Properties;
+
+import org.jboss.tools.common.model.project.ext.IValueInfo;
+import org.jboss.tools.jst.web.kb.internal.KbXMLStoreConstants;
+import org.jboss.tools.jst.web.kb.internal.taglib.AbstractComponent;
+import org.w3c.dom.Element;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class MyFacesComponent extends AbstractComponent {
+ static String PARENT_CLASS = "parent-class"; //$NON-NLS-1$
+ protected String parentClass;
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.internal.KbObject#getXMLClass()
+ */
+ @Override
+ public String getXMLClass() {
+ return KbXMLStoreConstants.CLS_MYFACES_LIBRARY;
+ }
+
+ public String getParentClass() {
+ return parentClass;
+ }
+
+ public void setParentClass(String parentClass) {
+ this.parentClass = parentClass;
+ }
+
+ public void setParentClass(IValueInfo s) {
+ parentClass = s == null ? null : s.getValue();
+ attributesInfo.put(PARENT_CLASS, s);
+ }
+
+ @Override
+ public void loadXML(Element element, Properties context) {
+ super.loadXML(element, context);
+ setParentClass(attributesInfo.get(PARENT_CLASS));
+ }
+
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/myfaces/MyFacesComponent.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/myfaces/MyFacesTagLibrary.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/myfaces/MyFacesTagLibrary.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/myfaces/MyFacesTagLibrary.java 2010-09-17 14:20:39 UTC (rev 24989)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jst.web.kb.internal.taglib.myfaces;
+
+import org.jboss.tools.jst.web.kb.internal.KbXMLStoreConstants;
+import org.jboss.tools.jst.web.kb.internal.taglib.AbstractTagLib;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class MyFacesTagLibrary extends AbstractTagLib {
+
+ public MyFacesTagLibrary clone() throws CloneNotSupportedException {
+ return (MyFacesTagLibrary)super.clone();
+ }
+
+ public String getXMLClass() {
+ return KbXMLStoreConstants.CLS_MYFACES_LIBRARY;
+ }
+
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/myfaces/MyFacesTagLibrary.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 7 months
JBoss Tools SVN: r24988 - in trunk/hibernatetools: tests/org.hibernate.eclipse.console.test/res/sample and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2010-09-17 10:18:00 -0400 (Fri, 17 Sep 2010)
New Revision: 24988
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenXMLFactory.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test1.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test2.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenJpa_test1.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenJpa_test2.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenNullable_test1.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenNullable_test2.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test1.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test2.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test1.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test2.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test1.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test2.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/CodeGenXMLFactoryTest.java
Log:
https://jira.jboss.org/browse/JBIDE-7071 - fixed - now attributes and properties are generated in alphabetic order for Ant codegen functionality
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenXMLFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenXMLFactory.java 2010-09-17 13:53:12 UTC (rev 24987)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenXMLFactory.java 2010-09-17 14:18:00 UTC (rev 24988)
@@ -360,10 +360,17 @@
}
expProps.put(ad.name, val);
}
+ // to add attributes and properties in alphabetic order
+ Map<String, Object> expPropsSorted = new TreeMap<String, Object>();
+ for (Map.Entry<Object, Object> propEntry : expProps.entrySet()) {
+ Object key = propEntry.getKey();
+ Object val = propEntry.getValue();
+ expPropsSorted.put(key.toString(), val);
+ }
// list2Remove - list to collect properties which put into attributes,
// all other properties be ordinal property definition
List<Object> list2Remove = new ArrayList<Object>();
- for (Map.Entry<Object, Object> propEntry : expProps.entrySet()) {
+ for (Map.Entry<String, Object> propEntry : expPropsSorted.entrySet()) {
Object key = propEntry.getKey();
Object val = propEntry.getValue();
AttributeDescription ad = attributesDescrAnt.get(key);
@@ -383,8 +390,9 @@
}
for (Object obj : list2Remove) {
expProps.remove(obj);
+ expPropsSorted.remove(obj);
}
- for (Map.Entry<Object, Object> propEntry : expProps.entrySet()) {
+ for (Map.Entry<String, Object> propEntry : expPropsSorted.entrySet()) {
Object key = propEntry.getKey();
Object val = propEntry.getValue();
Element property = exporter.addElement(CodeGenerationStrings.PROPERTY);
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test1.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test1.xml 2010-09-17 13:53:12 UTC (rev 24987)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test1.xml 2010-09-17 14:18:00 UTC (rev 24988)
@@ -20,9 +20,9 @@
<property key="jdk5" value="false"/>
</hbm2cfgxml>
<hbm2dao/>
- <hbm2ddl export="false">
- <property key="ejb3" value="false"/>
- <property key="jdk5" value="false"/>
+ <hbm2ddl console="false" create="false" delimiter="@" destdir="outputdir/test_test_suffix" drop="true" export="false" format="true" haltonerror="true" templatepath="outputdir/test" update="true">
+ <property key="ejb3" value="true"/>
+ <property key="jdk5" value="true"/>
</hbm2ddl>
<hbm2doc>
<property key="ejb3" value="false"/>
@@ -33,6 +33,9 @@
<property key="jdk5" value="false"/>
</hbm2hbmxml>
<hbm2java destdir="outputdir/test">
+ <property key="keyAAA" value="valueYYY"/>
+ <property key="keyCCC" value="valueYYY"/>
+ <property key="keyDDD" value="valueYYY"/>
<property key="keyXXX" value="valueYYY"/>
</hbm2java>
<hbmtemplate>
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test2.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test2.xml 2010-09-17 13:53:12 UTC (rev 24987)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test2.xml 2010-09-17 14:18:00 UTC (rev 24988)
@@ -17,6 +17,9 @@
<path location="${build.dir}"/>
</classpath>
<hbm2java destdir="outputdir/test">
+ <property key="keyAAA" value="valueYYY"/>
+ <property key="keyCCC" value="valueYYY"/>
+ <property key="keyDDD" value="valueYYY"/>
<property key="keyXXX" value="valueYYY"/>
</hbm2java>
</hibernatetool>
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenJpa_test1.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenJpa_test1.xml 2010-09-17 13:53:12 UTC (rev 24987)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenJpa_test1.xml 2010-09-17 14:18:00 UTC (rev 24988)
@@ -21,7 +21,7 @@
<property key="jdk5" value="true"/>
</hbm2cfgxml>
<hbm2dao ejb3="true" jdk5="true"/>
- <hbm2ddl export="false">
+ <hbm2ddl console="false" create="false" delimiter="@" destdir="outputdir/test_test_suffix" drop="true" export="false" format="true" haltonerror="true" templatepath="outputdir/test" update="true">
<property key="ejb3" value="true"/>
<property key="jdk5" value="true"/>
</hbm2ddl>
@@ -34,6 +34,9 @@
<property key="jdk5" value="true"/>
</hbm2hbmxml>
<hbm2java destdir="outputdir/test" ejb3="true" jdk5="true">
+ <property key="keyAAA" value="valueYYY"/>
+ <property key="keyCCC" value="valueYYY"/>
+ <property key="keyDDD" value="valueYYY"/>
<property key="keyXXX" value="valueYYY"/>
</hbm2java>
<hbmtemplate>
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenJpa_test2.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenJpa_test2.xml 2010-09-17 13:53:12 UTC (rev 24987)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenJpa_test2.xml 2010-09-17 14:18:00 UTC (rev 24988)
@@ -18,6 +18,9 @@
<path location="${build.dir}"/>
</classpath>
<hbm2java destdir="outputdir/test" ejb3="true" jdk5="true">
+ <property key="keyAAA" value="valueYYY"/>
+ <property key="keyCCC" value="valueYYY"/>
+ <property key="keyDDD" value="valueYYY"/>
<property key="keyXXX" value="valueYYY"/>
</hbm2java>
</hibernatetool>
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenNullable_test1.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenNullable_test1.xml 2010-09-17 13:53:12 UTC (rev 24987)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenNullable_test1.xml 2010-09-17 14:18:00 UTC (rev 24988)
@@ -11,9 +11,9 @@
<property key="jdk5" value="false"/>
</hbm2cfgxml>
<hbm2dao/>
- <hbm2ddl export="false">
- <property key="ejb3" value="false"/>
- <property key="jdk5" value="false"/>
+ <hbm2ddl console="false" create="false" delimiter="@" destdir="outputdir/test_test_suffix" drop="true" export="false" format="true" haltonerror="true" templatepath="outputdir/test" update="true">
+ <property key="ejb3" value="true"/>
+ <property key="jdk5" value="true"/>
</hbm2ddl>
<hbm2doc>
<property key="ejb3" value="false"/>
@@ -24,6 +24,9 @@
<property key="jdk5" value="false"/>
</hbm2hbmxml>
<hbm2java destdir="outputdir/test">
+ <property key="keyAAA" value="valueYYY"/>
+ <property key="keyCCC" value="valueYYY"/>
+ <property key="keyDDD" value="valueYYY"/>
<property key="keyXXX" value="valueYYY"/>
</hbm2java>
<hbmtemplate>
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenNullable_test2.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenNullable_test2.xml 2010-09-17 13:53:12 UTC (rev 24987)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenNullable_test2.xml 2010-09-17 14:18:00 UTC (rev 24988)
@@ -8,6 +8,9 @@
<path location="${build.dir}"/>
</classpath>
<hbm2java destdir="outputdir/test">
+ <property key="keyAAA" value="valueYYY"/>
+ <property key="keyCCC" value="valueYYY"/>
+ <property key="keyDDD" value="valueYYY"/>
<property key="keyXXX" value="valueYYY"/>
</hbm2java>
</hibernatetool>
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test1.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test1.xml 2010-09-17 13:53:12 UTC (rev 24987)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test1.xml 2010-09-17 14:18:00 UTC (rev 24988)
@@ -12,9 +12,9 @@
<property key="jdk5" value="false"/>
</hbm2cfgxml>
<hbm2dao/>
- <hbm2ddl export="false">
- <property key="ejb3" value="false"/>
- <property key="jdk5" value="false"/>
+ <hbm2ddl console="false" create="false" delimiter="@" destdir="outputdir/test_test_suffix" drop="true" export="false" format="true" haltonerror="true" templatepath="outputdir/test" update="true">
+ <property key="ejb3" value="true"/>
+ <property key="jdk5" value="true"/>
</hbm2ddl>
<hbm2doc>
<property key="ejb3" value="false"/>
@@ -25,6 +25,9 @@
<property key="jdk5" value="false"/>
</hbm2hbmxml>
<hbm2java destdir="outputdir/test">
+ <property key="keyAAA" value="valueYYY"/>
+ <property key="keyCCC" value="valueYYY"/>
+ <property key="keyDDD" value="valueYYY"/>
<property key="keyXXX" value="valueYYY"/>
</hbm2java>
<hbmtemplate>
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test2.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test2.xml 2010-09-17 13:53:12 UTC (rev 24987)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test2.xml 2010-09-17 14:18:00 UTC (rev 24988)
@@ -9,6 +9,9 @@
<path location="${build.dir}"/>
</classpath>
<hbm2java destdir="outputdir/test">
+ <property key="keyAAA" value="valueYYY"/>
+ <property key="keyCCC" value="valueYYY"/>
+ <property key="keyDDD" value="valueYYY"/>
<property key="keyXXX" value="valueYYY"/>
</hbm2java>
</hibernatetool>
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test1.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test1.xml 2010-09-17 13:53:12 UTC (rev 24987)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test1.xml 2010-09-17 14:18:00 UTC (rev 24988)
@@ -12,9 +12,9 @@
<property key="jdk5" value="false"/>
</hbm2cfgxml>
<hbm2dao/>
- <hbm2ddl export="false">
- <property key="ejb3" value="false"/>
- <property key="jdk5" value="false"/>
+ <hbm2ddl console="false" create="false" delimiter="@" destdir="outputdir/test_test_suffix" drop="true" export="false" format="true" haltonerror="true" templatepath="outputdir/test" update="true">
+ <property key="ejb3" value="true"/>
+ <property key="jdk5" value="true"/>
</hbm2ddl>
<hbm2doc>
<property key="ejb3" value="false"/>
@@ -25,6 +25,9 @@
<property key="jdk5" value="false"/>
</hbm2hbmxml>
<hbm2java destdir="outputdir/test">
+ <property key="keyAAA" value="valueYYY"/>
+ <property key="keyCCC" value="valueYYY"/>
+ <property key="keyDDD" value="valueYYY"/>
<property key="keyXXX" value="valueYYY"/>
</hbm2java>
<hbmtemplate>
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test2.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test2.xml 2010-09-17 13:53:12 UTC (rev 24987)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test2.xml 2010-09-17 14:18:00 UTC (rev 24988)
@@ -9,6 +9,9 @@
<path location="${build.dir}"/>
</classpath>
<hbm2java destdir="outputdir/test">
+ <property key="keyAAA" value="valueYYY"/>
+ <property key="keyCCC" value="valueYYY"/>
+ <property key="keyDDD" value="valueYYY"/>
<property key="keyXXX" value="valueYYY"/>
</hbm2java>
</hibernatetool>
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test1.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test1.xml 2010-09-17 13:53:12 UTC (rev 24987)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test1.xml 2010-09-17 14:18:00 UTC (rev 24988)
@@ -14,9 +14,9 @@
<property key="jdk5" value="false"/>
</hbm2cfgxml>
<hbm2dao/>
- <hbm2ddl export="false">
- <property key="ejb3" value="false"/>
- <property key="jdk5" value="false"/>
+ <hbm2ddl console="false" create="false" delimiter="@" destdir="outputdir/test_test_suffix" drop="true" export="false" format="true" haltonerror="true" templatepath="outputdir/test" update="true">
+ <property key="ejb3" value="true"/>
+ <property key="jdk5" value="true"/>
</hbm2ddl>
<hbm2doc>
<property key="ejb3" value="false"/>
@@ -27,6 +27,9 @@
<property key="jdk5" value="false"/>
</hbm2hbmxml>
<hbm2java destdir="outputdir/test">
+ <property key="keyAAA" value="valueYYY"/>
+ <property key="keyCCC" value="valueYYY"/>
+ <property key="keyDDD" value="valueYYY"/>
<property key="keyXXX" value="valueYYY"/>
</hbm2java>
<hbmtemplate>
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test2.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test2.xml 2010-09-17 13:53:12 UTC (rev 24987)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test2.xml 2010-09-17 14:18:00 UTC (rev 24988)
@@ -11,6 +11,9 @@
<path location="${build.dir}"/>
</classpath>
<hbm2java destdir="outputdir/test">
+ <property key="keyAAA" value="valueYYY"/>
+ <property key="keyCCC" value="valueYYY"/>
+ <property key="keyDDD" value="valueYYY"/>
<property key="keyXXX" value="valueYYY"/>
</hbm2java>
</hibernatetool>
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/CodeGenXMLFactoryTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/CodeGenXMLFactoryTest.java 2010-09-17 13:53:12 UTC (rev 24987)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/CodeGenXMLFactoryTest.java 2010-09-17 14:18:00 UTC (rev 24988)
@@ -66,6 +66,9 @@
public static final String HBMTEMPLATE1 = "query"; //$NON-NLS-1$
public static final String HBMTEMPLATE1_PROPERTIES = HibernateLaunchConstants.ATTR_EXPORTERS
+ '.' + HBMTEMPLATE1 + ".properties"; //$NON-NLS-1$
+ public static final String HBMTEMPLATE2 = "hbm2ddl"; //$NON-NLS-1$
+ public static final String HBMTEMPLATE2_PROPERTIES = HibernateLaunchConstants.ATTR_EXPORTERS
+ + '.' + HBMTEMPLATE2 + ".properties"; //$NON-NLS-1$
public static final String OUTDIR_PATH = "outputdir/test"; //$NON-NLS-1$
public class TestConsoleConfigPref extends TestConsoleConfigurationPreferences {
@@ -456,10 +459,30 @@
expProps2.put(ExporterFactoryStrings.OUTPUTDIR, OUTDIR_PATH);
expProps2.put(CodeGenerationStrings.DESTDIR, OUTDIR_PATH + "_test_suffix"); //$NON-NLS-1$
expProps2.put("keyXXX", "valueYYY"); //$NON-NLS-1$ //$NON-NLS-2$
+ expProps2.put("keyCCC", "valueYYY"); //$NON-NLS-1$ //$NON-NLS-2$
+ expProps2.put("keyAAA", "valueYYY"); //$NON-NLS-1$ //$NON-NLS-2$
+ expProps2.put("keyDDD", "valueYYY"); //$NON-NLS-1$ //$NON-NLS-2$
+ //
Map<String, String> expProps3 = new HashMap<String, String>();
expProps3.put(ExporterFactoryStrings.QUERY_STRING, "from testQuery"); //$NON-NLS-1$
+ //
+ Map<String, String> expProps4 = new HashMap<String, String>();
+ expProps4.put(CodeGenerationStrings.DESTDIR, OUTDIR_PATH + "_test_suffix"); //$NON-NLS-1$
+ expProps4.put(CodeGenerationStrings.TEMPLATEPATH, OUTDIR_PATH);
+ expProps4.put("export", "false"); //$NON-NLS-1$ //$NON-NLS-2$
+ expProps4.put("update", "true"); //$NON-NLS-1$ //$NON-NLS-2$
+ expProps4.put("drop", "true"); //$NON-NLS-1$ //$NON-NLS-2$
+ expProps4.put("create", "false"); //$NON-NLS-1$ //$NON-NLS-2$
+ expProps4.put("delimiter", "@"); //$NON-NLS-1$ //$NON-NLS-2$
+ expProps4.put("format", "true"); //$NON-NLS-1$ //$NON-NLS-2$
+ expProps4.put("haltonerror", "true"); //$NON-NLS-1$ //$NON-NLS-2$
+ expProps4.put("console", "false"); //$NON-NLS-1$ //$NON-NLS-2$
+ expProps4.put(CodeGenerationStrings.EJB3, "true"); //$NON-NLS-1$
+ expProps4.put(CodeGenerationStrings.JDK5, "true"); //$NON-NLS-1$
+ //
testLaunchConfigAttr.put(HBMTEMPLATE0_PROPERTIES, expProps2);
testLaunchConfigAttr.put(HBMTEMPLATE1_PROPERTIES, expProps3);
+ testLaunchConfigAttr.put(HBMTEMPLATE2_PROPERTIES, expProps4);
testLaunchConfigAttr.put(HibernateLaunchConstants.ATTR_REVERSE_ENGINEER, reveng);
testLaunchConfigAttr.put(HibernateLaunchConstants.ATTR_PREFER_BASIC_COMPOSITE_IDS, true);
return testLaunchConfigAttr;
15 years, 7 months
JBoss Tools SVN: r24987 - in trunk/jst/tests/org.jboss.tools.jst.jsp.test: src/org/jboss/tools/jst/jsp/test and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2010-09-17 09:53:12 -0400 (Fri, 17 Sep 2010)
New Revision: 24987
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/META-INF/MANIFEST.MF
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/TestUtil.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1704Test.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1717Test.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1585Test.java
Log:
JBIDE-6529 : jsf test failures
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/META-INF/MANIFEST.MF 2010-09-17 13:06:20 UTC (rev 24986)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/META-INF/MANIFEST.MF 2010-09-17 13:53:12 UTC (rev 24987)
@@ -16,7 +16,13 @@
org.jboss.tools.common.text.ext,
org.jboss.tools.jst.web,
org.jboss.tools.common.text.xml;bundle-version="2.0.0",
- org.jboss.tools.jst.web.kb;bundle-version="3.1.0"
+ org.jboss.tools.jst.web.kb;bundle-version="3.1.0",
+ org.jboss.tools.jmx.core;bundle-version="1.2.0",
+ org.jboss.tools.jsf;bundle-version="3.2.0",
+ org.jboss.tools.seam.core;bundle-version="3.2.0",
+ org.jboss.tools.seam.pages.xml;bundle-version="3.1.0",
+ org.jboss.tools.seam.xml;bundle-version="3.2.0",
+ org.jboss.tools.struts;bundle-version="3.2.0"
Export-Package:
org.jboss.tools.jst.jsp.test,
org.jboss.tools.jst.jsp.test.ca
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/TestUtil.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/TestUtil.java 2010-09-17 13:06:20 UTC (rev 24986)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/TestUtil.java 2010-09-17 13:53:12 UTC (rev 24987)
@@ -1,6 +1,9 @@
package org.jboss.tools.jst.jsp.test;
import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.text.BadLocationException;
@@ -8,6 +11,7 @@
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.TextUtilities;
import org.eclipse.jface.text.contentassist.ContentAssistant;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.text.contentassist.IContentAssistant;
import org.eclipse.jface.text.contentassist.IContentAssistantExtension;
@@ -114,4 +118,21 @@
ca.showPossibleCompletions();
}
+
+ public static int MAX_CATEGORIES_COUNT = 10;
+ public static List<ICompletionProposal> collectProposals(IContentAssistant ca, ITextViewer viewer, int offset) {
+ prepareCAInvokation(ca, viewer, offset);
+
+ final IContentAssistProcessor p= TestUtil.getProcessor(viewer, offset, ca);
+ List<ICompletionProposal> res= new ArrayList<ICompletionProposal>();
+ // Try to acquire all the proposal categories assuming that there are less than 10 or equal
+ for (int i = 0; i < MAX_CATEGORIES_COUNT && p != null; i++) {
+ ICompletionProposal[] result= p.computeCompletionProposals(viewer, offset);
+ for (int j = 0; result != null && j < result.length; j++) {
+ res.add(result[j]);
+ }
+ }
+ return res;
+ }
+
}
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java 2010-09-17 13:06:20 UTC (rev 24986)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java 2010-09-17 13:53:12 UTC (rev 24987)
@@ -1,5 +1,7 @@
package org.jboss.tools.jst.jsp.test.ca;
+import java.util.List;
+
import junit.framework.TestCase;
import org.eclipse.core.resources.IProject;
@@ -72,30 +74,15 @@
position = documentContent.indexOf(substring);
}
- ICompletionProposal[] result = null;
+ List<ICompletionProposal> res = TestUtil.collectProposals(contentAssistant, viewer, position+offset);
-// System.out.println("checkProposals >>> invoking TestUtil.getProcessor() for position " + (position + offset));
+ assertTrue("Content Assistant returned no proposals", (res != null && res.size() > 0));
- IContentAssistProcessor p = TestUtil.getProcessor(viewer, position + offset, contentAssistant);
- TestUtil.prepareCAInvokation(contentAssistant, viewer, position+offset);
- // System.out.println("checkProposals >>> TestUtil.getProcessor() is invoked for " + (position + offset));
- if (p != null) {
- try {
- // System.out.println("checkProposals >>> invoking p.computeCompletionProposals() for position " + (position + offset));
- result = p.computeCompletionProposals(viewer, position + offset);
- // System.out.println("checkProposals >>> p.computeCompletionProposals() is invoked for " + (position + offset));
- } catch (Throwable x) {
- x.printStackTrace();
- }
- }
- // System.out.println("checkProposals >>> Performing the values check up");
-
- assertTrue("Content Assistant returned no proposals", (result != null && result.length > 0));
-
// for (int i = 0; i < result.length; i++) {
// System.out.println("proposal - "+result[i].getDisplayString());
// }
+ ICompletionProposal[] result = res.toArray(new ICompletionProposal[res.size()]);
int foundCounter = 0;
for (int i = 0; i < proposals.length; i++) {
boolean found = compareProposal(proposals[i], result);
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1704Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1704Test.java 2010-09-17 13:06:20 UTC (rev 24986)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1704Test.java 2010-09-17 13:53:12 UTC (rev 24987)
@@ -1,5 +1,8 @@
package org.jboss.tools.jst.jsp.test.ca;
+import java.util.ArrayList;
+import java.util.List;
+
import junit.framework.Test;
import junit.framework.TestSuite;
@@ -9,6 +12,7 @@
import org.eclipse.jface.text.contentassist.ContentAssistant;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
import org.jboss.tools.jst.jsp.test.TestUtil;
import org.jboss.tools.test.util.TestProjectProvider;
@@ -45,7 +49,7 @@
doTestJsfJspJbide1704(PAGE_NAME + ".xhtml");
}
- private static final String THE_ONLY_ALLOWED_TEMPLATE = "New JSF EL Expression - Create a new attribute value with #{}".toLowerCase();
+ private static final String TEST_RESOURCES_VALUE = "\"resources\"";
private void doTestJsfJspJbide1704(String pageName) {
@@ -53,28 +57,51 @@
try {
- ICompletionProposal[] result= null;
final IRegion reg = new FindReplaceDocumentAdapter(document).find(0,
" var=\"msg\"", true, true, false, false);
+ String text = document.get();
String errorMessage = null;
- TestUtil.prepareCAInvokation(contentAssistant, viewer, reg.getOffset());
-
- final IContentAssistProcessor p= TestUtil.getProcessor(viewer, reg.getOffset(), contentAssistant);
- if (p != null) {
- result= p.computeCompletionProposals(viewer, reg.getOffset());
- }
- for (int k = 0; result != null && k < result.length; k++) {
+ List<ICompletionProposal> res = TestUtil.collectProposals(contentAssistant, viewer, reg.getOffset());
+
+ assertTrue("Content Assist returned no proposals: ", (res != null && res.size() > 0));
+
+ for (ICompletionProposal proposal : res) {
// There should not be a proposal of type AutoContentAssistantProposal in the result
// (the only exclusion is EL-proposals)
- if ((result[k] instanceof AutoContentAssistantProposal) &&
- ((AutoContentAssistantProposal)result[k]).getReplacementString().startsWith("#{")) {
- // The only EL template proposal is allowed to be shown here
- continue;
+ if (proposal instanceof AutoContentAssistantProposal) {
+ if(((AutoContentAssistantProposal)proposal).getReplacementString().startsWith("#{")) {
+ // The only EL template proposal is allowed to be shown here
+ continue;
+ }
}
- assertFalse("Content Assistant peturned proposals of type (" + result[k].getClass().getName() + ").", (result[k] instanceof AutoContentAssistantProposal));
+
+ if (proposal instanceof CustomCompletionProposal) {
+ // There are two cases are allowed to be shown
+ // AutoContentAssistantProposal which returns the "resources" string as replacement
+ // CustomCompletionProposal which returns the current value string as replacement
+
+ if (!(proposal instanceof AutoContentAssistantProposal)) {
+ int equalSignIndex = text.lastIndexOf('=', reg.getOffset());
+ if (equalSignIndex != -1) {
+ String prevAttrValue = text.substring(equalSignIndex+1, reg.getOffset()).trim();
+ if (((CustomCompletionProposal)proposal).getReplacementString().equals(prevAttrValue)){
+ // The old value for the attribute is allowed to be shown here
+ continue;
+ }
+ }
+ } else {
+ if (((CustomCompletionProposal)proposal).getReplacementString().equals(TEST_RESOURCES_VALUE)){
+ // The old value for the attribute is allowed to be shown here
+ continue;
+ }
+
+ }
+ }
+
+ assertFalse("Content Assistant peturned proposals of type (" + proposal.getClass().getName() + ").", (proposal instanceof AutoContentAssistantProposal));
}
} catch (BadLocationException e) {
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1717Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1717Test.java 2010-09-17 13:06:20 UTC (rev 24986)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1717Test.java 2010-09-17 13:53:12 UTC (rev 24987)
@@ -57,25 +57,18 @@
jspTextEditor.setText(documentContentModified);
- ICompletionProposal[] result= null;
String errorMessage = null;
- TestUtil.prepareCAInvokation(contentAssistant, viewer, offsetToTest);
- IContentAssistProcessor p= TestUtil.getProcessor(viewer, offsetToTest, contentAssistant);
- if (p != null) {
- try {
- result= p.computeCompletionProposals(viewer, offsetToTest);
- } catch (Throwable x) {
- x.printStackTrace();
- }
- errorMessage= p.getErrorMessage();
- }
+ List<ICompletionProposal> res = TestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
List<String> customCompletionProposals = new ArrayList<String>();
- for (int i = 0; i < result.length; i++) {
- // There should be at least one proposal of type CustomCompletionProposal in the result
- if (result[i] instanceof CustomCompletionProposal) {
- customCompletionProposals.add(((CustomCompletionProposal)result[i]).getReplacementString());
+
+ if (res != null) {
+ for (ICompletionProposal proposal : res) {
+ // There should be at least one proposal of type CustomCompletionProposal in the result
+ if (proposal instanceof CustomCompletionProposal) {
+ customCompletionProposals.add(((CustomCompletionProposal)proposal).getReplacementString());
+ }
}
}
assertFalse("Content Assistant returned no proposals of type CustomCompletionProposal.",customCompletionProposals.isEmpty());
@@ -100,24 +93,17 @@
"|" + documentContentModified.substring(offsetToTest);
jspTextEditor.setText(documentContentModified);
-
- p= TestUtil.getProcessor(viewer, offsetToTest, contentAssistant);
- if (p != null) {
- try {
- result= p.computeCompletionProposals(viewer, offsetToTest);
- } catch (Throwable x) {
- x.printStackTrace();
- }
- errorMessage= p.getErrorMessage();
- }
-
- for (int i = 0; i < result.length; i++) {
- // There should be the same proposals as in the saved result
- if (result[i] instanceof CustomCompletionProposal) {
- assertTrue("Content Assistant returned additional proposal (proposal returned doesn't exist in the saved list).",
- customCompletionProposals.contains(((CustomCompletionProposal)result[i]).getReplacementString()));
- customCompletionProposals.remove(((CustomCompletionProposal)result[i]).getReplacementString());
+ res = TestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
+
+ if (res != null) {
+ for (ICompletionProposal proposal : res) {
+ // There should be the same proposals as in the saved result
+ if (proposal instanceof CustomCompletionProposal) {
+ assertTrue("Content Assistant returned additional proposal (proposal returned doesn't exist in the saved list).",
+ customCompletionProposals.contains(((CustomCompletionProposal)proposal).getReplacementString()));
+ customCompletionProposals.remove(((CustomCompletionProposal)proposal).getReplacementString());
+ }
}
}
assertTrue("Content Assistant didn't returned some proposals.",customCompletionProposals.isEmpty());
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1585Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1585Test.java 2010-09-17 13:06:20 UTC (rev 24986)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1585Test.java 2010-09-17 13:53:12 UTC (rev 24987)
@@ -1,5 +1,7 @@
package org.jboss.tools.jst.jsp.test.ca;
+import java.util.List;
+
import junit.framework.Test;
import junit.framework.TestSuite;
@@ -52,43 +54,26 @@
jspTextEditor.setText(documentContentModified);
- // sets cursor position
- viewer.getTextWidget().setCaretOffset(offsetToTest);
-
- TestUtil.waitForIdle(TestUtil.MAX_IDLE);
- TestUtil.delay(1000);
-
- ICompletionProposal[] result= null;
- String errorMessage = null;
-
- if (contentAssistant instanceof ContentAssistant) {
- TestUtil.prepareCAInvokation(contentAssistant, viewer, offsetToTest);
- IContentAssistProcessor p= TestUtil.getProcessor(viewer, offsetToTest, contentAssistant);
- if (p != null) {
- try {
- result= p.computeCompletionProposals(viewer, offsetToTest);
- } catch (Throwable x) {
- x.printStackTrace();
- }
- errorMessage= p.getErrorMessage();
+ try {
+ List<ICompletionProposal> res = TestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
+
+ assertTrue("Content Assistant returned no proposals", (res != null && res.size() > 0));
+
+ for (ICompletionProposal p : res) {
+ assertTrue("Content Assistant returned proposals which type (" + p.getClass().getName() + ") differs from AutoContentAssistantProposal", (p instanceof AutoContentAssistantProposal));
+
+ AutoContentAssistantProposal proposal = (AutoContentAssistantProposal)p;
+ String proposalString = proposal.getReplacementString();
+ int proposalReplacementOffset = proposal.getReplacementOffset();
+ int proposalReplacementLength = proposal.getReplacementLength();
+
+ assertTrue("The proposal replacement Offset is not correct.", proposalReplacementOffset == start + TAG_OPEN_STRING.length());
+ assertTrue("The proposal replacement Length is not correct.", proposalReplacementLength == PREFIX_STRING.length());
+ assertTrue("The proposal isn\'t filtered properly in the Content Assistant.", proposalString.startsWith(PREFIX_STRING));
}
+ } finally {
+ closeEditor();
}
-
- assertTrue("Content Assistant returned no proposals", (result != null && result.length > 0));
-
- for (int i = 0; i < result.length; i++) {
- assertTrue("Content Assistant returned proposals which type (" + result[i].getClass().getName() + ") differs from AutoContentAssistantProposal", (result[i] instanceof AutoContentAssistantProposal));
- AutoContentAssistantProposal proposal = (AutoContentAssistantProposal)result[i];
- String proposalString = proposal.getReplacementString();
- int proposalReplacementOffset = proposal.getReplacementOffset();
- int proposalReplacementLength = proposal.getReplacementLength();
-
- assertTrue("The proposal replacement Offset is not correct.", proposalReplacementOffset == start + TAG_OPEN_STRING.length());
- assertTrue("The proposal replacement Length is not correct.", proposalReplacementLength == PREFIX_STRING.length());
- assertTrue("The proposal isn\'t filtered properly in the Content Assistant.", proposalString.startsWith(PREFIX_STRING));
- }
-
- closeEditor();
}
}
15 years, 7 months
JBoss Tools SVN: r24986 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2010-09-17 09:06:20 -0400 (Fri, 17 Sep 2010)
New Revision: 24986
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/tabPanel.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/toolBar.xhtml.xml
Log:
Content tests were corrected for rich:toolbar and rich:tabPanel.
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/tabPanel.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/tabPanel.xhtml.xml 2010-09-17 13:01:48 UTC (rev 24985)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/tabPanel.xhtml.xml 2010-09-17 13:06:20 UTC (rev 24986)
@@ -1,6 +1,5 @@
<tests>
<test id="tabPanel">
- <DIV>
<TABLE CELLSPACING="0" CELLPADDING="0" BORDER="0" CLASS="rich-tabpanel"
STYLE="width: 100%;">
<TBODY>
@@ -160,6 +159,5 @@
</TR>
</TBODY>
</TABLE>
- </DIV>
</test>
</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/toolBar.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/toolBar.xhtml.xml 2010-09-17 13:01:48 UTC (rev 24985)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/toolBar.xhtml.xml 2010-09-17 13:06:20 UTC (rev 24986)
@@ -1,6 +1,5 @@
<tests>
<test id="toolBar">
- <DIV>
<TABLE WIDTH="100%" CLASS="dr-toolbar-ext rich-toolbar"
STYLE="/background-image: url\(.*resources/common/background.gif\);/">
<TBODY>
@@ -68,7 +67,6 @@
</TR>
</TBODY>
</TABLE>
- </DIV>
</test>
<test id="toolBar2">
<DIV CLASS="dr-pnl rich-panel">
@@ -79,7 +77,6 @@
</SPAN>
</DIV>
<DIV CLASS="dr-pnl-b rich-panel-body">
- <DIV>
<TABLE WIDTH="100%" HEIGHT="26" CLASS="dr-toolbar-ext rich-toolbar btn"
STYLE="/background-image: url\(.*resources/common/background.gif\);/">
<TBODY>
@@ -172,9 +169,7 @@
</TR>
</TBODY>
</TABLE>
- </DIV>
<FORM STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px;">
- <DIV>
<TABLE WIDTH="100%" HEIGHT="34"
CLASS="dr-toolbar-ext rich-toolbar evenRow"
STYLE="/background-image: url\(.*resources/common/background.gif\);/">
@@ -290,7 +285,6 @@
</TR>
</TBODY>
</TABLE>
- </DIV>
</FORM>
<FORM STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px;">
<TABLE WIDTH="100%" CELLSPACING="0" CELLPADDING="0" BORDER="0"
@@ -391,7 +385,6 @@
</TBODY>
</TABLE>
</FORM>
- <DIV>
<TABLE WIDTH="100%" HEIGHT="30" CLASS="dr-toolbar-ext rich-toolbar"
STYLE="/background-image: url\(.*resources/common/background.gif\); color: Cornsilk; font-style: italic; background-color: Orchid; text-decoration: underline; font-family: Arial Narrow,Bodoni MT; font-weight: bold;/">
<TBODY>
@@ -475,7 +468,6 @@
</TR>
</TBODY>
</TABLE>
- </DIV>
</DIV>
</DIV>
</test>
15 years, 7 months
JBoss Tools SVN: r24985 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/selection/bar.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2010-09-17 09:01:48 -0400 (Fri, 17 Sep 2010)
New Revision: 24985
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/selection/bar/SelectionBar.java
Log:
https://jira.jboss.org/browse/JBIDE-6981 , drop down menu will be created only after childrens list is about to show but not at the initialization time.
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/selection/bar/SelectionBar.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/selection/bar/SelectionBar.java 2010-09-17 12:47:53 UTC (rev 24984)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/selection/bar/SelectionBar.java 2010-09-17 13:01:48 UTC (rev 24985)
@@ -21,6 +21,8 @@
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.MenuEvent;
+import org.eclipse.swt.events.MenuListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
@@ -372,16 +374,18 @@
* Create DropDownMenu button
*/
item = new ToolItem(selBar, SWT.DROP_DOWN, 1);
- final DropdownSelectionListener listenerOne = new DropdownSelectionListener(item);
- for (Node node2 : list) {
- listenerOne.add(node2);
- }
- item.addSelectionListener(listenerOne);
- item.addDisposeListener(new DisposeListener(){
+ final DropdownSelectionListener dropdownListener = new DropdownSelectionListener(
+ item, list);
+ item.addSelectionListener(dropdownListener);
+ /*
+ * Dispose the menu manually when the item is disposed.
+ * Thus unnecessary memory will be released.
+ */
+ item.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
- listenerOne.disposeMenu();
+ dropdownListener.disposeMenu();
}
- });
+ });
}
item.setData(node);
item.setText(node.getNodeName());
@@ -602,10 +606,21 @@
*********************************************************************************************
* This class provides the "drop down" functionality for the selection bar.
*********************************************************************************************/
- class DropdownSelectionListener extends SelectionAdapter {
+ class DropdownSelectionListener extends SelectionAdapter {
private ToolItem dropdown;
private Menu menu;
+ private List<Node> children;
private boolean shown = false;
+ /**
+ * Constructs a DropdownSelectionListener
+ *
+ * @param dropdown
+ * the tool item this listener belongs to
+ */
+ public DropdownSelectionListener(ToolItem dropdown, List<Node> children) {
+ this.dropdown = dropdown;
+ this.children = children;
+ }
public void disposeMenu() {
if (menu != null) {
@@ -613,16 +628,6 @@
menu = null;
}
}
- /**
- * Constructs a DropdownSelectionListener
- *
- * @param dropdown
- * the dropdown this listener belongs to
- */
- public DropdownSelectionListener(ToolItem dropdown) {
- this.dropdown = dropdown;
- menu = new Menu(dropdown.getParent().getShell());
- }
/**
* Adds an item to the dropdown list
@@ -653,10 +658,36 @@
*/
if (event.detail == SWT.ARROW) {
if (shown) {
- menu.setVisible(false);
+ if (menu != null) {
+ menu.setVisible(false);
+ }
shown = false;
} else {
/*
+ * Create menu when it is accessed for the first time.
+ */
+ if (menu == null) {
+ menu = new Menu(dropdown.getParent());
+ if ((children != null) && (children.size() > 0)) {
+ for (Node node : children) {
+ add(node);
+ }
+ }
+ }
+ menu.addMenuListener(new MenuListener() {
+ public void menuShown(MenuEvent e) {
+ /*
+ * Do nothing
+ */
+ }
+ public void menuHidden(MenuEvent e) {
+ /*
+ * Change the 'shown' state
+ */
+ shown = false;
+ }
+ });
+ /*
* Determine where to put the dropdown list and show it
*/
ToolItem item = (ToolItem) event.widget;
@@ -675,7 +706,7 @@
}
}
}
-
+
@Override
public void selectionChanged(SelectionChangedEvent event) {
updateNodes(true);
15 years, 7 months
JBoss Tools SVN: r24984 - in trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test: .settings and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2010-09-17 08:47:53 -0400 (Fri, 17 Sep 2010)
New Revision: 24984
Added:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launchers/
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launchers/CodeGeneration.launch
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launchers/ConsoleTest.launch
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launchers/DaliTest.launch
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launchers/HibernateAllTests.launch
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launchers/MappingFileTest.launch
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launchers/ReverseEngineerFileTest.launch
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/.settings/
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/CodeGenerationLauncherTest.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConsolePerspectiveTest.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConsoleTest.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/DaliTest.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/JIRATest.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/MappingFileTest.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ReverseEngineerFileTest.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/HibernateAllTests.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/HibernateTest.java
Log:
Updated to work with JBDS 4.0.0.m2.478
Launchers added
Property changes on: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test
___________________________________________________________________
Name: svn:ignore
- bin
target
build
+ bin
target
build
screenshots
Property changes on: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/.settings
___________________________________________________________________
Name: svn:ignore
+ org.eclipse.wst.validation.prefs
org.jboss.ide.eclipse.as.core.prefs
Added: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launchers/CodeGeneration.launch
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launchers/CodeGeneration.launch (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launchers/CodeGeneration.launch 2010-09-17 12:47:53 UTC (rev 24984)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.swtbot.eclipse.ui.launcher.JunitLaunchConfig">
+<booleanAttribute key="append.args" value="true"/>
+<booleanAttribute key="askclear" value="false"/>
+<booleanAttribute key="automaticAdd" value="true"/>
+<booleanAttribute key="automaticValidate" value="false"/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="[NONE]"/>
+<booleanAttribute key="clearConfig" value="true"/>
+<booleanAttribute key="clearws" value="true"/>
+<booleanAttribute key="clearwslog" value="false"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
+<booleanAttribute key="default" value="true"/>
+<booleanAttribute key="includeOptional" value="true"/>
+<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/CodeGenerationLauncherTest.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<mapAttribute key="org.eclipse.debug.core.environmentVariables">
+<mapEntry key="DISPLAY" value=":1"/>
+</mapAttribute>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
+<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
+<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.jboss.tools.hibernate.ui.bot.testcase.CodeGenerationLauncherTest"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.jboss.tools.hibernate.ui.bot.test"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms256m -Xmx384m -XX:MaxPermSize=256M -Dosgi.bundles=reference:file:org.eclipse.equinox.simpleconfigurator_1.0.200.v20100503.jar@1:start,org.eclipse.equinox.transforms.xslt@1:start,org.jboss.tools.equinox.transforms.xslt@1:start"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="org.eclipse.platform.ide"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useCustomFeatures" value="false"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<booleanAttribute key="useDefaultConfigArea" value="false"/>
+<booleanAttribute key="useProduct" value="true"/>
+</launchConfiguration>
Property changes on: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launchers/CodeGeneration.launch
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launchers/ConsoleTest.launch
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launchers/ConsoleTest.launch (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launchers/ConsoleTest.launch 2010-09-17 12:47:53 UTC (rev 24984)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.swtbot.eclipse.ui.launcher.JunitLaunchConfig">
+<booleanAttribute key="append.args" value="true"/>
+<booleanAttribute key="askclear" value="false"/>
+<booleanAttribute key="automaticAdd" value="true"/>
+<booleanAttribute key="automaticValidate" value="false"/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="[NONE]"/>
+<booleanAttribute key="clearConfig" value="true"/>
+<booleanAttribute key="clearws" value="true"/>
+<booleanAttribute key="clearwslog" value="false"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
+<booleanAttribute key="default" value="true"/>
+<booleanAttribute key="includeOptional" value="true"/>
+<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConsoleTest.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<mapAttribute key="org.eclipse.debug.core.environmentVariables">
+<mapEntry key="DISPLAY" value=":1"/>
+</mapAttribute>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
+<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
+<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.jboss.tools.hibernate.ui.bot.testcase.ConsoleTest"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.jboss.tools.hibernate.ui.bot.test"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms256m -Xmx384m -XX:MaxPermSize=256M -Dosgi.bundles=reference:file:org.eclipse.equinox.simpleconfigurator_1.0.200.v20100503.jar@1:start,org.eclipse.equinox.transforms.xslt@1:start,org.jboss.tools.equinox.transforms.xslt@1:start"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="org.eclipse.platform.ide"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useCustomFeatures" value="false"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<booleanAttribute key="useDefaultConfigArea" value="false"/>
+<booleanAttribute key="useProduct" value="true"/>
+</launchConfiguration>
Property changes on: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launchers/ConsoleTest.launch
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launchers/DaliTest.launch
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launchers/DaliTest.launch (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launchers/DaliTest.launch 2010-09-17 12:47:53 UTC (rev 24984)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.swtbot.eclipse.ui.launcher.JunitLaunchConfig">
+<booleanAttribute key="append.args" value="true"/>
+<booleanAttribute key="askclear" value="false"/>
+<booleanAttribute key="automaticAdd" value="true"/>
+<booleanAttribute key="automaticValidate" value="false"/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="[NONE]"/>
+<booleanAttribute key="clearConfig" value="true"/>
+<booleanAttribute key="clearws" value="true"/>
+<booleanAttribute key="clearwslog" value="false"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
+<booleanAttribute key="default" value="true"/>
+<booleanAttribute key="includeOptional" value="true"/>
+<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/DaliTest.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<mapAttribute key="org.eclipse.debug.core.environmentVariables">
+<mapEntry key="DISPLAY" value=":1"/>
+</mapAttribute>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
+<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
+<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.jboss.tools.hibernate.ui.bot.testcase.DaliTest"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.jboss.tools.hibernate.ui.bot.test"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms256m -Xmx384m -XX:MaxPermSize=256M -Dosgi.bundles=reference:file:org.eclipse.equinox.simpleconfigurator_1.0.200.v20100503.jar@1:start,org.eclipse.equinox.transforms.xslt@1:start,org.jboss.tools.equinox.transforms.xslt@1:start"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="org.eclipse.platform.ide"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useCustomFeatures" value="false"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<booleanAttribute key="useDefaultConfigArea" value="false"/>
+<booleanAttribute key="useProduct" value="true"/>
+</launchConfiguration>
Property changes on: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launchers/DaliTest.launch
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launchers/HibernateAllTests.launch
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launchers/HibernateAllTests.launch (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launchers/HibernateAllTests.launch 2010-09-17 12:47:53 UTC (rev 24984)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.swtbot.eclipse.ui.launcher.JunitLaunchConfig">
+<booleanAttribute key="append.args" value="true"/>
+<booleanAttribute key="askclear" value="false"/>
+<booleanAttribute key="automaticAdd" value="true"/>
+<booleanAttribute key="automaticValidate" value="false"/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="[NONE]"/>
+<booleanAttribute key="clearConfig" value="true"/>
+<booleanAttribute key="clearws" value="true"/>
+<booleanAttribute key="clearwslog" value="false"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
+<booleanAttribute key="default" value="true"/>
+<booleanAttribute key="includeOptional" value="true"/>
+<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/HibernateAllTests.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<mapAttribute key="org.eclipse.debug.core.environmentVariables">
+<mapEntry key="DISPLAY" value=":1"/>
+</mapAttribute>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
+<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
+<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.jboss.tools.hibernate.ui.bot.testsuite.HibernateAllTests"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.jboss.tools.hibernate.ui.bot.test"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms256m -Xmx384m -XX:MaxPermSize=256M -Dosgi.bundles=reference:file:org.eclipse.equinox.simpleconfigurator_1.0.200.v20100503.jar@1:start,org.eclipse.equinox.transforms.xslt@1:start,org.jboss.tools.equinox.transforms.xslt@1:start"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="org.eclipse.platform.ide"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useCustomFeatures" value="false"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<booleanAttribute key="useDefaultConfigArea" value="false"/>
+<booleanAttribute key="useProduct" value="true"/>
+</launchConfiguration>
Property changes on: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launchers/HibernateAllTests.launch
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launchers/MappingFileTest.launch
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launchers/MappingFileTest.launch (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launchers/MappingFileTest.launch 2010-09-17 12:47:53 UTC (rev 24984)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.swtbot.eclipse.ui.launcher.JunitLaunchConfig">
+<booleanAttribute key="append.args" value="true"/>
+<booleanAttribute key="askclear" value="false"/>
+<booleanAttribute key="automaticAdd" value="true"/>
+<booleanAttribute key="automaticValidate" value="false"/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="[NONE]"/>
+<booleanAttribute key="clearConfig" value="true"/>
+<booleanAttribute key="clearws" value="true"/>
+<booleanAttribute key="clearwslog" value="false"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
+<booleanAttribute key="default" value="true"/>
+<booleanAttribute key="includeOptional" value="true"/>
+<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/MappingFileTest.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<mapAttribute key="org.eclipse.debug.core.environmentVariables">
+<mapEntry key="DISPLAY" value=":1"/>
+</mapAttribute>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
+<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
+<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.jboss.tools.hibernate.ui.bot.testcase.MappingFileTest"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.jboss.tools.hibernate.ui.bot.test"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms256m -Xmx384m -XX:MaxPermSize=256M -Dosgi.bundles=reference:file:org.eclipse.equinox.simpleconfigurator_1.0.200.v20100503.jar@1:start,org.eclipse.equinox.transforms.xslt@1:start,org.jboss.tools.equinox.transforms.xslt@1:start"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="org.eclipse.platform.ide"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useCustomFeatures" value="false"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<booleanAttribute key="useDefaultConfigArea" value="false"/>
+<booleanAttribute key="useProduct" value="true"/>
+</launchConfiguration>
Property changes on: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launchers/MappingFileTest.launch
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launchers/ReverseEngineerFileTest.launch
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launchers/ReverseEngineerFileTest.launch (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launchers/ReverseEngineerFileTest.launch 2010-09-17 12:47:53 UTC (rev 24984)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.swtbot.eclipse.ui.launcher.JunitLaunchConfig">
+<booleanAttribute key="append.args" value="true"/>
+<booleanAttribute key="askclear" value="false"/>
+<booleanAttribute key="automaticAdd" value="true"/>
+<booleanAttribute key="automaticValidate" value="false"/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="[NONE]"/>
+<booleanAttribute key="clearConfig" value="true"/>
+<booleanAttribute key="clearws" value="true"/>
+<booleanAttribute key="clearwslog" value="false"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
+<booleanAttribute key="default" value="true"/>
+<booleanAttribute key="includeOptional" value="true"/>
+<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ReverseEngineerFileTest.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<mapAttribute key="org.eclipse.debug.core.environmentVariables">
+<mapEntry key="DISPLAY" value=":1"/>
+</mapAttribute>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
+<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
+<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.jboss.tools.hibernate.ui.bot.testcase.ReverseEngineerFileTest"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.jboss.tools.hibernate.ui.bot.test"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms256m -Xmx384m -XX:MaxPermSize=256M -Dosgi.bundles=reference:file:org.eclipse.equinox.simpleconfigurator_1.0.200.v20100503.jar@1:start,org.eclipse.equinox.transforms.xslt@1:start,org.jboss.tools.equinox.transforms.xslt@1:start"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="org.eclipse.platform.ide"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useCustomFeatures" value="false"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<booleanAttribute key="useDefaultConfigArea" value="false"/>
+<booleanAttribute key="useProduct" value="true"/>
+</launchConfiguration>
Property changes on: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/launchers/ReverseEngineerFileTest.launch
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/CodeGenerationLauncherTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/CodeGenerationLauncherTest.java 2010-09-17 12:45:15 UTC (rev 24983)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/CodeGenerationLauncherTest.java 2010-09-17 12:47:53 UTC (rev 24984)
@@ -39,6 +39,9 @@
*/
public static void setUpTest() {
+ eclipse.maximizeActiveShell();
+ eclipse.closeView(IDELabel.View.WELCOME);
+
prepareProject();
prepareConsole();
prepareDatabase();
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConsolePerspectiveTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConsolePerspectiveTest.java 2010-09-17 12:45:15 UTC (rev 24983)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConsolePerspectiveTest.java 2010-09-17 12:47:53 UTC (rev 24984)
@@ -13,6 +13,7 @@
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
import org.jboss.tools.hibernate.ui.bot.testsuite.HibernateTest;
import org.jboss.tools.ui.bot.ext.gen.ActionItem;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -24,7 +25,7 @@
*/
@Test
public void openPerspectiveElements() {
- bot.viewByTitle("Welcome").close();
+ eclipse.closeView(IDELabel.View.WELCOME);
open.perspective(ActionItem.Perspective.HIBERNATE.LABEL);
bot.sleep(TIME_1S);
@@ -36,5 +37,4 @@
open.viewOpen(ActionItem.View.HibernateHibernateQueryResult.LABEL);
bot.sleep(TIME_1S);
}
-
}
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConsoleTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConsoleTest.java 2010-09-17 12:45:15 UTC (rev 24983)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ConsoleTest.java 2010-09-17 12:47:53 UTC (rev 24984)
@@ -139,7 +139,7 @@
}
/**
- * TC 16 - open console, change serveral value, apply changes and check changes if they were store correctly
+ * TC 16 - open console, change several values, apply changes and check changes if they were store correctly
*/
@Test
public void editConsole() {
@@ -149,12 +149,18 @@
// open console
openConsoleConfiguration();
editConsoleValues();
+ closeConsole();
// open console again
openConsoleConfiguration();
- checkConsoleValues();
+ checkConsoleValues();
+ closeConsole();
}
+ private void closeConsole() {
+ bot.clickButton(IDELabel.Button.OK);
+ }
+
private void editConsoleValues() {
// perform change on
// - Main page
@@ -185,9 +191,7 @@
assertTrue(bot.radioInGroup("Type:",1).isSelected());
// - Option
bot.cTabItem(IDELabel.HBConsoleWizard.OPTIONS_TAB).activate();
- assertEquals("MySQL", bot.comboBoxInGroup("Database dialect:").getText());
- bot.clickButton(IDELabel.Button.OK);
-
+ assertEquals("MySQL", bot.comboBoxInGroup("Database dialect:").getText());
log.info("Changed console value checked");
}
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/DaliTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/DaliTest.java 2010-09-17 12:45:15 UTC (rev 24983)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/DaliTest.java 2010-09-17 12:47:53 UTC (rev 24984)
@@ -32,7 +32,7 @@
@BeforeClass
public static void prepare() {
- bot.viewByTitle("Welcome").close();
+ eclipse.closeView(IDELabel.View.WELCOME);
eclipse.openPerspective(PerspectiveType.JPA);
util.waitForNonIgnoredJobs();
}
@@ -57,7 +57,7 @@
bot.button(IDELabel.Button.NEXT).click();
// JPA Facet Page
- bot.comboBoxInGroup("Platform").setSelection("Hibernate");
+ bot.comboBoxInGroup("Platform").setSelection("Hibernate (JPA 2.x)");
//bot.comboBoxInGroup("JPA Implementation").setSelection("Library Provided by Target Runtime");
bot.comboBoxInGroup("JPA implementation").setSelection("Disable Library Configuration");
@@ -99,8 +99,9 @@
bot.button(IDELabel.Button.FINISH).click();
+ // TODO
// Check file
- packageExplorer.openFile(Project.JPA_PRJ_NAME, Project.DDL_OUTPUT, Project.DDL_FILENAME);
+ // packageExplorer.openFile(Project.JPA_PRJ_NAME, Project.DDL_OUTPUT, Project.DDL_FILENAME);
}
/**
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/JIRATest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/JIRATest.java 2010-09-17 12:45:15 UTC (rev 24983)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/JIRATest.java 2010-09-17 12:47:53 UTC (rev 24984)
@@ -23,7 +23,7 @@
*/
@Test
public void issue1() {
-
+ // TODO
}
}
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/MappingFileTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/MappingFileTest.java 2010-09-17 12:45:15 UTC (rev 24983)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/MappingFileTest.java 2010-09-17 12:47:53 UTC (rev 24984)
@@ -31,12 +31,12 @@
@BeforeClass
public static void setUpTest() {
- HibernateTest.prepare();
+ prepareProject();
+ prepareClasses();
}
@AfterClass
public static void tearDownTest() {
- HibernateTest.clean();
}
/**
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ReverseEngineerFileTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ReverseEngineerFileTest.java 2010-09-17 12:45:15 UTC (rev 24983)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testcase/ReverseEngineerFileTest.java 2010-09-17 12:47:53 UTC (rev 24984)
@@ -14,23 +14,33 @@
import org.jboss.tools.hibernate.ui.bot.testsuite.HibernateTest;
import org.jboss.tools.hibernate.ui.bot.testsuite.Project;
import org.jboss.tools.ui.bot.ext.types.EntityType;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(SWTBotJunit4ClassRunner.class)
public class ReverseEngineerFileTest extends HibernateTest {
+ @BeforeClass
+ public static void prepare() {
+ prepareProject();
+ }
/**
* TC 08
*/
@Test
public void createFile() {
- // Create
- eclipse.createNew(EntityType.HIBERNATE_REVERSE_FILE);
-
+ bot.viewByTitle(IDELabel.View.PACKAGE_EXPLORER).setFocus();
packageExplorer.selectProject(Project.PROJECT_NAME);
+ // Create reveng file
+ eclipse.createNew(EntityType.HIBERNATE_REVERSE_FILE);
+ bot.clickButton(IDELabel.Button.NEXT);
+ bot.clickButton("Include...");
+ bot.clickButton(IDELabel.Button.FINISH);
}
/**
@@ -38,7 +48,10 @@
*/
@Test
public void editFile() {
-
+ // TBD
}
-
+
+ @AfterClass
+ public static void finish() {
+ }
}
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/HibernateAllTests.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/HibernateAllTests.java 2010-09-17 12:45:15 UTC (rev 24983)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/HibernateAllTests.java 2010-09-17 12:47:53 UTC (rev 24984)
@@ -11,9 +11,17 @@
package org.jboss.tools.hibernate.ui.bot.testsuite;
import org.jboss.tools.hibernate.ui.bot.testcase.CodeGenerationLauncherTest;
+import org.jboss.tools.hibernate.ui.bot.testcase.ConfigurationContextTest;
import org.jboss.tools.hibernate.ui.bot.testcase.ConfigurationFileTest;
+import org.jboss.tools.hibernate.ui.bot.testcase.ConsolePerspectiveTest;
import org.jboss.tools.hibernate.ui.bot.testcase.ConsoleTest;
+import org.jboss.tools.hibernate.ui.bot.testcase.CriteriaEditorsTest;
+import org.jboss.tools.hibernate.ui.bot.testcase.DaliTest;
+import org.jboss.tools.hibernate.ui.bot.testcase.JIRATest;
import org.jboss.tools.hibernate.ui.bot.testcase.MappingFileTest;
+import org.jboss.tools.hibernate.ui.bot.testcase.MappingsDiagramTest;
+import org.jboss.tools.hibernate.ui.bot.testcase.ReverseEngineerFileTest;
+import org.jboss.tools.hibernate.ui.bot.testcase.ViewsTest;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
@@ -21,7 +29,8 @@
import org.junit.runners.Suite.SuiteClasses;
@RunWith(Suite.class)
-/* CodeGenerationLauncherTest.class,
+
+@SuiteClasses( { CodeGenerationLauncherTest.class,
ConfigurationContextTest.class,
ConfigurationFileTest.class,
ConsolePerspectiveTest.class,
@@ -31,13 +40,9 @@
JIRATest.class,
MappingFileTest.class,
MappingsDiagramTest.class,
- ReverseEngineerFileTest.class, ViewsTest.class */
+ ReverseEngineerFileTest.class,
+ ViewsTest.class})
-@SuiteClasses( { ConfigurationFileTest.class,
- MappingFileTest.class,
- CodeGenerationLauncherTest.class,
- ConsoleTest.class})
-
public class HibernateAllTests extends HibernateTest {
@BeforeClass
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/HibernateTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/HibernateTest.java 2010-09-17 12:45:15 UTC (rev 24983)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hibernate/ui/bot/testsuite/HibernateTest.java 2010-09-17 12:47:53 UTC (rev 24984)
@@ -37,6 +37,7 @@
import org.hsqldb.Server;
import org.jboss.tools.hibernate.ui.bot.testcase.Activator;
import org.jboss.tools.hibernate.ui.bot.testcase.ConsoleTest;
+import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
import org.jboss.tools.ui.bot.ext.entity.JavaClassEntity;
import org.jboss.tools.ui.bot.ext.entity.JavaProjectEntity;
@@ -49,7 +50,6 @@
public class HibernateTest extends SWTTestExt {
- private static boolean finished = false;
private static boolean classesCreated = false;
private static boolean projectCreated = false;
private static boolean databasePrepared = false;
@@ -63,8 +63,7 @@
* Prepare project and classes
*/
public static void prepare() {
- prepareProject();
- prepareClasses();
+ log.info("Hibernate All Test Started");
}
/**
@@ -73,7 +72,12 @@
public static void prepareClasses() {
if (classesCreated) return;
-
+
+
+ // Package Explorer
+ SWTBot viewBot = eclipse.showView(ViewType.PACKAGE_EXPLORER);
+ SWTEclipseExt.selectTreeLocation(viewBot, Project.PROJECT_NAME,"src");
+
// Class 1
JavaClassEntity classEntity = new JavaClassEntity();
classEntity.setClassName(Project.CLASS1);
@@ -97,12 +101,14 @@
if (projectCreated) return;
+ eclipse.openPerspective(PerspectiveType.JAVA);
eclipse.showView(ViewType.PACKAGE_EXPLORER);
bot.activeView();
System.out.println("View Activated");
// Show perspective and view
+ //open.viewClose(view)
eclipse.closeView(IDELabel.View.WELCOME);
eclipse.openPerspective(PerspectiveType.JAVA);
@@ -155,6 +161,7 @@
bot.tree().expandNode("Java Build Path").select();
bot.tabItem("Libraries").activate();
bot.button("Add JARs...").click();
+ bot.sleep(TIME_500MS);
bot.tree().expandNode(Project.PROJECT_NAME).expandNode("hsqldb.jar").select();
bot.button(IDELabel.Button.OK).click();
@@ -189,9 +196,7 @@
* Clean after tests
*/
public static void clean() {
- if (finished) return;
-
- log.info("Clean finished");
+ log.info("Hibernate All Test finished");
}
/**
15 years, 7 months
JBoss Tools SVN: r24983 - in trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext: parts and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2010-09-17 08:45:15 -0400 (Fri, 17 Sep 2010)
New Revision: 24983
Added:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/widgets/SWTBotTreeExt.java
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/ObjectMultiPageEditorBot.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
Log:
SWTBotTreeExt added
IDELabel consts added
ObjectMultipageEditor issue fixed
EclipseExt closeView updated
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2010-09-17 12:32:40 UTC (rev 24982)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2010-09-17 12:45:15 UTC (rev 24983)
@@ -96,7 +96,11 @@
* Close view by text
*/
public void closeView(String view) {
- bot.viewByTitle(view).close();
+ try {
+ bot.viewByTitle(view).close();
+ } catch (WidgetNotFoundException ex) {
+ log.info("WARN - Can't close the view \"" + view + "\"");
+ }
}
/**
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/ObjectMultiPageEditorBot.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/ObjectMultiPageEditorBot.java 2010-09-17 12:32:40 UTC (rev 24982)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/parts/ObjectMultiPageEditorBot.java 2010-09-17 12:45:15 UTC (rev 24983)
@@ -6,6 +6,10 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.log4j.Logger;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
@@ -15,33 +19,38 @@
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
+
/**
- *
+ *
* @author jpeterka
*
*/
public class ObjectMultiPageEditorBot {
-
+
+ private Logger log = Logger.getLogger(ObjectMultiPageEditorBot.class);
private final IEditorReference ref;
-
+
public ObjectMultiPageEditorBot(String title) {
ref = getEditorReferenceByTitle(title);
}
public ObjectMultiPageEditorBot(SWTBotEditor editor) {
ref = editor.getReference();
}
-
+
public IEditorReference getEditorReference() {
return ref;
}
- private IEditorReference getEditorReferenceByTitle(final String title) {
+ private IEditorReference getEditorReferenceByTitle(final String title) {
// Search for editor
IEditorReference ref = UIThreadRunnable.syncExec(new Result<IEditorReference>() {
public IEditorReference run() {
+
+
+
IEditorReference ref = null;
IEditorReference[] editorReferences = null;
editorReferences = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getEditorReferences();
-
+
try {
for (IEditorReference reference: editorReferences) {
IEditorInput input = reference.getEditorInput();
@@ -53,33 +62,59 @@
} catch (PartInitException ex) {
fail(ex.toString());
}
- return ref;
+ return ref;
}
});
-
+
assertNotNull(ref);
return ref;
}
-
- public void selectPage(final String pageName) {
-
+
+
+
+ /**
+ * Returns list of classes which are super classes of the given class
+ * @param list - empty list of classes
+ * @param clazz - first class
+ */
+ private void getSuperclassesList(List<Class<? extends Object>> list, Class<? extends Object> clazz) {
+
+ Class<? extends Object> superClass = clazz.getSuperclass();
+
+ if (!superClass.getCanonicalName().equalsIgnoreCase("java.lang.Object")) {
+ list.add(superClass);
+ getSuperclassesList(list, superClass);
+ }
+ return;
+ }
+
+
+ public void selectPage(final String pageName) {
+
final Object editor = ref.getPart(true);
boolean found = false;
- for (Class<?> cl : editor.getClass().getDeclaredClasses()) {
- System.out.println(cl.getName());
- if (cl.getName().equals("org.jboss.tools.common.editor.ObjectMultiPageEditor")) {
- found=true;break;
+
+ //ObjectMultiPageEditor editor = new ObjectMultiPageEditor();
+ List<Class<? extends Object>> cl = new ArrayList<Class<? extends Object>>();
+ getSuperclassesList(cl, editor.getClass());
+ for (Class<? extends Object> c : cl) {
+ log.info(c.getCanonicalName());
+ if (c.getCanonicalName().equals("org.jboss.tools.common.editor.ObjectMultiPageEditor")) {
+ found = true;
+ break;
}
}
- assertTrue("Editor is not instance of ObjectMultiPageEditor",found);
+
+ assertTrue("Editor is not instance of ObjectMultiPageEditor, rep. HibConfig3CompoundEditor",found);
+
try {
final Method m = editor.getClass().getMethod("selectPageByName", String.class);
// Select page
- Display.getDefault().syncExec(new Runnable() {
-
+ Display.getDefault().asyncExec(new Runnable() {
+
public void run() {
try {
- m.invoke(editor, pageName);
+ m.invoke(editor, pageName);
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -99,8 +134,7 @@
// TODO Auto-generated catch block
e.printStackTrace();
}
-
+
}
}
-
\ No newline at end of file
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-09-17 12:32:40 UTC (rev 24982)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-09-17 12:45:15 UTC (rev 24983)
@@ -164,7 +164,7 @@
public class EntityLabel {
public static final String HIBERNATE_MAPPING_FILE = "Hibernate XML Mapping file (hbm.xml)";
- public static final String HIBERNATE_REVERSE_FILE = "Hibernate Reverse Engineering File(reveng.xml)";
+ public static final String HIBERNATE_REVERSE_FILE = "Hibernate Reverse Engineering File (reveng.xml)";
public static final String HIBERNATE_CONSOLE = "Hibernate Console Configuration";
public static final String JAVA_CLASS = "Class";
public static final String JAVA_PROJECT = "Java Project";
Added: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/widgets/SWTBotTreeExt.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/widgets/SWTBotTreeExt.java (rev 0)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/widgets/SWTBotTreeExt.java 2010-09-17 12:45:15 UTC (rev 24983)
@@ -0,0 +1,27 @@
+package org.jboss.tools.ui.bot.ext.widgets;
+
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+
+public class SWTBotTreeExt {
+ SWTBotTree tree;
+
+ /**
+ * SWTBotTreeExt contstructor
+ * @param tree
+ */
+ public SWTBotTreeExt(SWTBotTree tree) {
+ this.tree = tree;
+ }
+
+ /**
+ * Expands whole tree
+ */
+ public void expandAll() {
+ SWTBotTreeItem[] items = tree.getAllItems();
+ for (SWTBotTreeItem i : items ) {
+ if (!i.isExpanded())
+ i.expand();
+ }
+ }
+}
Property changes on: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/widgets/SWTBotTreeExt.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 7 months