1 package org.jacorb.test.bugs.bug532; 2 3 4 5 42 43 44 45 import junit.framework.*; 46 47 48 49 import org.omg.CORBA.*; 50 51 52 53 70 71 public class TestCase extends junit.framework.TestCase 72 73 { 74 75 public TestCase(String name) 76 77 { 78 79 super(name); 80 81 } 82 83 84 85 public static Test suite() 86 87 { 88 89 TestSuite suite = new TestSuite ("bug 532 CDROutputStream.create_input_stream is wrong when there are deferred writes"); 90 91 suite.addTest (new TestCase ("testLargeByteArrayToAnyInsertion")); 92 93 return suite; 94 95 } 96 97 98 99 public void testLargeByteArrayToAnyInsertion() 100 101 { 102 103 try 104 105 { 106 107 ORB orb = org.omg.CORBA.ORB.init (new String []{}, null); 108 109 110 111 byte[] bytes = new byte[4001]; 112 113 Any any = orb.create_any(); 114 115 ByteSequenceHelper.insert(any, bytes); 116 117 } 118 119 catch (Exception e) 120 121 { 122 123 fail("Caught Exception while inserting large byte[] into an Any: " + e); 124 125 } 126 127 } 128 129 130 131 public static void main(String [] args) 132 133 { 134 135 junit.textui.TestRunner.run(TestCase.class); 136 137 } 138 139 140 141 } 142 143 | Popular Tags |