harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r540241 - in /harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound: midi/MetaMessageTest.java midi/MidiMessageTest.java midi/PatchTest.java sampled/AudioSystemTest.java
Date Mon, 21 May 2007 19:01:55 GMT
Author: hindessm
Date: Mon May 21 12:01:54 2007
New Revision: 540241

URL: http://svn.apache.org/viewvc?view=rev&rev=540241
Log:
Fixing junit usage - use assertEquals w/parameters in the correct order.

Modified:
    harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/MetaMessageTest.java
    harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/MidiMessageTest.java
    harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/PatchTest.java
    harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/sampled/AudioSystemTest.java

Modified: harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/MetaMessageTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/MetaMessageTest.java?view=diff&rev=540241&r1=540240&r2=540241
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/MetaMessageTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/MetaMessageTest.java
Mon May 21 12:01:54 2007
@@ -69,13 +69,13 @@
         /**
          * values change!!!
          */
-        assertEquals( meta3.getStatus(), 10 );
-        assertEquals( meta3.getType(), 20 );
-        assertEquals( meta3.getMessage().length, 3 );
-        assertEquals( meta3.getMessage()[0], 10 );
-        assertEquals( meta3.getMessage()[1], 20 );
-        assertEquals( meta3.getMessage()[2], 30 );
-        assertEquals( meta3.getData().length, 0 );
+        assertEquals(10, meta3.getStatus());
+        assertEquals(20, meta3.getType());
+        assertEquals(3, meta3.getMessage().length);
+        assertEquals(10, meta3.getMessage()[0]);
+        assertEquals(20, meta3.getMessage()[1]);
+        assertEquals(30, meta3.getMessage()[2]);
+        assertEquals(0, meta3.getData().length);
 
         bt = new byte[] {17, -9, 23, 45, 56};
         MetaMessage1 meta1 = new MetaMessage1(bt);
@@ -99,26 +99,26 @@
          * values change, but the begin of array that
          * return by method getData() doesn't displace!!!
          */
-        assertEquals( meta1.getLength(), 5 );
-        assertEquals( meta1.getStatus(), 98 );
-        assertEquals( meta1.getType(), 247 );
-        assertEquals( meta1.getMessage().length, 5 );
-        assertEquals( meta1.getMessage()[0], 98 );
-        assertEquals( meta1.getMessage()[1], -9 );
-        assertEquals( meta1.getMessage()[2], -56 );
-        assertEquals( meta1.getMessage()[3], -16 );
-        assertEquals( meta1.getMessage()[4], -3 );
+        assertEquals(5, meta1.getLength());
+        assertEquals(98, meta1.getStatus());
+        assertEquals(247, meta1.getType());
+        assertEquals(5, meta1.getMessage().length);
+        assertEquals(98, meta1.getMessage()[0]);
+        assertEquals(-9, meta1.getMessage()[1]);
+        assertEquals(-56, meta1.getMessage()[2]);
+        assertEquals(-16, meta1.getMessage()[3]);
+        assertEquals(-3, meta1.getMessage()[4]);
         assertEquals( 2, meta1.getData().length ); //!!!
-        assertEquals( meta1.getData()[0], -16 );   //!!! 
-        assertEquals( meta1.getData()[1], -3 );    //!!!
+        assertEquals(-16, meta1.getData()[0]);   //!!! 
+        assertEquals(-3, meta1.getData()[1]);    //!!!
         byte[] nb = meta1.getData();
         nb[0] = 1;
         nb[1] = 2;
         /**
          * and here values don't change...
          */
-        assertEquals( meta1.getData()[0], -16 );
-        assertEquals( meta1.getData()[1], -3 );
+        assertEquals(-16, meta1.getData()[0]);
+        assertEquals(-3, meta1.getData()[1]);
         
         bt = new byte[] {17, -9, -23, -45, -56};
         MetaMessage1 meta4 = new MetaMessage1(bt);
@@ -194,49 +194,49 @@
 
         meta.setMessage(18, new byte[] { 1, 2, 3 }, 0);
 
-        assertEquals(meta.getLength(), 3);
-        assertEquals(meta.getMessage().length, 3);
-        assertEquals(meta.getMessage()[0], -1);
-        assertEquals(meta.getMessage()[1], 18);
-        assertEquals(meta.getMessage()[2], 0);
-        assertEquals(meta.getData().length, 0);
+        assertEquals(3, meta.getLength());
+        assertEquals(3, meta.getMessage().length);
+        assertEquals(-1, meta.getMessage()[0]);
+        assertEquals(18, meta.getMessage()[1]);
+        assertEquals(0, meta.getMessage()[2]);
+        assertEquals(0, meta.getData().length);
 
         meta.setMessage(10, new byte[100000], 65535);
