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.

Autoboxing.java 2.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*******************************************************************************
  2. * Copyright (c) 2004 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. * Andy Clement - initial implementation
  10. *******************************************************************************/
  11. package org.aspectj.systemtest.ajc150;
  12. import org.aspectj.testing.XMLBasedAjcTestCase;
  13. import junit.framework.Test;
  14. /**
  15. This test must be run under a Java5 VM - so it is *not* currently
  16. in the test suite !!!
  17. */
  18. public class Autoboxing extends XMLBasedAjcTestCase {
  19. public static Test suite() {
  20. return XMLBasedAjcTestCase.loadSuite(Autoboxing.class);
  21. }
  22. protected java.net.URL getSpecFile() {
  23. return getClassResource("ajc150.xml");
  24. }
  25. public void testSimpleBoxing() {
  26. runTest("simple boxing test");
  27. }
  28. public void testIntegerBoxing() {
  29. runTest("integer boxing");
  30. }
  31. public void testCharacterBoxing() {
  32. runTest("char boxing");
  33. }
  34. public void testDoubleBoxing() {
  35. runTest("double boxing");
  36. }
  37. public void testFloatBoxing() {
  38. runTest("float boxing");
  39. }
  40. public void testShortBoxing() {
  41. runTest("short boxing");
  42. }
  43. public void testLongBoxing() {
  44. runTest("long boxing");
  45. }
  46. public void testBooleanBoxing() {
  47. runTest("boolean boxing");
  48. }
  49. public void testByteBoxing() {
  50. runTest("byte boxing");
  51. }
  52. public void testBoxingAfterReturning() {
  53. runTest("boxing in after returning");
  54. }
  55. // CompilationResult cR = binaryWeave("testcode.jar","AspectAfterReturning.aj",0,0,"-1.5");
  56. // //System.err.println(cR.getStandardError());
  57. // assertTrue("Expected six weaving messages but got: "+getWeavingMessages(cR.getInfoMessages()).size(),
  58. // getWeavingMessages(cR.getInfoMessages()).size()==6);
  59. // RunResult rR = run("AspectAfterReturning");
  60. // int lines = countLines(rR.getStdErr());
  61. // assertTrue("Expected 6 lines of output but got: #"+lines+":\n"+rR.getStdErr(),lines==6);
  62. // }
  63. //
  64. // public int countLines(String s) {
  65. // int count = 0;
  66. // while (s.indexOf("\n")!=-1) {
  67. // count++;
  68. // s = s.substring(s.indexOf("\n")+1);
  69. // }
  70. // return count;
  71. // }
  72. //
  73. // protected void verify(String output,String lookingFor) {
  74. // assertTrue("Didn't find expected string '"+lookingFor+"' in:\n"+output,output.indexOf(lookingFor)!=-1);
  75. // }
  76. //
  77. }