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 testAdmin() throws Exception {
    Set<String> expected = Sets.newTreeSet(Sets.newHashSet(ADMIN));
    Assert.assertEquals(expected.toString(),
            new TreeSet<String>(policy.getPrivileges(set("admin_group"), ActiveRoleSet.ALL)).toString());
}

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

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

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

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

From source file:controllerTas.controller.TasController.java

public void consumeStats(Set<HashMap<String, PublishAttribute>> jmx, Set<HashMap<String, PublishAttribute>> mem)
        throws PublishAttributeException, Tas2Exception {

    if (state.testAndSetMaskInterrupt(false, true)) {
        try {/* ww w  .j a  v  a2s . c  o m*/
            double timeWindow = state.getLastTimeWindow() / 1e3;
            state.resetTimeWindow();
            log.info("Analyzing stats relevant to the last " + timeWindow + " sec");
            DSTMScenarioTas2 scenario = factory.buildScenario(jmx, mem, timeWindow,
                    state.getCurrentScale().getNumThreads());
            if (!state.isStable((int) scenario.getWorkParams().getWriteOpsPerTx())) {
                return;
            }
            log.trace("BuiltScenario\n" + scenario.toString());
            Set<KPI> kpis = analyzer.computeKPI(scenario);
            log.trace("KPIs " + kpis.toString());
            ThroughputPlotter gnu = new ThroughputPlotter(config.getGnuplotConfig());
            gnu.plot(kpis);
            //this.throughputMaximizer.computeMaxThroughputScale(scenario);
        } catch (Tas2Exception t) {
            log.warn(t);
            log.trace(Arrays.toString(t.getStackTrace()));
            log.trace("Skipping");
        } catch (GnuplotException g) {
            log.warn(g.getMessage());
        } catch (Exception e) {
            log.fatal(e.getMessage());
            log.fatal(Arrays.toString(e.getStackTrace()));
        } finally {
            log.trace("Resetting maskInterrupt");
            state.atomicSetMaskInterrupt(false);
        }
    } else {
        state.resetTimeWindow();
        log.trace("Masked interrupt");
    }
}

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

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

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

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

From source file:org.bonitasoft.console.common.server.servlet.PageUploadServlet.java

protected String getPermissions(final HttpServletRequest request, final File uploadedFile)
        throws IOException, BonitaException {

    final String action = request.getParameter(ACTION_PARAM_NAME);
    final boolean checkIfItAlreadyExists = ADD_ACTION.equals(action);
    String permissions;//  w w  w  . j  ava2 s .c om
    try {
        final Set<String> permissionsSet = getPagePermissions(request, uploadedFile, checkIfItAlreadyExists);
        permissions = permissionsSet.toString();
    } catch (final InvalidPageZipContentException e) {
        permissions = getPermissionsError(e);
    } catch (final InvalidPageTokenException e) {
        permissions = getPermissionsError(e);
    } catch (final AlreadyExistsException e) {
        permissions = getPermissionsError(e);
    }
    if (permissions == null) {
        permissions = "[]";
    }
    return permissions;
}

From source file:esg.security.yadis.XrdsDocTest.java

@Test
@Ignore//from   w w  w . ja va 2  s . c  om
public void testParseDoc() throws ParserConfigurationException, SAXException, IOException,
        XPathExpressionException, XrdsParseException {

    final InputStream yadisDocFile = new ClassPathResource(YADIS_FILEPATH).getInputStream();
    StringWriter writer = new StringWriter();
    IOUtils.copy(yadisDocFile, writer, "UTF-8");
    String yadisDocContent = writer.toString();

    XrdsDoc yadisParser = new XrdsDoc();

    List<XrdsServiceElem> serviceElems = yadisParser.parse(yadisDocContent);
    Assert.assertEquals(serviceElems.toArray().length, 3);
    for (XrdsServiceElem elem : serviceElems) {
        String localId = elem.getLocalId();
        if (localId != null) {
            Assert.assertEquals(elem.getLocalId(), "https://openid.somewhere.ac.uk/PJKershaw");
        }
        Set<String> types = elem.getTypes();
        System.out.printf("Service: Priority=%d; Type=%s; URI=%s;\n", elem.getServicePriority(),
                types.toString(), elem.getUri());
    }
}

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

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

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

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