Author: mareshkau
Date: 2010-11-25 12:53:36 -0500 (Thu, 25 Nov 2010)
New Revision: 26948
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4373Test.java
Log:
https://jira.jboss.org/browse/JBIDE-7704
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4373Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4373Test.java 2010-11-25
17:50:56 UTC (rev 26947)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4373Test.java 2010-11-25
17:53:36 UTC (rev 26948)
@@ -13,6 +13,7 @@
import java.io.IOException;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PlatformUI;
@@ -53,11 +54,13 @@
vpeController.getSourceBuilder().openOn(domNode);
IEditorPart activeEditor =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
assertEquals("facelets.taglib.xml file should be
opened","facelets.taglib.xml", activeEditor.getEditorInput().getName());
//$NON-NLS-1$//$NON-NLS-2$
- StructuredSelection selection = (StructuredSelection)
activeEditor.getEditorSite().getSelectionProvider().getSelection();
- CustomizedObjectImpl customizedObjectImpl = (CustomizedObjectImpl)
selection.getFirstElement();
- //cheak if selection on right line, how?
- assertEquals("Children lenght should be
","FileSystems/WEB-ROOT/tags/facelets.taglib.xml/paginator",customizedObjectImpl.getLongPath());
//$NON-NLS-1$ //$NON-NLS-2$
-
+ IStructuredSelection selection = (IStructuredSelection)
activeEditor.getEditorSite().getSelectionProvider().getSelection();
+ //check pass only if we have been opened in our xml editor
+ if(selection.getFirstElement() instanceof CustomizedObjectImpl) {
+ CustomizedObjectImpl customizedObjectImpl = (CustomizedObjectImpl)
selection.getFirstElement();
+ //Check if selection on right line, how?
+ assertEquals("Children lenght should be
","FileSystems/WEB-ROOT/tags/facelets.taglib.xml/paginator",customizedObjectImpl.getLongPath());
//$NON-NLS-1$ //$NON-NLS-2$
+ }
}
/**
@@ -74,11 +77,13 @@
vpeController.getSourceBuilder().openOn(domNode);
IEditorPart activeEditor =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
assertEquals("facelets.taglib.xml file should be
opened","facelets.taglib.xml", activeEditor.getEditorInput().getName());
//$NON-NLS-1$//$NON-NLS-2$
- StructuredSelection selection = (StructuredSelection)
activeEditor.getEditorSite().getSelectionProvider().getSelection();
- SimpleFileImpl customizedObjectImpl = (SimpleFileImpl) selection.getFirstElement();
- //cheak if selection on right line, how?
- assertEquals("Children lenght should
be","FileSystems/WEB-ROOT/tags/facelets.taglib.xml",customizedObjectImpl.getLongPath());
//$NON-NLS-1$ //$NON-NLS-2$
-
+ IStructuredSelection selection = (IStructuredSelection)
activeEditor.getEditorSite().getSelectionProvider().getSelection();
+ //check pass only if we have been opened in our xml editor
+ if(selection.getFirstElement() instanceof SimpleFileImpl){
+ SimpleFileImpl customizedObjectImpl = (SimpleFileImpl) selection.getFirstElement();
+ //check if selection on right line, how?
+ assertEquals("Children lenght should
be","FileSystems/WEB-ROOT/tags/facelets.taglib.xml",customizedObjectImpl.getLongPath());
//$NON-NLS-1$ //$NON-NLS-2$
+ }
}
/**
* test open on for following case <h:outputText value="#{msg.greeting}"
/>