TestWho improvements
This commit is contained in:
		
							parent
							
								
									ede22e8b5c
								
							
						
					
					
						commit
						bddacd90ca
					
				@ -18,7 +18,8 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
package org.hyperic.sigar.test;
 | 
					package org.hyperic.sigar.test;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import org.hyperic.sigar.OperatingSystem;
 | 
					import java.util.Date;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import org.hyperic.sigar.SigarException;
 | 
					import org.hyperic.sigar.SigarException;
 | 
				
			||||||
import org.hyperic.sigar.Who;
 | 
					import org.hyperic.sigar.Who;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -29,10 +30,18 @@ public class TestWho extends SigarTestCase {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public void testWho() throws SigarException {
 | 
					    public void testWho() throws SigarException {
 | 
				
			||||||
        if (OperatingSystem.IS_WIN32) {
 | 
					        traceln("");
 | 
				
			||||||
            return;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        Who[] who = getSigar().getWhoList();
 | 
					        Who[] who = getSigar().getWhoList();
 | 
				
			||||||
        assertTrue(who.length > 0);
 | 
					        for (int i=0; i<who.length; i++) {
 | 
				
			||||||
 | 
					            String host = who[i].getHost();
 | 
				
			||||||
 | 
					            if (host.length() != 0) {
 | 
				
			||||||
 | 
					                host = "(" + host + ")";
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            traceln(who[i].getUser() + "\t" +
 | 
				
			||||||
 | 
					                    who[i].getDevice() + "\t" +
 | 
				
			||||||
 | 
					                    new Date(who[i].getTime() * 1000) + "\t" +
 | 
				
			||||||
 | 
					                    host);
 | 
				
			||||||
 | 
					            assertLengthTrace("user", who[i].getUser());
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user