-        assertEquals(meta.getLength(), 65540);
-        assertEquals(meta.getMessage().length, 65540);
-        assertEquals(meta.getMessage()[0], -1);
-        assertEquals(meta.getMessage()[1], 10);
-        assertEquals(meta.getMessage()[2], -125);
-        assertEquals(meta.getMessage()[3], -1);
-        assertEquals(meta.getMessage()[4], 127);
+        assertEquals(65540, meta.getLength());
+        assertEquals(65540, meta.getMessage().length);
+        assertEquals(-1, meta.getMessage()[0]);
+        assertEquals(10, meta.getMessage()[1]);
+        assertEquals(-125, meta.getMessage()[2]);
+        assertEquals(-1, meta.getMessage()[3]);
+        assertEquals(127, meta.getMessage()[4]);
 
         meta.setMessage(10, new byte[100000], 16385);
-        assertEquals(meta.getLength(), 16390);
-        assertEquals(meta.getMessage().length, 16390);
-        assertEquals(meta.getMessage()[0], -1);
-        assertEquals(meta.getMessage()[1], 10);
-        assertEquals(meta.getMessage()[2], -127);
-        assertEquals(meta.getMessage()[3], -128);
-        assertEquals(meta.getMessage()[4], 1);
+        assertEquals(16390, meta.getLength());
+        assertEquals(16390, meta.getMessage().length);
+        assertEquals(-1, meta.getMessage()[0]);
+        assertEquals(10, meta.getMessage()[1]);
+        assertEquals(-127, meta.getMessage()[2]);
+        assertEquals(-128, meta.getMessage()[3]);
+        assertEquals(1, meta.getMessage()[4]);
 
         byte[] bt = new byte[] { 1, 2, 3, 4 };
         meta.setMessage(10, bt, 4);
-        assertEquals(meta.getLength(), 7);
-        assertEquals(meta.getStatus(), 255);
-        assertEquals(meta.getType(), 10);
+        assertEquals(7, meta.getLength());
+        assertEquals(255, meta.getStatus());
+        assertEquals(10, meta.getType());
         assertEquals(4, meta.getData().length);
-        assertEquals(meta.getData()[0], 1);
-        assertEquals(meta.getData()[1], 2);
-        assertEquals(meta.getData()[2], 3);
-        assertEquals(meta.getData()[3], 4);
-        assertEquals(meta.getMessage().length, 7);
-        assertEquals(meta.getMessage()[0], -1);
-        assertEquals(meta.getMessage()[1], 10);
-        assertEquals(meta.getMessage()[2], 4);
-        assertEquals(meta.getMessage()[3], 1);
-        assertEquals(meta.getMessage()[4], 2);
-        assertEquals(meta.getMessage()[5], 3);
-        assertEquals(meta.getMessage()[6], 4);
+        assertEquals(1, meta.getData()[0]);
+        assertEquals(2, meta.getData()[1]);
+        assertEquals(3, meta.getData()[2]);
+        assertEquals(4, meta.getData()[3]);
+        assertEquals(7, meta.getMessage().length);
+        assertEquals(-1, meta.getMessage()[0]);
+        assertEquals(10, meta.getMessage()[1]);
+        assertEquals(4, meta.getMessage()[2]);
+        assertEquals(1, meta.getMessage()[3]);
+        assertEquals(2, meta.getMessage()[4]);
+        assertEquals(3, meta.getMessage()[5]);
+        assertEquals(4, meta.getMessage()[6]);
         bt[0] = 0;
         bt[1] = 1;
         bt[2] = 2;
@@ -244,33 +244,33 @@
         /**
          * values don't change
          */
