For v2003.06.01 Release $Revision: 1.39 $ Support: ------------- Language : Java Features : Component Testing - Code Coverage - Performance Profiling - Memory Profiling - Trace Tested Against: ------------------------ Host Machine : Windows 2000 Compiler : IBM J9 Java Virtual Machine Linker : IBM J9 Java Virtual Machine Debugger : IBM J9 Java Virtual Machine OS : Native Target : Native java jar -g -warn:none J2ME_RESTRICTION true SOCKET_UPLOAD false SOCKET_UPLOAD_DELIMITER ^ DEFAULT_BOOTCLASSPATH /usr/local/vame1.4/ive/lib/jclMax/classes.zip ENV_PATH /usr/local/vame1.4/ive/bin:$ENV{'PATH'} COMPILER j9c VIRTUALMACHINE j9 JAR jxelink JCL_VAL -jcl:max DEBUGGER j9 sub atl_cc($$$$\@\@) { my ( $lang,$src,$outDir,$cflags,$Defines,$Includes) = @_; # build the classpath # build the classpath my $separator = ($OSNAME eq "win32") ? ";" : ":"; my $classpath = &BuildCompleteJavaClassPath("-classpath ", $separator); my $COMP = $Ini{'COMPILER'}; if ( !$COMP ) { print "Error: no compiler known for target (lang:\"$lang\")\n"; return 1; } my $status=0; &CreateDirectory( "$outDir/classes" ); $status=SystemP( "$COMP -d \"$outDir/classes\" $classpath \"$src\" $cflags" ); return $status; } 1; sub atl_link($\@$\@$) { my ($OutputFile,$Objects,$Manifest,$JarOtherDir,$OutputDir) = @_; # build the classpath # build the classpath my $separator = ($OSNAME eq "win32") ? ";" : ":"; my $classpath = &BuildJavaClassPath("-cp ", $separator); my $status=0; &CreateDirectory( "$OutputDir/tmpclasses" ); # Build jar file: my $JAR = $Ini{'JAR'}; if ( !$JAR ) { print "Error: no jar command known for target\n"; return 1; } $status=SystemP( "$JAR $classpath -includeResource $Manifest -outputType jar -srcDir \"$OutputDir/classes\" -o \"$OutputFile\" " ); return $status if ($status > 0); foreach $res (@$JarOtherDir) { $status=SystemP( "$JAR $classpath -includeResource $Manifest -outputType jar -srcDir \"$res\" -o \"$OutputFile\" " ); return $status if ($status > 0); } return $status; } 1; sub atl_exec($$$) { my ($JarFile,$MainClass,$Parameters) = @_; # get the jcl configuration. my $JCL = $Ini{'JCL_VAL'}; # build the boot classpath my $separator = ($OSNAME eq "win32") ? ";" : ":"; my $bootclasspath = &BuildJavaBootClassPath("-bp:", $separator); # build the classpath my $application = $JAVA_BUILDJARFILE ? $JarFile : "$INTDIR/classes"; my $classpath = &BuildJavaClassPath("-cp:", $separator, $application); my $VMachine = $Ini{'VIRTUALMACHINE'}; # build the JVMPI parameter and path if any my $jvmpi_args = &BuildJvmpiArgs("-Xrun", ""); my $jvmpi_path = &GetJvmpiPath; my $status = 0; if ($jvmpi_path) { if ($OSNAME eq "win32") { $ENV{'PATH'} = "$ENV{'PATH'};$jvmpi_path"; } else { $ENV{'LD_LIBRARY_PATH'} = "$ENV{'LD_LIBRARY_PATH'}:$jvmpi_path"; } } $status = SystemP( "$VMachine $JCL $jvmpi_args $VIRTUAL_MACHINE_ARGUMENTS $bootclasspath $classpath $AdditionalOptions $MainClass " ); return $status; } sub atl_execdbg($$$) { my ($exe,$out,$parameters) = @_; my ( $JarFile, $MainClass, $AdditionalOptions )= @_; # build the classpath # build the classpath my $separator = ($OSNAME eq "win32") ? ";" : ":"; my $classpath = &BuildJavaClassPath("-cp:", $separator); $classpath .= ":\"$JarFile\""; # get the jcl configuration. my $JCL = $Ini{'DEFAULT_JCL'}; # build the boot classpath my $bootclasspath = &BuildJavaBootClassPath("-bp:", $separator); # build the JVMPI parameter and path if any my $jvmpi_args = &BuildJvmpiArgs("-Xrun", ""); my $jvmpi_path = &GetJvmpiPath; my $Debugger = $Ini{'DEBUGGER'}; SystemP( "xterm -e $Debugger $JCL $jvmpi_args $VIRTUAL_MACHINE_ARGUMENTS $bootclasspath $classpath $AdditionalOptions $MainClass" ); return 0; } 1; If you want to change the javic instrumenter written in perl, simply copy the contents of the lib/scripts/javic_j.pl here then modify it. die "Environment variable TESTRTDIR not found. Exiting.\n" if(!defined($ENV{'TESTRTDIR'})); # NO TRANSLATION require "$ENV{'TESTRTDIR'}/lib/scripts/javic_j.pl"; 1; import java.io.*; JAVA_USR static { // Nothing to do } JAVA_USR static String UTF_8_unsupported = null; public static void waitForThreads() { Thread tab[] = new Thread[Products.max_threads]; while ( true ) { Thread current = Thread.currentThread ( ); current.yield(); int count = Thread.enumerate ( tab ); boolean wait = false; for ( int i = 0; i < tab.length; i++ ) { if ( tab[i] == null ) continue; if ( ( tab[i] != current ) && ( ! tab[i].isDaemon ( ) ) && ( tab[i].isAlive ( ) ) ) { wait = true; break; } } if ( wait ) { try { current.sleep(1000); } catch(InterruptedException E) { } } else { break; } } } public static byte [] threadName() { String name = Thread.currentThread().getName ( ); if ( name != null ) { try { return name.getBytes ( "UTF-8" ); } catch ( java.io.UnsupportedEncodingException e ) { if ( UTF_8_unsupported == null ) { UTF_8_unsupported = new String ( "<UTF-8 unsupported>" ); } return ( UTF_8_unsupported.getBytes ( ) ); } } return null; } JAVA_USR public static java.io.OutputStream out_testrt = null; static final byte out_delimiter = (byte)'^'; public static void outOpen() { if (out_testrt == null) { try { out_testrt = new FileOutputStream ( Products.out_file ); } catch ( IOException e ) { System.err.println ( "TestRT: java.io.IOException in com.rational.testrealtime.Custom.outOpen" ); out_testrt = null; } } } public static void outWrite(byte[] buffer, int index) { if ( out_testrt == null ) { return; } try { out_testrt.write ( buffer, 0, index ); } catch ( java.io.IOException e ) { System.err.println ( "ERROR - com.rational.testrealtime.Custom: Cannot write to OutputStream: " ); } } public static void outClose() { if ( out_testrt == null ) { return; } try { out_testrt.close ( ); } catch ( java.io.IOException e ) { System.err.println ( "ERROR - com.rational.testrealtime.Custom: Cannot close OutputStream: " ); e.printStackTrace(); } } public static void pushError ( String msg ) { System.err.println ( msg ); } JAVA_USR static byte clock_unit[] = { (byte)'m', (byte)'s' }; public static long getClock() { return java.lang.System.currentTimeMillis ( ); } public static byte[] getClockUnit() { return clock_unit; } /* Add any extra includes or code */ JVMPI_STD JVMPI_USR int void *jvmpi_usr_malloc(JVMPI_SIZE_T size) { /* Code here the memory allocation function */ void *ptr=0; return(ptr); } void jvmpi_usr_free(void *ptr) { /* Code here the free function */ } JVMPI_STD JVMPI_USR FILE * JVMPI_FILE_TYPE jvmpi_usr_open(char *fileName) { /* Code here the open function */ JVMPI_FILE_TYPE f=(JVMPI_FILE_TYPE)0; return(f); } void *jvmpi_usr_write(JVMPI_FILE_TYPE file,char *buffer,int len) { /* Code here the write function */ } void *jvmpi_usr_close(JVMPI_FILE_TYPE file) { /* Code here the close function */ } JVMPI_STD JVMPI_USR void *jvmpi_usr_error(char *message) { /* Code here the error-print function */ printf("%s\n",message); } JVMPI_STD JVMPI_USR int jvmpi_usr_strncmp(const char *s1, const char *s2,JVMPI_SIZE_T n) { /* Code here the strncmp function */ } int jvmpi_usr_strcmp(const char *s1, const char *s2) { /* Code here the strcmp function */ return(0); } char *jvmpi_usr_strcpy(char *dest,const char *src) { /* Code here the strcpy function */ return(0); } char *jvmpi_usr_strstr(const char *haystack, const char *needle) { /* Code here the strstr function */ return(0); } JVMPI_SIZE_T jvmpi_usr_strlen(const char *s) { /* Code here the strlen function */ return(0); } JVMPI_STD JVMPI_USR unsigned long jvmpi_usr_getDateInMilliSec(void) { /* Code here the getDate function and return milliseconds */ } JVMPI_STD JVMPI_USR JVMPI_NONE int JVMPI_SOCKET_ID jvmpi_usr_connect(char *address,char *port) { /* Code here the connect function */ } int jvmpi_usr_recv(JVMPI_SOCKET_ID s,char *buffer,int len) { /* Code here the receive function */ } int jvmpi_usr_send(JVMPI_SOCKET_ID s,char *buffer,int len) { /* Code here the send function */ } int jvmpi_usr_socket_close(JVMPI_SOCKET_ID s) { /* Code here the close function */ } /* Add any extra code */ make --no_gen_finalize