/*
* 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
* objects with Arrays types
*
* @build ArrayOpsTest PrimitivesTest
* @run main SimpleArrays
*/
public class SimpleArrays {
"serialization/deserialization of objects with Arrays types\n");
try {
byte b[] = { 0, 1};
p.writeObject((Object)b);
short s[] = { 0, 1, 2};
p.writeObject((Object)s);
char c[] = { 'A', 'B', 'C', 'D'};
p.writeObject((Object)c);
int i[] = { 0, 1, 2, 3, 4};
p.writeObject((Object)i);
long l[] = { 0, 1, 2, 3, 4, 5};
p.writeObject((Object)l);
boolean z[] = new boolean[4];
z[0] = true;
z[1] = false;
z[2] = true;
z[3] = false;
p.writeObject(z);
float f[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f};
p.writeObject((Object)f);
double d[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0d};
p.writeObject((Object)d);
p.flush();
/* now read them back */
byte b_u[] = (byte[])q.readObject();
short s_u[] = (short[])q.readObject();
char c_u[] = (char[])q.readObject();
int i_u[] = (int[])q.readObject();
long l_u[] = (long[])q.readObject();
/* This should be boolean, but they were serialized as bytes
*/
try {
z_obj = q.readObject();
} catch (ClassCastException e) {
e.getMessage());
z_u = z;
throw new Error();
}
float f_u[] = (float[])q.readObject();
double d_u[] = (double[])q.readObject();
throw new Error();
}
throw new Error();
}
throw new Error();
}
throw new Error();
}
throw new Error();
}
throw new Error();
}
throw new Error();
}
throw new Error();
}
throw new Error();
}
"failed");
throw new Error();
}
} catch (Exception e) {
e.printStackTrace();
int ch;
try {
}
} catch (Exception f) {
throw new Error();
}
throw new Error();
} finally {
}
}
}