Quantcast
Channel: T. C. Mits 108 » java
Browsing latest articles
Browse All 36 View Live

Image may be NSFW.
Clik here to view.

Run svn command from Java using Commons exec

In a project I will need to marshal a Subversion log into Java. First step was getting Java to talk to a subversion repository. There are many options for doing this. Two of these are using a SVN API...

View Article



Image may be NSFW.
Clik here to view.

Use JAXB to export Subversion log to Java

In a previous blog post I obtained the subversion XML log output. Now I need to convert that into Java objects in order to provide some special reporting requirements. Below I just present the...

View Article

Image may be NSFW.
Clik here to view.

SvnKit E170001: Negotiate authentication failed: ‘No valid credentials provided’

In a new project, attempts to programmatically access our Subversion server using SvnKit fails with an E170001 error. But, only on one Windows 7 workstation. After a lot of searching on web for answers...

View Article

Image may be NSFW.
Clik here to view.

maven-tomcat7-plugin not extracting the war file

The Apache Tomcat Maven Plugin has a great feature: it can create a runnable jar file with an embedded Tomcat server. I tried this on a simple ‘Hello world!’ webapp to see if this works. It didn’t....

View Article

Image may be NSFW.
Clik here to view.

Unit testing Java exception handling using JMockIt

How do you test that a method caught an exception? What if that catch did not have a side effect, it just logged output, or simply swallowed the exception? Context We have a method in a class that was...

View Article


Image may be NSFW.
Clik here to view.

Search Java classpath for JUnit tests using Spring

A simple classpath scanner implementation that searches for classes having any method annotated with @Test or @RunWith. Spring Framework’s scanner utility is used to do this. Many tools and dev...

View Article

Image may be NSFW.
Clik here to view.

How to unit test Java servlets

The question of how to unit test Servlets comes up a lot. How can it be done? Should it be done? What are the options? A unit test, in the realm of xUnit semantics, is an isolated test of the smallest...

View Article

Image may be NSFW.
Clik here to view.

Java fluent inline map initialization

This is a common task, and there are many good and bad solutions out there. Java 8 even has a “Supplier” that can assist with inline map initializations. Unfortunately, Java does not have a simple...

View Article


Image may be NSFW.
Clik here to view.

Java dupe key Properties detect using Commons Configuration

Java Properties files can contain duplicate key entries. This can be a problem since the Java Properties loader will just keep the last value parsed. Not a problem for small applications, but when...

View Article


Image may be NSFW.
Clik here to view.

Prune deleted folders of repo diff report using Java

Sometimes the contents of deleted folders are not relevant. Just showing the top level deleted folder or dir is enough. For example, in a branch diff against trunk, folder moves are shown as adds and...

View Article
Browsing latest articles
Browse All 36 View Live




Latest Images