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

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