Skip to content

Commit

Permalink
JBTIS-758: Add test for collapse/expand feature in Camel Editor
Browse files Browse the repository at this point in the history
  • Loading branch information
djelinek committed Mar 24, 2017
1 parent 6b40f56 commit 98b212a
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/org.jboss.tools.fuse.ui.bot.test/META-INF/MANIFEST.MF
Expand Up @@ -13,7 +13,8 @@ Require-Bundle: org.eclipse.ui,
org.jboss.reddeer.graphiti;bundle-version="1.0.0",
org.jboss.tools.runtime.reddeer;bundle-version="4.4.0",
org.jboss.tools.fuse.reddeer;bundle-version="4.4.0",
org.jboss.reddeer.eclipse
org.jboss.reddeer.eclipse,
org.eclipse.draw2d
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-Vendor: JBoss by Red Hat
Expand Down
Expand Up @@ -8,6 +8,8 @@

import org.jboss.reddeer.common.logging.Logger;
import org.jboss.reddeer.core.exception.CoreLayerException;
import org.jboss.reddeer.common.wait.AbstractWait;
import org.jboss.reddeer.common.wait.TimePeriod;
import org.jboss.reddeer.eclipse.ui.perspectives.JavaEEPerspective;
import org.jboss.reddeer.gef.view.PaletteView;
import org.jboss.reddeer.jface.text.contentassist.ContentAssistant;
Expand All @@ -28,6 +30,7 @@
import org.jboss.tools.fuse.reddeer.component.File;
import org.jboss.tools.fuse.reddeer.component.Log;
import org.jboss.tools.fuse.reddeer.component.Otherwise;
import org.jboss.tools.fuse.reddeer.editor.CamelComponentEditPart;
import org.jboss.tools.fuse.reddeer.editor.CamelEditor;
import org.jboss.tools.fuse.reddeer.editor.SourceEditor;
import org.jboss.tools.fuse.reddeer.projectexplorer.CamelProject;
Expand Down Expand Up @@ -253,4 +256,38 @@ public void testDragAndDropComponents() {
assertTrue(EditorManipulator.isEditorContentEqualsFile("resources/camel-context-all.xml"));
assertTrue(LogGrapper.getPluginErrors("fuse").size() == 0);
}

/**
* <p>
* Test checks collapse/expand feature of Camel editor components
* </p>
* <ol>
* <li>create a new project from template 'Content Based Router'</li>
* <li>open camel-context.xml file</li>
* <li>Invoke 'Collapse' on route component 'Choice'</li>
* <li>Check if component was collapsed (check if changed size of collapsed component area and height is smaller
* then begin values)</li>
* <li>Check fuse errors in Error Log View</li>
* <li>Invoke 'Expand' on route component 'Choice'</li>
* <li>Check if component was expanded (check changed size of expanded component area -> should be same as area size
* and height before collapse)</li>
* <li>Check fuse errors in Error Log View</li>
* </ol>
*
* @author djelinek
*/
@Test
public void testCollapseExpandFeature() {
CamelEditor editor = new CamelEditor("camel-context.xml");
CamelComponentEditPart editPart = new CamelComponentEditPart("Choice");
int startHeight = editPart.getBounds().height;
editor.doOperation("Choice", "Collapse");
AbstractWait.sleep(TimePeriod.getCustom(5));
assertTrue("Route component 'Choice' wasn't collapsed properly", editPart.getBounds().height < startHeight);
assertTrue(LogGrapper.getPluginErrors("fuse").size() == 0);
editor.doOperation("Choice", "Expand");
AbstractWait.sleep(TimePeriod.getCustom(5));
assertEquals(editPart.getBounds().height, startHeight);
assertTrue(LogGrapper.getPluginErrors("fuse").size() == 0);
}
}

0 comments on commit 98b212a

Please sign in to comment.