public class MidiEventTest extends TestCase {
public void test_getMessage() {
byte[] bt = new byte[] {1, 2, 3, 4};
MidiMessage1 message = new MidiMessage1(bt);
MidiEvent event = new MidiEvent(message, 10L);
MidiMessage mm = event.getMessage();
assertEquals(1, mm.getMessage()[0]);
assertEquals(2, mm.getMessage()[1]);
assertEquals(3, mm.getMessage()[2]);
assertEquals(4, mm.getMessage()[3]);
bt[0] = 10;
bt[1] = 20;
bt[2] = 30;
bt[3] = 40;
/*
* values change
*/
assertEquals(10, mm.getMessage()[0]);
assertEquals(20, mm.getMessage()[1]);
assertEquals(30, mm.getMessage()[2]);
assertEquals(40, mm.getMessage()[3]);
byte[] nb = mm.getMessage();
nb[0] = 45;
nb[1] = -12;
nb[2] = 90;
nb[3] = 14;
/*
* values don't change
*/
assertEquals(10, mm.getMessage()[0]);
assertEquals(20, mm.getMessage()[1]);
assertEquals(30, mm.getMessage()[2]);
assertEquals(40, mm.getMessage()[3]);
MidiEvent event1 = new MidiEvent(null, 10L);
assertNull(event1.getMessage());
}