Blog

Testing Angular 2 Components with Unit Tests and the TestComponentBuilder (RC1+)

Note – I’ve updated this article and created a new github project using angular-cli to test it. Run all tests with ng test after following instructions at https://github.com/krimple/angular2-unittest-samples-rc Testing Components In my last post, I discussed how to write tests in Angular 2 based on the new angular-testing API. We learned how to stand up a test and use the test injector, and how to mock the network requests to the Http service using the MockBackend. In this post, we'll…

Sensu: Finally the Nagios Replacement I Have Been Looking For!

Nagios, the popular open source system and networking monitoring service, is awesome. It gives you so much flexibility that expensive commercial software like Solarwinds and Spiceworks just doesn’t have. However after I moved my infrastructure to Chef, Nagios was constantly giving me issues. The configuration scheme just doesn’t fit well in an autonomous environment. In this blog article I review how I found a replacement for Nagios,

Making a Java SafeString that works with all unicode characters

In Java, there is an issue with String when using characters that take up more than 2 bytes in UTF-16. substring() and similar methods can split the character in the middle. I was thinking switching Strings to UTF-8 might be good, and there are currently two JEPs for Java 9 somewhat related to this. 226: UTF-8 Property Files and 254: Compact Strings. But thinking about this a little more, I don’t necessarily want a UTF-8 String class, but a String class that works with all unicode characters. Here’s how I did it.

Changing Java 8 – handling nulls with the AST

One aspect of Java 8 that would be nice to change is the handling of nulls. Can testName.getName() be changed so that a NullPointerException is never thrown, even if testName is null? Is it possible to modify java to support this directly? Java does provide an interface to read the Abstract Syntax Tree (AST) in javax.annotation.processing.Processor and a base class in javax.annotation.processing.AbstractProcessor. Let’s see what is required to change the AST. First an annotation is helpful (although not required). @Retention(RetentionPolicy.CLASS)…

Angular2 Observables, Http, and separating services and components

What Angular1 brought, Angular2 takes away – for a good reason. No more Promises in ng2! See how observables make Angular2 a reactive, functional platform. We’ll roll up our sleeves and get something practical done with Angular2’s Http service, and we’ll get some data via the new Http service – it's quite a bit different than the Angular 1 $http service semantically, but serves the same purpose, but is also more fully featured.

How can we help your company with your development needs?

Contact Us