-        assertEquals( meta.getLength(), 7 );
-        assertEquals( meta.getStatus(), 255 );
-        assertEquals( meta.getType(), 10 );
-        assertEquals( meta.getData().length, 4 );
-        assertEquals( meta.getData()[0], 1 );
-        assertEquals( meta.getData()[1], 2 );
-        assertEquals( meta.getData()[2], 3 );
-        assertEquals( meta.getData()[3], 4 );
-        assertEquals( meta.getMessage().length, 7 );
-        assertEquals( meta.getMessage()[0], -1 );
-        assertEquals( meta.getMessage()[1], 10 );
-        assertEquals( meta.getMessage()[2], 4 );
-        assertEquals( meta.getMessage()[3], 1 );
-        assertEquals( meta.getMessage()[4], 2 );
-        assertEquals( meta.getMessage()[5], 3 );
-        assertEquals( meta.getMessage()[6], 4 );
+        assertEquals(7, meta.getLength());
+        assertEquals(255, meta.getStatus());
+        assertEquals(10, meta.getType());
+        assertEquals(4, meta.getData().length);
+        assertEquals(1, meta.getData()[0]);
+        assertEquals(2, meta.getData()[1]);
+        assertEquals(3, meta.getData()[2]);
+        assertEquals(4, meta.getData()[3]);
+        assertEquals(7, meta.getMessage().length);
+        assertEquals(-1, meta.getMessage()[0]);
+        assertEquals(10, meta.getMessage()[1]);
+        assertEquals(4, meta.getMessage()[2]);
+        assertEquals(1, meta.getMessage()[3]);
+        assertEquals(2, meta.getMessage()[4]);
+        assertEquals(3, meta.getMessage()[5]);
+        assertEquals(4, meta.getMessage()[6]);
 
         meta.setMessage(12, null, 0);
 
