Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

SanityTestsJava14.java 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*******************************************************************************
  2. * Copyright (c) 2020 Contributors
  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. package org.aspectj.systemtest.ajc196;
  9. import org.aspectj.testing.XMLBasedAjcTestCase;
  10. import org.aspectj.testing.XMLBasedAjcTestCaseForJava14OrLater;
  11. import junit.framework.Test;
  12. /*
  13. * Some very trivial tests that help verify things are OK.
  14. * These are a copy of the earlier Sanity Tests created for 1.6 but these supply the -10 option
  15. * to check code generation and modification with that version specified.
  16. *
  17. * @author Andy Clement
  18. */
  19. public class SanityTestsJava14 extends XMLBasedAjcTestCaseForJava14OrLater {
  20. public static final int bytecode_version_for_JDK_level = 58;
  21. // Incredibly trivial test programs that check the compiler works at all (these are easy-ish to debug)
  22. public void testSimpleJava_A() {
  23. runTest("simple - a");
  24. }
  25. public void testSimpleJava_B() {
  26. runTest("simple - b");
  27. }
  28. public void testSimpleCode_C() {
  29. runTest("simple - c");
  30. }
  31. public void testSimpleCode_D() {
  32. runTest("simple - d");
  33. }
  34. public void testSimpleCode_E() {
  35. runTest("simple - e");
  36. }
  37. public void testSimpleCode_F() {
  38. runTest("simple - f");
  39. }
  40. public void testSimpleCode_G() {
  41. runTest("simple - g");
  42. }
  43. public void testSimpleCode_H() {
  44. runTest("simple - h", true);
  45. }
  46. public void testSimpleCode_I() {
  47. runTest("simple - i");
  48. }
  49. public void testVersionCorrect1() {
  50. runTest("simple - j");
  51. checkVersion("A", bytecode_version_for_JDK_level, 0);
  52. }
  53. public void testVersionCorrect2() {
  54. runTest("simple - k");
  55. checkVersion("A", bytecode_version_for_JDK_level, 0);
  56. }
  57. public void testVersionCorrect4() {
  58. runTest("simple - m");
  59. // Must be 49.0 when -1.5 is specified
  60. checkVersion("A", 49, 0);
  61. }
  62. public static Test suite() {
  63. return XMLBasedAjcTestCase.loadSuite(SanityTestsJava14.class);
  64. }
  65. @Override
  66. protected java.net.URL getSpecFile() {
  67. return getClassResource("sanity-tests-14.xml");
  68. }
  69. }