Java Code Examples for azkaban.utils.Props#put()

The following examples show how to use azkaban.utils.Props#put() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LdapUserManagerTest.java    From azkaban-ldap-usermanager with MIT License 5 votes vote down vote up
private Props getProps() {
    Props props = new Props();
    props.put(LdapUserManager.LDAP_HOST, "localhost");
    props.put(LdapUserManager.LDAP_PORT, "11389");
    props.put(LdapUserManager.LDAP_USE_SSL, "false");
    props.put(LdapUserManager.LDAP_USER_BASE, "dc=example,dc=com");
    props.put(LdapUserManager.LDAP_USERID_PROPERTY, "uid");
    props.put(LdapUserManager.LDAP_EMAIL_PROPERTY, "mail");
    props.put(LdapUserManager.LDAP_BIND_ACCOUNT, "cn=read-only-admin,dc=example,dc=com");
    props.put(LdapUserManager.LDAP_BIND_PASSWORD, "password");
    props.put(LdapUserManager.LDAP_ALLOWED_GROUPS, "");
    props.put(LdapUserManager.LDAP_GROUP_SEARCH_BASE, "dc=example,dc=com");
    return props;
}
 
Example 2
Source File: LdapUserManagerTest.java    From azkaban-ldap-usermanager with MIT License 5 votes vote down vote up
@Test
public void testGetUserWithAllowedGroup() throws Exception {
    Props props = getProps();
    props.put(LdapUserManager.LDAP_ALLOWED_GROUPS, "svc-test");
    final LdapUserManager manager = new LdapUserManager(props);

    User user = manager.getUser("gauss", "password");

    assertEquals("gauss", user.getUserId());
    assertEquals("[email protected]", user.getEmail());
}
 
Example 3
Source File: LdapUserManagerTest.java    From azkaban-ldap-usermanager with MIT License 5 votes vote down vote up
@Test
public void testGetUserWithAllowedGroupThatGroupOfNames() throws Exception {
    Props props = getProps();
    props.put(LdapUserManager.LDAP_ALLOWED_GROUPS, "svc-test2");
    final LdapUserManager manager = new LdapUserManager(props);

    User user = manager.getUser("gauss", "password");

    assertEquals("gauss", user.getUserId());
    assertEquals("[email protected]", user.getEmail());
}
 
Example 4
Source File: LdapUserManagerTest.java    From azkaban-ldap-usermanager with MIT License 5 votes vote down vote up
@Test
public void testGetUserWithEmbeddedGroup() throws Exception {
    Props props = getProps();
    props.put(LdapUserManager.LDAP_ALLOWED_GROUPS, "svc-test");
    props.put(LdapUserManager.LDAP_EMBEDDED_GROUPS, "true");
    final LdapUserManager manager = new LdapUserManager(props);

    User user = manager.getUser("gauss", "password");

    assertEquals("gauss", user.getUserId());
    assertEquals("[email protected]", user.getEmail());
}
 
Example 5
Source File: LdapUserManagerTest.java    From azkaban-ldap-usermanager with MIT License 5 votes vote down vote up
@Test
public void testInvalidEmailPropertyDoesNotThrowNullPointerException() throws Exception {
    Props props = getProps();
    props.put(LdapUserManager.LDAP_EMAIL_PROPERTY, "invalidField");
    userManager = new LdapUserManager(props);
    User user = userManager.getUser("gauss", "password");

    assertEquals("gauss", user.getUserId());
    assertEquals("", user.getEmail());
}
 
Example 6
Source File: LdapUserManagerTest.java    From azkaban-ldap-usermanager with MIT License 5 votes vote down vote up
@Test
public void testInvalidIdPropertyThrowsUserManagerException() throws Exception {
    thrown.expect(UserManagerException.class);

    Props props = getProps();
    props.put(LdapUserManager.LDAP_USERID_PROPERTY, "invalidField");
    userManager = new LdapUserManager(props);
    userManager.getUser("gauss", "password");
}
 
Example 7
Source File: TeradataJob.java    From azkaban-plugins with Apache License 2.0 5 votes vote down vote up
public TeradataJob(String jobid, Props sysProps, Props jobProps, Logger log) {
  super(jobid, sysProps, jobProps, log);
  jobProps.put(LIB_JARS_KEY, sysProps.get(LIB_JARS_KEY));
  //Initialize TDWallet if it hasn't on current JVM.
  File tempDir = new File(sysProps.getString("azkaban.temp.dir", "temp"));
  TeraDataWalletInitializer.initialize(tempDir, new File(sysProps.get(TD_WALLET_JAR)));

  if(sysProps.containsKey(Whitelist.WHITE_LIST_FILE_PATH_KEY)) {
    jobProps.put(Whitelist.WHITE_LIST_FILE_PATH_KEY, sysProps.getString(Whitelist.WHITE_LIST_FILE_PATH_KEY));
  }
}