Example usage for java.util Set toString

List of usage examples for java.util Set toString

Introduction

In this page you can find the example usage for java.util Set toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:org.apache.sentry.policy.kafka.AbstractTestKafkaPolicyEngine.java

@Test
public void testProducer1() throws Exception {
    Set<String> expected = Sets.newTreeSet(Sets.newHashSet(PRODUCER_T1_HOST1));
    Assert.assertEquals(expected.toString(),
            new TreeSet<String>(policy.getPrivileges(set("producer_group1"), ActiveRoleSet.ALL)).toString());
}

From source file:org.apache.sentry.policy.kafka.AbstractTestKafkaPolicyEngine.java

@Test
public void testProducer2() throws Exception {
    Set<String> expected = Sets.newTreeSet(Sets.newHashSet(PRODUCER_T2_HOST2));
    Assert.assertEquals(expected.toString(),
            new TreeSet<String>(policy.getPrivileges(set("producer_group2"), ActiveRoleSet.ALL)).toString());
}

From source file:org.apache.sentry.policy.kafka.AbstractTestKafkaPolicyEngine.java

@Test
public void testConsumerProducer0() throws Exception {
    Set<String> expected = Sets.newTreeSet(Sets.newHashSet(CONSUMER_PRODUCER_T1));
    Assert.assertEquals(expected.toString(),
            new TreeSet<String>(policy.getPrivileges(set("consumer_producer_group0"), ActiveRoleSet.ALL))
                    .toString());//w  w  w.j a  v  a2 s  . co  m
}

From source file:org.apache.sentry.policy.sqoop.AbstractTestSqoopPolicyEngine.java

@Test
public void testAnalyst() throws Exception {
    Set<String> expected = Sets.newTreeSet(Sets.newHashSet(ANALYST_JOBS_ALL, ANALYST_LINKS_ALL));
    Assert.assertEquals(expected.toString(),
            new TreeSet<String>(policy.getPrivileges(set("analyst"), ActiveRoleSet.ALL)).toString());
}

From source file:org.apache.sentry.policy.sqoop.AbstractTestSqoopPolicyEngine.java

@Test
public void testJobOperator() throws Exception {
    Set<String> expected = Sets.newTreeSet(Sets.newHashSet(OPERATOR_JOB1_READ, OPERATOR_JOB2_READ));
    Assert.assertEquals(expected.toString(),
            new TreeSet<String>(policy.getPrivileges(set("job1_2_operator"), ActiveRoleSet.ALL)).toString());
}

From source file:org.apache.sentry.provider.file.AbstractTestSimplePolicyEngine.java

@Test
public void testOtherGroup() throws Exception {
    authorizables.add(new Database("other_group_db"));
    Set<String> expected = Sets.newTreeSet(Sets.newHashSet(PERM_SERVER1_OTHER_GROUP_DB_CUSTOMERS_SELECT));
    Assert.assertEquals(expected.toString(),
            new TreeSet<String>(policy.getPermissions(authorizables, list("other_group")).values()).toString());
}

From source file:org.apache.sentry.policy.sqoop.AbstractTestSqoopPolicyEngine.java

@Test
public void testLinkOperator() throws Exception {
    Set<String> expected = Sets.newTreeSet(Sets.newHashSet(OPERATOR_LINK1_READ, OPERATOR_LINK2_READ));
    Assert.assertEquals(expected.toString(),
            new TreeSet<String>(policy.getPrivileges(set("link1_2_operator"), ActiveRoleSet.ALL)).toString());
}

From source file:controllers.Parser.java

/**
 * /*  w ww  . jav a2s. co m*/
 * @param entries 
 */
public Parser(Set<Map.Entry<String, String[]>> entries) {
    Logger.info("GET Request: " + entries.toString());

    Map<String, String> map = new HashMap<String, String>();
    for (Map.Entry<String, String[]> entry : entries) {
        String[] values = entry.getValue();
        String key = entry.getKey();
        for (String value : values) {
            // IE sends empty parameters and this results in queries returning 
            // 0 result.
            if (value.length() > 0) {
                map.put(key, key + ":\"" + value + "\"");
                Logger.debug(key + " " + value);
            }
        }
    }

    extractParameters(map);
}

From source file:org.apache.sentry.policy.db.AbstractTestSimplePolicyEngine.java

@Test
public void testOtherGroup() throws Exception {
    Set<String> expected = Sets.newTreeSet(Sets.newHashSet(PERM_SERVER1_OTHER_GROUP_DB_CUSTOMERS_SELECT));
    Assert.assertEquals(expected.toString(),
            new TreeSet<String>(policy.getAllPrivileges(set("other_group"), ActiveRoleSet.ALL)).toString());
}

From source file:org.apache.sentry.policy.db.AbstractTestSimplePolicyEngine.java

@Test
public void testDbAllforOtherGroup() throws Exception {
    Set<String> expected = Sets.newTreeSet(Sets.newHashSet(PERM_SERVER1_OTHER_GROUP_DB_CUSTOMERS_SELECT));
    Assert.assertEquals(expected.toString(),
            new TreeSet<String>(policy.getAllPrivileges(set("other_group"), ActiveRoleSet.ALL)).toString());
}