Friday, March 5, 2010

Red Samurai Tool - JDeveloper 11g Extension to Validate ADF Code Quality

I was working long on JDeveloper 11g extension for ADF 11g code quality checks. Finally it is available for public use - first release. This release is based on my Oracle Forms to Oracle Fusion 11g migration experience.

You can download extension - redsamuraiqt_1_0.zip and install it through JDeveloper Update wizard. It is available directly from Oracle JDeveloper Open Source and Partners Extension update center as well. Additionally, you can download sample project I'm using for this post - RedSamuraiToolTestSample.zip.

When you will run it, first screen will be welcome screen:


Next, you will be given with a list of rules to be applied for ADF code quality validation:


And finally, we have confirmation screen:


Extension can be customized through JDeveloper Preferences wizard:


You can install redsamuraiqt_1_0.zip extension through JDeveloper Check for Updates wizard from local file:


Or simply to download it from Open Source and Partner Extensions update center:


In order to invoke Red Samurai tool, right click on Model or ViewController project and select RedSamurai QT option:


To demonstrate extension functionality, I decided to show how you can ensure all View Objects contain ORDER BY clause:


It will report rule violations - View Object name and rule title:


Then you go to View Object screen and add ORDER BY clause:


If same rule is applied again, no more violations will be reported:


Another example - page title. We may have a rule to ensure all page titles are coming from Message Bundle file. If developer forgot to use title from Message Bundle and typed hard coded value:


Let's run Page Document Title rule:


Tool will generate report document, where violation will be reported:


It says that page title must be used from Message Bundle and property key should have specific value. I correct this violation and map page title to Message Bundle entry:


You can check,  Message Bundle reference should be included:


Run same rule again, no violations now:


Check for my next blog posts on the same topic - I will post updates and extension improvements.

36 comments:

Unknown said...

Very impressive and a really good idea. Will evaluate it soon.

Andrej Baranovskij said...

Thanks Aino, in my next posts I will describe more how to use the rest of the rules.

Anonymous said...

I haven't been able to play around enough yet to validate how effective it is, but this is just very neat. Great idea.

Andrej Baranovskij said...

Thanks, its first release - so if you will notice any issue or problems - please submit. Will be happy to improve it ;)

tina.wang said...

whether customers can add his/her own rules in a simple way. or we can only request you to satisfy new requests.

Andrej Baranovskij said...

Hi Tina,

Technically, we designed it in a such way, that it will allow customers to plug their own rules. However, in first release this functionality is disabled.

Regards,
Andrejus

Anonymous said...

Good stuff. Don't let Oracle to steal your idea & asset. Thanks.

Andrej Baranovskij said...

Thanks, if there will be something similar from Oracle, I will be only happy - it will make ADF popular even more. From our side, we will continue to do updates for this extension, based on most common problems we encounter in ADF projects.

Anonymous said...

Hi, I use jdev 11g latest. Where should I look for JDeveloper Update wizard? Can you help me to install? Thanks.

Andrej Baranovskij said...

Hi,

You can open this wizard through Help -> Check For Updates.

Regards,
Andrejus

Anonymous said...

Thanks. I have installed it using wizard through Help -> Check For Updates. I have opened your test jws using jdev 11g. Now, how do I open the testing tool?

Andrej Baranovskij said...

Hi,

Please read this blog post - I describe "In order to invoke Red Samurai tool, right click on Model or ViewController project and select RedSamurai QT option"

Regards,
Andrejus

- ASK - said...

Hi,

when i invoke
'Entity Attribute Label Control Hint' i got al lot of violations with"Label not found on attribute 'XYZ'".
All EO was created with 'Business Components Wizard from Tables' and i cannot find the right place where i can set a label for a EO attibut.

Please, could you give some suggestions for using this rule?

Thanks in advance
Andre

Andrej Baranovskij said...

Hi,

You can double click on attribute name in Entity and go to Control Hints section. There you will find Label property.

Regards,
Andrejus

Mark Woodman said...

Out of curiosity, is this leveraging JDeveloper's Audit framework? If not, what did you need to do in your extension that the Audit system couldn't provide?

Andrej Baranovskij said...

Hi Mark,

JDeveloper's Audit provides standard ADF validation. We are implementing logical validation, based on different rules, for example - check if table component is inside panel collection.

Regards,
Andrejus

Don Kleppinger said...

I would like to find every table that has the contentDelivery attribute either missing or set to the default of "whenAvailable" How would I do that? We need to change those to be either lazy or immediate so that our performance testing tool sees the same number of http requests on the playback as it saw on the recording.

Andrej Baranovskij said...

Hi,

We can add this functionality (or any other requested). You can forward your request to abaranovskis at redsamuraiconsulting dot com

Thanks,
Andrejus

Dinil Mithra said...

Is there an option for customizing or adding a new rule

Andrej Baranovskij said...

Hi,

Its not supported in current version, but we could add this feature on customer request.

Thanks,
Andrejus

Anonymous said...

Andrejus,

When will your extension be available for 11.1.2?

I tried installing it and it didn't throw an error, but it also didn't show up under the "Project Properties"

Andrej Baranovskij said...

Hi,

Thanks for your interest. We are planning to add support for JDev 11 R2, from next patch set of JDeveloper.

Andrejus

Unknown said...

Hi Andrejus,
I am a member of a project which is developed as a Oracle ADF Fusion Middleware Webapp. We use JDeveloper 11.1.2.0.0. As you say in this post it does not support JDeveloper R2. Now does it?

Regards !
Sameera

Andrej Baranovskij said...

Hi,

No it doesnt support R2. Unless some customer will ask us to migrate to R2.

Regards,
Andrejus

baluleo said...

Hi Andrejus,

Thats so cool and helpful:-)

baluleo said...

I just downloaded the tool, its freaking cool :-)

Thanks

Sameer Boddun said...

Hi

Could you please point me to source code for this tool... thanks.

Andrej Baranovskij said...

Hi,

We distribute source code only to the customers. You can download JAR...

Andrejus

Anonymous said...

hi andrejus,

How can we make it to work if our VO,EO,AM are in such packages like com.company.model.employee.views
com.company.model.department.views

Andrej Baranovskij said...

You can change package naming config in the settings. We are working now on the next version, improved and easier - we will announce it later in the year, close to UKOUG.

Andrejus

Fernando Hackbart said...

Hi Andrejus, is there any way to run Red Samurai Tool in command line in order to embed the tool in a Hudson job (while building the application or a job that only validates the code quality)?

Andrej Baranovskij said...

Possible, but not in the public version.

Regards,
Andrejus

sivanagakrishna said...

Hi Andrejus,is this tool compatible with Jdeveloper Studio Edition Version 12.1.3.0.0...?

if possible please provide the download link.

Thanks in Advance.

Andrej Baranovskij said...

For ADF 12c, you should use ADF EMG Rules.

Andrejus

Anonymous said...

Hello Andrejus,
The tools is not available for download for ADF 11g currently, the link seems to be broken.
Please can you help and/or fix the link so that we can download the tool.
Thanks.

Andrej Baranovskij said...

This is administered by Oracle.

Andrejus