public static UserInfo getUserInfo() { UserInfo userInfo = new DefaultUserInfo(true); if ("ldap".equalsIgnoreCase(USER_INFO_IMPL)) { userInfo = new LDAPUserInfoImpl(true); } else if ("db".equalsIgnoreCase(USER_INFO_IMPL)) { userInfo = new DBUserInfoImpl(true); } else if ("props".equalsIgnoreCase(USER_INFO_IMPL)) { userInfo = new PropertyUserInfoImpl(true); } else if ("custom".equalsIgnoreCase(USER_INFO_IMPL)) { try { userInfo = (UserInfo) Class.forName(CUSTOM_USER_INFO_IMPL).newInstance(); } catch (Exception e) { throw new RuntimeException("Unable to create instance of custom user info impl", e); } } return userInfo; } }
userInfo = new DefaultUserInfo(true);
@Bean @ConditionalOnMissingBean(name = "userInfo") public UserInfo userInfo() throws IOException { Resource resource = new ClassPathResource("/userinfo.properties"); Properties userInfo = PropertiesLoaderUtils.loadProperties(resource); return new DefaultUserInfo(userInfo); }
public static UserInfo getUserInfo() { UserInfo userInfo = new DefaultUserInfo(true); if ("ldap".equalsIgnoreCase(USER_INFO_IMPL)) { userInfo = new LDAPUserInfoImpl(true); } else if ("db".equalsIgnoreCase(USER_INFO_IMPL)) { userInfo = new DBUserInfoImpl(true); } else if ("props".equalsIgnoreCase(USER_INFO_IMPL)) { userInfo = new PropertyUserInfoImpl(true); } else if ("custom".equalsIgnoreCase(USER_INFO_IMPL)) { try { userInfo = (UserInfo) Class.forName(CUSTOM_USER_INFO_IMPL).newInstance(); } catch (Exception e) { throw new RuntimeException("Unable to create instance of custom user info impl", e); } } return userInfo; } }
@Before public void setUp() throws Exception { System.setProperty("org.jbpm.email.templates.dir", new File("src/test/resources/templates").getAbsolutePath()); TemplateManager.reset(); ChainedProperties props = ChainedProperties.getChainedProperties( "email.conf", ClassLoaderUtil.getClassLoader( null, getClass(), false )); emailHost = props.getProperty( "mail.smtp.host", "localhost" ); emailPort = props.getProperty( "mail.smtp.port", "2345" ); wiser = new Wiser(); wiser.setHostname( emailHost ); wiser.setPort( Integer.parseInt( emailPort ) ); wiser.start(); Thread.sleep(200); connection = new Connection(emailHost, emailPort); userInfo = new DefaultUserInfo(true); }