PageRenderTime 39ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/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
  1. /*
  2. * XmlPluginFailingTest.java
  3. * :folding=explicit:collapseFolds=1:
  4. *
  5. * Copyright (C) 2009 Eric Le Lay
  6. *
  7. * The XML plugin is licensed under the GNU General Public License, with
  8. * the following exception:
  9. *
  10. * "Permission is granted to link this code with software released under
  11. * the Apache license version 1.1, for example used by the Xerces XML
  12. * parser package."
  13. */
  14. package xml;
  15. // {{{ jUnit imports
  16. import java.util.concurrent.TimeUnit;
  17. import org.junit.*;
  18. import static org.junit.Assert.*;
  19. import org.fest.swing.fixture.*;
  20. import org.fest.swing.core.*;
  21. import org.fest.swing.finder.*;
  22. import org.fest.swing.edt.*;
  23. import org.fest.swing.timing.*;
  24. import static org.fest.assertions.Assertions.*;
  25. import org.gjt.sp.jedit.testframework.Log;
  26. import static xml.XMLTestUtils.*;
  27. import static org.gjt.sp.jedit.testframework.TestUtils.*;
  28. import static org.gjt.sp.jedit.testframework.EBFixture.*;
  29. import org.gjt.sp.jedit.testframework.TestUtils;
  30. // }}}
  31. import org.gjt.sp.jedit.jEdit;
  32. import org.gjt.sp.jedit.EBMessage;
  33. import org.gjt.sp.jedit.textarea.JEditTextArea;
  34. import org.gjt.sp.jedit.Buffer;
  35. import java.io.*;
  36. import java.awt.event.KeyEvent;
  37. import java.awt.event.InputEvent;
  38. import junit.framework.AssertionFailedError;
  39. import org.gjt.sp.jedit.gui.CompletionPopup;
  40. /**
  41. * integration tests using test_data.
  42. * They all fail, I know ;-)
  43. * $Id: XmlPluginFailingTest.java 21248 2012-03-05 19:37:01Z kerik-sf $
  44. */
  45. public class XmlPluginFailingTest{
  46. private static File testData;
  47. @BeforeClass
  48. public static void setUpjEdit() throws IOException{
  49. TestUtils.beforeClass();
  50. testData = new File(System.getProperty("test_data")).getCanonicalFile();
  51. assertTrue(testData.exists());
  52. }
  53. @AfterClass
  54. public static void tearDownjEdit() {
  55. TestUtils.afterClass();
  56. }
  57. /** Completion in JSPs */
  58. @Test
  59. public void testMixedJSP(){
  60. File xml = new File(testData,"mixed_jsp/myjsp.jsp");
  61. TestUtils.openFile(xml.getPath());
  62. action("xml-insert-float",1);
  63. FrameFixture insert = TestUtils.findFrameByTitle("XML Insert");
  64. // wait for end of parsing
  65. try{
  66. simplyWaitForMessageOfClass(sidekick.SideKickUpdate.class,10000);
  67. }catch(AssertionFailedError e){
  68. // no worry
  69. }
  70. action("error-list-show",1);
  71. FrameFixture errorlist = TestUtils.findFrameByTitle("Error List");
  72. requireEmpty(errorlist.tree());
  73. errorlist.close();
  74. // inside body
  75. gotoPositionAndWait(234);
  76. assertThat(insert.list("elements").contents()).contains("h1");
  77. // inside java code
  78. // the test fails, because completion is not disabled in java snippets.
  79. gotoPositionAndWait(296);
  80. assertThat(insert.list("elements").contents()).isEmpty();
  81. insert.close();
  82. }
  83. }