Example usage for java.util HashMap toString

List of usage examples for java.util HashMap toString

Introduction

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

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:ru.apertum.qsystem.reports.formirovators.DistributionWaitDay.java

@Override
public String validate(String driverClassName, String url, String username, String password,
        HttpRequest request, HashMap<String, String> params) {
    //   ?  //w w w. j a v  a2  s . co  m
    QLog.l().logger().trace("?  \"" + params.toString() + "\".");
    if (params.size() == 1) {
        Date date;
        String sdate;
        try {
            date = Uses.format_dd_MM_yyyy.parse(params.get("date"));
            sdate = (new java.text.SimpleDateFormat("yyyy-MM-dd")).format(date);
        } catch (ParseException ex) {
            return "<br>  ! ? ?   (..).";
        }
        paramMap.put("sdate", sdate);
        paramMap.put("date", date);

    } else {
        return "<br>  !";
    }
    return null;// ? 
}

From source file:jsentvar.SurrogateTest.java

/**
 * Test of surrogatesForeach method, of class Surrogate.
 *//*from w  w w  .j  a  va  2 s  . c om*/
@Test
public void testSurrogatesForeach() throws IOException {
    System.out.println("surrogatesForeach");

    RDFReader lector = new RDFReader();
    String filename;
    filename = "resources/test/miniReasoner.owl";
    Model model;
    //String term_value = term_value0.substring(0, 1).toUpperCase() +term_value0.substring(1);

    model = lector.reader(filename);
    ArrayList<String> terms0 = new ArrayList<>();
    terms0.add("military satellites");
    terms0.add("intelligent_systems");

    Surrogate sur = new Surrogate(model);
    HashMap<String, ArrayList<String>> result;
    Utils utils = new Utils();
    ArrayList<String> terms = utils.firstUpperForeach(terms0);
    result = sur.surrogatesForeach(terms);
    System.out.println(result.toString());
    String expResult = FileUtils.readFileToString(new File("resources/test/surrogateForeachResult.txt"),
            "utf8");
    assertEquals(expResult, result.toString());

}

From source file:com.intuit.wasabi.tests.service.IntegrationAuthorization.java

/**
 * Test getting user roles/*from   w ww  .jav  a2  s.  co  m*/
 */
@Test(dependsOnMethods = { "t_getUserPermissions" })
public void t_getUserRoles() {

    String testRole = "superadmin";
    String uri = "authorization/roles/" + testRole + "/permissions";
    response = apiServerConnector.doGet(uri);

    assertReturnCode(response, HttpStatus.SC_OK);
    @SuppressWarnings("rawtypes")
    HashMap jsonMap = (HashMap) response.jsonPath().get();
    Assert.assertNotNull(jsonMap);
    Assert.assertTrue(jsonMap.toString().contains("SUPERADMIN"));
}

From source file:jsentvar.GenerateTestsResults.java

public void surrogateForeachResult() throws IOException {
    ArrayList<String> terms0 = new ArrayList<>();
    terms0.add("military satellites");
    terms0.add("intelligent_systems");

    Surrogate sur = new Surrogate(model);
    HashMap<String, ArrayList<String>> Result;
    Utils utils = new Utils();
    ArrayList<String> terms = utils.firstUpperForeach(terms0);
    Result = sur.surrogatesForeach(terms);
    FileUtils.writeStringToFile(new File("resources/test/surrogateForeachResult.txt"), Result.toString(),
            "utf8");

}

From source file:ru.apertum.qsystem.reports.formirovators.DistributionJobDayUsers.java

@Override
public String validate(String driverClassName, String url, String username, String password,
        HttpRequest request, HashMap<String, String> params) {
    //   ?  //  w  w w.j  a  va 2s  .  c o  m
    QLog.l().logger().trace("?  \"" + params.toString() + "\".");
    if (params.size() == 3) {
        // date/user_id/user
        Date date;
        String sdate, user;
        long user_id;
        try {
            date = Uses.format_dd_MM_yyyy.parse(params.get("date"));
            sdate = (new java.text.SimpleDateFormat("yyyy-MM-dd")).format(date);
            user_id = Long.parseLong(params.get("user_id"));
            user = params.get("user");
        } catch (ParseException | NumberFormatException ex) {
            return "<br>  ! ? ?    (..).";
        }
        paramMap.put("sdate", sdate);
        paramMap.put("date", date);
        paramMap.put("user_id", user_id);
        paramMap.put("user", user);
    } else {
        return "<br>  !";
    }
    return null;
}

From source file:ru.apertum.qsystem.reports.formirovators.DistributionJobDayServices.java

