Skip to content
Snippets Groups Projects
Commit 0c7183d6 authored by Arthur Coolen's avatar Arthur Coolen
Browse files

BugID: 604

This was needed for the initial RMI/JNI test for OTB. Can be placed on the
Attic  now.
parent 2d0d96b3
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 1291 deletions
SUBDIRS=src test
include $(top_srcdir)/Makefile.common
#!/bin/sh
../../autoconf_share/bootstrap ../../autoconf_share
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<project name="OTBTest" default="default" basedir=".">
<description>Builds, tests, and runs the project OTBTest.</description>
<import file="nbproject/build-impl.xml"/>
<!--
There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. They are:
-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-single: called before javac compilation of single file
-post-compile-single: called after javac compilation of single file
-pre-compile-test: called before javac compilation of JUnit tests
-post-compile-test: called after javac compilation of JUnit tests
-pre-compile-test-single: called before javac compilation of single JUnit test
-post-compile-test-single: called after javac compilation of single JUunit test
-pre-jar: called before JAR building
-post-jar: called after JAR building
-post-clean: called after cleaning build products
(Targets beginning with '-' are not intended to be called on their own.)
Example of inserting an obfuscator after compilation could look like this:
<target name="-post-compile">
<obfuscate>
<fileset dir="${build.classes.dir}"/>
</obfuscate>
</target>
For list of available properties check the imported
nbproject/build-impl.xml file.
Another way to customize the build is by overriding existing main targets.
The targets of interest are:
-init-macrodef-javac: defines macro for javac compilation
-init-macrodef-junit: defines macro for junit execution
-init-macrodef-debug: defines macro for class debugging
-init-macrodef-java: defines macro for class execution
-do-jar-with-manifest: JAR building (if you are using a manifest)
-do-jar-without-manifest: JAR building (if you are not using a manifest)
run: execution of project
-javadoc-build: Javadoc generation
test-report: JUnit report generation
An example of overriding the target for project execution could look like this:
<target name="run" depends="OTBTest-impl.jar">
<exec dir="bin" executable="launcher.exe">
<arg file="${dist.jar}"/>
</exec>
</target>
Notice that the overridden target depends on the jar target and not only on
the compile target as the regular run target does. Again, for a list of available
properties which you can use, check the target you are overriding in the
nbproject/build-impl.xml file.
-->
</project>
dnl
dnl Process this file with autoconf to produce a configure script.
dnl
AC_INIT
dnl AC_CONFIG_AUX_DIR(config)
dnl AM_CONFIG_HEADER(config/config.h)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(OTBTest, 1.0, no-define)
dnl Initialize for LOFAR (may set compilers)
lofar_INIT
dnl Checks for programs.
AC_PROG_AWK
AC_PROG_YACC
AC_PROG_CC
AC_PROG_CXX
AM_PROG_LEX
AC_PROG_INSTALL
AC_PROG_LN_S
AC_DISABLE_SHARED
AC_PROG_LIBTOOL
dnl Checks for libraries.
dnl dnl Replace `main' with a function in -lfl:
dnl AC_CHECK_LIB(fl, main)
dnl dnl Replace `main' with a function in -lcosev_r:
dnl AC_CHECK_LIB(cosev_r, main)
dnl dnl Replace `main' with a function in -lcosnm_r:
dnl AC_CHECK_LIB(cosnm_r, main)
dnl dnl Replace `main' with a function in -lorb_r:
dnl AC_CHECK_LIB(orb_r, main)
dnl dnl Replace `main' with a function in -lpthread:
dnl AC_CHECK_LIB(pthread, main)
dnl dnl Replace `main' with a function in -lvport_r:
dnl AC_CHECK_LIB(vport_r, main)
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
dnl Checks for library functions.
AC_FUNC_VPRINTF
dnl
dnl Check for LOFAR specific things
dnl
lofar_GENERAL
dnl lofar_BLITZ
dnl lofar_MPI
dnl lofar_PACKAGE(LCS/Common)
dnl
dnl Output Makefiles
dnl
AC_OUTPUT(
src/Makefile
test/Makefile
Makefile
)
Manifest-Version: 1.0
X-COMMENT: Main-Class will be added automatically by build
<?xml version="1.0" encoding="UTF-8"?>
<!--
*** GENERATED FROM project.xml - DO NOT EDIT ***
*** EDIT ../build.xml INSTEAD ***
For the purpose of easier reading the script
is divided into following sections:
- initialization
- compilation
- jar
- execution
- debugging
- javadoc
- junit compilation
- junit execution
- junit debugging
- applet
- cleanup
-->
<project name="OTBTest-impl" default="build" basedir="..">
<target name="default" depends="test,jar,javadoc" description="Build and test whole project."/>
<!--
======================
INITIALIZATION SECTION
======================
-->
<target name="-pre-init">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="-init-private" depends="-pre-init">
<property file="nbproject/private/private.properties"/>
</target>
<target name="-init-user" depends="-pre-init,-init-private">
<property file="${user.properties.file}"/>
<!-- The two properties below are usually overridden -->
<!-- by the active platform. Just a fallback. -->
<property name="default.javac.source" value="1.4"/>
<property name="default.javac.target" value="1.4"/>
</target>
<target name="-init-project" depends="-pre-init,-init-private,-init-user">
<property file="nbproject/project.properties"/>
</target>
<target name="-do-init" depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property">
<available file="${manifest.file}" property="manifest.available"/>
<condition property="manifest.available+main.class">
<and>
<isset property="manifest.available"/>
<isset property="main.class"/>
<not>
<equals arg1="${main.class}" arg2="" trim="true"/>
</not>
</and>
</condition>
<available property="have.tests" file="${test.src.dir}"/>
<condition property="netbeans.home+have.tests">
<and>
<isset property="netbeans.home"/>
<isset property="have.tests"/>
</and>
</condition>
<condition property="no.javadoc.preview">
<isfalse value="${javadoc.preview}"/>
</condition>
<property name="run.jvmargs" value=""/>
<property name="javac.compilerargs" value=""/>
<property name="work.dir" value="${basedir}"/>
<condition property="no.deps">
<and>
<istrue value="${no.dependencies}"/>
</and>
</condition>
</target>
<target name="-post-init">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="-init-check" depends="-pre-init,-init-private,-init-user,-init-project,-do-init">
<fail unless="src.dir">Must set src.dir</fail>
<fail unless="test.src.dir">Must set test.src.dir</fail>
<fail unless="build.dir">Must set build.dir</fail>
<fail unless="dist.dir">Must set dist.dir</fail>
<fail unless="build.classes.dir">Must set build.classes.dir</fail>
<fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
<fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
<fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
<fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
<fail unless="dist.jar">Must set dist.jar</fail>
</target>
<target name="-init-macrodef-property">
<macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
<attribute name="name"/>
<attribute name="value"/>
<sequential>
<property name="@{name}" value="${@{value}}"/>
</sequential>
</macrodef>
</target>
<target name="-init-macrodef-javac">
<macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/1">
<attribute name="srcdir" default="${src.dir}"/>
<attribute name="destdir" default="${build.classes.dir}"/>
<attribute name="classpath" default="${javac.classpath}"/>
<attribute name="debug" default="${javac.debug}"/>
<element name="customize" optional="true"/>
<sequential>
<javac srcdir="@{srcdir}" destdir="@{destdir}" debug="@{debug}" deprecation="${javac.deprecation}" source="${javac.source}" target="${javac.target}" includeantruntime="false">
<classpath>
<path path="@{classpath}"/>
</classpath>
<compilerarg line="${javac.compilerargs}"/>
<customize/>
</javac>
</sequential>
</macrodef>
</target>
<target name="-init-macrodef-junit">
<macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/1">
<attribute name="includes" default="**/*Test.java"/>
<sequential>
<junit showoutput="true" fork="true" dir="${basedir}" failureproperty="tests.failed" errorproperty="tests.failed">
<batchtest todir="${build.test.results.dir}">
<fileset dir="${test.src.dir}" includes="@{includes}"/>
</batchtest>
<classpath>
<path path="${run.test.classpath}"/>
</classpath>
<syspropertyset>
<propertyref prefix="test-sys-prop."/>
<mapper type="glob" from="test-sys-prop.*" to="*"/>
</syspropertyset>
<formatter type="brief" usefile="false"/>
</junit>
</sequential>
</macrodef>
</target>
<target name="-init-macrodef-nbjpda">
<macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
<attribute name="name" default="${main.class}"/>
<attribute name="classpath" default="${debug.classpath}"/>
<attribute name="stopclassname" default=""/>
<sequential>
<nbjpdastart transport="dt_socket" addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}">
<classpath>
<path path="@{classpath}"/>
</classpath>
</nbjpdastart>
</sequential>
</macrodef>
<macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
<attribute name="dir" default="${build.classes.dir}"/>
<sequential>
<nbjpdareload>
<fileset includes="${fix.includes}*.class" dir="@{dir}"/>
</nbjpdareload>
</sequential>
</macrodef>
</target>
<target name="-init-macrodef-debug">
<macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/1">
<attribute name="classname" default="${main.class}"/>
<attribute name="classpath" default="${debug.classpath}"/>
<attribute name="args" default="${application.args}"/>
<sequential>
<java fork="true" classname="@{classname}" dir="${work.dir}">
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xnoagent"/>
<jvmarg value="-Djava.compiler=none"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
<jvmarg line="${run.jvmargs}"/>
<classpath>
<path path="@{classpath}"/>
</classpath>
<syspropertyset>
<propertyref prefix="run-sys-prop."/>
<mapper type="glob" from="run-sys-prop.*" to="*"/>
</syspropertyset>
<arg line="@{args}"/>
</java>
</sequential>
</macrodef>
</target>
<target name="-init-macrodef-java">
<macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
<attribute name="classname" default="${main.class}"/>
<element name="customize" optional="true"/>
<sequential>
<java fork="true" classname="@{classname}" dir="${work.dir}">
<jvmarg line="${run.jvmargs}"/>
<classpath>
<path path="${run.classpath}"/>
</classpath>
<syspropertyset>
<propertyref prefix="run-sys-prop."/>
<mapper type="glob" from="run-sys-prop.*" to="*"/>
</syspropertyset>
<customize/>
</java>
</sequential>
</macrodef>
</target>
<target name="-init-presetdef-jar">
<presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
<jar jarfile="${dist.jar}" compress="${jar.compress}">
<fileset dir="${build.classes.dir}" xmlns="http://www.netbeans.org/ns/j2se-project/1"/>
</jar>
</presetdef>
</target>
<target name="init" depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar"/>
<!--
===================
COMPILATION SECTION
===================
-->
<target name="deps-jar" depends="init" unless="no.deps"/>
<target name="-pre-pre-compile" depends="init,deps-jar">
<mkdir dir="${build.classes.dir}"/>
</target>
<target name="-pre-compile">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="-do-compile" depends="init,deps-jar,-pre-pre-compile,-pre-compile">
<j2seproject:javac xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1"/>
<copy todir="${build.classes.dir}">
<fileset dir="${src.dir}" excludes="${build.classes.excludes}"/>
</copy>
</target>
<target name="-post-compile">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="compile" depends="init,deps-jar,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project."/>
<target name="-pre-compile-single">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="-do-compile-single" depends="init,deps-jar,-pre-pre-compile">
<fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
<j2seproject:javac xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1">
<customize>
<patternset includes="${javac.includes}"/>
</customize>
</j2seproject:javac>
</target>
<target name="-post-compile-single">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="compile-single" depends="init,deps-jar,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single"/>
<!--
====================
JAR BUILDING SECTION
====================
-->
<target name="-pre-pre-jar" depends="init">
<dirname property="dist.jar.dir" file="${dist.jar}"/>
<mkdir dir="${dist.jar.dir}"/>
</target>
<target name="-pre-jar">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="-do-jar-without-manifest" depends="init,compile,-pre-pre-jar,-pre-jar" unless="manifest.available">
<j2seproject:jar xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1"/>
</target>
<target name="-do-jar-with-manifest" depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available" unless="manifest.available+main.class">
<j2seproject:jar manifest="${manifest.file}" xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1"/>
</target>
<target name="-do-jar-with-mainclass" depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class">
<j2seproject:jar manifest="${manifest.file}" xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1">
<manifest xmlns="http://www.netbeans.org/ns/j2se-project/1">
<attribute j2seproject:name="Main-Class" value="${main.class}"/>
</manifest>
</j2seproject:jar>
</target>
<target name="-post-jar">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="jar" depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-post-jar" description="Build JAR."/>
<!--
=================
EXECUTION SECTION
=================
-->
<target name="run" depends="init,compile" description="Run a main class.">
<j2seproject:java xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1">
<customize>
<arg line="${application.args}"/>
</customize>
</j2seproject:java>
</target>
<target name="run-single" depends="init,compile-single">
<fail unless="run.class">Must select one file in the IDE or set run.class</fail>
<j2seproject:java classname="${run.class}" xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1"/>
</target>
<!--
=================
DEBUGGING SECTION
=================
-->
<target name="-debug-start-debugger" if="netbeans.home" depends="init">
<j2seproject:nbjpdastart name="${debug.class}" xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1"/>
</target>
<target name="-debug-start-debuggee" depends="init,compile">
<j2seproject:debug xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1"/>
</target>
<target name="debug" if="netbeans.home" depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE."/>
<target name="-debug-start-debugger-stepinto" if="netbeans.home" depends="init">
<j2seproject:nbjpdastart stopclassname="${main.class}" xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1"/>
</target>
<target name="debug-stepinto" if="netbeans.home" depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee"/>
<target name="-debug-start-debuggee-single" if="netbeans.home" depends="init,compile-single">
<fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
<j2seproject:debug classname="${debug.class}" xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1"/>
</target>
<target name="debug-single" if="netbeans.home" depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single"/>
<target name="-pre-debug-fix" depends="init">
<fail unless="fix.includes">Must set fix.includes</fail>
<property name="javac.includes" value="${fix.includes}.java"/>
</target>
<target name="-do-debug-fix" if="netbeans.home" depends="init,-pre-debug-fix,compile-single">
<j2seproject:nbjpdareload xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1"/>
</target>
<target name="debug-fix" if="netbeans.home" depends="init,-pre-debug-fix,-do-debug-fix"/>
<!--
===============
JAVADOC SECTION
===============
-->
<target name="-javadoc-build" depends="init">
<mkdir dir="${dist.javadoc.dir}"/>
<javadoc destdir="${dist.javadoc.dir}" source="${javac.source}" notree="${javadoc.notree}" use="${javadoc.use}" nonavbar="${javadoc.nonavbar}" noindex="${javadoc.noindex}" splitindex="${javadoc.splitindex}" author="${javadoc.author}" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}" private="${javadoc.private}" failonerror="true">
<classpath>
<path path="${javac.classpath}"/>
</classpath>
<sourcepath>
<pathelement location="${src.dir}"/>
</sourcepath>
<fileset dir="${src.dir}"/>
</javadoc>
</target>
<target name="-javadoc-browse" if="netbeans.home" unless="no.javadoc.preview" depends="init,-javadoc-build">
<nbbrowse file="${dist.javadoc.dir}/index.html"/>
</target>
<target name="javadoc" depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc."/>
<!--
=========================
JUNIT COMPILATION SECTION
=========================
-->
<target name="-pre-pre-compile-test" if="have.tests" depends="init,compile">
<mkdir dir="${build.test.classes.dir}"/>
</target>
<target name="-pre-compile-test">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="-do-compile-test" if="have.tests" depends="init,compile,-pre-pre-compile-test,-pre-compile-test">
<j2seproject:javac srcdir="${test.src.dir}" destdir="${build.test.classes.dir}" debug="true" classpath="${javac.test.classpath}" xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1"/>
<copy todir="${build.test.classes.dir}">
<fileset dir="${test.src.dir}">
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="-post-compile-test">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="compile-test" depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test"/>
<target name="-pre-compile-test-single">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="-do-compile-test-single" if="have.tests" depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single">
<fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
<j2seproject:javac srcdir="${test.src.dir}" destdir="${build.test.classes.dir}" debug="true" classpath="${javac.test.classpath}" xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1">
<customize>
<patternset includes="${javac.includes}"/>
</customize>
</j2seproject:javac>
</target>
<target name="-post-compile-test-single">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="compile-test-single" depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single"/>
<!--
=======================
JUNIT EXECUTION SECTION
=======================
-->
<target name="-pre-test-run" if="have.tests" depends="init">
<mkdir dir="${build.test.results.dir}"/>
</target>
<target name="-do-test-run" if="have.tests" depends="init,compile-test,-pre-test-run">
<j2seproject:junit xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1"/>
</target>
<target name="-post-test-run" if="have.tests" depends="init,compile-test,-pre-test-run,-do-test-run">
<fail if="tests.failed">Some tests failed; see details above.</fail>
</target>
<target name="test-report" if="have.tests" depends="init"/>
<target name="-test-browse" if="netbeans.home+have.tests" depends="init"/>
<target name="test" depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests."/>
<target name="-pre-test-run-single" if="have.tests" depends="init">
<mkdir dir="${build.test.results.dir}"/>
</target>
<target name="-do-test-run-single" if="have.tests" depends="init,compile-test-single,-pre-test-run-single">
<fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
<j2seproject:junit includes="${test.includes}" xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1"/>
</target>
<target name="-post-test-run-single" if="have.tests" depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single">
<fail if="tests.failed">Some tests failed; see details above.</fail>
</target>
<target name="test-single" depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test."/>
<!--
=======================
JUNIT DEBUGGING SECTION
=======================
-->
<target name="-debug-start-debuggee-test" if="have.tests" depends="init,compile-test">
<fail unless="test.class">Must select one file in the IDE or set test.class</fail>
<j2seproject:debug classname="junit.textui.TestRunner" classpath="${debug.test.classpath}" args="${test.class}" xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1"/>
</target>
<target name="-debug-start-debugger-test" if="netbeans.home+have.tests" depends="init,compile-test">
<j2seproject:nbjpdastart name="${test.class}" classpath="${debug.test.classpath}" xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1"/>
</target>
<target name="debug-test" depends="init,compile-test,-debug-start-debugger-test,-debug-start-debuggee-test"/>
<target name="-do-debug-fix-test" if="netbeans.home" depends="init,-pre-debug-fix,compile-test-single">
<j2seproject:nbjpdareload dir="${build.test.classes.dir}" xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1"/>
</target>
<target name="debug-fix-test" if="netbeans.home" depends="init,-pre-debug-fix,-do-debug-fix-test"/>
<!--
=========================
APPLET EXECUTION SECTION
=========================
-->
<target name="run-applet" depends="init,compile-single">
<fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
<j2seproject:java classname="sun.applet.AppletViewer" xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1">
<customize>
<arg value="${applet.url}"/>
</customize>
</j2seproject:java>
</target>
<!--
=========================
APPLET DEBUGGING SECTION
=========================
-->
<target name="-debug-start-debuggee-applet" if="netbeans.home" depends="init,compile-single">
<fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
<j2seproject:debug classname="sun.applet.AppletViewer" args="&quot;${applet.url}&quot;" xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1"/>
</target>
<target name="debug-applet" if="netbeans.home" depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet"/>
<!--
===============
CLEANUP SECTION
===============
-->
<target name="deps-clean" depends="init" unless="no.deps"/>
<target name="-do-clean" depends="init">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
</target>
<target name="-post-clean">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="clean" depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products."/>
</project>
build.xml.data.CRC32=52b5b621
build.xml.script.CRC32=7f478078
build.xml.stylesheet.CRC32=ba5d3624
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=52b5b621
nbproject/build-impl.xml.script.CRC32=65051966
nbproject/build-impl.xml.stylesheet.CRC32=1cf0b40c
application.args=
javac.debug=true
javadoc.preview=true
user.properties.file=/home/coolen/.netbeans/4.1/build.properties
application.args=
build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java,**/*.form
# This directory is removed when the project is cleaned:
build.dir=build
# Only compile against the classpath explicitly listed here:
build.sysclasspath=ignore
build.test.classes.dir=${build.dir}/test/classes
build.test.results.dir=${build.dir}/test/results
debug.classpath=\
${run.classpath}
debug.test.classpath=\
${run.test.classpath}
# This directory is removed when the project is cleaned:
dist.dir=dist
dist.jar=${dist.dir}/OTBTest.jar
dist.javadoc.dir=${dist.dir}/javadoc
jar.compress=false
javac.classpath=
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
javac.source=${default.javac.source}
javac.target=${default.javac.target}
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}:\
${libs.junit.classpath}
javadoc.author=false
javadoc.encoding=
javadoc.noindex=false
javadoc.nonavbar=false
javadoc.notree=false
javadoc.private=false
javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=
main.class=otb.Main
manifest.file=manifest.mf
platform.active=default_platform
run.classpath=\
${javac.classpath}:\
${build.classes.dir}
# Space-separated list of JVM arguments used when running the project
# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
# or test-sys-prop.name=value to set system properties for unit tests):
run.jvmargs=
run.test.classpath=\
${javac.test.classpath}:\
${build.test.classes.dir}
src.dir=src
test.src.dir=test
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.java.j2seproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/j2se-project/1">
<name>OTBTest</name>
<minimum-ant-version>1.6</minimum-ant-version>
</data>
</configuration>
</project>
// \defgroup OTBTest OTB OTB test directory to try out techniques
# if HAVE_SHMEM
# SUBDIRS = shmem .
# endif
INSTHDRS =
NOINSTHDRS =
TCCHDRS =
nobase_pkginclude_HEADERS = $(INSTHDRS) $(TCCHDRS)
noinst_HEADERS = $(NOINSTHDRS)
DOCHDRS = $(INSTHDRS) $(NOINSTHDRS)
lib_LTLIBRARIES = libotb.la
libotb_la_SOURCES =
# AM_YFLAGS = -d -p KeyParse
# AM_LFLAGS = -PKeyTokenize
# LEX_OUTPUT_ROOT = lex.KeyTokenize
# if HAVE_SHMEM
# libotb_la_LIBADD = shmem/libshmem.la
# endif
bin_PROGRAMS =
glishdir = $(libexecdir)/glish
dist_glish_SCRIPTS =
pythondir = $(bindir)
dist_python_SCRIPTS =
scriptdir = $(bindir)
dist_script_SCRIPTS =
include $(top_srcdir)/Makefile.common
package otbtest;
import java.awt.*;
import java.awt.event.*;
/** A listener that you attach to the top-level Frame or JFrame of
* your application, so quitting the frame exits the application.
* 1998-99 Marty Hall, http://www.apl.jhu.edu/~hall/java/
*/
public class ExitListener extends WindowAdapter {
public void windowClosing(WindowEvent event) {
System.exit(0);
}
}
/*
* Main.java
*
* Created on April 26, 2005, 2:07 PM
*/
package otbtest;
/**
*
* @author alex
*/
public class Main {
/** Creates a new instance of Main */
public Main() {
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
otbgui aGui = new otbgui();
aGui.setSize(800, 400);
aGui.setVisible(true);
}
}
#include <jni.h>
#include "otb_navigatorRMIImpl.h"
JNIEXPORT jobjectArray JNICALL
Java_otb_navigatorRMIImpl_getDBList (JNIEnv *env, jobject obj) {
jobjectArray ret;
int i;
char *DBList[105]= {
"Departments.Administration.Cees_Boon.Salary=\"1500\"",
"Departments.Administration.Cees_Boon.Address=\"Randervoordestraat 6\"",
"Departments.Administration.Cees_Boon.PostalCode=\"7906HM\"",
"Departments.Administration.Cees_Boon.City=\"Hoogeveen\"",
"Departments.Administration.Cees_Boon.WorkPhone=\"0521-595117\"",
"Departments.Administration.Cees_Boon.PrivatePhone=\"0528-268049\"",
"Departments.Administration.Cees_Boon.Email=\"boon@astron.nl\"",
"Departments.Administration.Jaap_van_de_Spreng.Salary=\"1600\"",
"Departments.Administration.Jaap_van_de_Spreng.Address=\"Veenwijksweg 17\"",
"Departments.Administration.Jaap_van_de_Spreng.PostalCode=\"8427RS\"",
"Departments.Administration.Jaap_van_de_Spreng.City=\"Ravenswoud\"",
"Departments.Administration.Jaap_van_de_Spreng.WorkPhone=\"0521-595130\"",
"Departments.Administration.Jaap_van_de_Spreng.PrivatePhone=\"0516-433364\"",
"Departments.Administration.Jaap_van_de_Spreng.Email=\"spreng@astron.nl\"",
"Departments.Administration.Thijs_Zanders.Salary=\"1600\"",
"Departments.Administration.Thijs_Zanders.Address=\"Alexander Dubcekweg 49\"",
"Departments.Administration.Thijs_Zanders.PostalCode=\"9403XB\"",
"Departments.Administration.Thijs_Zanders.City=\"Assen\"",
"Departments.Administration.Thijs_Zanders.WorkPhone=\"0521-595148\"",
"Departments.Administration.Thijs_Zanders.PrivatePhone=\"06-55707136\"",
"Departments.Administration.Thijs_Zanders.Email=\"zanders@astron.nl\"",
"Departments.ICT.Chris_Broekema.Salary=\"2000\"",
"Departments.ICT.Chris_Broekema.Address=\"Aquamarijnstraat 309\"",
"Departments.ICT.Chris_Broekema.PostalCode=\"9743PH\"",
"Departments.ICT.Chris_Broekema.City=\"Groningen\"",
"Departments.ICT.Chris_Broekema.WorkPhone=\"0521-595215\"",
"Departments.ICT.Chris_Broekema.PrivatePhone=\"050-5714258\"",
"Departments.ICT.Chris_Broekema.Email=\"broekema@astron.nl\"",
"Departments.ICT.Arthur_Coolen.Salary=\"1900\"",
"Departments.ICT.Arthur_Coolen.Address=\"Hoofdstraat 78\"",
"Departments.ICT.Arthur_Coolen.PostalCode=\"9635AW\"",
"Departments.ICT.Arthur_Coolen.City=\"Noordbroek\"",
"Departments.ICT.Arthur_Coolen.WorkPhone=\"0521-595292\"",
"Departments.ICT.Arthur_Coolen.PrivatePhone=\"0598-451712\"",
"Departments.ICT.Arthur_Coolen.Email=\"coolen@astron.nl\"",
"Departments.ICT.Ger_van_Diepen.Salary=\"2200\"",
"Departments.ICT.Ger_van_Diepen.Address=\"Moleneinde 25\"",
"Departments.ICT.Ger_van_Diepen.PostalCode=\"7981AM\"",
"Departments.ICT.Ger_van_Diepen.City=\"Diever\"",
"Departments.ICT.Ger_van_Diepen.WorkPhone=\"0521-595241\"",
"Departments.ICT.Ger_van_Diepen.PrivatePhone=\"0521-592729\"",
"Departments.ICT.Ger_van_Diepen.Email=\"diepen@astron.nl\"",
"Departments.ICT.Alex_Gerdes.Salary=\"2100\"",
"Departments.ICT.Alex_Gerdes.Address=\"Westermaten 3\"",
"Departments.ICT.Alex_Gerdes.PostalCode=\"7854TS\"",
"Departments.ICT.Alex_Gerdes.City=\"Aalden\"",
"Departments.ICT.Alex_Gerdes.WorkPhone=\"0521-595272\"",
"Departments.ICT.Alex_Gerdes.PrivatePhone=\"0591-610421\"",
"Departments.ICT.Alex_Gerdes.Email=\"gerdes@astron.nl\"",
"Departments.ICT.Management.Marcel_Loose.Salary=\"2200\"",
"Departments.ICT.Management.Marcel_Loose.Address=\"De Goorn 58\"",
"Departments.ICT.Management.Marcel_Loose.PostalCode=\"7975BT\"",
"Departments.ICT.Management.Marcel_Loose.City=\"Uffelte\"",
"Departments.ICT.Management.Marcel_Loose.WorkPhone=\"0521-595243\"",
"Departments.ICT.Management.Marcel_Loose.PrivatePhone=\"0521-343338\"",
"Departments.ICT.Management.Marcel_Loose.Email=\"loose@astron.nl\"",
"Departments.ICT.Management.Ellen_van_Meijeren.Salary=\"2300\"",
"Departments.ICT.Management.Ellen_van_Meijeren.Address=\"Tiendweg West 2c\"",
"Departments.ICT.Management.Ellen_van_Meijeren.PostalCode=\"2941EP\"",
"Departments.ICT.Management.Ellen_van_Meijeren.City=\"Lekkerkerk\"",
"Departments.ICT.Management.Ellen_van_Meijeren.WorkPhone=\"0521-595265\"",
"Departments.ICT.Management.Ellen_van_Meijeren.PrivatePhone=\"06-29522776\"",
"Departments.ICT.Management.Ellen_van_Meijeren.Email=\"meijeren@astron.nl\"",
"Departments.Technical_Lab.Dion_Kant.Salary=\"2300\"",
"Departments.Technical_Lab.Dion_Kant.Address=\"de Stelling 48\"",
"Departments.Technical_Lab.Dion_Kant.PostalCode=\"8391ME\"",
"Departments.Technical_Lab.Dion_Kant.City=\"Noordwolde\"",
"Departments.Technical_Lab.Dion_Kant.WorkPhone=\"0521-595139\"",
"Departments.Technical_Lab.Dion_Kant.PrivatePhone=\"0561-431826\"",
"Departments.Technical_Lab.Dion_Kant.Email=\"kant@astron.nl\"",
"Departments.Technical_Lab.Gaby_Kroes.Salary=\"2100\"",
"Departments.Technical_Lab.Gaby_Kroes.Address=\"Korenmolen 20\"",
"Departments.Technical_Lab.Gaby_Kroes.PostalCode=\"9203VA\"",
"Departments.Technical_Lab.Gaby_Kroes.City=\"Drachten\"",
"Departments.Technical_Lab.Gaby_Kroes.WorkPhone=\"0521-595176\"",
"Departments.Technical_Lab.Gaby_Kroes.PrivatePhone=\"0512-518729\"",
"Departments.Technical_Lab.Gaby_Kroes.Email=\"kroes@astron.nl\"",
"Departments.Technical_Lab.Jan_Nijboer.Salary=\"1900\"",
"Departments.Technical_Lab.Jan_Nijboer.Address=\"Achterdiep NZ 29\"",
"Departments.Technical_Lab.Jan_Nijboer.PostalCode=\"9611BT\"",
"Departments.Technical_Lab.Jan_Nijboer.City=\"Sappemeer\"",
"Departments.Technical_Lab.Jan_Nijboer.WorkPhone=\"0521-595177\"",
"Departments.Technical_Lab.Jan_Nijboer.PrivatePhone=\"0598-398722\"",
"Departments.Technical_Lab.Jan_Nijboer.Email=\"nijboer@astron.nl\"",
"Departments.System_Management.Jan_Slagter.Salary=\"1800\"",
"Departments.System_Management.Jan_Slagter.Address=\"Bovenboer 18\"",
"Departments.System_Management.Jan_Slagter.PostalCode=\"7924PT\"",
"Departments.System_Management.Jan_Slagter.City=\"Veeningen\"",
"Departments.System_Management.Jan_Slagter.WorkPhone=\"0521-595238\"",
"Departments.System_Management.Jan_Slagter.PrivatePhone=\"0528-391570\"",
"Departments.System_Management.Jan_Slagter.Email=\"slagter@astron.nl\"",
"Departments.System_Management.Klaas_Stuurwold.Salary=\"2100\"",
"Departments.System_Management.Klaas_Stuurwold.Address=\"De Stroom 48\"",
"Departments.System_Management.Klaas_Stuurwold.PostalCode=\"9411MA\"",
"Departments.System_Management.Klaas_Stuurwold.City=\"Beilen\"",
"Departments.System_Management.Klaas_Stuurwold.WorkPhone=\"0521-595231\"",
"Departments.System_Management.Klaas_Stuurwold.PrivatePhone=\"0593-541930\"",
"Departments.System_Management.Klaas_Stuurwold.Email=\"stuurwold@astron.nl\"",
"Departments.System_Management.Management.Roelof_Boesenkool.Salary=\"2500\"",
"Departments.System_Management.Management.Roelof_Boesenkool.Address=\"Elzenhage 15\"",
"Departments.System_Management.Management.Roelof_Boesenkool.PostalCode=\"7943MA\"",
"Departments.System_Management.Management.Roelof_Boesenkool.City=\"Meppel\"",
"Departments.System_Management.Management.Roelof_Boesenkool.WorkPhone=\"0521-5952434\"",
"Departments.System_Management.Management.Roelof_Boesenkool.PrivatePhone=\"0522-244033\"",
"Departments.System_Management.Management.Roelof_Boesenkool.Email=\"boesenkool@astron.nl\""
};
ret= (jobjectArray)env->NewObjectArray(105,
env->FindClass("java/lang/String"),
env->NewStringUTF(""));
for(i=0;i<105;i++) {
env->SetObjectArrayElement(
ret,i,env->NewStringUTF(DBList[i]));
}
return(ret);
}
package otbtest;
import javax.swing.*;
import java.awt.*;
/** A few utilities that simplify using windows in Swing.
* 1998-99 Marty Hall, http://www.apl.jhu.edu/~hall/java/
*/
public class WindowUtilities {
/** Tell system to use native look and feel, as in previous
* releases. Metal (Java) LAF is the default otherwise.
*/
public static void setNativeLookAndFeel() {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch(Exception e) {
System.out.println("Error setting native LAF: " + e);
}
}
public static void setJavaLookAndFeel() {
try {
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
} catch(Exception e) {
System.out.println("Error setting Java LAF: " + e);
}
}
public static void setMotifLookAndFeel() {
try {
UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
} catch(Exception e) {
System.out.println("Error setting Motif LAF: " + e);
}
}
/** A simplified way to see a JPanel or other Container.
* Pops up a JFrame with specified Container as the content pane.
*/
public static JFrame openInJFrame(Container content,
int width,
int height,
String title,
Color bgColor) {
JFrame frame = new JFrame(title);
frame.setBackground(bgColor);
content.setBackground(bgColor);
frame.setSize(width, height);
frame.setContentPane(content);
frame.addWindowListener(new ExitListener());
frame.setVisible(true);
return(frame);
}
/** Uses Color.white as the background color. */
public static JFrame openInJFrame(Container content,
int width,
int height,
String title) {
return(openInJFrame(content, width, height, title, Color.white));
}
/** Uses Color.white as the background color, and the
* name of the Container's class as the JFrame title.
*/
public static JFrame openInJFrame(Container content,
int width,
int height) {
return(openInJFrame(content, width, height,
content.getClass().getName(),
Color.white));
}
}
/*
* navigatorRMI.java
*
* Created on 7 juni 2005, 15:22
*
* To change this template, choose Tools | Options and locate the template under
* the Source Creation and Management node. Right-click the template and choose
* Open. You can then make changes to the template in the Source Editor.
*/
package otbtest;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.ArrayList;
/**
*
* @author Arthur Coolen
*/
public interface navigatorRMI extends Remote {
ArrayList<String []> getList() throws RemoteException;
}
/*
* navigatorRMIImpl.java
*
* Created on 7 juni 2005, 15:35
*
* To change this template, choose Tools | Options and locate the template under
* the Source Creation and Management node. Right-click the template and choose
* Open. You can then make changes to the template in the Source Editor.
*/
package otbtest;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.ArrayList;
/**
*
* @author Arthur Coolen
*
* What to do to get RMI going.
*
* look at the server ip and port in navigatorRMIImpl.java and otbgui.java and change if you take another server ip
*
* make a subdir otb and place navigatorRMI.jave navigatorRMIServer.java and navigatorRMIImpl.java in it
* go one dir below the otb dir and say javac otb/navigatorRMI.java
* javac otb/navigatorRMIImpl.java
* javac otb/navigatorRMIServer.java
*
* from the same place make the stub by typing rmic otb.navigatorRMIImpl
* this will create a navigatorRMIImpl_Stub.class
*
* ftp navigatorRMI.class navigatorRMIImpl.class navigatorRMIServer.class to the server to an otb subdir
* login to the server and go to the directory and type rmiregistry & this will start the rmi registry
* then start the server with java otb/navigatorRMIServer 10099 &
* 10099 represents the chosen port.
*
* ATTENTION:
*
* Make VERY sure that when you run the server side classes, that you use the same or a newer java version!
* Make also VERY sure that the CLASSPATH is set to the place where your classes reside, ESPECIALLY BEFORE you
* start rmiserver !!!!
*
* */
public class navigatorRMIImpl extends UnicastRemoteObject implements navigatorRMI {
// JNI test with stringarraylist
public native String [] getDBList();
static {
System.loadLibrary("OTDB");
}
private ArrayList<String []> people = new ArrayList<String []>();
/**
* Construct a remote object
* @param msg the message of the remote object, such as "Hello, world!".
* @exception RemoteException if the object handle cannot be constructed.
*/
public navigatorRMIImpl() throws RemoteException {
}
/**
* Implementation of the remotely invocable method.
* @return the found data
* @exception RemoteException if the remote invocation fails.
*/
public ArrayList<String []> getList() throws RemoteException {
return people;
}
public void setList(String [] aStrList) {
for (int j=0; j < aStrList.length;j++) {
// find the last aaa="bbb" combination
String [] aS1 = aStrList[j].split("[=]");
String [] aS2 = aS1[0].split("[.]");
String [] saveString= new String[2];
for (int i=0; i< aS2.length-1;i++) {
if (i>0) {
saveString[0]+="."+aS2[i];
} else {
saveString[0]=aS2[i];
}
}
saveString[1]=aS2[aS2.length-1]+"="+aS1[1];
saveString[0]=saveString[0].replace('_',' ');
saveString[1]=saveString[1].replace('_',' ');
people.add(saveString);
}
}
}
/*
* navigatorRMIServer.java
*
* Created on June 10, 2005, 2:11 PM
*
* To change this template, choose Tools | Options and locate the template under
* the Source Creation and Management node. Right-click the template and choose
* Open. You can then make changes to the template in the Source Editor.
*/
package otbtest;
import java.rmi.Naming;
/**
*
* @author Arthur Coolen
*
* How to build the JNI part (RMI is explained in navigatorRMIImpl.java)
*
* On the server you need to following programs in subdir otb:
* navigatorRMIImpl.java
* navigatorRMIServer.java
* OTDBImpl.cc
*
* from withing otb do the following:
* cd ..
* javac otb/navigatorRMIImpl.java
* javac otb/navigatorRMIServer.java
* javah -jni otb.navigatorRMIImpl this will build: otb_navigatorRMIImpl.h
* mv otb_navigatorRMIImpl.h otb
* cd otb
* g++ -shared -I/opt/jdk1.5.0_03/include -I/opt/jdk1.5.0_03/include/linux \
* OTDBImpl.cc -o libOTDB.so
*
* Then Start the server with :
* cd ..
* java otb.navigatorRMIServer
*
* Requirement is that the rmiregistry 10099 & as explained
* in navigatorRMIImpl.java should be running also
*
*/
public class navigatorRMIServer {
/**
* Server program for the navigator example program
* @param argv The command line arguments which are ignored.
*/
public static void main (String[] argv) {
try {
navigatorRMIImpl aNRI = new navigatorRMIImpl();
Naming.rebind("rmi://10.0.0.154:10099/navigatorRMItje", aNRI);
// Naming.rebind("rmi://dop32.astron.nl:10099/navigatorRMItje", aNRI);
System.out.println ("navigator Server is ready.");
//test the JNI binding
aNRI.setList(aNRI.getDBList());
System.out.println("People should be set now");
} catch (Exception e) {
System.out.println ("navigator Server failed: " + e);
}
}
}
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class otb_navigatorRMIImpl */
#ifndef _Included_otb_navigatorRMIImpl
#define _Included_otb_navigatorRMIImpl
#ifdef __cplusplus
extern "C" {
#endif
#undef otb_navigatorRMIImpl_serialVersionUID
#define otb_navigatorRMIImpl_serialVersionUID -3215090123894869218LL
#undef otb_navigatorRMIImpl_serialVersionUID
#define otb_navigatorRMIImpl_serialVersionUID -4100238210092549637LL
#undef otb_navigatorRMIImpl_serialVersionUID
#define otb_navigatorRMIImpl_serialVersionUID 4974527148936298033LL
/*
* Class: otb_navigatorRMIImpl
* Method: getDBList
* Signature: ()[Ljava/lang/String;
*/
JNIEXPORT jobjectArray JNICALL Java_otb_navigatorRMIImpl_getDBList
(JNIEnv *, jobject);
#ifdef __cplusplus
}
#endif
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment