Freitag, 30. Dezember 2016

Chromecast setup - not as easy as promised

Today, I bought a Google Chromecast for a friend of mine. The leaflet promises setup in three easy steps:
  • connect to power and TV (via HDMI) => ok, no problem
  • switch the source on your TV to the chromecast => ok, the splash screen asks you to open chromecast.com/setup to complete the setup
  • open chromecast.com/setup => doesn't work at all - apparently, the chromecast fails to perform a DNS lookup for itself (sic!)
The only reliable way to get it to work seems to be to install the Google Home app and use that to setup the Chromecast - which is okay, but the leaflet and the Chromecast itself explicitly recommend doing it the other way. It's a shame that Google fails to provide correct information regarding such a basic thing.

Freitag, 9. Dezember 2016

Unit testing PL/SQL stored procedures with JRuby (Part I)

Synopsis

My PL/SQL code that's running on Oracle doesn't have proper unit tests so far. The main reasons for this are
- lack of tooling (neither utplsql nor QuestCodeTester nor the SQL Developer built-in has satisfied me so far)
- lack of time (lame excuse, I know)

So I decided to once more tackle the problem.

Past experiences

Until now, I've tried the following approaches:

utPLSQL

Pro

- runs directly in the database => no additional setup necessary
- syntax errors in the unit tests / procedure calls are caught by the compiler
- same language for Code Under Test and unit tests

Con

- PL/SQL is quite limited in its expressiveness
- Integration in a CI environment for automatic builds / reporting build failures requires additional work

MRI Ruby with oci8 and Cucumber Spec files

Pro

- Ruby (it's such a wonderful language, really)
- Gherkin syntax for spec files

Con

- complicated deployment in CI environment (requires at least an Oracle instant client installation)
- even more complicated to set up on Windows (requires Devkit to compile the native extension oci8)

.NET with SpecFlow

Pro

- excellent IDE (Visual Studio)
- Gherkin syntax for spec files

Con

- Windows only (although Mono might be viable, but setting this up with ODP.NET / Oracle client seems quite complicated)
- C# is quite verbose (F# might be an alternative, though)

Java with Maven, JUnit / Cucumber-JVM

Pro

- real cross-platform
- easy deployment (no need for the Oracle client - just include ojdbc7.jar)
- Gherkin syntax for spec files

Con

- Java is incredibly verbose (Scala / Kotlin might be an alternative, though)
- Maven (enough said)

A new horizon

Requirements

My new solution should be:
- easy to deploy (no full-blown Oracle client necessary)
- really cross-platform (Windows, Linux, Mac OS X; Docker integration not strictly necessary, but would be very nice)
 - joyful (this excludes Java as a language, Maven as a build tool, and several others)

Choice

For now, I'll go with:
- JRuby (Ruby + JVM = dream team)
- Gradle (although I might switch to Rake)
- RSpec (although I might switch to Cucumber if I want a more high-level solution)