ROOT

ROOT is an object-oriented program and library developed by CERN. It was originally designed for particle physics data analysis and contains several features specific to this field, but it is also used in other applications such as astronomy and data mining. read more at WikiPedia

  • <><><><>

    X-UFO R/C Spaceship
    A cheaper (200euro) alternative to the draganflyer (800euro)
    Measures 49 x 49 x 7cm (l x w x d). UFO uses 1 x 12V battery
    Available at www.boysstuff.co.uk, in this page HERE
    I even found found a video (wmv 6.54Mb bad quality)

    Product Dimensions: Diameter 585mm (23" )
    Product Weight: 322g, including Flight Battery.
    Rechargeable Flight Battery: High capacity 12v NiMH Battery included. Spare batteries available.
    Charger: Mains Charger & convenient Car Charger included. LED indicator/Auto shut off facility.
    Charging Time: Fast charge 20-25 minutes for full charge. Optional slow charge 100 minutes.
    Flight Duration: 4-5 minutes.
    Batteries Required: 4 x 1.5v AA Alkaline Batteries for Transmitter.
    R/C Specification: Supplied completely assembled ready-to-fly, with 4 Channel FM Proportional Radio Control pre-installed.
    Additional Features: Incorporates four powerful Electric Motors with twin contra-rotating Propellers, Electronic Gyroscope for optimum stability, three blue flashing LED Lights and one red, to assist orientation and show when the Gyro is up to speed.
    Full three dimensional control: Take off, hover and descend, spin left & right, pitch forwards & backwards, left & right. May be flown indoors, or outside in calm conditions.
    Range: Up to 100m (300ft) Frequency: 27MHz
    Instruction Manual: Included, providing helpful tips for the new X-UFO Pilot and experienced flyer.
    Materials: Made of lightweight flexible EPP Foam, with tough Carbon Fibre Airframe.
    Buddy Box Facility: Allows an experienced pilot to assist a beginner, by linking two Transmitters together, using the cable provided.
    Spare Parts: 4 Spare Propellers provided, two of each configuration, including fixings.
    Age Recommendation: 14+
    Gift Box Dimensions: 682 x 527 x 127mm. Gift Box Weight: 2.5kgs.
    Incorporates a useful carrying handle and may be used for safe storage between Missions!...
  • An original way to mount the sensorbysgunn911 
    correct cooling fan
    global view
    sensor mounted
    result


    "Finding out that the GV-1 Brackets were not meant to be used with a Caliber 30's clutch hub being directly in the way, I decided to get creative.

    This worked out perfect, and is probably better that the normal installation method. I used a cooling fan from Correct, (item 416-141) and used the rim around the top to install the magnet. I then mounted the sensor on the TOP of the fan facing down and drilled a hole and shaped it to fit the sensor.

    The sensor now sits above the fan facing down, and is receiving at a 97% (which is very good). It also is mounted to the frame instead of a long bracket, and doesn't move around. This method also makes for a much cleaner look, as there is no brackets used to mount.
    "

    All credits to sgunn911, his gallery at runryder and website CUSTOM-RC.COM
      "Installing the GV-1 sensor on the Caliber 30 can be tricky because the fan, where the magnets are mounted, is above the clutch. I've seen many modified brackets on the web to 'bend' the sensor around the clutch. However, I found that..."
    more on his site
    http://www.cjwoods.com/Caliber_30_tips.htm
  • I use the hard way, free but a bit more difficult as it require a rooted device, I personally use “Android Terminal Emulator” with granted root permissions (after typing su a prompt will appear)

    Android how to delete system application

    su (enter)
    mount -o rw,remount /system (enter)
    rm -r /system/app/FILE-NAME-HERE.apk (enter)

    How to remove this SHIT of myTaxi – Passenger Taxi App on Samsung Galaxy S3

    This application got installed without my knowledge by a Samsung update as a System App that CANNOT BE UN INSTALLED!

    First before I forgot: Go to hell Samsung andIntelligent Apps GmbH

    If either of you continue in that direction, installing software without my prior permission, the next update to my Samsung Galaxy S3 will be CyanogenMod 10

    Back to the removal of MyTaxi,&160; Samsung did hide taxi.android.client_v2.5.1.apk under the name /system/app/samsung_ch.apk

    To remove it

    su (enter)
    mount -o rw,remount /system (enter)
    rm -r /system/app/samsung_ch.apk (enter)
  • freemind.logo

    joomla

    I am developing a new plug-in for Joomla!! 1.5 that allow you to display any Freemind Mind Map using a fancy Flash applet in any Joomla! article

    Usage:

    you’ll be able to write in your article this special text code

    {mindmapurl:http://…./map.mm}

    to trigger the rendering.

    The admin panel will contains a lot of settings, among others: width, height, settings of the rendering applet.

    Code is ready and will be released shortly. Submission to Joomla extensions directory will be done later this week.

  • photowidget.smugmug.flickr.picasa

    I did integrate the Flickr widget from RoyTanck.com as a Joomla module. This version do not depend on Roy’s site, and run offline if needed as i rewrite the RSS parsing code myself. For now you can see it live running on the right side of Roy’s site

    • Your Smugmug/ Picasa or Flickr RSS feed. To get feed URL one for your Flickr photo stream, simply go to your photo stream's page and right-click the little orange RSS icon at the bottom. Select ‘Copy link location’ or ‘Copy shortcut’ and paste it into the form below. For Picasa, there’s a link called ‘RSS’ at the bottom right of the ‘My Photos’ page, and a small icon on the sidebar on other pages. For Smugmug the icon is located at the bottom of the page.
    • The dimensions for the widget. This depends almost entirely from the layout of your website. Square aspect rations work best (equal width and height). At very large sizes (400px and up) the thumbnails might have bigger pixels than usual.
    • The background color for the widget. You can use Colorpicker.com to get the right value for your website. The selected color serves only as a backup if ‘Use background transparency’ is selected.
    • RSS feed is also optional photowidget also support up to 10 images on your server.

    Before releasing I need to clean the code a bit, test the installer, write a small documentation, submit module to Joomla! extension.. maybe tomorrow, but before the week end for sure!

  • In order to regain control of development, avoid code duplications, easing installations, I have decided to group all these extensions Into one single component CedThumbnails.

    This new component will be delivered shortly! You are advised to update to Joomla 1.7 and soon 2.5 if you are still using Joomla 1.5. A version for Joomla 1.5 may be done later this week.

    Module Latest article with thumbnails (mod_articles_latest_thumb)

    This is a drop in replacement for the Joomla! core module "Latest Articles", it offer the same level of features but also add thumbnails.

    Module Popular articles with thumbnails (mod_articles_popular_thumb)

    This is a drop in replacement for the Joomla! core module "Popular Articles", it offer the same level of features but also add thumbnails.

    Module Related articles with thumbnails (mod_related_items_thumb)

    This is a drop in replacement for the Joomla! core module "Related Articles", it offer the same level of features but also add thumbnails.
    This Module displays other Articles that are related to the one currently being viewed. These relations are established by the Meta Keywords.
    All the keywords of the current Article are searched against all the keywords of all other published Articles. For example, you may have an Article on "Breeding Parrots" and another on "Hand Raising Black Cockatoos". If you include the keyword "parrot" in both Articles, then the Related Items Module will list the "Breeding Parrots" Article when viewing "Hand Raising Black Cockatoos" and vice-versa.

    Plugin Related articles with thumbnails (plg_content_relatedthumbarticles)

    This plugin displays other Articles that are related to the one currently being viewed. These relations are established by the Meta Keywords or using Joomla categories.
    All the keywords of the current Article are searched against all the keywords of all other published Articles. For example, you may have an Article on "Breeding Parrots" and another on "Hand Raising Black Cockatoos". If you include the keyword "parrot" in both Articles, then the Related Items Module will list the "Breeding Parrots" Article when viewing "Hand Raising Black Cockatoos" and vice-versa.

    Library WideImage (lib_wideimage)

    Is a famous PHP library for manipulating images. WideImage is a lot better than TimThumb for that job,.

    Note that Joomla 2.5&160; though JImage support images manipulations, this new extension will let you the choice to use JImage or WideImage. It support both!
    Attention JImage do not support manipulation of remote file. If your articles, in introtext or fulltext,&160; have images not located on your Joomla host, it will be better to use WideImage.

    * -> Security Fix
    # -> Bug Fix
    + -> Addition
    ^ -> Change
    - -> Removed
    ! –> Note

    - Remove support for TimThumb,
    + Support for Joomla 2.5 JImage class.
    + Caching of thumbnails is done per extension, and the same image can be displayed on different size in the module or plugin
    + assembly one component to install to install 3 modules, 1 plugin and 1 library
    ^ avoid code duplications, same code for all extensions
    + ability to locate picture for thumbnails is more flexible

    I am currently making the changes at Joomla Extensions Directory , the version for Joomla 1.6, 1.7 and 2.5 is ready!

  • When Eclipse meet Joomla!...from 0 to Joomla! in 3 minutes

    &160;

    The easiest way to develop component, modules, plugin for Joomla! using best of the breed open source software.&160;
    In order to speed up development of Joomla software, I did develop a developer package "start and ready to work". So basically nothing special for any experienced developer, just a gain of time. Less experienced developer will enjoy the package!&160; Just unpack the big ZIP file on any drive, start 2 program and you have a running Eclipse and Joomla! environment for developing

    Read more in the WIKI

    To be release in a few hours from now


    Content of package

    eclipse logo
    Eclipse 3.4
    www.eclipse.org
    Eclipse is an open source community whose projects are focused on providing a vendor-neutral open development platform and application frameworks for building software. The Eclipse Foundation is a not-for-profit corporation formed to advance the creation, evolution, promotion, and support of the Eclipse Platform and to cultivate both an open source community and an ecosystem of complementary products, capabilities, and services.
    PDT 2.0 The PDT project provides a PHP Development Tools framework for the Eclipse platform. This project encompasses all development components necessary to develop PHP and facilitate extensibility. It leverages the existing Web Tools Platform (WTP) and Dynamic Languages Toolkit (DLTK) in providing developers with PHP capabilities.
    xampp.logo&160;
    XAMPP 1.7.0
    XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl. XAMPP is really very easy to install and to use - just download, extract and start.
    apache http server
    • Apache HTTPD 2.2.11 + Openssl 0.9.8i

    The Apache HTTP Server Project is an effort to develop and maintain an open-source HTTP server for modern operating systems including UNIX and Windows NT. The goal of this project is to provide a secure, efficient and extensible server that provides HTTP services in sync with the current HTTP standards.

    Apache has been the most popular web server on the Internet since April 1996.
    with mod_rewrite
    php logo
    • phpMyAdmin 3.1.1
    • FileZilla FTP Server 0.9.29
    • Mercury Mail Transport System 4.52
    PHP is a popular open-source programming language used primarily for developing server-side applications and dynamic web content, and more recently, other software. The name is a recursive acronym for "PHP: Hypertext Preprocessor".

    with PHPdg debugger support
    with GD2 image manipulation library
    phpadmin
    PphpMyAdmin 3.1.1
    phpMyAdmin is a tool written in PHP intended to handle the administration of MySQL over the Web. Currently it can create and drop databases, create/drop/alter tables, delete/edit/add fields, execute any SQL statement, manage keys on fields.

    Accessible through:
    http://localhost/mysql/
    joomla logo
    Joomla 1.0.15
    www.joomla.org
    Joomla! is one of the most powerful Open Source Content Management Systems on the planet. It is used all over the world for everything from simple websites to complex corporate applications. Joomla! is easy to install, simple to manage, and reliable.

    configured to access mysql dev10x database
    admin panel login: admin
    admin panel pwd: admin
    joomla logo
    Joomla 1.5.9
    www.joomla.org
    configured to access mysql dev15x database
    admin panel login: admin
    admin panel pwd: admin
    mysql logo
    MySQL 5.1.30&160;
    root login: root
    root password: empty
    Eclipse Launcher Version 2.0.2 A tool for java developers using eclipse IDE. The eclipse launcher provides developers to manage multiple workspaces and to start those. The program is shown in system tray from which it is possible to edit or start the workspace definition in an easy way.
    java
    Sun
    KDK 1.6u11
    Java Development Kit from Sun Microsystems that implements the basic set of tools needed to write, test and debug Java applications and applets. Needed to run Eclipse.


    &160; MySQL Administrator is a powerful visual administration tool that makes it easy to administer and monitor your MySQL environment and gain significantly better visibility into how your databases are operating. MySQL Administrator now integrates database management and maintenance into a single, seamless environment, with a clear and intuitive graphical user interface.

    MySQL Query Browser is the easiest visual tool for creating, executing, and optimizing SQL queries for your MySQL Database Server. The MySQL Query Browser gives you a complete set of drag-and-drop tools to visually build, analyze and manage your queries.

    The MySQL Migration Toolkit is a powerful framework that enables you to quickly migrate your proprietary databases to MySQL. Using a Wizard-driven interface, the MySQL Migration Toolkit implements a proven methodology and walks you through the necessary steps to successfully complete a database migration project.

    Some figures

    • Distribution is available as zip
    • You will have to accept and Read all licenses in directory SolarJoomla\licenses\
    • start one program to enjoy a running a Joomla developer environment in no time!

  • security images
    for Mambo
    can help YOU
    Ever been to a site where you had to register and the registration form required that you type in the same phrase that is found in a hard-to-read image?  Mambo has since now not have this possibility. That's why I created an administration component com_securityimages.

    The component is not release yet but will be tomorrow!!!

    The engine is based on this great article at DevShed, I have only modified it to be more flexible, create an admin panel and extend it for Mambo.

    In order to appreciate my work, by clicking read more You will be able to read the manual...
    A GNU/GPL release ;-)

    Update 15.08.2005: I will release the component soon, I have add today:
    • Localization: french, english and german!
    • The core component com_contact is also now using security images (will be installable only as patch, sorry)
    • A new tab in the admin panel: file logging to keep track of the bad boys posting crap to Your site...
    • AkoComment and AkoBook can now live/be used without hashcash and security images if required (switch on/off) in their admin panel
    • com_securityimages is currently in test, but no big error has been found, I am only adding functionnalities (bad before delivery ;-( )
    • Remarq: I can give You installable component version of all components I've changed, but be careful! only use them if You have a fresh install of mambo (or none of the component involved) or You will loose Your comments or Guestbook entries -> It may be safer to carefully overwrite all file with FTP...



    Security images for Mambo

    Installation

    com_securityimages is a regular Mambo component, You can install it like any other component using the backend admin panel.

    After installation, verify that

    You can access the admin panel...
    By pointing your browser to
    http://youhost/administrator/components/com_securityimages/imageGenerator.php

    You see a security image (HIT reload page or refresh to receive a new one)

    Prerequisite

    NONE, but this component use the GD library (PHP extension), it should be present on your Mambo server.

    Already done

    I already modified akocomment and akobook from Arthur Konze to support security images. You can find the component bundled in the ZIP distribution BUT if You decide to use them....

    • Akocomment require com_hashcash which required com_log4php -> so first intall com_log4php then com_hashcash then com_akocomment (component and mambot)
    • Akobook require com_hashcash which required com_log4php -> so first intall com_log4php then com_hashcash then com_akobook

    Usage (for developer)

    Using this framework is very simple.

    In the page your code send to the user...

    <?php include
    ($mosConfig_absolute_path.'/administrator/components/com_securityimages/client.inc');
    ?>
    <?php echo insertSecurityImage("security_refid" );
    ?>
    <?php echo getSecurityImageText("security_try" );
    ?>

    The code above insert the image, and the text, You page normally submit information to the server for processing. Most of the time using the tag form action

    In the server code where you process the data...

    include $mosConfig_absolute_path.'/administrator/components/com_securityimages/server.inc'); $checkSecurity = checkSecurityImage($security_refid, $security_try);



    if $checkSecurity = true then the user has entered the right text.

    Admin panel Screenshots...

    security images for Mambo is highly configurable

    have fun...

  • Another scary news...even If you are behind a firewall, it is possible to fingerprint (identifying) Your computer...yes we may be not alone  :-)

    The technique works by "exploiting small, microscopic deviations in device hardware: clock skews." In practice, Kohno's paper says, his techniques "exploit the fact that most modern TCP stacks implement the TCP timestamps option from RFC 1323 whereby, for performance purposes, each party in a TCP flow includes information about its perception of time in each outgoing packet. A fingerprinter can use the information contained within the TCP headers to estimate a device's clock skew and thereby fingerprint a physical device. Read more at news.com

  • I am a huge fan of these NASA opportunities as it is a way to be one of the "few" names that "may" stay in history. By participating in this opportunity to send your name aboard InSight to the Red Planet, you're showing that you're part of that journey and the future of space!  I've send already my name to Mars (2009), in orbit around Planet Pluto (2005)to the Moon (2008), in Face in Space project (2011), tp Bennu asteroid (OSIRIS-REx).

    When it lands on Mars in November of 2018, NASA's InSight lander will be carrying several science instruments -- along with hundreds of thousands of names from members of the public.

    In 2015, nearly 827,000 people signed up to add their names to a silicon microchip onboard the robotic spacecraft. NASA is now adding a second microchip, giving the public another chance to send their names to Mars!

    Click here to Send Your Name to Mars.

    ATTENTION FREQUENT FLYERS: If you flew your name during our last opportunity in 2015, your name is already aboard the spacecraft. You can retrieve your Boarding Pass.

    Follow InSight at:
    Twitter: https://twitter.com/NASAInSight 
    Facebook: https://www.facebook.com/NASAInSight 

     

  • sony_playstation_ps3

    Here's another game play video of Little Big Planet.

     



  • antec_skeleton_00

    Nice case especially since I got it for 1/3 of its price (40€ at the flea market: a bargain)

    The Antec Skeleton is a truly revolutionary enclosure. With a unique design that allows for unprecedented airflow, a front 92mm fan, and a top three speed 250mm fan with multicolor LED customization, the Skeleton goes utterly unmatched in stylish cooling. Factor in the layered component trays for top-notch convenience, as well as the rack mount quality side rails, and you have a case truly without equal.

    The old case and the new Antec Skeleton case ready to be use. A smaller Antec Skeleton for Mini-ITX boards: Mini Skeleton-90 is also available.

    IMG_3659IMG_3655

     

    Nothing particular while mounting everything in the new case, it is quite fast to mount everything in the Antec Skeleton. Note that disks will be “hanging” on both side of the case. Quite unusual setup for your disks. The bottom level is for your power supply, hard drives, and CDROM drives if any. The upper level is for the motherboard and PCI cards. If your target is aesthetic (I did not took care in this first setup), cable routing can be a bit tedious and will take some time.

    Antec_skeleton_02

    The big fan on top make the whole setup quite silent, it’s design, fully open (ready to collect dust would say some of you), top the heat accumulated in the case to near zero. The lighted 220mm top fan can be a bit distracting when it cycles through colors (blue-green-red) but it can be switch off. Three fan speed are available depending on your acceptance for level of noise.

    Antec_skeleton_01

    The whole computer ready to display high definition videos, Since the case is fully open, there is some precaution to take: don’t drop any metal objects and liquid onto it or you will surely break something or worse!

    IMG_3760IMG_3757

    And an overall picture of the Antec Skeleton case empty:

    IMG_3657

     

    Features

    • 4 Drive Bays
        • External 2 x 5.25¨
        • Internal 2 x 3.5¨
        • Optional 4 x 3.5¨ side panel mounted drive trays
    • Layered tray design for greater system integration flexibility
    • 8 Expansion Slots with room for 11 graphics cards and multiple graphic card solutions, including NVIDIA 3-way SLI®
    • Cooling System:
        • 1 top 250mm TriCool 3-speed multi color customizable LED Fan
        • 1 front 92mm HD cooling fan
    • Maximum video card size: 11"/279mm (Note: some video cards may require removal of the adjacent hard drive cage)
    • Compatible Motherboards: Mini-ITX, microATX, Standard ATX
    • Front ports: 2 x USB 2.0, 1 x FireWire (IEEE1394), 1 x eSATA, Audio (AC97' and HDA compatible) In and Out
    • Rack mount quality side rails for greater durability
    • 0.8mm cold rolled steel component tray and high density ABS frame reinforced with with 0.8mm cold rolled steel for durability
    • No Power Supply included: To optimize performance of your Skeleton, your choice of power supply is crucial. Antec strongly recommends choosing from Signature or TruePower series.
    • Unit Dimensions:
        • 13"(H) x 14.8"(W) x 16.5"(D)
        • 33 cm(H) x 37.6 cm(W) x 41.9 cm(D)
    • Packaging Dimensions:
        • 15.74"(H) x 18.11"(W) x 18.89"(D)
        • 40 cm(H) x 46 cm(W) x 48 cm(D)
    • Net Weight: 15.5 lb / 7.02 kg
    • Gross Weight: 21.4 lb / 9.7 kg
  • AntiPattern: "An AntiPattern is a literary form that describes a commonly occurring solution to a problem that generates decidedly negative consequences.

  • Â

    Work in progress

  • In computer programming, a unit test is a method of testing the correctness of a particular module of source code. The idea is to write test cases for every non-trivial function or method in the module so that each test case is separate from the others if possible.

    JUNIT: A testcase framework for Java

     

    In computer programming, a unit test is a method of testing the correctness of a particular module of source code. The idea is to write test cases for every non-trivial function or method in the module so that each test case is separate from the others if possible.

    Advantages
    The goal of unit testing is to isolate each part of the program and show that the individual parts are correct. It provides a written contract that the piece must satisfy. This isolated testing provides two main benefits:

    • Encourages change
      Unit testing allows the programmer to refactor code at a later date, and make sure the module still works correctly (regression testing). This provides the benefit of encouraging programmers to make changes to the code since it is easy for the programmer to check if the piece is still working properly.
    • Simplifies Integration
      Unit testing helps eliminate uncertainty in the pieces themselves and can be used in a bottom-up testing style approach. By testing the parts of a program first and then testing the sum of its parts will make integration testing easier.
    • Documentation
      As an added value, all your Testcases can act as a documentation for your set of classes

    Kent Beck, (CSLife) and Erich Gamma, (OTI Zürich) have made a very good article:
    "Testing is not closely integrated with development. This prevents you from measuring the progress of development- you can't tell when something starts working or when something stops working. Using JUnit you can cheaply and incrementally build a test suite that will help you measure your progress, spot unintended side effects, and focus your development efforts." more here

    Limitations
    It is important to realize that unit-testing will not catch every error in the program. By definition, it only tests the functionality of the units themselves. Therefore, it will not catch integration errors, performance problems and any other system-wide issues. Unit testing is only effective if it is used in conjunction with other software testing activities.

    Usage
    There is a lot of ways to use JUNIT:

    • Write your set of classes, then some Testcase that should run and validate the work done,
    • Write Testcases first that won't run because no classes are existing yet, then write the code that will make it run!
    • Correct a bug in a piece of code, and write a Testcase for being sure that it won't reappear one day.

    Junit is based on fact that you want to test a code. Normally you know the result expected, all you have to do is to ask your code (class, method, set of cooperating class) and to test if the response is correct.
    Let's take an example.... I have a Class that can replace patterns in a string (like in JDK 1.4.2: "aText".replace("seachPattern","withThisPattern"))). Since I wrote the class, and know the purpose of it, I can write some pertinent testcases. I want to protect this Object and all other Object that may use it from loss of functionnality, bugs which may lead to malfunction in a complex system.

    Writing good Testcases

    There is no rule how to write a test, but remember

    • That a testcase should be pertinent, otherwise it will have no quality impact and will lead to a loss of developer time.
    • Be honest: push your Objects to the limit of their usage! try to describe and test all functionnality of your set of objects.
    • You need to do some dummy/obvious assertions (but sometimes these dummy tests are not obvious with complex object and or runtime environment).
      Constructor should not give back the same instance
      (Except if you are using a singleton pattern)
      ClassA classA = new ClassA();
      ClassA classA1 = new ClassA();
      assertNotEquals(classA, classA1);
      

    The JUNIT language

    JUnit use some primitives methods to achieve regression testing. As today in JUNIT 1.3.8, The assertion methods are all located in junit.framework.AssertA lot of third party tools has been developed to extends possibilities of tests with database, EJB, JSP for example.

    • Assert methods are testing equality of nearly all Java standard type
    • If these methods are not enough, you can always decide to validate your objects by Your own and call fail() if you decide that conditions are not met.

    Write your first Testcase

    A Junit test is a classe which extends junit.framework.Tescase and has some methods beginning with the word "test"

    A trivial example:

    Your first JUNIT testcase classe
    public class SquareTest extends junit.framework.TestCase {
            public void testClassA {
            
             Square squareA = new Square();
             Square squareB = new Square();
            
             assertNotEquals(squareB,squareA);
             assertEquals(squareA.getName(),"ClassAadummyexample");
            
             //verifysetter,getter
             squareA.setX(2);assertEquals(2,squareA.getX());
             squareA.setY(4);assertEquals(4,squareA.getY());
            
             //perimeterofasquareis2X+2y
             assertEquals(12,squareA.getPerimeter());
             //surface
             assertEquals(8,squareA.getSurface());
            }
    
            public void testCloneability() {
            
             Square squareA = new Square();
             squareA.setX(10);
             
             Square squareB = (Square) squareA.clone();
            
             //ifSquaredonotimplemeentComparable,thefollowingistrue
             assertNotEquals(squareA,squareB);
             
             //testdeepClone
             assertEquals(10,squareB.getX());
            }
    }
    

    Writing a Testcase is always more or less the same:

    1. Create one or more classes extending junit.framework.Tescaseand implement some test methods
    2. Create in these methods instances of the object you want to test or validate.
    3. Use your object, use setter and getter, constructor to change their internal state (here is the concept of pushing your object to the limits: use the full range of input data accepted by your objects)
    4. Test values returned by methods, assuming that you know what would be the correct result,
    5. Write a lot of them to test the maximum of functionnalities provided by your objects.

    Run your testcases
    Different TestRunner or how to run your suite of testcases

    A TestRunner is able to run JUNIT testcases, there is more or less 2 categories:

    • Textual TestRunner (console output)
      • The fastest to launch and can be used when you don't need a red green success indication. This is recommended with ANT.
    • Graphical TestRunners (client server web GUI, swing, AWT in eclipse....)
      • They show a simple graphical dialog to start/stop and display results of tests and provide some graphical progress indication.

    A TestRunner can be configured to be either loading or non-loading. In the loading configuration the TestRunner reloads your class from the class path for each run. As a consequence you don't have to restart the TestRunner after you have changed your code. In the non-loading configuration you have to restart the TestRunner after each run. The TestRunner configuration can be either set on the command line with the -noloading switch or in the junit.properties file located in the "user.home" by adding an entry loading=false.

    JUNIT find all testcase using java.lang.reflexion package, in fact it will call all methods starting with the word test will be found.

    In a JAVA main class:
    String[] listUnitTest = {ClassA.class.getName(), ClassB.class.getName()}; //list of classname containing your units tests
    junit.textui.TestRunner.main(listUnitTest); //Text based
    junit.awtui.TestRunner.main(listUnitTest);//green mean all test successful red is bad in case of error, you see the stack and which test failed.
    junit.swingui.TestRunner.main(listUnitTest); //green mean all testcases successful red is badin case of error, you see the stack and which test failed.
    JUnit Testrunner in Eclipse is a standar View

    Testsuite
    Testsuite is a suite of testcase or method, you can give this testsuite to a testrunner.

    Some particular TestSuite

    Multi threading test
    If you need to have multiple threads hitting your class. ActiveTestSuite starts each test in its own thread However, ActiveTestSuite does not have a constructor which automatically adds all testXXX methods in a class to the test suite. I tried addTestSuite method with class name as the argument, but it added all tests in the class to run sequentially in the same thread. So, I had to manually add each test name to the ActiveTestSuite.
    public static Test suite() {
    TestSuite suite = new ActiveTestSuite();
    suite.addTest(new com.waltercedric.junit.ClassA ("testClonability"));
    suite.addTest(new com.waltercedric.junit.ClassA ("testSerialization"));
    suite.addTest(new com.waltercedric.junit.ClassA ("testRandom"));
    return suite;
    }

    public static void runTest (String[] args) {
    junit.textui.TestRunner.run( suite() );
    }

    Extensions
    JUNIT can be extended with 3rd party extensions, if you need some specials capabilities, refer to this page: JUNIT extensions

     

  • Log4J: A logging framework for J2EE

    Log4j homepage: http://jakarta.apache.org/log4j/

    Reference book on log4j:

    The Complete Log4j Manual

    by Ceki Gulcu
    Edition: Paperback

    Introduction
    Log4j is an open source tool (OSS) developed for inserting logs statements into your application and was developed by people at Apache fundation. It's speed and flexibility allows log statements to remain in shipped code while giving the user the ability to enable logging at runtime without modifying any of the application binary. All of this while not incurring a high performance cost/loss.

    Requirements

    • Log4j need at least a compatible JDK 1.1.x to run.
    • The DOMConfigurator is based on the DOM Level 1 API. The DOMConfigurator.configure(Element) method will work with any XML parser that will pass it a DOM tree. The DOMConfigurator.configure(String filename) method and its variants require a JAXP compatible XML parser, for example Xerces or Sun's parser. Compiling the DOMConfigurator requires the presence of a JAXP parser in the classpath.
    • The org.apache.log4j.net.SMTPAppender relies on the JavaMail API. It has been tested with JavaMail API version 1.2. The JavaMail API requires the JavaBeans Activation Framework package.
    • The org.apache.log4j.net.JMSAppender requires the presence of the JMS API as well as JNDI.
    • Log4j test code relies on the JUnit testing framework in order to maintain quality of release.

    Why inserting log statement or rely on this (old) technology?

    Advantages Drawbacks
    It offers several advantages. It provides precise context about a run of the application.
    Once inserted into the code:
    • It Help developer to develop and correct bugs,
    • Generation of logging output requires no human intervention,
    • Log output can be saved in persistent medium to be studied at a later time,
    • Rich logging package can also be viewed as an auditing tool, for example to determine performance...
    • Debugging statements stay with the program (for years) while debugging sessions are always transient (lifetime of bug resolution).
    • Log can make the glue between developer within a development environment and specialist within a production environment. The know how or description in log statements can help the production specialist to undestand how your application work.
    But
    • It can/May slow down an application.
    • If the program verbosity is high, it can pollute reader's mind, or lead to misanalyse of a problems.
      For example:
      - saying something false in a log statement can have tremendous effects...
      - Writing too much info (irrelevent), can hide some major error.

    Why choosing Log4J? (Fromapache.org)

    • log4j is optimized for speed. The system write has been rewrite for efficiency and is now asynchrone (compare to System.err)
    • log4j is based on a named logger hierarchy. (category)
    • log4j is fail-stop but not reliable.
    • log4j is thread-safe. No interblocking thread, or memory leaks.
    • log4j is not restricted to a predefined set of facilities.
    • Logging behavior can be set at runtime using a configuration file. Configuration files can be property files or in XML format.
    • log4j is designed to handle Java Exceptions from the start.
    • log4j can direct its output to a file, the console, an java.io.OutputStream, java.io.Writer, a remote server using TCP, a remote Unix Syslog daemon, to a remote listener using JMS, to the NT EventLog or even send e-mail. (Appenders)
    • log4j uses 5 levels, namely DEBUG, INFO, WARN, ERROR and FATAL.
    • The format of the log output can be easily changed by extending the Layout class.
    • The target of the log output as well as the writing strategy can be altered by implementations of the Appender interface.
    • log4j supports multiple output appenders per logger
    • log4j supports internationalization.
    • It is used extensively by thousands of Java developers. If a flaw is discovered it gets fixed in the next release.
    • The log4j code is likely to be better than code you'd write yourself and is l ikely to improve over time.
    • Ports to other languages are: C++, Eifel, Perl, .NET, Python, Ruby…more than 57 languages are supported

    Log4j concepts

    Logger Logger are responsible for handling the majority of log operations. The logger is the core component of the logging process.
    Levels Log4j by default can log messages with five priority levels (not including custom Levels). More can be defined by subclassing, but it is not recommended.

    debug to write debugging messages which should not be printed when the application is in production.
    log.debug("Starting init of RequestController");

    info for messages similar to the "verbose" mode of many applications.
    log.info("Analyser init successfull");

    warn for warning messages which are logged to some log but the application is able to carry on without a problem.
    log.warn("Inconsistent value in conf for key 'debug', line 123 assuming default value true");

    error for application error messages which are also logged to some log but, still, the application can hobble along. Such as when some administrator-supplied configuration parameter is incorrect and you fall back to using some hard-coded default value. You must use this level in all catch clause, if you can not resolve the exception!
    log.error("The object Account is null");

    fatal for critical messages, after logging of which the application quits abnormally
    log.fatal("Can not get any new connection from database");

    Notes:

    A logger will only output messages that are of a level greater than or equal to it. If the level of a logger is not set it will inherit the level of the closest ancestor. So if a logger is created in the package com.waltercedric.account and no level is set for it, it will inherit the level of the logger created in com.waltercedric. If no logger was created in com.waltercedric., the logger created in com.waltercedric.balance will inherit the level of the root logger, the root logger is always instantiated and available.

    Appender Appender
    1. Are responsible for controlling the output of log operations.
    2. Controls where and how logging result is store.

    The Appenders available are (from the log4j API)

    • ConsoleAppender: appends log events to System.out or System.err using a layout specified by the user. The default target is System.out
    • DailyRollingFileAppender extends FileAppender so that the underlying file is rolled over at a user chosen frequency.
    • FileAppender appends log events to a file.
    • RollingFileAppender extends FileAppender to backup the log files when they reach a certain size.
    • WriterAppender appends log events to a Writer or an OutputStream depending on the user's choice.
    • SMTPAppender sends an e-mail when a specific logging event occurs, typically on errors or fatal errors.
    • SocketAppender sends LoggingEvent objects to a remote a log server, usually a SocketNode.
    • SocketHubAppender sends LoggingEvent objects to a set of remote log servers, usually a SocketNodes
    • SyslogAppender sends messages to a remote syslog daemon.
    • TelnetAppender is a log4j appender that specializes in writing to a read-only socket.

    One may also implement the Appender interface to create ones own ways of outputting log statements.

    Layout Layout:
    1. Are responsible for formatting the output for Appender.
    2. Are always used by Appender
    3. Knows how to format the output.

    There are three types of Layout available:

    • HTMLLayout formats the output as a HTML table.
    • PatternLayout formats the output based on a conversion pattern specified, or if none is specified, the default conversion pattern.
    • SimpleLayout formats the output in a very simple manner, it prints the Level, then a dash '-' and then the log message.

    Using Log4j in your code

    It is not recommended to use log4j api directly, since who knows if a better logging framework won't do better in the future or if log4j won't modify its api's. The main idea is that when you aquire a 3rd party component, is to build a wrapper around it. It is even better if the wrapper contains an abstract factory: maybe in some case you wil have to use different class of logging (because of performance, licence...)

    A simple log4j wrapper
    Import com.waltercedric.LogWrapper;

    public LogWrapper {

    ...
    }

    Using your newly created wrapper
    Import com.waltercedric.LogWrapper;

    public void init() throws com.waltercedric.applicationException {

    LogWrapper logger = new LogWrapper(Account.class);
    logger.info("Starting init");

    logger.debug("create an Account");
    up = new Account(new NullObject());
    }

    Log4j Guidelines
    The FAQ of log4J is a must to read, here are the most important points:

    1. Respect Levels!
      Respect levels and categorize the logs according to severity and messages size. Please define a special logger (restricted to a package) that can be switch off and that do not write to much statement in log output.
    2. Meaningful statements
      Create code with System.err.println or System.out.println If you are doing some internal reviews of your code, please try to write some meaningful information in logs. Avoid log of type: "I am here", "here 1", "here 2" and so on..
    3. Classwide static logger
      It is recommended to provide a class wide logger access point, if you need to do a lot of output in a class or hierarchy. Define a protected Logger in the parent hierarchie
      public class Mamals {
      protected static LoggerWrapper logger = LogFactory.getLog(Mamals.class);
      ...
      }
      and use it in all children
      public class Human extends Mamals {

      public Human() {
      super();
      logger.debug("init");
      }

      }

    4. Increase speed
      Log4J is not slow, it is even faster than System.out or System.err (System.err or System.out are synchronous while NOT with log4j, the cost in times comes more from costs during formating messages!
      If you know that you must heavily formatted the output message, do not use the following:
      l.debug("Cash balance is " + cashvalue);
      use instead
      if(myLogger.isDebugEnabled()) {
      myLogger.debug("Cash balance is " + cashBalance.toXML());
      }
    5. How to name Loggers?
      You can name loggers by locality. It turns out that instantiating a logger in each class, with the logger name equal to the fully-qualified name of the class, is a useful and straightforward approach of defining loggers. This approach has many benefits:
    • It is very simple to implement.
    • It is very simple to explain to new developers.
    • It automatically mirrors your application's own modular design.
    • It can be further refined at will.
    • Printing the logger automatically gives information on the locality of the log statement.

    However, this is not the only way for naming loggers. A common alternative is to name loggers by functional areas. For example, the "database" logger, "RMI" logger, "security" logger, or the "XML" logger. You are totally free in choosing the names of your loggers. The log4j package merely allows you to manage your names in a hierarchy. However, it is your responsibility to define this hierarchy. Note by naming loggers by locality one tends to name things by functionality, since in most cases the locality relates closely to functionality.

    Remote logging over TCP
    Read carefully: http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/net/SocketAppender.html and
    http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/net/SocketHubAppender.html

    Starting the server.Chainsaw
    Chainsaw is a graphical logging client, where you can see, sort and filter logs data.
    Documentation can be read here: http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/chainsaw/package-summary.html and it is a part of log4j.jar

    Starting chainsaw
    c:jdk1.4.2binjava org.apache.log4j.chainsaw.Main "chainsaw.port", "5000"
    1. Log4 gives you the ability to send messages to a remote location over a socket for logging purposes. The org.apache.log4j.net.SocketAppender and org.apache.log4j.net.SocketServer classes are the key classes used in remote logging.
    2. Modify all logger in your log4j.xml to use a SocketApender as appender, Once you have loaded this configuration, all messages will be written to the machine and port that you specify.
    3. Start the client application (Chainsaw), this program will receive logs and show them in a swing GUI
    Example of TCP appender in log4j.xml
    log4j.appender.remote =org.apache.log4j.net.SocketAppender
    log4j.appender. remote.RemoteHost=localhost
    log4j.appender. remote.Port=5000
    log4j.appender. remote.LocationInfo=true

    On the server side (where your application create logs), you will need to run log4j's SocketServer class. You can create a configuration file with configuration information similar to the following: The whole applcation is in DEBUG mode

    Example of socketserver.properties
    log4j.rootCategory=DEBUG,log1

    ############################
    # log1 is set to be a file

    log4j.appender.log1=org.apache.log4j.RollingFileAppender
    log4j.appender.log1.MaxFileSize=100KB
    log4j.appender.log1.MaxBackupIndex=1
    log4j.appender.log1.File=c://logs.log
    log4j.appender.log1.append = true
    log4j.appender.log1.layout=org.apache.log4j.PatternLayout
    log4j.appender.log1.layout.ConversionPattern=%p %t %c - %m%n
    1. Set up your CLASSPATH on both the client and server to contain log4j.jar
    2. Run the SocketServer at the command line. The command line syntax for the SocketServer is as follows:
      java org.apache.log4j.net.SocketServer portNumber configurationFile configurationDirectory
      start the server:
    Start the server
    java org.apache.log4j.net.SocketServer 5000 C:socketserver.properties C:temp
    org.apache.log4j.net.SocketServer "5000", "C:socketserver.properties", "C:temp"

    Start your application, without doing any change in your code or recompiling it, you can now log data remotely!

    Configuring log4j

    Location of configuration file
    The configuration files of log4j must be in classpath, if more than one are in classpath, the first found will be used. Log4j require to have a compatible parser in classpath in order to read the configuration file. As default, Logj use Crimson.jar

    Location of DTD
    The DTD is needed in order to initialize log4j, 2 solutions are available:

    Public DTD, the file must be on internet or on network System path, but with a fix path (URI)

    "http://www.waltercedric.com/log4j.dtd">

    Extending log4j

    Defining your application specific loggers, appenders and layouts
    You can look at the Log4j API to see how to implement a logger, appender and layout.

    Conclusions

    One of the strength of log4j is that is do not require to recompile the java code to binary classes to change considerably the ouput amount in logs. You can add logging statements in your code, and without changing the code shipped, change at runtime the amount of log output. Thus the major behaviour logging strategies are done in this file (it can be a properties file or a XML file). You should store this file in the classpath of your application.

    Annexes

    Example of configuration files:

    Example of log4j.xml













































































    Example of log4j.properties
    ###########################################################################
    #
    # log4Java properties
    #
    # Documentation can be found at
    http://jakarta.apache.org/log4j/docs/api/index.html
    # There is no other documentation except forum, a commercial book is due (oreilly)
    #
    # To permit reloading during runtime, the LogDecorator will test each 60s if the file has changed
    # and update configuration of log4j if needed
    #
    # Ascending prioriy INFO < WARNING < DEBUG < ERROR < FATAL
    # log visible only if current log level >= defined level
    #
    # current layout can be: DateLayout, HTMLLayout, PatternLayout, SimpleLayout, XMLLayout
    #
    ###########################################################################

    # Set root logger level to [FATAL|ERROR|WARN|INFO|DEBUG], and provide default appender

    log4j.rootLogger=DEBUG, stdout

    ############################
    # define category (and their level [INHERITED|FATAL|ERROR|WARN|INFO|DEBUG] and appender)
    # category should be fully qualified class name or incomplete package name
    # Note that you inherit from the root logger otherwise specified (set addtivity flag)
    #
    # additivity= true (default) all request will also be forwarded to the hierarchy
    # -> log twice if the same appender is already in the hierarchy
    # additivity= false do not forward to ancestor appenders
    #
    # INHERITED can be optionally specified which means that named category should inherit
    # its priority from the category hierarchy. If you add the flag additivity to false,
    # you do not inherit of appender
    ##

    log4j.category.com.waltercedric.account=INHERIT, log1
    log4j.additivity.com.waltercedric.account=false

    log4j.category.com.waltercedric=DEBUG, log1

    ########################################################
    # You Can defined as many appender as you want
    ########################################################

    ############################
    # stdout is set to be a ConsoleAppender.
    ##

    log4j.appender.stdout=org.apache.log4j.ConsoleAppender
    log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
    see http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/PatternLayout.html
    log4j.appender.stdout.layout.ConversionPattern=%d %r [%t] %-5p %c - %m%n

    ##################################
    # log1 is set to be a file by date

    log4j.appender.log1=org.apache.log4j.DailyRollingFileAppender
    rollover each day at midnight, see DailyRollingFileAppender object
    log4j.appender.log1.DatePattern='.'yyyy-MM- dd
    by size
    #log4j.appender.log1=org.apache.log4j.RollingFileAppender
    #log4j.appender.log1.MaxFileSize=100KB
    #log4j.appender.log1.MaxBackupIndex=1


    #/WEB-INF/conf/Log4j.properties
    log4j.appender.log1.File=c://VirtualTransport.log
    log4j.appender.log1.append = true
    log4j.appender.log1.layout=org.apache.log4j.PatternLayout
    see http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/PatternLayout.html
    #-4r [%t] %-5p %c %x - %m%n lead to 331 [main] ERROR com.waltercedric.account - classCastexception-->

    log4j.appender.log1.layout.ConversionPattern=%p %t %c - %m%n

    ############################
    # eMail logging
    #
    # SMTPAppender will store all the logging events on an
    # internal cache and it will send all the messages when
    # the TriggeringEventEvaluator you set with the
    # setEvaluatorMethod or the constructor parameter return true.
    # By default the evaluator is set with an instance of
    # DefaultEvaluator wich is a package-private class
    # defined in the same compilation unit of SMTPAppender.
    # This evaluator will return true only when the logging
    # event has a priority greater or equal than ERROR.
    ##

    log4j.appender.email=org.apache.log4j.net.SMTPAppender
    log4j.appender.email.Threshold=FATAL
    log4j.appender.email.SMTPHost=XXX.XXX.XXX.XXX
    log4j.appender.email.To=This email address is being protected from spambots. You need JavaScript enabled to view it.
    log4j.appender.email.From=This email address is being protected from spambots. You need JavaScript enabled to view it.
    log4j.appender.email.Subject=A Fatal error has occured in your application
    log4j.appender.email.BufferSize=1
    log4j.appender.email.layout=org.apache.log4j.PatternLayout
    see http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/PatternLayout.html
    log4j.appender.email.ConversionPattern=%d{ABSOLUTE} (%F:%L) - %m%n

    ############################
    # remote socket server logging
    #
    # The SocketAppender has the following properties:
    # please read: http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/net/SocketAppender.html
    #
    # If you want to have a server that listen, you can start the following utilities Chainsaw
    # (swing gui) read how at http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/chainsaw/package-summary.html
    # Chainsaw is a particular server!
    ##

    log4j.appender.CHAINSAW_CLIENT=org.apache.log4j.net.SocketAppender
    log4j.appender.CHAINSAW_CLIENT.RemoteHost=localhost
    log4j.appender.CHAINSAW_CLIENT.Port=5000
    log4j.appender.CHAINSAW_CLIENT.LocationInfo=true

    Resources

  • &160;

    First a big thanks toPackt Publishing for having sent me this book to review! I did enjoy going through this book, while I did not learn a lot of new stuff (I am using Apache Maven daily since 2006!), I found it to be concise and would recommend it anytime to any of my colleagues. But let’s go through my review of this cookbook of over 50 recipes towards optimal Java Software Engineering with Maven 3:

    Apache Maven 3 Cookbook is a clear, precise, well-written book that gives readers clear recipes for the release process using Apache Maven 3. The authors give a step-by-step account of expectations and hurdles for software development.

    The first few chapters quickly bring you to the point to be comfortable using Maven on straightforward projects, and the later chapters provide even more recipes examples on subjects like running a Repository Manager, Writing Plugins, and details on various techniques. The book also covers numerous real world software delivery issues such as multi-module projects, web/enterprise projects, dependency management, automatic testing and documentation.

    To sum up key points from this 224 pages book in a few bullets:

  • Chapter 1: Basics of Apache Maven: Setting up Apache Maven on Windows/Linux/Mac, Creating a new project, Understanding the Project Object Model, build lifecycle and build profiles,
  • Chapter 2: Software Engineering Techniques: Build automation, modularization, Dependency management, Source code quality check, Test Driven Development (TDD), Acceptance testing automation and Deployment automation,
  • Chapter 3: Agile Team Collaboration: Creating centralized remote repositories, Performing continuous integration with Hudson, Integrating source code management, Team integration with Apache Maven, Implementing environment integration, Distributed development and Working in offline mode,
  • Chapter 4: Reporting and Documentation: javadocs, unit tests, coverage reports and Maven dashboard setup,
  • Chapter 5: Java Development with Maven: Java web application, J2EE, Spring, Hibernate and JBoss SEAM development,
  • Chapter 6: Google Development with Maven: Android and GWT (Google Web Toolkit), Google App Engine deployment,
  • Chapter 7: Scala, Groovy, and Adobe Flex
  • Chapter 8: IDE Integration
  • Chapter 9: Extending Apache Maven: creating plugins using Java, Apache ANT or Ruby,
  • The author Srirangan go into detail in describing each of these themes.&160;

    I recommend you this book if

  • If you need to learn Apache Maven quickly, you can go through the recipes and examples and come away with a good knowledge of Maven.
  • If you are currently implementing Apache Maven for the first time in your development process and feel a bit lost by the lack of clear examples that just run.
  • If you want to use proven solutions to real common engineering challenges: this book will save you a lot of time!
  • &160;

    if you want to be able to deliver your software to any target environment, using continuous delivery processes, chances are high that Apache Maven is the right tool for this job, and this book should be part of your technical library, beside also of course the free online book of Sonatype Maven: The Complete Reference

  • Thanks to Packt Publishing for having sent me this book to review. I will publish a review in the next coming days

    • Grasp the fundamentals and extend Apache Maven 3 to meet your needs
    • Implement engineering practices in your application development process with Apache Maven
    • Collaboration techniques for Agile teams with Apache Maven
    • Use Apache Maven with Java, Enterprise Frameworks, and various other cutting-edge technologies
    • Develop for Google Web Toolkit, Google App Engine, and Android Platforms using Apache Maven

    Apache_Maven3_Cookbook

    You may also consider reading all my articles related to Apache Maven

  • Got this email from Cyprian Sniegota, he did develop a Maven Archetype for easing development of Joomla extensions. His archetype currently support the creation of a skeleton for components, modules, plugins and templates.

    I noticed some time ago that you described combination of Joomla! and Maven. Few weeks ago i wrote joomla-maven-plugin with skeleton projects (sources: bitbucket.org/deviapps) based on php-maven.org work.
    Here is short description http://deviapps.com/create-joomla-extension-with-maven and 5 min video (in Polish so far) http://www.youtube.com/watch?v=aE8w9EZciTg
    I hope you will be interested.

    Thanks to him for having written this project. I will also try to Maven-ize what Joomla has done with Ant in the future (I prefer now crystal clear software lifecycle )

  •  apache_maven

    In this small post I will show you how to deploy automatically some artifacts of your build into bea_logo1Weblogic 10.3 by using the weblogic-maven-plugin

    This plugin will support various tasks within the Weblogic 8.1 and 9.x environment. Such tasks as deploy, undeploy,clientgen,servicegen, and appc are supported as well as many others. The plugin uses exposed API's that are subject to change but have been tested in 8.1 SP 4-6 and 9.0 - 9.2 MP3. There are two versions of the plugin to support the two environments based on differences in the JDK. The 9.x version is currently being refactored to support the standard JSR supported deployment interface

  •  apache_maven

    In this small post I will show you how to deploy automatically some artifacts of your build into bea_logo1Weblogic 10.3 by using the weblogic-maven-plugin

    This plugin will support various tasks within the Weblogic 8.1 and 9.x environment. Such tasks as deploy, undeploy,clientgen,servicegen, and appc are supported as well as many others. The plugin uses exposed API's that are subject to change but have been tested in 8.1 SP 4-6 and 9.0 - 9.2 MP3. There are two versions of the plugin to support the two environments based on differences in the JDK. The 9.x version is currently being refactored to support the standard JSR supported deployment interface

  • apache_maven

    Questions for the official certification.

     JavaBlackBelt is a community for Java & open source skills assessment. It is dedicated to technical quizzes about Java related technologies. This is the place where Java developers have their technology knowledge and development abilities recognized. Everybody is welcome to take existing and build new exams.

     

    maven.the.definitive.guide BetterBuildsWithMaven

    Maven: The Definitive Guide (Readable HTML alpha release)

    Better Builds with Maven (Free PDF)

    • Covers:Maven 2.0.4
    • Publisher:DevZuz
    • Published:March 2006
    • Authors: John Casey, Vincent Massol, Brett Porter, Carlos Sanchez

      Better Builds with Maven is a comprehensive 'How-to' guide for using Maven 2.0 to better manage the build, test and release cycles associated with software development. The chapters include:

      • An introduction to Maven 2.0
      • Creating, compiling and packaging your first project
      • Best practices and real-world examples
      • Building J2EE Applications
      • Extending builds by creating your own Maven plugins
      • Monitoring the health of source code, testing, dependencies and releases
      • Team collaboration and utilising Continuum for continuous integration
      • Converting existing Ant builds to Maven
    0596007507_cat  

    Maven: A Developer's Notebook

     

     

     

  • apache_maven

    cargo-banner-left

    Following the post about Deploy to Tomcat 6 using Maven, here is a ready to use example with the main differences explained in the table below

      Tomcat 7 Tomcat 6
    containerId <containerId>tomcat7x</containerId> <containerId>tomcat6x</containerId>
    Url of Tomcat manager <cargo.remote.uri> <cargo.tomcat.manager.url>
    example http://host..com/manager/text/ http://host..com/manager/
    tomcat-users.xml

    <tomcat-users>
    <role rolename="manager-gui"/>
    <role rolename="manager-script"/>
    <role rolename="manager-jmx"/>
    <role rolename="manager-status"/>
    <user username="admin" password="admin" roles="manager-gui,manager-script"/>
    </tomcat-users>

    <tomcat-users>
      <role rolename="manager"/>
      <user username="admin" password="admin" roles="manager"/>
    </tomcat-users>

    And finally a snippet of an Apache Maven pom.xml ready to use in a profile, so you can reuse this profile like a method call

    <profile>
     <id>deployTomcat</id>
    <activation>
      <activeByDefault>false</activeByDefault>
    </activation>
    <build>
     <plugins>
        <plugin>
         <groupId>org.codehaus.cargo</groupId>
         <artifactId>cargo-maven2-plugin</artifactId>
         <version>1.1.0</version>
        <configuration>
         <wait>true</wait>
         <container>
          <containerId>tomcat7x</containerId>
          <type>remote</type>
         </container>
         <configuration>
          <type>runtime</type>
          <properties>
           <cargo.remote.uri>
             ${tomcat.url}
           </cargo.remote.uri>
           <cargo.remote.username>
              ${tomcat.user}     
           </cargo.remote.username>
            <cargo.remote.password>
              ${tomcat.pwd}
            </cargo.remote.password>
          </properties>
          </configuration>
          <deployer>
           <type>remote</type>
           <deployables>
           <deployable>
            <groupId>${deploy.groupid}</groupId>
            <artifactId>${deploy.artifactid}</artifactId>
            <type>war</type>
            <properties>
             <context>${deploy.context}</context>
            </properties>
           </deployable>
          </deployables>
         </deployer>
        </configuration>
        <executions>
         <execution>
          <id>verify-deploy</id>
          <phase>pre-integration-test</phase>
          <goals>
           <goal>deployer-undeploy</goal>
           <goal>deployer-deploy</goal>
          </goals>
         </execution>
        </executions>
        </plugin>
     </plugins>
    </build>
    </profile>

    Place as many profiles as you have machine to deploy in settings.xml and declare some variables as properties, as shown below:

    <profile>
     <id>serverA</id>
     <activation>
        <activeByDefault>false</activeByDefault>
     </activation>
     <properties>
        <tomcat.url>http://host.com/manager/text</tomcat.url>
        <tomcat.user>admin</tomcat.user>
        <tomcat.pwd>admin</tomcat.pwd>
        <!-- these properties must be defined
           as system property or -D -->
        <!-- - deployable.artifactid:
             artifactId of web application to be deployed -->
        <!-- - deployable.context: web context name -->
     </properties>
    </profile>

    So you can run, and traget multiple host by just exchanging the name of the profile serverA to something else.

    mvn integration-test –PdeployTomcat,serverA
       –Ddeployable.artifactid=demo
       -Ddeploy.groupid=com.mycompany
       –Ddeployable.context=showcase
  • apache_maven

    cargo-banner-left

    Following the post about Deploy to Tomcat 6 using Maven, here is a ready to use example with the main differences explained in the table below

      Tomcat 7 Tomcat 6
    containerId <containerId>tomcat7x</containerId> <containerId>tomcat6x</containerId>
    Url of Tomcat manager <cargo.remote.uri> <cargo.tomcat.manager.url>
    example http://host..com/manager/text/ http://host..com/manager/
    tomcat-users.xml

    <tomcat-users>
    <role rolename="manager-gui"/>
    <role rolename="manager-script"/>
    <role rolename="manager-jmx"/>
    <role rolename="manager-status"/>
    <user username="admin" password="admin" roles="manager-gui,manager-script"/>
    </tomcat-users>

    <tomcat-users>
      <role rolename="manager"/>
      <user username="admin" password="admin" roles="manager"/>
    </tomcat-users>

    And finally a snippet of an Apache Maven pom.xml ready to use in a profile, so you can reuse this profile like a method call

    <profile>
     <id>deployTomcat</id>
    <activation>
      <activeByDefault>false</activeByDefault>
    </activation>
    <build>
     <plugins>
        <plugin>
         <groupId>org.codehaus.cargo</groupId>
         <artifactId>cargo-maven2-plugin</artifactId>
         <version>1.1.0</version>
        <configuration>
         <wait>true</wait>
         <container>
          <containerId>tomcat7x</containerId>
          <type>remote</type>
         </container>
         <configuration>
          <type>runtime</type>
          <properties>
           <cargo.remote.uri>
             ${tomcat.url}
           </cargo.remote.uri>
           <cargo.remote.username>
              ${tomcat.user}     
           </cargo.remote.username>
            <cargo.remote.password>
              ${tomcat.pwd}
            </cargo.remote.password>
          </properties>
          </configuration>
          <deployer>
           <type>remote</type>
           <deployables>
           <deployable>
            <groupId>${deploy.groupid}</groupId>
            <artifactId>${deploy.artifactid}</artifactId>
            <type>war</type>
            <properties>
             <context>${deploy.context}</context>
            </properties>
           </deployable>
          </deployables>
         </deployer>
        </configuration>
        <executions>
         <execution>
          <id>verify-deploy</id>
          <phase>pre-integration-test</phase>
          <goals>
           <goal>deployer-undeploy</goal>
           <goal>deployer-deploy</goal>
          </goals>
         </execution>
        </executions>
        </plugin>
     </plugins>
    </build>
    </profile>

    Place as many profiles as you have machine to deploy in settings.xml and declare some variables as properties, as shown below:

    <profile>
     <id>serverA</id>
     <activation>
        <activeByDefault>false</activeByDefault>
     </activation>
     <properties>
        <tomcat.url>http://host.com/manager/text</tomcat.url>
        <tomcat.user>admin</tomcat.user>
        <tomcat.pwd>admin</tomcat.pwd>
        <!-- these properties must be defined
           as system property or -D -->
        <!-- - deployable.artifactid:
             artifactId of web application to be deployed -->
        <!-- - deployable.context: web context name -->
     </properties>
    </profile>

    So you can run, and traget multiple host by just exchanging the name of the profile serverA to something else.

    mvn integration-test –PdeployTomcat,serverA
       –Ddeployable.artifactid=demo
       -Ddeploy.groupid=com.mycompany
       –Ddeployable.context=showcase