KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > Ostermiller > util > ArrayHelperTests


1 /*
2  * Regression tests for ArrayHelper
3  * Copyright (C) 2005 Stephen Ostermiller
4  * http://ostermiller.org/contact.pl?regarding=Java+Utilities
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * See COPYING.TXT for details.
17  */

18 package com.Ostermiller.util;
19
20 import java.io.*;
21 import java.util.*;
22
23 /**
24  * Regression test for ArrayHelper. When run, this program
25  * should nothing unless an error occurs.
26  *
27  * More information about this class is available from <a target="_top" HREF=
28  * "http://ostermiller.org/utils/ArrayHelper.html">ostermiller.org</a>.
29  *
30  * @author Stephen Ostermiller http://ostermiller.org/contact.pl?regarding=Java+Utilities
31  * @since ostermillerutils 1.06.00
32  */

33 class ArrayHelperTests {
34
35     public static void main(String JavaDoc args[]){
36         try {
37             String JavaDoc[] arr = (String JavaDoc[])ArrayHelper.cat(new String JavaDoc[]{"one","two","three"}, new String JavaDoc[]{"four","five","six"});
38             if (!ArrayHelper.equal(arr, new String JavaDoc[]{"one","two","three","four","five","six"})){
39                 throw new Exception JavaDoc ("Arrays are not equal");
40             }
41         } catch (Exception JavaDoc x){
42             x.printStackTrace();
43             System.exit(1);
44         }
45         System.exit(0);
46     }
47 }
48
Popular Tags