-        assertEquals(meta.getLength(), 3);
-        assertEquals(meta.getStatus(), 255);
-        assertEquals(meta.getType(), 12);
-        assertEquals(meta.getData().length, 0);
-        assertEquals(meta.getMessage().length, 3);
-        assertEquals(meta.getMessage()[0], -1);
-        assertEquals(meta.getMessage()[1], 12);
-        assertEquals(meta.getMessage()[2], 0);
+        assertEquals(3, meta.getLength());
+        assertEquals(255, meta.getStatus());
+        assertEquals(12, meta.getType());
+        assertEquals(0, meta.getData().length);
+        assertEquals(3, meta.getMessage().length);
+        assertEquals(-1, meta.getMessage()[0]);
+        assertEquals(12, meta.getMessage()[1]);
+        assertEquals(0, meta.getMessage()[2]);
 
         /**
          * I will testing following condition after throw out exception;
@@ -284,64 +284,64 @@
             meta.setMessage(12, new byte[0], 9);
             fail("InvalidMidiDataException expected");
         } catch (InvalidMidiDataException e) {}
-        assertEquals(meta.getLength(), 7);
-        assertEquals(meta.getStatus(), 255);
-        assertEquals(meta.getType(), 10);
-        assertEquals(meta.getData().length, 4);
-        assertEquals(meta.getData()[0], 1);
-        assertEquals(meta.getData()[1], 2);
-        assertEquals(meta.getData()[2], 3);
-        assertEquals(meta.getData()[3], 4);
-        assertEquals(meta.getMessage().length, 7);
-        assertEquals(meta.getMessage()[0], -1);
-        assertEquals(meta.getMessage()[1], 10);
-        assertEquals(meta.getMessage()[2], 4);
-        assertEquals(meta.getMessage()[3], 1);
-        assertEquals(meta.getMessage()[4], 2);
-        assertEquals(meta.getMessage()[5], 3);
-        assertEquals(meta.getMessage()[6], 4);
+        assertEquals(7, meta.getLength());
+        assertEquals(255, meta.getStatus());
+        assertEquals(10, meta.getType());
+        assertEquals(4, meta.getData().length);
+        assertEquals(1, meta.getData()[0]);
+        assertEquals(2, meta.getData()[1]);
+        assertEquals(3, meta.getData()[2]);
+        assertEquals(4, meta.getData()[3]);
+        assertEquals(7, meta.getMessage().length);
+        assertEquals(-1, meta.getMessage()[0]);
+        assertEquals(10, meta.getMessage()[1]);
+        assertEquals(4, meta.getMessage()[2]);
+        assertEquals(1, meta.getMessage()[3]);
+        assertEquals(2, meta.getMessage()[4]);
+        assertEquals(3, meta.getMessage()[5]);
+        assertEquals(4, meta.getMessage()[6]);
 
         try {
             meta.setMessage(12, null, 9);
             fail("NullPointerException expected");
         } catch (NullPointerException e) {}
-        assertEquals(meta.getLength(), 7);
-        assertEquals(meta.getStatus(), 255);
-        assertEquals(meta.getType(), 10);
-        assertEquals(meta.getData().length, 4);
-        assertEquals(meta.getData()[0], 1);
-        assertEquals(meta.getData()[1], 2);
-        assertEquals(meta.getData()[2], 3);
-        assertEquals(meta.getData()[3], 4);
-        assertEquals(meta.getMessage().length, 7);
-        assertEquals(meta.getMessage()[0], -1);
-        assertEquals(meta.getMessage()[1], 10);
-        assertEquals(meta.getMessage()[2], 4);
-        assertEquals(meta.getMessage()[3], 1);
-        assertEquals(meta.getMessage()[4], 2);
-        assertEquals(meta.getMessage()[5], 3);
-        assertEquals(meta.getMessage()[6], 4);
+        assertEquals(7, meta.getLength());
+        assertEquals(255, meta.getStatus());
+        assertEquals(10, meta.getType());
+        assertEquals(4, meta.getData().length);
+        assertEquals(1, meta.getData()[0]);
+        assertEquals(2, meta.getData()[1]);
+        assertEquals(3, meta.getData()[2]);
+        assertEquals(4, meta.getData()[3]);
+        assertEquals(7, meta.getMessage().length);
+        assertEquals(-1, meta.getMessage()[0]);
+        assertEquals(10, meta.getMessage()[1]);
+        assertEquals(4, meta.getMessage()[2]);
+        assertEquals(1, meta.getMessage()[3]);
+        assertEquals(2, meta.getMessage()[4]);
+        assertEquals(3, meta.getMessage()[5]);
+        assertEquals(4, meta.getMessage()[6]);
 
         try {
             meta.setMessage(12, null, -9);
             fail("InvalidMidiDataException expected");
         } catch (InvalidMidiDataException e) {}
-        assertEquals(meta.getLength(), 7);
-        assertEquals(meta.getStatus(), 255);
-        assertEquals(meta.getType(), 10);
-        assertEquals(meta.getData().length, 4);
-        assertEquals(meta.getData()[0], 1);
-        assertEquals(meta.getData()[1], 2);
-        assertEquals(meta.getData()[2], 3);
-        assertEquals(meta.getData()[3], 4);
-        assertEquals(meta.getMessage().length, 7);
-        assertEquals(meta.getMessage()[0], -1);
-        assertEquals(meta.getMessage()[1], 10);
-        assertEquals(meta.getMessage()[2], 4);
-        assertEquals(meta.getMessage()[3], 1);
-        assertEquals(meta.getMessage()[4], 2);
-        assertEquals(meta.getMessage()[5], 3);
-        assertEquals(meta.getMessage()[6], 4);
+        assertEquals(7, meta.getLength());
+        assertEquals(255, meta.getStatus());
+        assertEquals(10, meta.getType());
+        assertEquals(4, meta.getData().length);
+        assertEquals(1, meta.getData()[0]);
+        assertEquals(2, meta.getData()[1]);
+        assertEquals(3, meta.getData()[2]);
+        assertEquals(4, meta.getData()[3]);
+        assertEquals(7, meta.getMessage().length);
+        assertEquals(-1, meta.getMessage()[0]);
+        assertEquals(10, meta.getMessage()[1]);
+        assertEquals(4, meta.getMessage()[2]);
+        assertEquals(1, meta.getMessage()[3]);
+        assertEquals(2, meta.getMessage()[4]);
+        assertEquals(3, meta.getMessage()[5]);
+        assertEquals(4, meta.getMessage()[6]);
     }
 
     /**
@@ -373,47 +373,47 @@
 
         meta.setMessage(10, new byte[] { 1, 2, 3, 4 }, 4);
 
-        assertEquals(meta.getLength(), 7);
-        assertEquals(meta.getStatus(), 255);
-        assertEquals(meta.getType(), 10);
-        assertEquals(meta.getData().length, 4);
-        assertEquals(meta.getData()[0], 1);
-        assertEquals(meta.getData()[1], 2);
-        assertEquals(meta.getData()[2], 3);
-        assertEquals(meta.getData()[3], 4);
-        assertEquals(meta.getMessage().length, 7);
-        assertEquals(meta.getMessage()[0], -1);
-        assertEquals(meta.getMessage()[1], 10);
-        assertEquals(meta.getMessage()[2], 4);
-        assertEquals(meta.getMessage()[3], 1);
-        assertEquals(meta.getMessage()[4], 2);
-        assertEquals(meta.getMessage()[5], 3);
-        assertEquals(meta.getMessage()[6], 4);
+        assertEquals(7, meta.getLength());
+        assertEquals(255, meta.getStatus());
+        assertEquals(10, meta.getType());
+        assertEquals(4, meta.getData().length);
+        assertEquals(1, meta.getData()[0]);
+        assertEquals(2, meta.getData()[1]);
+        assertEquals(3, meta.getData()[2]);
+        assertEquals(4, meta.getData()[3]);
+        assertEquals(7, meta.getMessage().length);
+        assertEquals(-1, meta.getMessage()[0]);
+        assertEquals(10, meta.getMessage()[1]);
+        assertEquals(4, meta.getMessage()[2]);
+        assertEquals(1, meta.getMessage()[3]);
+        assertEquals(2, meta.getMessage()[4]);
+        assertEquals(3, meta.getMessage()[5]);
+        assertEquals(4, meta.getMessage()[6]);
 
         meta.setMessage(10, new byte[] { 1, 2, 3, 4 }, 2);
 
-        assertEquals(meta.getLength(), 5);
-        assertEquals(meta.getStatus(), 255);
-        assertEquals(meta.getType(), 10);
-        assertEquals(meta.getData().length, 2);
-        assertEquals(meta.getData()[0], 1);
-        assertEquals(meta.getData()[1], 2);
-        assertEquals(meta.getMessage().length, 5);
-        assertEquals(meta.getMessage()[0], -1);
-        assertEquals(meta.getMessage()[1], 10);
-        assertEquals(meta.getMessage()[2], 2);
-        assertEquals(meta.getMessage()[3], 1);
-        assertEquals(meta.getMessage()[4], 2);
+        assertEquals(5, meta.getLength());
+        assertEquals(255, meta.getStatus());
+        assertEquals(10, meta.getType());
+        assertEquals(2, meta.getData().length);
+        assertEquals(1, meta.getData()[0]);
+        assertEquals(2, meta.getData()[1]);
+        assertEquals(5, meta.getMessage().length);
+        assertEquals(-1, meta.getMessage()[0]);
+        assertEquals(10, meta.getMessage()[1]);
+        assertEquals(2, meta.getMessage()[2]);
+        assertEquals(1, meta.getMessage()[3]);
+        assertEquals(2, meta.getMessage()[4]);
 
         meta.setMessage(12, null, 0);
-        assertEquals(meta.getLength(), 3);
-        assertEquals(meta.getStatus(), 255);
-        assertEquals(meta.getType(), 12);
-        assertEquals(meta.getData().length, 0);
-        assertEquals(meta.getMessage().length, 3);
-        assertEquals(meta.getMessage()[0], -1);
-        assertEquals(meta.getMessage()[1], 12);
-        assertEquals(meta.getMessage()[2], 0);
+        assertEquals(3, meta.getLength());
+        assertEquals(255, meta.getStatus());
+        assertEquals(12, meta.getType());
+        assertEquals(0, meta.getData().length);
+        assertEquals(3, meta.getMessage().length);
+        assertEquals(-1, meta.getMessage()[0]);
+        assertEquals(12, meta.getMessage()[1]);
+        assertEquals(0, meta.getMessage()[2]);
 
     }
 
@@ -423,11 +423,11 @@
      */
     public void test_getType() throws Exception {
         MetaMessage meta = new MetaMessage();
-        assertEquals(meta.getType(), 0);
+        assertEquals(0, meta.getType());
 
         byte[] bt = new byte[] { 9, -4, 34, 18 };
         MetaMessage1 meta2 = new MetaMessage1(bt);
-        assertEquals(meta2.getType(), 252);
+        assertEquals(252, meta2.getType());
         bt[1] = 5;
         /**
          * value change
@@ -435,10 +435,10 @@
         assertEquals(5, meta2.getType());
         
         meta.setMessage(10, new byte[] { 1, 2, 3, 4 }, 4);
-        assertEquals(meta.getType(), 10);
+        assertEquals(10, meta.getType());
 
         meta.setMessage(27, null, 0);
-        assertEquals(meta.getType(), 27);
+        assertEquals(27, meta.getType());
     }
 
     /**

Modified: harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/MidiMessageTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/MidiMessageTest.java?view=diff&rev=540241&r1=540240&r2=540241
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/MidiMessageTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/MidiMessageTest.java
Mon May 21 12:01:54 2007
@@ -29,29 +29,29 @@
      */
     public void test_constructor_MidiMessage() {
         MidiMessage1 midi = new MidiMessage1(new byte[] { 1, 2, 3, -5 });
-        assertTrue(midi.getLength() == 4);
-        assertTrue(midi.getStatus() == 1);
-        assertTrue(midi.getMessage().length == 4);
-        assertTrue(midi.getMessage()[0] == 1);
-        assertTrue(midi.getMessage()[1] == 2);
-        assertTrue(midi.getMessage()[2] == 3);
-        assertTrue(midi.getMessage()[3] == -5);
+        assertEquals(4, midi.getLength());
+        assertEquals(1, midi.getStatus());
+        assertEquals(4, midi.getMessage().length);
+        assertEquals(1, midi.getMessage()[0]);
+        assertEquals(2, midi.getMessage()[1]);
+        assertEquals(3, midi.getMessage()[2]);
+        assertEquals(-5, midi.getMessage()[3]);
 
         MidiMessage1 midi1 = new MidiMessage1(new byte[] { 0, -2 });
-        assertTrue(midi1.getLength() == 2);
-        assertTrue(midi1.getStatus() == 0);
-        assertTrue(midi1.getMessage().length == 2);
-        assertTrue(midi1.getMessage()[0] == 0);
-        assertTrue(midi1.getMessage()[1] == -2);
+        assertEquals(2, midi1.getLength());
+        assertEquals(0, midi1.getStatus());
+        assertEquals(2, midi1.getMessage().length);
+        assertEquals(0, midi1.getMessage()[0]);
+        assertEquals(-2, midi1.getMessage()[1]);
 
         byte[] bt = new byte[] { -1, 87, 19 };
         MidiMessage1 midi2 = new MidiMessage1(bt);
-        assertTrue(midi2.getLength() == 3);
-        assertTrue(midi2.getStatus() == 255);
-        assertTrue(midi2.getMessage().length == 3);
-        assertTrue(midi2.getMessage()[0] == -1);
-        assertTrue(midi2.getMessage()[1] == 87);
-        assertTrue(midi2.getMessage()[2] == 19);
+        assertEquals(3, midi2.getLength());
+        assertEquals(255, midi2.getStatus());
+        assertEquals(3, midi2.getMessage().length);
+        assertEquals(-1, midi2.getMessage()[0]);
+        assertEquals(87, midi2.getMessage()[1]);
+        assertEquals(19, midi2.getMessage()[2]);
         bt[0] = 45;
         bt[1] = 16;
         bt[2] = -29;
@@ -67,8 +67,8 @@
         
 
         MidiMessage1 midi3 = new MidiMessage1(null);
-        assertTrue(midi3.getLength() == 0);
-        assertTrue(midi3.getStatus() == 0);
+        assertEquals(0, midi3.getLength());
+        assertEquals(0, midi3.getStatus());
         try {
             midi3.getMessage();
             fail("No NPE");
@@ -89,9 +89,9 @@
     public void test_getMessage() throws Exception {
         byte[] bt = new byte[] {1, 2, 3};
         MidiMessage1 midi = new MidiMessage1(bt);
-        assertTrue(midi.getMessage()[0] == 1);
-        assertTrue(midi.getMessage()[1] == 2);
-        assertTrue(midi.getMessage()[2] == 3);
+        assertEquals(1, midi.getMessage()[0]);
+        assertEquals(2, midi.getMessage()[1]);
+        assertEquals(3, midi.getMessage()[2]);
         bt[0] = 76;
         bt[1] = 13;
         bt[2] = -5;
@@ -103,7 +103,7 @@
         assertEquals(-5, midi.getMessage()[2]);
 
         MidiMessage1 midi1 = new MidiMessage1(new byte[] {1});
-        assertTrue(midi1.getMessage()[0] == 1);
+        assertEquals(1, midi1.getMessage()[0]);
 
         MidiMessage1 midi2 = new MidiMessage1(null);
         try {
@@ -113,9 +113,9 @@
         }
 
         midi2.setMessage(new byte[] { 90, 84 }, 2);
-        assertTrue(midi2.getMessage().length == 2);
-        assertTrue(midi2.getMessage()[0] == 90);
-        assertTrue(midi2.getMessage()[1] == 84);
+        assertEquals(2, midi2.getMessage().length);
+        assertEquals(90, midi2.getMessage()[0]);
+        assertEquals(84, midi2.getMessage()[1]);
         byte[] nb = midi2.getMessage();
         nb[0] = 1;
         nb[1] = 2;
@@ -126,11 +126,11 @@
         assertEquals(84, midi2.getMessage()[1]);
 
         midi1.setMessage(new byte[] { -54, 84, -9 }, 1);
-        assertTrue(midi1.getMessage().length == 1);
-        assertTrue(midi1.getMessage()[0] == -54);
+        assertEquals(1, midi1.getMessage().length);
+        assertEquals(-54, midi1.getMessage()[0]);
 
         midi.setMessage(new byte[] { -90, -7, 4 }, 0);
-        assertTrue(midi.getMessage().length == 0);
+        assertEquals(0, midi.getMessage().length);
     }
 
     /**
@@ -140,7 +140,7 @@
     public void test_getStatus() throws Exception {
         byte[] bt = new byte[] {1, 2, 3};
         MidiMessage1 midi = new MidiMessage1(bt);
-        assertTrue(midi.getStatus() == 1);
+        assertEquals(1, midi.getStatus());
         bt[0] = -1;
         /**
          * value change
@@ -148,13 +148,13 @@
         assertEquals(255, midi.getStatus());
 
         MidiMessage1 midi1 = new MidiMessage1(new byte[] { -91, 2, 3 });
-        assertTrue(midi1.getStatus() == 165);
+        assertEquals(165, midi1.getStatus());
 
         MidiMessage1 midi2 = new MidiMessage1(new byte[] { 1 });
-        assertTrue(midi2.getStatus() == 1);
+        assertEquals(1, midi2.getStatus());
 
         MidiMessage1 midi3 = new MidiMessage1(null);
-        assertTrue(midi3.getStatus() == 0);
+        assertEquals(0, midi3.getStatus());
 
         bt = new byte[] {90, 84};
         midi2.setMessage(bt, 2);
@@ -166,10 +166,10 @@
         assertEquals(90, midi2.getStatus());
 
         midi1.setMessage(new byte[] {-54, 84, -9}, 1);
-        assertTrue(midi1.getStatus() == 202);
+        assertEquals(202, midi1.getStatus());
 
         midi.setMessage(new byte[] { -90, -7, 4 }, 0);
-        assertTrue(midi.getStatus() == 0);
+        assertEquals(0, midi.getStatus());
     }
 
     /**
@@ -178,22 +178,22 @@
      */
     public void test_getLength() throws Exception {
         MidiMessage1 midi = new MidiMessage1(new byte[] {1, 2, 3});
-        assertTrue(midi.getLength() == 3);
+        assertEquals(3, midi.getLength());
 
         MidiMessage1 midi1 = new MidiMessage1(null);
-        assertTrue(midi1.getLength() == 0);
+        assertEquals(0, midi1.getLength());
 
         MidiMessage1 midi2 = new MidiMessage1(new byte[] {-71, 2, 3, -90});
-        assertTrue(midi2.getLength() == 4);
+        assertEquals(4, midi2.getLength());
 
         midi2.setMessage(new byte[] {90, 84}, 2);
-        assertTrue(midi2.getLength() == 2);
+        assertEquals(2, midi2.getLength());
 
         midi1.setMessage(new byte[] { 90, 84, -9 }, 2);
-        assertTrue(midi1.getLength() == 2);
+        assertEquals(2, midi1.getLength());
 
         midi.setMessage(new byte[] { -90, -7, 4 }, 0);
-        assertTrue(midi.getLength() == 0);
+        assertEquals(0, midi.getLength());
     }
 
     /**
@@ -219,11 +219,11 @@
         assertEquals(84, midi2.getMessage()[1]);
 
         midi1.setMessage(new byte[] { -54, 84, -9 }, 1);
-        assertTrue(midi1.getMessage().length == 1);
-        assertTrue(midi1.getMessage()[0] == -54);
+        assertEquals(1, midi1.getMessage().length);
+        assertEquals(-54, midi1.getMessage()[0]);
 
         midi.setMessage(new byte[] { -90, -7, 4 }, 0);
-        assertTrue(midi.getMessage().length == 0);
+        assertEquals(0, midi.getMessage().length);
         
         try {
             midi1.setMessage(new byte[] { -54, 84, -9 }, 5);

Modified: harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/PatchTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/PatchTest.java?view=diff&rev=540241&r1=540240&r2=540241
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/PatchTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/PatchTest.java
Mon May 21 12:01:54 2007
@@ -34,12 +34,12 @@
     public void test_constructor()
     {
         Patch patch = new Patch( 34, 68 );
-        assertTrue( patch.getBank() == 34 );
-        assertTrue( patch.getProgram() == 68 );
+        assertEquals(34, patch.getBank());
+        assertEquals(68, patch.getProgram());
         
         Patch patch2 = new Patch( -4, 567 );
-        assertTrue( patch2.getBank() == -4 );
-        assertTrue( patch2.getProgram() == 567 );
+        assertEquals(-4, patch2.getBank());
+        assertEquals(567, patch2.getProgram());
     }
     
     /**
@@ -49,13 +49,13 @@
     public void test_getBank()
     {
         Patch patch = new Patch( 45, 78 );
-        assertTrue( patch.getBank() == 45 );
+        assertEquals(45, patch.getBank());
         
         Patch patch1 = new Patch( -78, 78 );
-        assertTrue( patch1.getBank() == -78 );
+        assertEquals(-78, patch1.getBank());
         
         Patch patch2 = new Patch( 16400, 78 );
-        assertTrue( patch2.getBank() == 16400 );
+        assertEquals(16400, patch2.getBank());
         
     }
     
@@ -66,13 +66,13 @@
     public void test_getProgram()
     {
         Patch patch = new Patch( 45, 78 );
-        assertTrue( patch.getProgram() == 78 );
+        assertEquals(78, patch.getProgram());
         
         Patch patch1 = new Patch( -78, -5 );
-        assertTrue( patch1.getProgram() == -5 );
+        assertEquals(-5, patch1.getProgram());
         
         Patch patch2 = new Patch( 16400, 216 );
-        assertTrue( patch2.getProgram() == 216 );
+        assertEquals(216, patch2.getProgram());
         
     }
 }

Modified: harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/sampled/AudioSystemTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/sampled/AudioSystemTest.java?view=diff&rev=540241&r1=540240&r2=540241
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/sampled/AudioSystemTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/sampled/AudioSystemTest.java
Mon May 21 12:01:54 2007
@@ -59,16 +59,16 @@
 
         Mixer.Info[] minfos = AudioSystem.getMixerInfo();
         assertTrue(minfos.length > 0);
-        assertEquals(minfos[0].getName(), "NAME");
-        assertEquals(minfos[0].getVersion(), "VERSION");
+        assertEquals("NAME", minfos[0].getName());
+        assertEquals("VERSION", minfos[0].getVersion());
 
         assertTrue(AudioSystem.getMixer(null) != null);
 
         Mixer mix = AudioSystem.getMixer(minfos[0]);
-        assertEquals(mix.getClass().getName(),
-                "org.apache.harmony.sound.testProvider.MyMixer");
+        assertEquals("org.apache.harmony.sound.testProvider.MyMixer",
+                mix.getClass().getName());
         Line.Info[] mli = mix.getSourceLineInfo();
-        assertEquals(mli.length, 4);
+        assertEquals(4, mli.length);
 
         Line.Info[] infos = AudioSystem.getSourceLineInfo(mli[0]);
         ok = false;
@@ -149,23 +149,25 @@
 
     public void testGetLine() throws Exception {
 
-        assertEquals(AudioSystem.getLine(
+        assertEquals("org.apache.harmony.sound.testProvider.myClip",
+                AudioSystem.getLine(
                 new Line.Info(javax.sound.sampled.Clip.class)).getClass()
-                .getName(), "org.apache.harmony.sound.testProvider.myClip");
-        assertEquals(AudioSystem.getLine(
+                .getName());
+        assertEquals("org.apache.harmony.sound.testProvider.mySourceDataLine",
+                AudioSystem.getLine(
                 new Line.Info(javax.sound.sampled.SourceDataLine.class))
-                .getClass().getName(),
-                "org.apache.harmony.sound.testProvider.mySourceDataLine");
-        assertEquals(AudioSystem.getLine(
+                .getClass().getName());
+        assertEquals("org.apache.harmony.sound.testProvider.myTargetDataLine",
+                AudioSystem.getLine(
                 new Line.Info(javax.sound.sampled.TargetDataLine.class))
-                .getClass().getName(),
-                "org.apache.harmony.sound.testProvider.myTargetDataLine");
-        assertEquals(AudioSystem.getLine(
+                .getClass().getName());
+        assertEquals("org.apache.harmony.sound.testProvider.myPort",
+                AudioSystem.getLine(
                 new Line.Info(javax.sound.sampled.Port.class)).getClass()
-                .getName(), "org.apache.harmony.sound.testProvider.myPort");
+                .getName());
 
-        assertEquals(AudioSystem.getClip().getClass().getName(),
-                "org.apache.harmony.sound.testProvider.myClip");
+        assertEquals("org.apache.harmony.sound.testProvider.myClip",
+                     AudioSystem.getClip().getClass().getName());
 
     }
 }



Mime
View raw message