@Override
public String validate(String driverClassName, String url, String username, String password,
        HttpRequest request, HashMap<String, String> params) {
    //   ?  /*from w  ww . j a v  a2s. c  om*/
    QLog.l().logger().trace("?  \"" + params.toString() + "\".");
    if (params.size() == 3) {
        // date/service_id/service
        Date date;
        String sdate, service;
        long service_id;
        try {
            date = Uses.format_dd_MM_yyyy.parse(params.get("date"));
            sdate = (new java.text.SimpleDateFormat("yyyy-MM-dd")).format(date);
            service_id = Long.parseLong(params.get("service_id"));
            service = params.get("service");
        } catch (ParseException | NumberFormatException ex) {
            return "<br>  ! ? ?    (..).";
        }
        paramMap.put("sdate", sdate);
        paramMap.put("date", date);
        paramMap.put("service_id", service_id);
        paramMap.put("service", service);
    } else {
        return "<br>  !";
    }
    return null;
}

From source file:ru.apertum.qsystem.reports.formirovators.DistributionWaitDayServices.java

@Override
public String validate(String driverClassName, String url, String username, String password,
        HttpRequest request, HashMap<String, String> params) {
    //   ?  //  w  ww . jav  a  2 s  .  co m
    QLog.l().logger().trace("?  \"" + params.toString() + "\".");
    if (params.size() == 3) {
        // date/service_id/service
        Date date;
        String sdate;
        long service_id;
        String service;
        try {
            date = Uses.format_dd_MM_yyyy.parse(params.get("date"));
            sdate = (new java.text.SimpleDateFormat("yyyy-MM-dd")).format(date);
            service_id = Long.parseLong(params.get("service_id"));
            service = params.get("service");
        } catch (NumberFormatException | ParseException ex) {
            return "<br>  ! ? ?    (..).";
        }
        paramMap.put("sdate", sdate);
        paramMap.put("date", date);
        paramMap.put("service_id", service_id);
        paramMap.put("service", service);
    } else {
        return "<br>  !";
    }
    return null;
}

From source file:ru.apertum.qsystem.reports.formirovators.DistributionWaitDayUsers.java

@Override
public String validate(String driverClassName, String url, String username, String password,
        HttpRequest request, HashMap<String, String> params) {
    //   ?  /*from  w  w w  .j a va2  s  .co  m*/
    QLog.l().logger().trace("?  \"" + params.toString() + "\".");
    if (params.size() == 3) {
        // date/user_id/user
        Date date;
        String sdate;
        long user_id;
        String user;
        try {
            date = Uses.format_dd_MM_yyyy.parse(params.get("date"));
            sdate = (new java.text.SimpleDateFormat("yyyy-MM-dd")).format(date);
            user_id = Long.parseLong(params.get("user_id"));
            user = params.get("user");
        } catch (NumberFormatException | ParseException ex) {
            return "<br>  ! ? ?    (..).";
        }
        paramMap.put("sdate", sdate);
        paramMap.put("date", date);
        paramMap.put("user_id", user_id);
        paramMap.put("user", user);
    } else {
        return "<br>  !";
    }
    return null;
}

From source file:ru.apertum.qsystem.reports.formirovators.StatisticUsers.java

@Override
public String validate(String driverClassName, String url, String username, String password,
        HttpRequest request, HashMap<String, String> params) {
    //sd=20.01.2009&ed=28.01.2009
    //   ?  //from w w  w. j a v a2s. c  o  m
    QLog.l().logger().trace("?  \"" + params.toString() + "\".");
    if (params.size() == 2) {
        Date sd, fd, fd1;
        try {
            sd = Uses.format_dd_MM_yyyy.parse(params.get("sd"));
            fd = Uses.format_dd_MM_yyyy.parse(params.get("ed"));
            fd1 = DateUtils.addDays(Uses.format_dd_MM_yyyy.parse(params.get("ed")), 1);
        } catch (ParseException ex) {
            return "<br>  ! ? ?   (..).";
        }
        if (!sd.after(fd)) {
            paramMap.put("sd", sd);
            paramMap.put("ed", fd);
            paramMap.put("ed1", fd1);
        } else {
            return "<br>  !     ?.";
        }

    } else {
        return "<br>  !";
    }
    return null;// ? 
}

From source file:ru.apertum.qsystem.reports.formirovators.RatioServices.java

@Override
public String validate(String driverClassName, String url, String username, String password,
        HttpRequest request, HashMap<String, String> params) {
    //sd=20.01.2009&ed=28.01.2009
    //   ?  /*from  w  w  w .ja v  a2s . co  m*/
    QLog.l().logger().trace("?  \"" + params.toString() + "\".");
    if (params.size() == 2) {
        Date sd;
        Date fd;
        Date fd1;
        try {
            sd = Uses.format_dd_MM_yyyy.parse(params.get("sd"));
            fd = Uses.format_dd_MM_yyyy.parse(params.get("ed"));
            fd1 = DateUtils.addDays(Uses.format_dd_MM_yyyy.parse(params.get("ed")), 1);
        } catch (ParseException ex) {
            return "<br>  ! ? ?   (..).";
        }
        if (!sd.after(fd)) {
            paramMap.put("sd", sd);
            paramMap.put("ed", fd);
            paramMap.put("ed1", fd1);
        } else {
            return "<br>  !     ?.";
        }

    } else {
        return "<br>  !";
    }
    return null;// ? 
}