# 该命令用来列出目前与过去登录系统的用户相关信息 last # output root tty1 Mon Mar 12 18:33 still logged in reboot system boot 3.10.0-693.17.1. Mon Mar 12 18:33 - 19:02 (00:29) root tty1 Sat Mar 10 20:18 - 20:18 (00:00) reboot system boot 3.10.0-693.17.1. Sat Mar 10 20:18 - 20:18 (00:00) root tty1 Fri Mar 9 19:10 - 20:50 (01:40) ... 其中: 第一列:用户名 第二列:终端位置。(pts/0通过ssh或者telnet远程连接的用户,tty:直接连接到计算机或者本地用户) 第三列:登陆IP或者内核(看到0.0或者什么都没有,意味着用户通过本地终端连接,除了重启,内核版本会显示在状态中)
第四列:开始时间(如:sun apr 3 :四月三号星期天) 第五列:结束时间(still login in 还未退出,down:直到正常关机,crash:直到强制关机) 第六列:持续时间
//配置类仅打开自动扫描 @Configuration @ComponentScan(basePackages = "zhen" public class MyConfig { } //测试类 @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = MyConfig.class) public class MyConfigTest { @Autowired Playable playable; @Test public void checkNULL() { Assert.assertNotNull(playable); } }
此时再次运行测试类会发现,FAILD并且报错:
Unsatisfied dependency expressed through field ‘playable’; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type ‘zhen.Playable’ available: expected single matching bean but found 2: CD,video // 找到了两个都bean都能匹配