Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

SmbToolTest.java

Go to the documentation of this file.
00001 package net.threebit.utils.sosc.test;
00002 
00003 /*
00004         Copyright 2003 Shawn Deleurme
00005         Copyright 2003 Kevin O'Donnell
00006 
00007         This program is free software; you can redistribute it and/or modify
00008         it under the terms of the GNU General Public License as published by
00009         the Free Software Foundation; either version 2 of the License, or
00010         (at your option) any later version.
00011 
00012         This program is distributed in the hope that it will be useful,
00013         but WITHOUT ANY WARRANTY; without even the implied warranty of
00014         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015         GNU General Public License for more details.
00016 
00017         You should have received a copy of the GNU General Public License
00018         along with this program; if not, write to the Free Software
00019         Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020 */
00021 
00022 import java.io.*;
00023 import java.util.*;
00024 import java.util.logging.*;
00025 import junit.framework.*;
00026 import net.threebit.utils.sosc.*;
00027 
00032 public class SmbToolTest extends TestCase {
00033 
00034         public void test1() throws Exception {
00035                 /*
00036                  * WAS JUST USED FOR DEVEL: test3() is a replacement
00037                 SmbTool st = new SmbTool("kevino","uut54");
00038                 ProcTool p = st.put("/tmp/blah.txt","//shawn/c$/hishawn.txt");
00039                 p.waitFor();
00040                 */
00041         }
00042 
00043         public void test2() throws Exception {
00044                 SmbTool st = new SmbTool("kevino","uut54");
00045                 try {
00046                         st.put("/tmp/blah.txt","filesrv1/c$/temp/blah.txt");
00047                         assertTrue(false); // should never get here
00048                 }
00049                 catch (Exception e) {
00050                         // OK!
00051                 }
00052         }
00053 
00054         public void test3() throws Exception {
00055                 StringBuffer sb = new StringBuffer();
00056                 sb.append("line1\n");
00057                 sb.append("line2\n");
00058                 SmbTool st = new SmbTool("kevino","uut54");
00059                 st.put(sb,"//filesrv1/c$/temp/SbmToolTest3.txt");
00060                 StringBuffer sbGet = st.get("//filesrv1/c$/temp/SbmToolTest3.txt");
00061                 assertTrue(sb.toString().equals(sbGet.toString()));
00062         }
00063 
00064 }

Generated on Mon Jul 14 17:19:20 2003 for SOSC by doxygen1.2.15