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.

LocaleTest.java 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* Copyright (c) 2002 Contributors.
  2. *
  3. * This program and the accompanying materials are made available
  4. * 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. * PARC initial implementation
  10. */
  11. package org.aspectj.weaver;
  12. import java.io.IOException;
  13. import java.util.Locale;
  14. import org.aspectj.apache.bcel.generic.Instruction;
  15. import org.aspectj.apache.bcel.util.ByteSequence;
  16. import junit.framework.TestCase;
  17. public class LocaleTest extends TestCase {
  18. public LocaleTest(String name) {
  19. super(name);
  20. }
  21. public void testNormalLocale() {
  22. doBipush();
  23. }
  24. public void testTurkishLocale() {
  25. Locale def = Locale.getDefault();
  26. Locale.setDefault(new Locale("tr", ""));
  27. try {
  28. doBipush();
  29. } finally {
  30. Locale.setDefault(def);
  31. }
  32. }
  33. private static void doBipush() {
  34. try {
  35. Instruction.readInstruction(
  36. new ByteSequence(new byte[] {
  37. (byte)16, // bipush
  38. (byte) 3 // data for bipush
  39. }));
  40. } catch (IOException e) {
  41. throw new RuntimeException(e.getMessage());
  42. }
  43. }
  44. }