Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

  1. the code has been compiled with the debug option on
  2. the source code is available,
  3. session data is available in a local file,
  4. a relevant metadata file exists.

See also: QA-helper tool configuration

Command line recipe

Prerequisite

...

$root=When you have your Sakai source code
$target=Where you want your condensed tree
$filter=The directory pattern to search for

Code Block
borderStylesolid
titleExample source code condenserborderStylesolid
#!/usr/bin/perl
use File::Copy;
use File::Find;

my $root="/home/alan/temp/coverage/src/trunk";
my $target="/home/alan/temp/coverage/src/condensed_trunk";
my $filter="src/java/";
my @parts;

print "Copying and condensing source ready for htmlzing\n";
mkdir("$target", 0755) || die "Cannot mkdir $target: $!";
find (\&wanted, $root);

sub wanted{
    @parts=split(/$filter/,$File::Find::name);
    if ((-d $_)&&($parts[1] ne "")){
        if (!(-d "$target/$parts[1]" )){
             mkdir("$target/$parts[1]", 0755) || die "Cannot mkdir $target/$parts[1]: $!";
        }
    }else{
        if ($_=~/.java$/){
             copy($File::Find::name,"$target/$parts[1]");
        }
    }
}

...

{$JAVA_HOME}/bin/java emma

Code Block
borderStylesolid
titleResulting outputborderStylesolid
emma usage: emma <command> command options,
  where <command> is one of:

   run     application runner same as 'emmarun' tool;
   instr   offline instrumentation processor;
   ctl     remote control processor;

   merge   offline data file merge processor.
   report  offline report generator;

  use '<command> -h' to see usage help for a given command

EMMA v2.1, build 5320 (stable)

...

Assuming you are running from a *NIX environment and the now standard bash environment and the target Sakai server has been shutdown. Otherwise, you will need to expand the variables and add the full paths.

Code Block
java emma instr -ix - -ip {$SAKAI_HOME}/webapps/{$EMMA_INST}/WEB-INF/classes -m overwrite
-out= {$EMMA_REPORT_HOME}/{$EMMA_INST}.em

...

Result: The code for the sakai-login-tool is now instrumented and a metadata file sakai-login-tool.em has been created in the report directory.
Otherwise, you will need to expand the variables and add the full paths.

Generate report

Restart your server.
Near the beginning of the logging you will see an entry mentioning Emma is alive and listening at a given port number.

...