Coverage details for umich.cac.util.test.PasswdTest

LineHitsSource
1 package umich.cac.util.test;
2  
3 import junit.framework.Test;
4 import junit.framework.TestCase;
5 import junit.framework.TestSuite;
6 import umich.cac.util.Passwd;
7  
8 /**
9  * Tests for Passwd class.
10  *
11  * @author rmach@umich.edu
12  *
13  */
14 public class PasswdTest extends TestCase {
15  
16   /**
17    * Constructor
18    *
19    * @param testName name of test suite
20    */
21   public PasswdTest(java.lang.String testName) {
223    super(testName);
233  }
24  
25   /**
26    * Main - for running stand-alone test
27    *
28    * @param args command line arguments
29    */
30   public static void main(java.lang.String[] args) {
310    junit.textui.TestRunner.run(suite());
320  }
33  
34   /**
35    * Return a new test suite
36    *
37    * @return a new test suite
38    */
39   public static Test suite() {
406    TestSuite suite = new TestSuite(PasswdTest.class);
413    return suite;
42   }
43  
44   /**
45    * Unit test to make sure that lookupUid works correctly
46    * give a fake password file
47    */
48   public void testLookupUid() {
49     // passwd is a fake class for testing located in testcases dir
503    Passwd passwd = null;
51     
52     try {
533      passwd = new Passwd("testcases/passwd");
540    } catch (Exception e) {
550      fail();
563    }
57     // look me up out out of that file and make sure uid is still 28272
583    long uid = passwd.lookupUid("rmach");
593    assertTrue(uid == 28272);
603  }
61 }

this report was generated by version 1.0.5 of jcoverage.
visit www.jcoverage.com for updates.

copyright © 2003, jcoverage ltd. all rights reserved.
Java is a trademark of Sun Microsystems, Inc. in the United States and other countries.