/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/* @test
* @summary it is a new version of an old test which was
* Test of serialization/deserialization of
* primitives
*
* @build PrimitivesTest
* @run main WritePrimitive
*/
public class WritePrimitive {
"serialization/deserialization of primitives \n");
try {
int i = 123456;
byte b = 12;
short s = 45;
char c = 'A';
long l = 1234567890000L;
float f = 3.14159f;
double d = f*2;
boolean z = true;
p.writeInt(i);
p.writeByte(b);
p.writeShort(s);
p.writeChar(c);
p.writeLong(l);
p.writeFloat(f);
p.writeDouble(d);
p.writeBoolean(z);
p.writeObject(string);
p.writeObject(prim);
p.flush();
double d_u = q.readDouble();
boolean z_u = q.readBoolean();
if (i != i_u) {
throw new Error();
}
if (b != b_u) {
throw new Error();
}
if (s != s_u) {
s_u);
throw new Error();
}
if (c != c_u) {
c_u);
throw new Error();
}
if (l != l_u) {
l_u);
throw new Error();
}
if (f != f_u) {
f_u);
throw new Error();
}
if (d != d_u) {
d_u);
throw new Error();
}
if (z != z_u) {
z_u);
throw new Error();
}
" actual " + string_utf);
throw new Error();
}
" actual " + string_u);
throw new Error();
}
"correctly = " + false);
throw new Error();
}
} catch (Exception e) {
e.printStackTrace();
int ch;
try {
}
} catch (Exception f) {
throw new Error();
}
throw new Error();
} finally {
}
}
}