You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

StructureSearchManagerTest.java 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* *******************************************************************
  2. * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).
  3. * All rights reserved.
  4. * This program and the accompanying materials are made available
  5. * under the terms of the Eclipse Public License v1.0
  6. * which accompanies this distribution and is available at
  7. * http://www.eclipse.org/legal/epl-v10.html
  8. *
  9. * Contributors:
  10. * Xerox/PARC initial implementation
  11. * Helen Hawkins Converted to new interface (bug 148190)
  12. * ******************************************************************/
  13. package org.aspectj.ajde.ui;
  14. import java.util.List;
  15. import org.aspectj.ajde.Ajde;
  16. import org.aspectj.ajde.AjdeTestCase;
  17. import org.aspectj.asm.IProgramElement;
  18. import junit.framework.TestSuite;
  19. /**
  20. * @author Mik Kersten
  21. */
  22. public class StructureSearchManagerTest extends AjdeTestCase {
  23. public static void main(String[] args) {
  24. junit.swingui.TestRunner.run(StructureSearchManagerTest.class);
  25. }
  26. public static TestSuite suite() {
  27. TestSuite result = new TestSuite();
  28. result.addTestSuite(StructureSearchManagerTest.class);
  29. return result;
  30. }
  31. public void testFindPatternMatch() {
  32. Ajde.getDefault().getStructureSearchManager().findMatches(
  33. "Point",
  34. null
  35. );
  36. assertTrue("non existent node", true);
  37. }
  38. public void testFindPatternAndKindMatch() {
  39. Ajde.getDefault().getStructureSearchManager().findMatches(
  40. "Point",
  41. IProgramElement.Kind.CONSTRUCTOR
  42. );
  43. assertTrue("non existent node", true);
  44. }
  45. public void testFindNonExistent() {
  46. List matches = Ajde.getDefault().getStructureSearchManager().findMatches(
  47. "mumbleNodeDesNotExist",
  48. null
  49. );
  50. assertTrue("non existent", matches.isEmpty());
  51. }
  52. protected void setUp() throws Exception {
  53. super.setUp();
  54. initialiseProject("StructureSearchManagerTest");
  55. doBuild("all.lst");
  56. }
  57. protected void tearDown() throws Exception {
  58. super.tearDown();
  59. }
  60. }