PageRenderTime 43ms CodeModel.GetById 38ms app.highlight 3ms RepoModel.GetById 1ms 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
  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 */
 14package xml;
 15
 16// {{{ jUnit imports 
 17import java.util.concurrent.TimeUnit;
 18
 19import org.junit.*;
 20import static org.junit.Assert.*;
 21
 22import org.fest.swing.fixture.*;
 23import org.fest.swing.core.*;
 24import org.fest.swing.finder.*;
 25import org.fest.swing.edt.*;
 26import org.fest.swing.timing.*;
 27
 28import static org.fest.assertions.Assertions.*;
 29
 30import org.gjt.sp.jedit.testframework.Log;
 31
 32import static xml.XMLTestUtils.*;
 33import static org.gjt.sp.jedit.testframework.TestUtils.*;
 34import static org.gjt.sp.jedit.testframework.EBFixture.*;
 35import org.gjt.sp.jedit.testframework.TestUtils;
 36
 37// }}}
 38
 39import org.gjt.sp.jedit.jEdit;
 40import org.gjt.sp.jedit.EBMessage;
 41import org.gjt.sp.jedit.textarea.JEditTextArea;
 42import org.gjt.sp.jedit.Buffer;
 43
 44import java.io.*;
 45
 46import java.awt.event.KeyEvent;
 47import java.awt.event.InputEvent;
 48
 49import junit.framework.AssertionFailedError;
 50
 51import org.gjt.sp.jedit.gui.CompletionPopup;
 52
 53/**
 54 * integration tests using test_data.
 55 * They all fail, I know ;-)
 56 * $Id: XmlPluginFailingTest.java 21248 2012-03-05 19:37:01Z kerik-sf $
 57 */
 58public class XmlPluginFailingTest{
 59	private static File testData;
 60	
 61    @BeforeClass
 62    public static void setUpjEdit() throws IOException{
 63        TestUtils.beforeClass();
 64        testData = new File(System.getProperty("test_data")).getCanonicalFile();
 65        assertTrue(testData.exists());
 66    }
 67    
 68    @AfterClass
 69    public static void tearDownjEdit() {
 70        TestUtils.afterClass();
 71    }
 72    
 73	/** Completion in JSPs */
 74	@Test
 75	public void testMixedJSP(){
 76    	File xml = new File(testData,"mixed_jsp/myjsp.jsp");
 77    	
 78    	TestUtils.openFile(xml.getPath());
 79    	
 80    	action("xml-insert-float",1);
 81    	FrameFixture insert = TestUtils.findFrameByTitle("XML Insert");
 82    	
 83		// wait for end of parsing
 84    	try{
 85		simplyWaitForMessageOfClass(sidekick.SideKickUpdate.class,10000);
 86    	}catch(AssertionFailedError e){
 87    		// no worry
 88    	}
 89
 90		action("error-list-show",1);
 91		
 92    	FrameFixture errorlist = TestUtils.findFrameByTitle("Error List");
 93		
 94    	
 95    	requireEmpty(errorlist.tree());
 96
 97		errorlist.close();
 98		
 99		// inside body
100		gotoPositionAndWait(234);
101		assertThat(insert.list("elements").contents()).contains("h1");
102		
103		
104		// inside java code
105		// the test fails, because completion is not disabled in java snippets.
106		gotoPositionAndWait(296);
107		assertThat(insert.list("elements").contents()).isEmpty();
108		
109		insert.close();
110	}
111	
112}