Archive Page 2

Had a brilliant weekend up North in @barcampderry Met some interesting folks and had a chance to discover a fantastic city and the surrounding area.

As promised these is the slide deck for the presentation, I don’t think these are of much use but please feel free to ping me on twitter or as a comment here if you have questions or comments.

Cheers


The Art of Unit Testing (by Roy Osherove) First Meetup

Its amazing how much you can talk about just one chapter, ok we diverged at some point to related topics, we dreamed about our own Open Source project, again. Anyway, these are my thoughs about the first chapter, after the meeting

Integration testing and unit testing:  I end up thinking:

  • You shouldnt do it inadvertedly.
  • Its your responsability as as developer to do certain Integration tests (if you want to make sure that certain services are working as expected, that certain dependencies that you have and you are ok with that are working as expected)

We also mentioned the Demeter Law when talking about building APIs.

Again this inspired me to look at StoryTeller. Some resources I found:

I m now looking at the samples from it but that ll be in other post :)


We are meeting for the first time for the Book club and just to get the ball rolling on this I though I’d write up a mini summary of chapter 1 on The Art of  Unit Testing before the meeting as a way to explore the concepts and then another one after if necesary.

So far I like the book, a very clean and concrete explanation of the basics, in plain english.

Some concept definitions are opinionated, but  Roy does a good job of it by telling you that there are many defintions available of certain terms, he then tells you wich one he will be using, for example when he defines Legacy Code he setteles for: Code that has no unit tests ( in line with M Feathers), he gives you a few other options including one that kept sticking in my head: Code that works. (quite possibly with bugs , I cant help to add).

He makes a lot of emphasis in Good Unit Tests, as tests that are automated, repeatable, easy to implement and read, that are trustworthy and run quickly, normally written using an unit testing framework.

I think a knock on effect of this is that the tests will be just a few lines long and quite likely many.

The definition of Integration Tests made me think a lot. For reference: Integration testing means testing two or more dependent software modules as a group.  I’d really like to discuss this with the group tomorrow today, I’d say many of us do more Integration testing that we tend to think? particularly if we have a dependency on a service that has no other hard dependencies ( like a db, I/O operations or similar)   — Will update on this.

Another good concept to be introducing at this early stage is the Regression, and when I was reading this I was thinking It’s so great to tie this up with CI, why? Well if you have relevant test coverage and you change something (adding the required unit tests and all ) you commit your code , the build machine will immediately go and try to build and run your test suite, so that will help you to know if potentially you have a regression.

He outlines a series of questions to ask yourself  to find out if you are writting good tests the one I liked the most is this one:

Can I write a basic test in no more than a few minutes? — Will update on this too later on.

There is a  unit test example without using a  framework, I liked it  first because of this little snippet that I didnt know about: MethodBase.GetMethod().Name , more to the point I think hes trying to highlight the advantages of the frameworks and also because it reminds you of the fact that you dont need unit testing frameworks.

Then there is a basic intro to TDD, where the last D stands for Development , and thats ok, I have not much more to add because I didnt find anything that sticks out .

So far so good, I think we could have jammed the first two chapters in this meet up.

Comments, corrections and questions as always welcome :)


Very excited by a very very busy few months ahead:

- This wednesday thursday and Friday  Epicenter, In dublin where John Skeet, Craig Murphy (the man behind the DDD events), Barry Dorans, Barry Carr  and many others will be talking, including me :) . Sounds like a busy conference full of choices.

Oh yeah! and Craig Managed to get a Special Offer on Epicenter,  buy 1 day get 3. More here

- September Dublin Alt Net meeting. 15th of September. New location Seagrass we ll be doing some lightning presentations on  Kanban, Mono and Fluent NHibernate ( a bit of a mixed bag) more details to follow in dublinalt.net

- OSSBarcamp, this is one not to miss, the  19th of September all things open source. ONe takl i m particularly interested in is the one on IPython, I really hope I can make it at least to that talk.

- Finally  the 30th of september  Sebatien Lambla istalking about Open Rasta , finishing arrangements as we speak, this is the first urregular Dublin Alt net meet up =). Location will probably be Seagrass too. More info to follow in Dublinalt.net

Cheers


Just a quick post :

If are trying to use Format, in GWT, String.Format  is not supported, instead you should use Format a lot of interesting stuff there, so if you are using GWT-Ext take 5 min of your time and have  a look, you ll end up using it.

This is what I m using for Strings and for dates


Nvelocity help

05Aug09

Hi there

I ll just add this because I saw some people being directed to here when searching for NVelocity docs (no idea why tbh)

Anyway here is the link to the Appache documentation for velocity

Also of course the castle docs


