svenfila.wordpress.com
Script output redirection controlled from within a script | Sven's Blog
https://svenfila.wordpress.com/2012/10/05/script-output-redirection-controlled-from-within-a-script
HAI, CAN HAS STDIO? October 5, 2012. Script output redirection controlled from within a script. It’s trivial to send an output of a script to a file in bash:. But what if you want to control this redirection from within the script? It can actually be done in a really simple way as well. Here is a sample script that sends it’s own output to a file:. Bin/bash outfile=log # Send stdout to a file exec 1 $outfile echo This line is printed to stdout. Now this script can be executed simply as:. A more exciting ...
svenfila.wordpress.com
Spring MVC Test, and content negotiation and AJAX | Sven's Blog
https://svenfila.wordpress.com/2013/05/27/spring-mvc-test-and-content-negotiation-and-ajax
HAI, CAN HAS STDIO? May 27, 2013. Spring MVC Test, and content negotiation and AJAX. In recent projects we have used a combination of Spring MVC framework. And AJAX calls using jQuery. For automated testing of all them, we have used Spring MVC Test framework. The setup is quite typical. Here is the simplistic version of an MVC request mapping:. For requests that expect HTML response, and plain JSON for requests that expect JSON response. Header set to value. AjaxSetup({ dataType : 'json' });. We can test...
svenfila.wordpress.com
Optimising Sql.firstRow() in Groovy | Sven's Blog
https://svenfila.wordpress.com/2013/12/22/optimising-sql-firstrow-in-groovy
HAI, CAN HAS STDIO? December 22, 2013. Optimising Sql.firstRow() in Groovy. Returns the first row in the result set received from the database. Internally it invokes. And takes the first element from the resulting list of rows. In production code that works just fine — the consumer should construct the SQL statements so that only minimum amount of rows is selected from the database. In test code things may not be so straightforward however. Def row = sql.firstRow('select * from my large table'). Class Sq...
svenfila.wordpress.com
Spring MVC Test Support with an open HTTP session | Sven's Blog
https://svenfila.wordpress.com/2012/07/10/spring-mvc-test-support-with-an-open-http-session
HAI, CAN HAS STDIO? July 10, 2012. Spring MVC Test Support with an open HTTP session. Spring MVC Test Support. Is a neat way to test Spring MVC controllers. It is easy to use and has a fluent interface. It also runs fast, being comparable to plain old unit tests rather than integration tests based on, say, Selenium WebDriver. Recently there was the first milestone of. To the wild, with plans to integrate it to the main Spring Test Support in version 3.2. That is used by. The base class for tests creates ...
svenfila.wordpress.com
Running Java applications in a VMware virtual machine | Sven's Blog
https://svenfila.wordpress.com/2013/03/15/running-java-applications-in-a-vmware-virtual-machine
HAI, CAN HAS STDIO? March 15, 2013. Running Java applications in a VMware virtual machine. When setting up a virtual server for running Java applications, such as a web app, it is essential to avoid some virtualisation specific pitfalls. However, JVM is very sensitive to memory overcommitment because JVM heap space is in active use constantly. Therefore VMware ballooning has to be avoided for virtual machines running JVM processes (see here. And memory limit (. That it is using a ridiculous amount memory...
svenfila.wordpress.com
RestTemplate with custom HTTP headers | Sven's Blog
https://svenfila.wordpress.com/2012/01/05/resttemplate-with-custom-http-headers
HAI, CAN HAS STDIO? January 5, 2012. RestTemplate with custom HTTP headers. Provides simple ways to make requests to RESTful services. When you want to set additional HTTP headers to such requests, then a tiny bit of more work is needed. Starting from Spring Framework version 3.0.2 it is possible to utilise. Class An example of querying a PDF file from a server:. Private static final String APPLICATION PDF = application/pdf; RestTemplate restTemplate = new RestTemplate(); @Test public void acceptHeaderUs...
svenfila.wordpress.com
Sven Filatov | Sven's Blog
https://svenfila.wordpress.com/author/svenfila
HAI, CAN HAS STDIO? December 22, 2013. Optimising Sql.firstRow() in Groovy. Returns the first row in the result set received from the database. Internally it invokes. And takes the first element from the resulting list of rows. In production code that works just fine — the consumer should construct the SQL statements so that only minimum amount of rows is selected from the database. In test code things may not be so straightforward however. Continue reading →. May 27, 2013. And AJAX calls using jQuery.