[Pydev-cvs] org.python.pydev/tests_navigator/org/python/pydev/navigator PythonModelProviderTest.ja
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2008-04-27 17:28:19
|
Update of /cvsroot/pydev/org.python.pydev/tests_navigator/org/python/pydev/navigator In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14736/tests_navigator/org/python/pydev/navigator Modified Files: PythonModelProviderTest.java Log Message: Fixes for integration problems in project explorer. Index: PythonModelProviderTest.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/tests_navigator/org/python/pydev/navigator/PythonModelProviderTest.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PythonModelProviderTest.java 22 Apr 2008 12:01:15 -0000 1.7 --- PythonModelProviderTest.java 27 Apr 2008 17:28:05 -0000 1.8 *************** *** 3,6 **** --- 3,7 ---- import java.io.File; import java.util.ArrayList; + import java.util.Arrays; import java.util.HashSet; import java.util.Set; *************** *** 26,34 **** PythonModelProviderTest test = new PythonModelProviderTest(); test.setUp(); ! test.testProjectIsRoot(); test.tearDown(); junit.textui.TestRunner.run(PythonModelProviderTest.class); ! } catch (Exception e) { e.printStackTrace(); } --- 27,35 ---- PythonModelProviderTest test = new PythonModelProviderTest(); test.setUp(); ! test.testDontRemoveOtherPluginElements(); test.tearDown(); junit.textui.TestRunner.run(PythonModelProviderTest.class); ! } catch (Throwable e) { e.printStackTrace(); } *************** *** 179,185 **** public void testDontRemoveOtherPluginElements() throws Exception { ! //TODO: see TODO's in those methods and make it work ! provider.getPipelinedChildren(null, null); ! provider.getPipelinedElements(null, null); } } --- 180,215 ---- public void testDontRemoveOtherPluginElements() throws Exception { ! final HashSet<String> pythonPathSet = new HashSet<String>(); ! pythonPathSet.add(TestDependent.TEST_PYSRC_NAVIGATOR_LOC+"projroot/source"); ! PythonNature nature = createNature(pythonPathSet); ! ! project = new ProjectStub(new File(TestDependent.TEST_PYSRC_NAVIGATOR_LOC+"projroot"), nature); ! provider = new PythonModelProvider(); ! ! HashSet<Object> currentChildren = new HashSet<Object>(); ! currentChildren.add("Test"); ! provider.getPipelinedChildren(project, currentChildren); ! ! assertEquals(1, currentChildren.size()); ! assertEquals("Test", currentChildren.iterator().next()); ! ! Object[] children = provider.getChildren(project); ! currentChildren.addAll(Arrays.asList(children)); ! provider.getPipelinedChildren(project, currentChildren); ! ! assertEquals(2, currentChildren.size()); //Test + source folder ! boolean found = false; ! for(Object o:currentChildren){ ! if("Test".equals(o)){ ! found = true; ! }else{ ! assertTrue(o instanceof PythonSourceFolder); ! } ! } ! if(!found){ ! fail("Could not find generated child"); ! } ! ! } } |