@@ -0,0 +1,2103 @@
+import com.alibaba.druid.pool.DruidDataSource;%0Aimport org.apache.shiro.SecurityUtils;%0Aimport org.apache.shiro.authc.UsernamePasswordToken;%0Aimport org.apache.shiro.authc.pam.AtLeastOneSuccessfulStrategy;%0Aimport org.apache.shiro.authc.pam.ModularRealmAuthenticator;%0Aimport org.apache.shiro.authz.ModularRealmAuthorizer;%0Aimport org.apache.shiro.authz.permission.WildcardPermissionResolver;%0Aimport org.apache.shiro.mgt.DefaultSecurityManager;%0Aimport org.apache.shiro.realm.jdbc.JdbcRealm;%0Aimport org.apache.shiro.subject.Subject;%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0A%0A/**%0A * Created by Will.Zhang on 2016/12/2 0002 15:31.%0A */%0Apublic class NonConfigurationCreateTest %7B%0A%0A    @Test%0A    public void test()%7B%0A%0A        DefaultSecurityManager securityManager = new DefaultSecurityManager();%0A%0A        //%E8%AE%BE%E7%BD%AEauthenticator%0A        ModularRealmAuthenticator authenticator = new ModularRealmAuthenticator();%0A        authenticator.setAuthenticationStrategy(new AtLeastOneSuccessfulStrategy());%0A        securityManager.setAuthenticator(authenticator);%0A%0A        //%E8%AE%BE%E7%BD%AEauthorizer%0A        ModularRealmAuthorizer authorizer = new ModularRealmAuthorizer();%0A        authorizer.setPermissionResolver(new WildcardPermissionResolver());%0A        securityManager.setAuthorizer(authorizer);%0A%0A        //%E5%88%9B%E5%BB%BAdatasource%0A        DruidDataSource dataSource = new DruidDataSource();%0A        dataSource.setDriverClassName(%22com.mysql.jdbc.Driver%22);%0A        dataSource.setUrl(%22jdbc:mysql://192.168.31.188:3306/shiro%22);%0A        dataSource.setUsername(%22root%22);%0A        dataSource.setPassword(%22YEEkoo@2016%22);%0A%0A        //%E8%AE%BE%E7%BD%AEreal%0A        JdbcRealm realm = new JdbcRealm();%0A        realm.setDataSource(dataSource);%0A        realm.setPermissionsLookupEnabled(true);%0A        securityManager.setRealm(realm);%0A%0A        //%E5%B0%86SecurityManager%E8%AE%BE%E7%BD%AE%E5%88%B0SecurityUtils,%E6%96%B9%E4%BE%BF%E5%85%A8%E5%B1%80%E4%BD%BF%E7%94%A8%0A        SecurityUtils.setSecurityManager(securityManager);%0A%0A%0A        Subject subject = SecurityUtils.getSubject();%0A        UsernamePasswordToken token = new UsernamePasswordToken(%22zhang%22, %22123%22);%0A        subject.login(token);%0A%0A        Assert.assertTrue(subject.isAuthenticated());%0A    %7D%0A%7D%0A

update section4