Examples of Passwd


Examples of com.manning.hip.ch3.passwd.Passwd

    private void parseLine() {
      String line = reader.getCurrentValue().toString();
      String[] tokens =
          StringUtils.splitPreserveAllTokens(line,
              PASSWD_LINE_SEPARATOR);
      value = new Passwd(
          StringUtils.trimToNull(tokens[0]),
          StringUtils.trimToNull(tokens[1]),
          StringUtils.trimToNull(tokens[2]) == null ?
              null : Long.valueOf(tokens[2]),
          StringUtils.trimToNull(tokens[3]) == null ?
View Full Code Here

Examples of com.omnicarecr.accounts.util.Passwd

   * Unit test to make sure that lookupUid works correctly   
   * give a fake password file   
   */   
  public void testLookupUidPass() {   
 
    Passwd passwd = null;   
    try
      passwd = new Passwd(PASSWD_STREAM);
    } catch (Exception e) { 
     
      fail();   
    }   
    long uid = passwd.lookupUid(USER_ID_PASS)

    assertTrue(uid == 0);   
 
View Full Code Here

Examples of com.omnicarecr.accounts.util.Passwd

    assertTrue(uid == 0);   
 
 
  public void testLookupUidFail() {   
      // passwd is a fake class for testing located in testcases dir   
      Passwd passwd = null;   
         
      try
        passwd = new Passwd(PASSWD_STREAM);
      } catch (Exception e) { 
        fail();   
      }   
      // look me up out out of that file and make sure uid is still 28272   
      long uid = passwd.lookupUid(USER_ID_FAIL)
    
      assertTrue(uid == passwd.NOT_FOUND);   
   
View Full Code Here

Examples of com.omnicarecr.accounts.util.Passwd

      assertTrue(uid == passwd.NOT_FOUND);   
   
 
  public void testLookupGidPass() {   
      // passwd is a fake class for testing located in testcases dir   
      Passwd passwd = null;   
         
      try
        passwd = new Passwd(PASSWD_STREAM);   
      } catch (Exception e) { 
        fail();   
      }   
      // look me up out out of that file and make sure uid is still 28272   
      long gid = passwd.lookupGid(USER_ID_PASS)

      assertTrue(gid == GID_PASS);   
   
View Full Code Here

Examples of com.omnicarecr.accounts.util.Passwd

      assertTrue(gid == GID_PASS);   
   
   
    public void testLookupGidFail() {   
        // passwd is a fake class for testing located in testcases dir   
        Passwd passwd = null;   
           
        try
          passwd = new Passwd(PASSWD_STREAM);   
        } catch (Exception e) { 
          fail();   
        }   
        // look me up out out of that file and make sure uid is still 28272   
        long gid = passwd.lookupGid(USER_ID_FAIL)
        assertTrue(gid == Long.valueOf(passwd.NOT_FOUND));   
     
View Full Code Here

Examples of com.omnicarecr.accounts.util.Passwd

        assertTrue(gid == Long.valueOf(passwd.NOT_FOUND));   
     
   
    public void testLookupGecosPass() {   
        // passwd is a fake class for testing located in testcases dir   
        Passwd passwd = null;   
           
        try
          passwd = new Passwd(PASSWD_STREAM);   
        } catch (Exception e) { 
          fail();   
        }   
        // look me up out out of that file and make sure uid is still 28272   
        String gecos = passwd.lookupGecos(USER_ID_PASS)

        assertEquals(gecos, GECOS_PASS);   
     
View Full Code Here

Examples of com.omnicarecr.accounts.util.Passwd

        assertEquals(gecos, GECOS_PASS);   
     
     
      public void testLookupGecosFail() {   
          // passwd is a fake class for testing located in testcases dir   
          Passwd passwd = null;   
             
          try
            passwd = new Passwd(PASSWD_STREAM);   
          } catch (Exception e) { 
            fail();   
          }   
          // look me up out out of that file and make sure uid is still 28272   
          String gecos = passwd.lookupGecos(USER_ID_FAIL)
        
          assertEquals(gecos, String.valueOf(passwd.NOT_FOUND));   
        }
View Full Code Here

Examples of com.omnicarecr.accounts.util.Passwd

          assertEquals(gecos, String.valueOf(passwd.NOT_FOUND));   
        }
     
      public void testLookupHomeDirPass() {   
          // passwd is a fake class for testing located in testcases dir   
          Passwd passwd = null;   
             
          try
            passwd = new Passwd(PASSWD_STREAM);   
          } catch (Exception e) { 
            fail();   
          }   
          // look me up out out of that file and make sure uid is still 28272   
          String homedir = passwd.lookupHomeDir(USER_ID_PASS)

          assertEquals(homedir, HOME_DIR_PASS);   
       
View Full Code Here

Examples of com.omnicarecr.accounts.util.Passwd

          assertEquals(homedir, HOME_DIR_PASS);   
       
       
        public void testLookupHomeDirFail() {   
            // passwd is a fake class for testing located in testcases dir   
            Passwd passwd = null;   
               
            try
              passwd = new Passwd(PASSWD_STREAM);   
            } catch (Exception e) { 
              fail();   
            }   
            // look me up out out of that file and make sure uid is still 28272   
            String homedir = passwd.lookupGecos(USER_ID_FAIL)
          
            assertEquals(homedir, String.valueOf(passwd.NOT_FOUND));   
         
View Full Code Here

Examples of jnr.posix.Passwd

    public static IRubyObject getpwuid(IRubyObject recv, IRubyObject[] args) {
        Ruby runtime = recv.getRuntime();
        POSIX posix = runtime.getPosix();
        try {
            int uid = args.length == 0 ? posix.getuid() : RubyNumeric.fix2int(args[0]);
            Passwd pwd = posix.getpwuid(uid);
            if(pwd == null) {
                if (Platform.IS_WINDOWS) {  // MRI behavior
                    return recv.getRuntime().getNil();
                }
                throw runtime.newArgumentError("can't find user for " + uid);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.