/bundles/plugins-trunk/XML/test/xml/XmlPluginFailingTest.java
Java | 112 lines | 57 code | 29 blank | 26 comment | 0 complexity | 131ea877a792f7bba0ec965816b7a339 MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
- /*
- * XmlPluginFailingTest.java
- * :folding=explicit:collapseFolds=1:
- *
- * Copyright (C) 2009 Eric Le Lay
- *
- * The XML plugin is licensed under the GNU General Public License, with
- * the following exception:
- *
- * "Permission is granted to link this code with software released under
- * the Apache license version 1.1, for example used by the Xerces XML
- * parser package."
- */
- package xml;
- // {{{ jUnit imports
- import java.util.concurrent.TimeUnit;
- import org.junit.*;
- import static org.junit.Assert.*;
- import org.fest.swing.fixture.*;
- import org.fest.swing.core.*;
- import org.fest.swing.finder.*;
- import org.fest.swing.edt.*;
- import org.fest.swing.timing.*;
- import static org.fest.assertions.Assertions.*;
- import org.gjt.sp.jedit.testframework.Log;
- import static xml.XMLTestUtils.*;
- import static org.gjt.sp.jedit.testframework.TestUtils.*;
- import static org.gjt.sp.jedit.testframework.EBFixture.*;
- import org.gjt.sp.jedit.testframework.TestUtils;
- // }}}
- import org.gjt.sp.jedit.jEdit;
- import org.gjt.sp.jedit.EBMessage;
- import org.gjt.sp.jedit.textarea.JEditTextArea;
- import org.gjt.sp.jedit.Buffer;
- import java.io.*;
- import java.awt.event.KeyEvent;
- import java.awt.event.InputEvent;
- import junit.framework.AssertionFailedError;
- import org.gjt.sp.jedit.gui.CompletionPopup;
- /**
- * integration tests using test_data.
- * They all fail, I know ;-)
- * $Id: XmlPluginFailingTest.java 21248 2012-03-05 19:37:01Z kerik-sf $
- */
- public class XmlPluginFailingTest{
- private static File testData;
-
- @BeforeClass
- public static void setUpjEdit() throws IOException{
- TestUtils.beforeClass();
- testData = new File(System.getProperty("test_data")).getCanonicalFile();
- assertTrue(testData.exists());
- }
-
- @AfterClass
- public static void tearDownjEdit() {
- TestUtils.afterClass();
- }
-
- /** Completion in JSPs */
- @Test
- public void testMixedJSP(){
- File xml = new File(testData,"mixed_jsp/myjsp.jsp");
-
- TestUtils.openFile(xml.getPath());
-
- action("xml-insert-float",1);
- FrameFixture insert = TestUtils.findFrameByTitle("XML Insert");
-
- // wait for end of parsing
- try{
- simplyWaitForMessageOfClass(sidekick.SideKickUpdate.class,10000);
- }catch(AssertionFailedError e){
- // no worry
- }
- action("error-list-show",1);
-
- FrameFixture errorlist = TestUtils.findFrameByTitle("Error List");
-
-
- requireEmpty(errorlist.tree());
- errorlist.close();
-
- // inside body
- gotoPositionAndWait(234);
- assertThat(insert.list("elements").contents()).contains("h1");
-
-
- // inside java code
- // the test fails, because completion is not disabled in java snippets.
- gotoPositionAndWait(296);
- assertThat(insert.list("elements").contents()).isEmpty();
-
- insert.close();
- }
-
- }