Author: dvinnichek
Date: 2010-11-19 06:11:53 -0500 (Fri, 19 Nov 2010)
New Revision: 26752
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/handlers/VpeCommandsTests.java
Log:
added test for 'Show bundle's messages as EL expressions' button on vpe
toolbar
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/handlers/VpeCommandsTests.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/handlers/VpeCommandsTests.java 2010-11-19
11:06:34 UTC (rev 26751)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/handlers/VpeCommandsTests.java 2010-11-19
11:11:53 UTC (rev 26752)
@@ -30,6 +30,7 @@
import org.eclipse.ui.handlers.RegistryToggleState;
import org.eclipse.ui.part.FileEditorInput;
import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.jboss.tools.jst.jsp.bundle.BundleMap;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditorPart;
import org.jboss.tools.jst.jsp.preferences.IVpePreferencesPage;
@@ -223,7 +224,39 @@
.isShowInvisibleTags();
assertEquals(!oldToogleState, uiNonVisualTagsVisibility);
}
+
+ /**
+ * Test 'Show bundle's messages as EL expressions' toolbar button
+ *
+ * @throws Throwable
+ */
+ public void testShowBundleAsEL() throws Throwable {
+
+ JSPMultiPageEditor multiPageEditor = openInputUserNameJsp();
+ Command command = getCommandById(ShowBundleAsELHandler.COMMAND_ID);
+ State state = command.getState(RegistryToggleState.STATE_ID);
+ boolean oldToogleState = ((Boolean) state.getValue()).booleanValue();
+
+ handlerService.executeCommand(ShowBundleAsELHandler.COMMAND_ID, null);
+ TestUtil.delay(500);
+
+ boolean newToogleState = ((Boolean) state.getValue()).booleanValue();
+ assertEquals(!oldToogleState, newToogleState);
+
+ IPreferenceStore prefStore = JspEditorPlugin.getDefault()
+ .getPreferenceStore();
+ boolean prefBundleAsELVisibility = prefStore
+ .getBoolean(IVpePreferencesPage.SHOW_RESOURCE_BUNDLES_USAGE_AS_EL);
+ assertEquals(!oldToogleState, prefBundleAsELVisibility);
+
+ VpeController vpeController = (VpeController) multiPageEditor
+ .getVisualEditor().getController();
+ BundleMap bundle = vpeController.getPageContext().getBundle();
+ boolean uiBundleAsELVisibility = bundle.isShowBundleUsageAsEL();
+ assertEquals(!oldToogleState, uiBundleAsELVisibility);
+ }
+
private JSPMultiPageEditor openInputUserNameJsp() throws CoreException,
IOException, SecurityException, IllegalArgumentException,
NoSuchMethodException, IllegalAccessException,
Show replies by date