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.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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
  25. = "org.aspectj.bridge.VersionTest";
  26. /** @param args ignored */
  27. public static void main(String[] args) {
  28. TestRunner.main(new String[] {ME});
  29. }
  30. /**
  31. * Constructor for MessageTest.
  32. * @param name
  33. */
  34. public VersionTest(String name) {
  35. super(name);
  36. }
  37. public void testVersion() {
  38. if (Version.time_text.equals("")) return; // dev build, we can only test this on the build server.
  39. Date date = new Date(Version.getTime());
  40. SimpleDateFormat format = new SimpleDateFormat(Version.SIMPLE_DATE_FORMAT, Locale.getDefault());
  41. format.setTimeZone(TimeZone.getTimeZone("GMT"));
  42. String timeString = format.format(date);
  43. assertEquals(Version.time_text, timeString);
  44. }
  45. }