Search

Showing posts with label Ruby. Show all posts
Showing posts with label Ruby. Show all posts

Sunday, 28 April 2013

Sirius: ruby package installation testing

All Sirius client components are delivered as installable packages. And for Java and C# they are easy to use just by putting references to appropriate binaries. The Ruby packages are easy to install but it's hard to predict in advance whether they reference properly to all necessary resources. That's because any code becomes accessible via adding reference to the path in the file rather than including package name.

The key difference is that local relative paths work OK only for local sources but when you create Ruby package and install it those paths will be applied relatively to completely different folder. So, if you run local unit tests you don't have guarantee that all the code would work in the same fashion as it would work from the gem location. For this purpose, I've added separate class of tests into Sirius Ruby client packages. This class of tests is called installation tests. The main aim of them is to make sure that all modules are properly accessible after the package is installed. And in general it verifies that packages are operational after installation process.

Sunday, 14 April 2013

Sirius: Adding code style checks

We already set up the build process for Sirius as well as we reserved the placeholders for testing. So, further improvement in this area is to extend build with different tests and checkpoints which make more detail verification. This time we'll add more modules which perform static testing for our components and they should fail the build if static checks didn't pass (especially taking into account that it was initially planned).

What would we look for? Basically that's:

  • Conformity to coding standards - all code standards are made to provide unified approach of writing code as well as reading and maintaining it.
  • Various cases of improper code usage - a lot of actual application errors are results of improper code use or use of potentially dangerous code constructions. So, the earlier we find them the less number of silly mistakes we take during further testing stages
Actually, we've made first approximation for that while we checked the compilation ability. If system isn't compilable it's not working at all. So, we're just making more detailed checks.

Since Sirius modules use different programming languages the tool set will be varying based on that. We'll use the following tool set for that:

LanguageEngine
Java
C#
Ruby
OK. Let's see how it would be added.

Monday, 25 February 2013

Ruby: soap4r - fixing wsdl2ruby for 1.9.3 version

Some time before when I was trying to generate SOAP Ruby client for my project I encountered the problem with soap4r library. The key problem was with Ruby 1.8 and 1.9 versions compatibility. I've found several independent fixes for that:

and many others. But there were problems with getting them work properly. So, I had to dig into the installed gem code to find out what causes the errors. In particular, I'm getting error like:
[2011-06-09T17:16:01.012268 #10104] INFO -- app: Creating class definition. I, 
[2011-06-09T17:16:01.012268 #10104] INFO -- app: Creates file 'SessionServic e.rb'. F, 
[2011-06-09T17:16:01.014268 #10104] FATAL -- app: Detected an exception. Stop ping ... undefined method collect' for # (NoMethodError) C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/codegen/gensupport.rb:2 39:intrim_eol' 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/codegen/gensupport.rb:2 27:in format' 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/codegen/commentdef.rb:2 7:indump_comment' 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/codegen/classdef.rb:51: in dump' 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/classDefCreator.r b:118:inblock in dump_complextype' 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/classDefCreator.r b:116
...
Actually I was interested in wsdl2ruby utility which was needed for SOAP client generation. So, what should be done to make it working?

Wednesday, 26 December 2012

Sirius: solution improvements

Overview

The more code is prepared the more items require various corrections and enhancements. Also, some things weren't done initially but they were planned. So, in this article I'll describe various changes applied to the entire project. Here I'll cover the following topics:

  1. Adding functionality to stop service endpoints
  2. Server side updates for more informative generated code
  3. Generate Ruby client from Java server code
  4. Migrating solution from Ant to Maven