Craig Taylor

Ranch Hand
+ Follow
since Jul 17, 2008
Merit badge: grant badges
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Craig Taylor

In search of a solution to my problem I've written a service activator which is essentially just :

however, I'm getting a statement that the context has not yet been initialized. From the servicemix logs it appears that the context has already been loaded, or at least, a significant chunk has.

I guess the question now boils down to : How can I delay activation of the ServiceActivator until the application context has finished?

If I have a class defined as :


how can I define my osgi bundle to pick up and export all services with the @Service annotation?
For the test portion of my maven project I'd like to either configure hudson or maven to run a createDb script and subsequently, upon successful tests run the purgeDb script.

I've been unable to find anything in maven to help me modify the test target.

In hudson, because this is a maven target it doesn't give me the build steps that I've used previously to do something similar.

Any suggestions?
12 years ago
To clarify : I've resolved one of the issues I was having in regards to the surefire environment not reflecting the profile changes.

I'm still left with the issue of a profile defining a property (in my settings.xml) not being able to active a profile in the pom.xml.

In the example above the settings.xml : Development profile should set a testDaoUrl which, in the pom.xml should active the DevTest profile iff the testDaoUrl property exists.

12 years ago
I'd like to have my mvn pom only perform certain tests when a condition is met (eg: environment variable).

Eg, if testDbUrl is defined - perform all dao tests under test/dao; otherwise perform all other tests.

I've tried setting a property in my settings.xml and then using that in a profile that attempts to override the surefire test plugin to no avail.

Build scraps:

Settings.xml (excerpt) :

pom.xml (excerpt)
12 years ago
I ended up finding two possible solutions to this issue:

o Use of a CompositeDataset where I enumerated all dependencies for my unit test in the constructor
o or (untested) getting Ant to run a xslt transformation for me to generate the full xml.

I ended up going with CompositeDataset although looking back on it now I think the XSLT might be a bit more flexible...
12 years ago
I'm in need to creating a number of creating a number of unit tests and so wanted to have a standard directory with inidividual files that I could include by defining an entity reference.

However it appears that dbunit is wanting to use the startup directory instead of the directory in which the root dbunit.xml file is located.


Has anyone tried / accomplished this before? If so, how was the directory location handled ?

12 years ago
You're right ... I was looking at the class definitions incorrectly.

Off-hand I'm not sure what the issue is ... Later tonight I'll try to recreate your project and see what I find.
Instead of location.parkingSpot did you mean locationDetails.parkingSpot ?
Netbeans 6.8 is the latest... 6.0 might be the same but not positive:

Go into the Services tab and click on the database item. You can then add a database connection and run queries etc - use the right button menu for options.

If you're looking for the hibernate annotations etc the java ee plugin should have everything you need.

Check the id to see if the data has previously been persisted to the database - if it has not then you know it needs to be saved.

Attempt to re-fetch the data based upon it's id; if it doesn't exist then your application (or another) has deleted it - otherwise it's an update if the fetched data and current data differ.

Note : Your question is of the nature that often is because of other problems you're handling ... Why do you want to / need to know?
The first thing that springs to mind is to use an a discriminator column (@DiscriminatorColumn) to define which of two trade tables the record is written to. This is also dependent upon how much you query the history trade records; how often they get updated etc (moving from trade_current to trade_history would involve a delete and re-add I believe).

Just as a followup as to how I figured it out:

I ended up using @IdClass to define the id class and then marked the individual getters with @Id as appropriate.
Your query is selecting both classes ... you are actually getting back an array with [0] containing Deviceanalogfeaturess and [1] containing the Fuelrecord.

The correct code would be something along the lines of :

Yes - The jpa implementation is responsible for assigning the id (assuming it's marked appropriately). The trigger is not needed.