summaryrefslogtreecommitdiffstats
path: root/weaver/testsrc/LocaleTest.java
blob: 2ed013a40a01dfcee06e6e12b80b1e52e649bb83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import java.io.IOException;
import java.util.Locale;

import junit.framework.TestCase;

import org.aspectj.apache.bcel.generic.Instruction;
import org.aspectj.apache.bcel.util.ByteSequence;

public class LocaleTest extends TestCase {

	public LocaleTest(String name) {
		super(name);
	}

	public void testNormalLocale() {
		doBipush();		
	}

	public void testTurkishLocale() {
		Locale def = Locale.getDefault();
		Locale.setDefault(new Locale("tr", ""));
		try {
			doBipush();
		} finally {
			Locale.setDefault(def);
		}
	}
	
	private static void doBipush() {
		try {
			Instruction.readInstruction(
						new ByteSequence(new byte[] { 
							(byte)16, // bipush 
							(byte) 3  // data for bipush
							}));
		} catch (IOException e) {
			throw new RuntimeException(e.getMessage());
		}
	}
}