This coming Wednesday the 5th of August we are going to be meeting up in Kennedy’s ( nearly opposite to Pearse Dart Station) Its been a while so I m really looking forward to catch up with the girls. More info here
Hope you can make it if you are a Girl Geek =)

Cheers


I found some interesting IronRuby Resources that I thought some people might find useful:

http://blog.jimmy.schementi.com/ complete Articles on Iron Ruby, I think he is somewhat related to the IronRuby project ( never really  read the profile, just the articles….)

http://flanders.co.nz/ Blog from Ivan Porto Carrero, the Author of Iron Ruby in action ( its on EAP from Maning).

http://blog.benhall.me.uk/ Ben Hall’s Blog. He s got some really complete articles in that blog, and a really good speaker. He wrote this article  on IronRuby and RSpec on the MSDN magazine.

http://www.ironruby.net/Documentation Of course :D

http://www.iunknown.com/ John Lam, I believe he is responsible for this project, however he doesn’t blog too often.


Say you have a panel, that contains a form and you want to get the values for the fields of that form, one way to go on about it is to use findByType():

Find a component under this container at any level by xtype.
Parameters:
xtype – the components xtype
Returns:
an array of components

this is all well and good, however the available xtypes, what are those?

A bit of magic string here?,  what are the available xtypes?

You can find a list below:

* xtype Class
* ------------- ------------------
* box BoxComponent
* button Button
* colorpalette ColorPalette
* component Component
* container Container
* cycle CycleButton
* dataview DataView
* datepicker DatePicker
* editor Editor
* editorgrid EditorGridPanel
* grid GridPanel
* paging PagingToolbar
* panel Panel
* progress ProgressBar
* splitbutton SplitButton
* tabpanel TabPanel
* treepanel TreePanel
* viewport ViewPort
* window Window
*

* Toolbar components
* ---------------------------------------
* toolbar Toolbar
*
* Form components
* ---------------------------------------
* checkbox Checkbox
* combo ComboBox
* datefield DateField
* field Field
* fieldset FieldSet
* form FormPanel
* hidden Hidden
* htmleditor HtmlEditor
* numberfield NumberField
* radio Radio
* textarea TextArea
* textfield TextField
* timefield TimeField

This list is available from the Component class in the package com.gwtext.client.widgets;

As a cleaner way to deal with this I created an Enum to work with this information.

Hope it saves you 10min.


So… I had to set up a GXT development environment for myself from scratch, so I thought I d share the experience.

Getting the JDK was painfull

I ll spare you the rant, however I will say that Sun requires that you are registered to download the JDK, after a email like the one below:

We're sorry but your Sun Online Account password could not be reset.

We would be happy to look into this further for you. Please forward this email to us at login@sun.com. We apologize for any inconvenience.

a 404 ( see screenshot) and a failed attempt to re- register, I ended up getting the JDK from another machine, via remote desktop.

404

Sun website login 404

JDK, check

Ant

Next thing on the list was to get ant, I went to the appropriate website got the binaries, un-zipped, set the ANT_HOME, and proceeded to add ant to my path, checked that the version was the correct one with


ant -version

and all fine

ant : check

Installing GWT

Then i went to get GWT , downloaded, unzipped, added the GWT_HOME (not required but handy) then ran the mail sample in hosted mode as described in the GWT documentation getting started win ant deploy

Creating a project with GWT 1.6.4

A lot has changed since version 1.5.3 the two more obvious things so far are: speed running the hosted mode, the layout of the project files, and the application creatorand now you have to use webAppCreator.cmd (extension depends on your platform of course) , then, since I use eclipse I can jsut import the project and start working with it, tho I wanted to try GXT .

Installing and using Ext-GWT (or GXT) 2.0 RC1

GXT 2.0 required GWT 1.6.x ( I m using 1.6.4) , at a glance, there are a lot of things that make GXT look really good, like active development and a roadmap :D , some new widgets, support plans, etc.

There are a few steps required to make GXT work in the project I created in the previous step,

  • Copy the Resources folder into the project war folder (you could call it something else but I dont see the point yet), then, as described in the setup.txt,
  • Add the stylesheet to the host page html
  • Add the <inherits ..> to the ..Gwt.xml,
  • Include the gxt library to the project classpath
  • and include to the Launch configuration.

To check that this is a GXT app we write a bit of code on onModuleLoad method:

Button button = new Button(“Click here”);

ContentPanel panel = new ContentPanel();

panel.setTitle(“GXT Test”);

panel.setHeight(400);

panel.add(button);

RootPanel.get().add(panel);

gets me something like:
gxt
Task Completed. Next task, get a basic layout with a grid populated by JSON.
Button button = new Button(“Click here”);
ContentPanel panel = new ContentPanel();
panel.setTitle(“GXT Test”);
panel.setHeight(400);
panel.add(button);

RootPanel.get().add(panel);