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.

VersionTest.java 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* *******************************************************************
  2. * Copyright (c) 1999-2001 Xerox Corporation,
  3. * 2002 Palo Alto Research Center, Incorporated (PARC).
  4. * All rights reserved.
  5. * This program and the accompanying materials are made available
  6. * under the terms of the Eclipse Public License v1.0
  7. * which accompanies this distribution and is available at
  8. * http://www.eclipse.org/legal/epl-v10.html
  9. *
  10. * Contributors:
  11. * Xerox/PARC initial implementation
  12. * ******************************************************************/
  13. package org.aspectj.bridge;
  14. import java.text.SimpleDateFormat;
  15. import java.util.Date;
  16. import java.util.Locale;
  17. import java.util.TimeZone;
  18. import junit.framework.TestCase;
  19. import junit.textui.TestRunner;
  20. /**
  21. *
  22. */
  23. public class VersionTest extends TestCase {
  24. private static final String ME = "org.aspectj.bridge.VersionTest";
  25. /** @param args ignored */
  26. public static void main(String[] args) {
  27. TestRunner.main(new String[] { ME });
  28. }
  29. /**
  30. * Constructor for MessageTest.
  31. *
  32. * @param name
  33. */
  34. public VersionTest(String name) {
  35. super(name);
  36. }
  37. public void testVersion() {
  38. if (Version.time_text.equals("")) {
  39. return; // dev build, we can only test this on the build server.
  40. }
  41. Date date = new Date(Version.getTime());
  42. SimpleDateFormat format = new SimpleDateFormat(Version.SIMPLE_DATE_FORMAT, Locale.getDefault());
  43. format.setTimeZone(TimeZone.getTimeZone("GMT"));
  44. String timeString = format.format(date);
  45. assertEquals(Version.time_text, timeString);
  46. }
  47. }