Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*******************************************************************************
  2. * Copyright (c) 2006 IBM Corporation and others.
  3. * All rights reserved. This program and the accompanying materials
  4. * are made available under the terms of the Eclipse Public License v1.0
  5. * which accompanies this distribution, and is available at
  6. * http://www.eclipse.org/legal/epl-v10.html
  7. *
  8. * Contributors:
  9. * Matthew Webster - initial implementation
  10. *******************************************************************************/
  11. package org.aspectj.weaver.loadtime;
  12. import java.net.URL;
  13. import java.net.URLClassLoader;
  14. import junit.framework.TestCase;
  15. public class AjTest extends TestCase {
  16. public void testAj() {
  17. // Aj aj =
  18. new Aj();
  19. }
  20. public void testAjIWeavingContext() {
  21. ClassLoader loader = new URLClassLoader(new URL[] {}, null);
  22. IWeavingContext weavingContext = new DefaultWeavingContext(loader);
  23. // Aj aj =
  24. new Aj(weavingContext);
  25. }
  26. public void testInitialize() {
  27. Aj aj = new Aj();
  28. aj.initialize();
  29. }
  30. public void testPreProcess() {
  31. ClassLoader loader = new URLClassLoader(new URL[] {}, null);
  32. Aj aj = new Aj();
  33. aj.preProcess("Junk", new byte[] {}, loader, null);
  34. }
  35. public void testGetNamespace() {
  36. ClassLoader loader = new URLClassLoader(new URL[] {}, null);
  37. Aj aj = new Aj();
  38. String namespace = aj.getNamespace(loader);
  39. assertEquals("Namespace should be empty", "", namespace);
  40. }
  41. public void testGeneratedClassesExist() {
  42. ClassLoader loader = new URLClassLoader(new URL[] {}, null);
  43. Aj aj = new Aj();
  44. boolean exist = aj.generatedClassesExist(loader);
  45. assertFalse("There should be no generated classes", exist);
  46. }
  47. public void testFlushGeneratedClasses() {
  48. ClassLoader loader = new URLClassLoader(new URL[] {}, null);
  49. Aj aj = new Aj();
  50. aj.flushGeneratedClasses(loader);
  51. boolean exist = aj.generatedClassesExist(loader);
  52. assertFalse("There should be no generated classes", exist);
  53. }
  54. }