aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/com/sun/opengl/impl/macosx/MacOSXJava2DGLContext.java
blob: 5f4de04649c0fc065631bf026ac7e648e32b576c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/*
 * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
 * 
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 * 
 * - Redistribution of source code must retain the above copyright
 *   notice, this list of conditions and the following disclaimer.
 * 
 * - Redistribution in binary form must reproduce the above copyright
 *   notice, this list of conditions and the following disclaimer in the
 *   documentation and/or other materials provided with the distribution.
 * 
 * Neither the name of Sun Microsystems, Inc. or the names of
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * 
 * This software is provided "AS IS," without a warranty of any kind. ALL
 * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
 * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
 * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
 * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
 * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
 * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
 * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
 * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
 * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
 * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
 * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
 * 
 * You acknowledge that this software is not designed or intended for use
 * in the design, construction, operation or maintenance of any nuclear
 * facility.
 * 
 * Sun gratefully acknowledges that this software was originally authored
 * and developed by Kenneth Bradley Russell and Christopher John Kline.
 */

package com.sun.opengl.impl.macosx;

import java.awt.Graphics;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;

/** MacOSXGLContext implementation supporting the Java2D/JOGL bridge
 * on Mac OS X. The external GLDrawable mechanism does not work on Mac
 * OS X due to how drawables and contexts are operated upon on this
 * platform, so it is necessary to supply an alternative means to
 * create, make current, and destroy contexts on the Java2D "drawable"
 * on the Mac platform.
 */

public class MacOSXJava2DGLContext extends MacOSXGLContext implements Java2DGLContext {
  private Graphics graphics;

  // FIXME: ignoring context sharing for the time being; will need to
  // rethink this in particular if using FBOs to implement the
  // Java2D/OpenGL pipeline on Mac OS X

  public MacOSXJava2DGLContext(GLContext shareWith) {
    super(null, shareWith);
  }

  public void setGraphics(Graphics g) {
    this.graphics = g;
  }

  protected int makeCurrentImpl() throws GLException {
    boolean created = false;
    if (nsContext == 0) {
      if (!create()) {
        return CONTEXT_NOT_CURRENT;
      }
      if (DEBUG) {
        System.err.println("!!! Created GL nsContext for " + getClass().getName());
      }
      created = true;
    }
            
    if (!Java2D.makeOGLContextCurrentOnSurface(graphics, nsContext)) {
      throw new GLException("Error making context current");
    }
            
    if (created) {
      resetGLFunctionAvailability();
      return CONTEXT_CURRENT_NEW;
    }
    return CONTEXT_CURRENT;
  }

  protected boolean create() {
    // Find and configure share context
    MacOSXGLContext other = (MacOSXGLContext) GLContextShareSet.getShareContext(this);
    long share = 0;
    if (other != null) {
      // Reconfigure pbuffer-based GLContexts
      if (other instanceof MacOSXPbufferGLContext) {
        MacOSXPbufferGLContext ctx = (MacOSXPbufferGLContext) other;
        ctx.setOpenGLMode(MacOSXGLDrawable.CGL_MODE);
      } else {
        if (other.getOpenGLMode() != MacOSXGLDrawable.CGL_MODE) {
          throw new GLException("Can't share between NSOpenGLContexts and CGLContextObjs");
        }
      }
      share = other.getNSContext();
      // Note we don't check for a 0 return value, since switching
      // the context's mode causes it to be destroyed and not
      // re-initialized until the next makeCurrent
    }

    if (DEBUG) {
      System.err.println("!!! Share context is " + toHexString(share) + " for " + getClass().getName());
    }

    long ctx = Java2D.createOGLContextOnSurface(graphics, share);
    if (ctx == 0) {
      return false;
    }
    // FIXME: think about GLContext sharing
    nsContext = ctx;
    return true;
  }

  protected void releaseImpl() throws GLException {
    // FIXME: would need another primitive in the Java2D class in
    // order to implement this; hopefully should not matter for
    // correctness
  }

  protected void destroyImpl() throws GLException {
    if (nsContext != 0) {
      Java2D.destroyOGLContext(nsContext);
      if (DEBUG) {
        System.err.println("!!! Destroyed OpenGL context " + nsContext);
      }
      nsContext = 0;
      // FIXME
      // GLContextShareSet.contextDestroyed(this);
    }
  }

  public void setSwapInterval(int interval) {
    // Not supported in this context implementation
  }

  public void setOpenGLMode(int mode) {
    if (mode != MacOSXGLDrawable.CGL_MODE)
      throw new GLException("OpenGL mode switching not supported for Java2D GLContexts");
  }

  public int  getOpenGLMode() {
    return MacOSXGLDrawable.CGL_MODE;
  }
}
631'>631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261
<?xml version="1.0" encoding="UTF-8"?>

<project name="JOGLTest" basedir="." default="all">

    <description>JUNIT Tests JOGL</description>

    <property name="gluegen.basename" value="gluegen" /> <!-- if differs, ie jenkins jobname, must be set properly first -->
    <property name="jogl.basename" value="jogl" /> <!-- if differs, ie jenkins jobname, must be set properly first -->
    <echo message="gluegen.basename: ${gluegen.basename}"/>
    <echo message="jogl.basename: ${jogl.basename}"/>

    <import file="build-common.xml"/>

    <taskdef resource="net/sf/antcontrib/antlib.xml">
      <classpath> <pathelement location="${ant-contrib.jar}"/> </classpath>
    </taskdef>

    <!-- ================================================================== -->
    <!-- 
       - Declare all paths and user defined variables.
      -->
    <target name="declare.common" description="Declare properties" depends="common.init">
        <property name="rootrel.src.test"     value="src/test" />
        <property name="src.test"             value="${project.root}/${rootrel.src.test}" />
        <property name="src.demos"            value="${project.root}/src/demos" />

        <property name="classes"              value="${build.test}/classes" />
        <property name="classes.path"         location="${classes}"/> <!-- absolute path -->
        <property name="classes.demos"        value="${build.demos}/classes" />

        <property name="java.part.demo.mobile" value="com/jogamp/opengl/demos/demos/**"/>
        <property name="java.part.test.all" value="com/jogamp/opengl/test/** jogamp/**"/>
        <property name="java.part.test.android" value="com/jogamp/opengl/test/android/**"/>
        <property name="java.part.test.oculusvr" value="com/jogamp/opengl/test/junit/jogl/stereo/ovr/**"/>
        <property name="java.dir.test"        value="com/jogamp/opengl/test"/>
        <property name="java.dir.junit"       value="${java.dir.test}/junit"/>
        <property name="java.dir.bugs"        value="${java.dir.test}/bugs"/>

        <property name="test.archive.name"    value="${archive.name}-test-results-${build.node.name}"/>
        <condition property="jvmarg.mainthrd" value="-XstartOnFirstThread"><isset property="isOSX"/></condition>
        <condition property="jvmarg.mainthrd" value="-Ddummy"><not><isset property="isOSX"/></not></condition>
        <condition property="jvmarg.headless" value="-XstartOnFirstThread -Djava.awt.headless=true"><isset property="isOSX"/></condition>
        <condition property="jvmarg.headless" value="-Djava.awt.headless=true"><not><isset property="isOSX"/></not></condition>

        <property name="batchtest.timeout"    value="1800000"/> <!-- 30 min -->
    </target>
    
    <!-- ================================================================== -->
    <!--
       - Clean up all that is built.
      -->
    <target name="clean" description="Remove all build products" depends="declare.common">
        <delete includeEmptyDirs="true" quiet="true">
            <fileset dir="${build.test}" />
            <fileset dir="${build.demos}" />
            <fileset dir="." includes="*.ps" />
            <fileset dir="." includes="*.pdf" />
            <fileset dir="." includes="*.png" />
            <fileset dir="." includes="*.pam" />
            <fileset dir="." includes="*.tga" />
            <fileset dir="." includes="hs_err_pid*.log" />
            <fileset file="${jogl-test.jar}" />
            <fileset file="${jogl-demos-mobile.jar}" />
        </delete>
    </target>

    <!-- ================================================================== -->
    <!--
       - Build/run tests/junit.
      -->

    <target name="make.demos.mobile">
        <javac destdir="${classes.demos}"
               fork="yes"
               includeAntRuntime="false"
               memoryMaximumSize="${javac.memorymax}"
               encoding="UTF-8"
               source="${target.sourcelevel}" 
               target="${target.targetlevel}" 
               bootclasspath="${target.rt.jar}"
               debug="${javacdebug}" debuglevel="${javacdebuglevel}">
            <classpath refid="junit_jogl_newt.compile.classpath"/>
            <src path="${src.demos}" />
        </javac>
        <copy file="joglversion-test"
            tofile="${build.test}/manifest-demo-mobile.mf"
            overwrite="true">
            <filterset>
                <filter token="VERSION" value="${jogamp.version}"/>
                <filter token="BUILD_VERSION" value="${jogl.version}"/>
                <filter token="SCM_BRANCH" value="${jogl.build.branch}"/>
                <filter token="SCM_COMMIT" value="${jogl.build.commit}"/>
                <filter token="BASEVERSION" value="${jogamp.version.base}"/>
                <filter token="JAR_CODEBASE_TAG" value="${jogamp.jar.codebase}"/>
            </filterset>
        </copy>
        <!-- include any resource files that tests may require -->
        <copy todir="${classes.demos}">
            <fileset dir="${src.demos}">
                <exclude name="**/*.java"/>
            </fileset>
        </copy>
        <jar manifest="${build.test}/manifest-demo-mobile.mf" destfile="${jogl-demos-mobile.jar}" filesonly="true">
            <fileset dir="${classes.demos}" 
                     includes="**"/>
            <fileset dir="resources/assets-test" includes="**" />
        </jar>
    </target>
    <target name="test.compile.javase.generic" unless="setup.noAWT">
        <javac destdir="${classes}"
               excludes="${java.part.test.android} ${java.part.test.oculusvr}"
               fork="yes"
               includeAntRuntime="false"
               memoryMaximumSize="${javac.memorymax}"
               encoding="UTF-8"
               source="${target.sourcelevel}" 
               target="${target.targetlevel}" 
               bootclasspath="${target.rt.jar}"
               debug="${javacdebug}" debuglevel="${javacdebuglevel}">
            <classpath refid="junit_jogl_newt.compile.classpath"/>
            <src path="${src.test}" />
        </javac>
    </target>
    <target name="test.compile.javase.oculusvr" if="oculusvr.sdk.available">
        <javac destdir="${classes}"
               includes="${java.part.test.oculusvr}"
               excludes="${java.part.test.android}"
               fork="yes"
               includeAntRuntime="false"
               memoryMaximumSize="${javac.memorymax}"
               encoding="UTF-8"
               source="${target.sourcelevel}" 
               target="${target.targetlevel}" 
               bootclasspath="${target.rt.jar}"
               debug="${javacdebug}" debuglevel="${javacdebuglevel}">
            <classpath refid="junit_jogl_newt_oculusvr.compile.classpath"/>
            <src path="${src.test}" />
        </javac>
    </target>
    <target name="test.compile.javase" depends="test.compile.javase.generic, test.compile.javase.oculusvr" unless="setup.noAWT">
        <copy file="joglversion-test"
            tofile="${build.test}/manifest-test.mf"
            overwrite="true">
            <filterset>
                <filter token="VERSION" value="${jogamp.version}"/>
                <filter token="BUILD_VERSION" value="${jogl.version}"/>
                <filter token="SCM_BRANCH" value="${jogl.build.branch}"/>
                <filter token="SCM_COMMIT" value="${jogl.build.commit}"/>
                <filter token="BASEVERSION" value="${jogamp.version.base}"/>
                <filter token="JAR_CODEBASE_TAG" value="${jogamp.jar.codebase}"/>
            </filterset>
        </copy>

        <jar manifest="${build.test}/manifest-test.mf" destfile="${jogl-test.jar}" filesonly="true">
            <!-- get all class files, but skip any resource files that external tools
                 might have copied into the class directory (otherwise, it's possible
                 to get the same resource file twice in the jar) -->
            <fileset dir="${classes}" 
                     includes="${java.part.test.all}"
                     excludes="${java.part.test.android}"/>
            <fileset dir="resources/assets-test" includes="**" />
        </jar>
    </target>

    <target name="test.compile.android" if="android-jars.available" unless="setup.noAWT">
        <!-- Perform the junit pass Java Android compile -->
        <javac destdir="${classes}"
               excludes="${java.part.test.oculusvr}"
               fork="yes"
               includeAntRuntime="false"
               memoryMaximumSize="${javac.memorymax}"
               encoding="UTF-8"
               source="${target.sourcelevel}" 
               target="${target.targetlevel}" 
               bootclasspath="${target.rt.jar}"
               debug="${javacdebug}" debuglevel="${javacdebuglevel}">
            <classpath refid="junit_jogl_newt_android.compile.classpath"/>
            <src path="${src.test}" />
        </javac>
        <copy file="joglversion-test-android"
            tofile="${build.test}/manifest-test-android.mf"
            overwrite="true">
            <filterset>
                <filter token="VERSION" value="${jogamp.version}"/>
                <filter token="BUILD_VERSION" value="${jogl.version}"/>
                <filter token="SCM_BRANCH" value="${jogl.build.branch}"/>
                <filter token="SCM_COMMIT" value="${jogl.build.commit}"/>
                <filter token="BASEVERSION" value="${jogamp.version.base}"/>
            </filterset>
        </copy>

        <jar manifest="${build.test}/manifest-test-android.mf" destfile="${jogl-test-android.jar}" filesonly="true">
            <!-- get all class files, but skip any resource files that external tools
                 might have copied into the class directory (otherwise, it's possible
                 to get the same resource file twice in the jar) -->
            <fileset dir="${classes}" 
                     includes="${java.part.test.all}"/>
            <fileset dir="resources/assets-test" includes="**" />
        </jar>
    </target>

    <target name="test.package.android" depends="test.compile.android" if="isAndroid" unless="setup.noAWT">
        <aapt.signed 
            assetsdir="resources/assets-test"
            jarsrcdir="${src}/test"
            jarbuilddir="${jar}"
            jarbasename="jogl-test-android"
            nativebuilddir="${lib}"
            nativebasename="non-existing"
            androidmanifest.path="resources/android/AndroidManifest-test.xml"
            androidresources.path="resources/android/res-test"
            jarmanifest.path="${build.test}/manifest-test-android.mf"
            version.code="${jogamp.version.int}"
            version.name="${jogamp.version}" />
    </target>

    <target name="test.compile.check" depends="declare.common">
      <!-- Create the required output directories. -->
      <mkdir dir="${obj.test}" />
      <mkdir dir="${classes}" />
      <mkdir dir="${classes.demos}" />

      <property name="jogl-test.jar.path" location="${jogl-test.jar}"/> <!-- absolute path -->
      <echo message="jogl-test.jar ${jogl-test.jar.path}"/>
      <uptodate property="test.compile.skip">
        <srcfiles dir= "."                 includes="*.xml"/>
        <srcfiles dir= "${src.test}"       includes="**"/>
        <srcfiles dir= "resources/android" includes="**/*.xml"/>
        <srcfiles                          file="${gluegen-rt.jar}" />
        <srcfiles                          dir="${src}/nativewindow" />
        <srcfiles                          dir="${src}/jogl" />
        <srcfiles                          dir="${src}/newt" />
        <mapper type="merge" to="${jogl-test.jar.path}"/>
      </uptodate>
    </target>

    <target name="test.compile" depends="test.compile.check" unless="test.compile.skip">
        <!-- include any resource files that tests may require -->
        <copy todir="${classes}">
            <fileset dir="${src.test}">
                <exclude name="**/*.java"/>
            </fileset>
        </copy>
        <antcall target="make.demos.mobile" inheritRefs="true" inheritAll="true"/>
        <antcall target="test.compile.javase" inheritRefs="true" inheritAll="true"/>
        <antcall target="test.package.android" inheritRefs="true" inheritAll="true"/>
    </target>

    <target name="test.manual.run" depends="test.compile, junit.run.settings">
        <for param="test.class.path.m" keepgoing="true">
            <!-- results in absolute path -->
            <fileset dir="${classes}">
                <include name="${java.dir.bugs}/**/*Test*"/>
                <exclude name="**/*$$*"/>
            </fileset>
          <sequential>
            <var name="test.class.path" unset="true"/>
            <property name="test.class.path" basedir="${classes}" relative="true" location="@{test.class.path.m}"/>
            <var name="test.class.fqn" unset="true"/>
            <pathconvert property="test.class.fqn">
              <fileset file="${classes}${file.separator}${test.class.path}"/>
              <chainedmapper>
                  <globmapper    from="${classes.path}${file.separator}*" to="*"/> <!-- rel. -->
                  <packagemapper from="*.class"           to="*"/> <!-- FQCN -->
              </chainedmapper>
            </pathconvert>
            <var name="test.class.result.file" value="${results.test}/TEST-${test.class.fqn}.log"/>
            <echo message="Testing ${test.class.fqn} -- ${test.class.result.file}"/>
            <apply dir="." executable="${jvmJava.exe}"
                 parallel="false" 
                 timeout="${batchtest.timeout}"
                 vmlauncher="false"
                 relative="true"
                 failonerror="false"
                 output="${test.class.result.file}">
                <env key="${system.env.library.path}" path="${obj.all.paths}"/>
                <env key="CLASSPATH" value="${junit_jogl_awt.run.jars}"/>
                <arg line="${junit.run.arg0}"/>
                <arg line="${junit.run.arg1}"/>
                <arg line="${jvmDataModel.arg}"/>
                <arg value="-Djava.library.path=${obj.all.paths}"/>
                <!--
                <arg line="-Dnewt.debug.EDT"/>
                -->
                <srcfile/>
                <mappedresources>
                    <fileset dir="${classes}" includes="${test.class.path}"/>
                    <packagemapper from="*.class" to="*"/>
                </mappedresources>
            </apply>
          </sequential>
        </for>
        <antcall target="test-zip-archive" inheritRefs="true" inheritAll="true"/>
    </target>

    <target name="junit.run.noui" depends="test.compile">
        <!-- Test*NOUI* -->
        <junit jvm="${jvmJava.exe}" forkmode="perTest" showoutput="true" fork="true" haltonerror="off" timeout="${batchtest.timeout}">
            <env key="${system.env.library.path}" path="${obj.all.paths}"/>
            <jvmarg value="${junit.run.arg0}"/>
            <jvmarg value="${junit.run.arg1}"/>
            <jvmarg value="${jvmDataModel.arg}"/>
            <jvmarg value="-Djava.library.path=${obj.all.paths}"/>

            <!--
            <jvmarg value="-Djogl.debug=all"/>
            <jvmarg value="-Dgluegen.debug.NativeLibrary=true"/>
            <jvmarg value="-Dgluegen.debug.ProcAddressHelper=true"/>
            <jvmarg value="-Djogl.debug.GLSLState"/>
            <jvmarg value="-Dnativewindow.debug=all"/>
            <jvmarg value="-verbose:jni"/> 
            <jvmarg value="-client"/>
            <jvmarg value="-d32"/>
            -->

            <formatter usefile="false" type="plain"/>
            <formatter usefile="true" type="xml"/>
            <classpath refid="junit_jogl_awt.run.classpath"/>

            <batchtest todir="${results.test}">
              <fileset dir="${classes}">
                  <include name="${java.dir.junit}/**/Test*NOUI*"/>
                  <exclude name="**/*$$*"/>
              </fileset>
              <formatter usefile="false" type="brief"/>
              <formatter usefile="true" type="xml"/>
            </batchtest>
        </junit>
    </target>

    <target name="generic.junit.run.newt.headless">
        <!-- attribute name="generic.junit.run.newt.headless.include.pattern" -->

        <!-- Test*NEWT* 

             Emulation of junit task,
             due to the fact that we have to place invoke our MainThread class first (-> MacOSX).

             Utilizing Ant-1.8.0 and ant-contrib-1.0b3 (loops, mutable properties).
          --> 
        <for param="test.class.path.m" keepgoing="true">
            <!-- results in absolute path -->
            <fileset dir="${classes}">
                <include name="${generic.junit.run.newt.headless.include.pattern}"/>
                <exclude name="**/*$$*"/>
                <exclude name="**/*AWT*"/>
                <exclude name="**/*SWT*"/>
            </fileset>
          <sequential>
            <var name="test.class.path" unset="true"/>
            <property name="test.class.path" basedir="${classes}" relative="true" location="@{test.class.path.m}"/>
            <var name="test.class.fqn" unset="true"/>
            <pathconvert property="test.class.fqn">
              <fileset file="${classes}${file.separator}${test.class.path}"/>
              <chainedmapper>
                  <globmapper    from="${classes.path}${file.separator}*" to="*"/> <!-- rel. -->
                  <packagemapper from="*.class"           to="*"/> <!-- FQCN -->
              </chainedmapper>
            </pathconvert>
            <var name="test.class.result.file" value="${results.test}/TEST-${test.class.fqn}.xml"/>
            <echo message="Testing ${test.class.fqn} -- ${test.class.result.file}"/>
            <apply dir="." executable="${jvmJava.exe}"
                 parallel="false" 
                 timeout="${batchtest.timeout}"
                 vmlauncher="false"
                 relative="true"
                 failonerror="false">
                <env key="${system.env.library.path}" path="${obj.all.paths}"/>
                <env key="CLASSPATH" value="${junit_jogl_noawt.run.jars}"/>
                <arg line="${junit.run.arg0}"/>
                <arg line="${junit.run.arg1}"/>
                <arg line="${jvmDataModel.arg}"/>
                <arg value="-Djava.library.path=${obj.all.paths}"/>
                <arg line="${jvmarg.headless}"/>
                <arg line="${jvmarg.mainthrd}"/>
                <!--
                <arg line="-Dnewt.debug.EDT"/>
                -->
                <arg line="com.jogamp.newt.util.MainThread"/>
                <arg line="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner"/>
                <srcfile/>
                <arg line="filtertrace=true"/>
                <arg line="haltOnError=false"/>
                <arg line="haltOnFailure=false"/>
                <arg line="showoutput=true"/>
                <arg line="outputtoformatters=true"/>
                <arg line="logfailedtests=true"/>
                <arg line="logtestlistenerevents=true"/>
                <arg line="formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter"/>
                <arg line="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.class.result.file}"/>
                <mappedresources>
                    <fileset dir="${classes}" includes="${test.class.path}"/>
                    <packagemapper from="*.class" to="*"/>
                </mappedresources>
            </apply>
          </sequential>
        </for>
        <var name="generic.junit.run.newt.headless.include.pattern" unset="true"/>
    </target>  

    <target name="junit.run.newt.headless" depends="test.compile">
        <!-- Test*NEWT* -->
        <property name="generic.junit.run.newt.headless.include.pattern" value="${java.dir.junit}/**/Test*NEWT*"/>
        <antcall target="generic.junit.run.newt.headless" inheritRefs="true" inheritAll="true"/>
    </target>

    <!-- junit.run.newt is covered by junit.run.newt.headless, disable it for now, but may be checked manually.
         This test target would also overwrite the test result XML files, we would also need a solution here for hudson,
         if run in parallel.
      -->
    <target name="junit.run.newt" depends="test.compile">
        <!-- Test*NEWT* -->
        <junit jvm="${jvmJava.exe}" forkmode="perTest" showoutput="true" fork="true" haltonerror="off" timeout="${batchtest.timeout}">
            <env key="${system.env.library.path}" path="${obj.all.paths}"/>
            <jvmarg value="${junit.run.arg0}"/>
            <jvmarg value="${junit.run.arg1}"/>
            <jvmarg value="${jvmDataModel.arg}"/>
            <jvmarg value="-Djava.library.path=${obj.all.paths}"/>

            <!--
            <jvmarg value="-Dnewt.debug.EDT"/>
            <jvmarg value="-Djogl.debug=all"/>
            <jvmarg value="-Dgluegen.debug.NativeLibrary=true"/>
            <jvmarg value="-Dgluegen.debug.ProcAddressHelper=true"/>
            <jvmarg value="-Djogl.debug.GLSLState"/>
            <jvmarg value="-Dnativewindow.debug=all"/>
            <jvmarg value="-Dnewt.debug=all"/>
            <jvmarg value="-verbose:jni"/> 
            <jvmarg value="-client"/>
            <jvmarg value="-d32"/>
            -->

            <formatter usefile="false" type="plain"/>
            <formatter usefile="true" type="xml"/>
            <classpath refid="junit_jogl_noawt.run.classpath"/>

            <batchtest todir="${results.test}">
              <fileset dir="${classes}">
                  <include name="${java.dir.junit}/**/Test*NEWT*"/>
                  <exclude name="**/*$$*"/>
                  <exclude name="**/*AWT*"/>
                  <exclude name="**/*SWT*"/>
              </fileset>
              <formatter usefile="false" type="brief"/>
              <formatter usefile="true" type="xml"/>
            </batchtest>
        </junit>
    </target>

    <target name="generic.junit.run.awt">
        <!-- attribute name="generic.junit.run.awt.include.pattern" -->

        <!-- Test*AWT* -->
        <junit jvm="${jvmJava.exe}" forkmode="perTest" showoutput="true" fork="true" haltonerror="off" timeout="${batchtest.timeout}">
            <env key="${system.env.library.path}" path="${obj.all.paths}"/>
            <jvmarg value="${junit.run.arg0}"/>
            <jvmarg value="${junit.run.arg1}"/>
            <jvmarg value="${jvmDataModel.arg}"/>
            <jvmarg value="-Djava.library.path=${obj.all.paths}"/>

            <!--
            <jvmarg value="-Djogl.debug=all"/>
            <jvmarg value="-Dgluegen.debug.NativeLibrary=true"/>
            <jvmarg value="-Dgluegen.debug.ProcAddressHelper=true"/>
            <jvmarg value="-Djogl.debug.GLSLState"/>
            <jvmarg value="-Dnativewindow.debug=all"/>
            <jvmarg value="-verbose:jni"/> 
            <jvmarg value="-client"/>
            <jvmarg value="-d32"/>
            -->

            <formatter usefile="false" type="plain"/>
            <formatter usefile="true" type="xml"/>
            <classpath refid="junit_jogl_awt.run.classpath"/>

            <batchtest todir="${results.test}">
              <fileset dir="${classes}">
                  <include name="${generic.junit.run.awt.include.pattern}"/>
                  <exclude name="**/*$$*"/>
                  <exclude name="**/*SWT*"/>
                  <exclude name="**/newt/**"/>
              </fileset>
              <formatter usefile="false" type="brief"/>
              <formatter usefile="true" type="xml"/>
            </batchtest>
        </junit>
        <var name="generic.junit.run.awt.include.pattern" unset="true"/>
    </target>

    <target name="junit.run.awt" depends="test.compile">
        <!-- Test*AWT* -->
        <property name="generic.junit.run.awt.include.pattern" value="${java.dir.junit}/**/Test*AWT*"/>
        <antcall target="generic.junit.run.awt" inheritRefs="true" inheritAll="true"/>
    </target>

    <target name="generic.junit.run.newt.awt">
        <!-- attribute name="generic.junit.run.newt.awt.include.pattern" -->

        <!-- Test*AWT* -->
        <junit jvm="${jvmJava.exe}" forkmode="perTest" showoutput="true" fork="true" haltonerror="off" timeout="${batchtest.timeout}">
            <env key="${system.env.library.path}" path="${obj.all.paths}"/>
            <jvmarg value="${junit.run.arg0}"/>
            <jvmarg value="${junit.run.arg1}"/>
            <jvmarg value="${jvmDataModel.arg}"/>
            <jvmarg value="-Djava.library.path=${obj.all.paths}"/>

            <!--
            <jvmarg value="-Dnewt.debug.EDT"/>
            <jvmarg value="-Djogl.debug=all"/>
            <jvmarg value="-Dgluegen.debug.NativeLibrary=true"/>
            <jvmarg value="-Dgluegen.debug.ProcAddressHelper=true"/>
            <jvmarg value="-Djogl.debug.GLSLState"/>
            <jvmarg value="-Dnativewindow.debug=all"/>
            <jvmarg value="-Dnewt.debug=all"/>
            <jvmarg value="-verbose:jni"/> 
            <jvmarg value="-client"/>
            <jvmarg value="-d32"/>
            -->

            <formatter usefile="false" type="plain"/>
            <formatter usefile="true" type="xml"/>
            <classpath refid="junit_jogl_awt.run.classpath"/>

            <batchtest todir="${results.test}">
              <fileset dir="${classes}">
                  <include name="${generic.junit.run.newt.awt.include.pattern}"/>
                  <exclude name="**/*SWT*"/>
                  <exclude name="**/*$$*"/>
              </fileset>
              <formatter usefile="false" type="brief"/>
              <formatter usefile="true" type="xml"/>
            </batchtest>
        </junit>
        <var name="generic.junit.run.newt.awt.include.pattern" unset="true"/>
    </target>

    <target name="junit.run.newt.awt" depends="test.compile">
        <!-- Test*AWT* -->
        <property name="generic.junit.run.newt.awt.include.pattern" value="${java.dir.junit}/**/newt/**/Test*AWT*"/>
        <antcall target="generic.junit.run.newt.awt" inheritRefs="true" inheritAll="true"/>

        <!--
        <property name="generic.junit.run.newt.awt.include.pattern" value="${java.dir.junit}/**/newt/**/TestNewtEventModifiers*AWT*"/>
        <antcall target="generic.junit.run.newt.awt" inheritRefs="true" inheritAll="true"/>
        <property name="generic.junit.run.newt.awt.include.pattern" value="${java.dir.junit}/**/acore/glels/Test**"/>
        <antcall target="generic.junit.run.newt.awt" inheritRefs="true" inheritAll="true"/>
          -->
    </target>

    <target name="junit.run.sharedctx" depends="test.compile, junit.run.settings">
        <!-- Test*NEWT* --> 
        <echo message="+++ "/>
        <echo message="+++ Testing Shared NEWT"/>
        <echo message="+++ "/>
        <property name="generic.junit.run.newt.headless.include.pattern" value="${java.dir.junit}/**/acore/Test*Shared*NEWT*"/>
        <antcall target="generic.junit.run.newt.headless" inheritRefs="true" inheritAll="true"/>

        <!-- Test*AWT* -->
        <echo message="+++ "/>
        <echo message="+++ Testing Shared AWT"/>
        <echo message="+++ "/>
        <property name="generic.junit.run.awt.include.pattern" value="${java.dir.junit}/**/acore/Test*Shared*AWT*"/>
        <antcall target="generic.junit.run.awt" inheritRefs="true" inheritAll="true"/>

        <!-- Test*SWTHeadless* -->
        <echo message="+++ "/>
        <echo message="+++ Testing Shared SWT"/>
        <echo message="+++ "/>
        <property name="generic.junit.run.swt.headless.include.pattern" value="${java.dir.junit}/**/acore/Test*Shared*SWT*"/>
        <antcall target="generic.junit.run.swt.headless" inheritRefs="true" inheritAll="true"/>
    </target>

    <target name="junit.run.newt.event" depends="test.compile, junit.run.settings">
        <!-- Test*AWT* -->
        <property name="generic.junit.run.newt.awt.include.pattern" value="${java.dir.junit}/**/newt/event/Test**"/>
        <antcall target="generic.junit.run.newt.awt" inheritRefs="true" inheritAll="true"/>
    </target>

    <target name="junit.run.newt.monitormode" depends="test.compile, junit.run.settings">
        <!-- Test*AWT* -->
        <property name="generic.junit.run.newt.awt.include.pattern" value="${java.dir.junit}/**/newt/mm/Test**"/>
        <antcall target="generic.junit.run.newt.awt" inheritRefs="true" inheritAll="true"/>
    </target>

    <target name="junit.run.awt.singletest" depends="test.compile, junit.run.settings">
        <!-- Test*AWT* -->
        <junit jvm="${jvmJava.exe}" forkmode="perTest" showoutput="true" fork="true" haltonerror="off" timeout="${batchtest.timeout}">
            <env key="${system.env.library.path}" path="${obj.all.paths}"/>
            <jvmarg value="${junit.run.arg0}"/>
            <jvmarg value="${junit.run.arg1}"/>
            <jvmarg value="${jvmDataModel.arg}"/>
            <jvmarg value="-Djava.library.path=${obj.all.paths}"/>

            <!--
            <jvmarg value="-Djogl.debug=all"/>
            <jvmarg value="-Dgluegen.debug.NativeLibrary=true"/>
            <jvmarg value="-Dgluegen.debug.ProcAddressHelper=true"/>
            <jvmarg value="-Djogl.debug.GLSLState"/>
            <jvmarg value="-Dnativewindow.debug=all"/>
            <jvmarg value="-verbose:jni"/> 
            <jvmarg value="-client"/>
            <jvmarg value="-d32"/>
            -->

            <formatter usefile="false" type="plain"/>
            <formatter usefile="true" type="xml"/>
            <classpath refid="junit_jogl_awt.run.classpath"/>

            <test name="${testclass}"/>
        </junit>
    </target>

    <target name="junit.run.newt.headless.singletest" depends="test.compile, junit.run.settings">
        <!-- Test*NEWT* 

             Emulation of junit task,
             due to the fact that we have to place invoke our MainThread class first (-> MacOSX).

             Utilizing Ant-1.8.0 and ant-contrib-1.0b3 (loops, mutable properties).
          --> 
        <var name="test.class.result.file" value="${results.test}/TEST-${testclass}.xml"/>
        <echo message="Testing ${testclass} -- ${test.class.result.file}"/>
        <apply dir="." executable="${jvmJava.exe}"
             parallel="false" 
             timeout="${batchtest.timeout}"
             vmlauncher="false"
             relative="true"
             failonerror="false">
            <env key="${system.env.library.path}" path="${obj.all.paths}"/>
            <env key="CLASSPATH" value="${junit_jogl_noawt.run.jars}"/>
            <arg line="${junit.run.arg0}"/>
            <arg line="${junit.run.arg1}"/>
            <arg line="${jvmDataModel.arg}"/>
            <arg value="-Djava.library.path=${obj.all.paths}"/>
            <arg line="${jvmarg.headless}"/>
            <arg line="${jvmarg.mainthrd}"/>
            <!--
            <arg line="-Dnewt.debug.EDT"/>
            -->
            <arg line="com.jogamp.newt.util.MainThread"/>
            <arg line="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner"/>
            <!-- srcfile/ -->
            <arg line="${testclass}"/>
            <arg line="filtertrace=true"/>
            <arg line="haltOnError=false"/>
            <arg line="haltOnFailure=false"/>
            <arg line="showoutput=true"/>
            <arg line="outputtoformatters=true"/>
            <arg line="logfailedtests=true"/>
            <arg line="logtestlistenerevents=true"/>
            <arg line="formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter"/>
            <arg line="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.class.result.file}"/>
            <fileset dir="${results.test}" includes="dummy.txt"/>
        </apply>
    </target>

    <target name="generic.junit.run.swt.headless">
        <!-- attribute name="generic.junit.run.swt.headless.include.pattern" -->

        <!-- Test*SWTHeadless* 

             Emulation of junit task.

             Utilizing Ant-1.8.0 and ant-contrib-1.0b3 (loops, mutable properties).
          --> 
        <for param="test.class.path.m" keepgoing="true">
            <!-- results in absolute path -->
            <fileset dir="${classes}">
                <include name="@{generic.junit.run.swt.headless.include.pattern}"/>
                <exclude name="**/*AWT*"/>
                <exclude name="**/*$$*"/>
            </fileset>
          <sequential>
            <var name="test.class.path" unset="true"/>
            <property name="test.class.path" basedir="${classes}" relative="true" location="@{test.class.path.m}"/>
            <var name="test.class.fqn" unset="true"/>
            <pathconvert property="test.class.fqn">
              <fileset file="${classes}${file.separator}${test.class.path}"/>
              <chainedmapper>
                  <globmapper    from="${classes.path}${file.separator}*" to="*"/> <!-- rel. -->
                  <packagemapper from="*.class"           to="*"/> <!-- FQCN -->
              </chainedmapper>
            </pathconvert>
            <var name="test.class.result.file" value="${results.test}/TEST-${test.class.fqn}.xml"/>
            <echo message="Testing ${test.class.fqn} -- ${test.class.result.file}"/>
            <apply dir="." executable="${jvmJava.exe}"
                 parallel="false" 
                 timeout="${batchtest.timeout}"
                 vmlauncher="false"
                 relative="true"
                 failonerror="false">
                <env key="${system.env.library.path}" path="${obj.all.paths}"/>
                <env key="CLASSPATH" value="${junit_extra_classpath}${junit_jogl_swt.run.jars}"/>
                <arg line="${junit.run.arg0}"/>
                <arg line="${junit.run.arg1}"/>
                <arg line="${jvmDataModel.arg}"/>
                <arg value="-Djava.library.path=${obj.all.paths}"/>
                <arg line="${jvmarg.headless}"/>
                <arg line="${jvmarg.mainthrd}"/>
                <!--
                <arg line="-Dnewt.debug.EDT"/>
                -->
                <arg line="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner"/>
                <srcfile/>
                <arg line="filtertrace=true"/>
                <arg line="haltOnError=false"/>
                <arg line="haltOnFailure=false"/>
                <arg line="showoutput=true"/>
                <arg line="outputtoformatters=true"/>
                <arg line="logfailedtests=true"/>
                <arg line="logtestlistenerevents=true"/>
                <arg line="formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter"/>
                <arg line="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.class.result.file}"/>
                <mappedresources>
                    <fileset dir="${classes}" includes="${test.class.path}"/>
                    <packagemapper from="*.class" to="*"/>
                </mappedresources>
            </apply>
          </sequential>
        </for>
        <var name="generic.junit.run.swt.headless.include.pattern" unset="true"/>
    </target>  

    <target name="junit.run.swt.headless" depends="test.compile" description="Runs all pure SWT tests." if="isSWTRuntimeAvailable">
        <!-- Test*SWTHeadless* -->
        <property name="generic.junit.run.swt.headless.include.pattern" value="${java.dir.junit}/**/Test*SWT*"/>
        <antcall target="generic.junit.run.swt.headless" inheritRefs="true" inheritAll="true"/>
    </target>

    <target name="junit.run.swt.awt" depends="test.compile" description="Runs all pure SWT AWT tests." if="isSWTRuntimeAvailable">
        <!-- Test*SWT* 

             Emulation of junit task.

             Utilizing Ant-1.8.0 and ant-contrib-1.0b3 (loops, mutable properties).
          --> 
        <for param="test.class.path.m" keepgoing="true">
            <!-- results in absolute path -->
            <fileset dir="${classes}">
                <include name="${java.dir.junit}/**/Test*SWT*AWT*"/>
                <exclude name="**/*$$*"/>
            </fileset>
          <sequential>
            <var name="test.class.path" unset="true"/>
            <property name="test.class.path" basedir="${classes}" relative="true" location="@{test.class.path.m}"/>
            <var name="test.class.fqn" unset="true"/>
            <pathconvert property="test.class.fqn">
              <fileset file="${classes}${file.separator}${test.class.path}"/>
              <chainedmapper>
                  <globmapper    from="${classes.path}${file.separator}*" to="*"/> <!-- rel. -->
                  <packagemapper from="*.class"           to="*"/> <!-- FQCN -->
              </chainedmapper>
            </pathconvert>
            <var name="test.class.result.file" value="${results.test}/TEST-${test.class.fqn}.xml"/>
            <echo message="Testing ${test.class.fqn} -- ${test.class.result.file}"/>
            <apply dir="." executable="${jvmJava.exe}"
                 parallel="false" 
                 timeout="${batchtest.timeout}"
                 vmlauncher="false"
                 relative="true"
                 failonerror="false">
                <env key="${system.env.library.path}" path="${obj.all.paths}"/>
                <env key="CLASSPATH" value="${junit_extra_classpath}${junit_jogl_swt.run.jars}"/>
                <arg line="${junit.run.arg0}"/>
                <arg line="${junit.run.arg1}"/>
                <arg line="${jvmDataModel.arg}"/>
                <arg value="-Djava.library.path=${obj.all.paths}"/>
                <!--
                <arg line="-Dnewt.debug.EDT"/>
                <arg line="-Dnativewindow.debug=all"/>
                <arg line="-Djogl.debug=all"/>
                <arg line="-Dnewt.debug=all"/>
                -->
                <arg line="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner"/>
                <srcfile/>
                <arg line="filtertrace=true"/>
                <arg line="haltOnError=false"/>
                <arg line="haltOnFailure=false"/>
                <arg line="showoutput=true"/>
                <arg line="outputtoformatters=true"/>
                <arg line="logfailedtests=true"/>
                <arg line="logtestlistenerevents=true"/>
                <arg line="formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter"/>
                <arg line="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.class.result.file}"/>
                <mappedresources>
                    <fileset dir="${classes}" includes="${test.class.path}"/>
                    <packagemapper from="*.class" to="*"/>
                </mappedresources>
            </apply>
          </sequential>
        </for>
    </target>

    <target name="junit.run.local" unless="isCrosscompilation" >
        <antcall target="junit.run.noui"          inheritRefs="true" inheritAll="true"/>
        <antcall target="junit.run.newt.headless" inheritRefs="true" inheritAll="true"/>
        <antcall target="junit.run.awt"           inheritRefs="true" inheritAll="true"/>
        <antcall target="junit.run.newt.awt"      inheritRefs="true" inheritAll="true"/>
        <antcall target="junit.run.swt.headless"  inheritRefs="true" inheritAll="true"/>
        <antcall target="junit.run.swt.awt"       inheritRefs="true" inheritAll="true"/>
    </target>

    <target name="junit.run.local.osx.d32" if="isOSX">
        <var name="jvmDataModel.arg" unset="true"/>
        <var name="jvmDataModel.arg" value="-d32"/>
        <var name="junit_extra_classpath" unset="true"/>
        <var name="junit_extra_classpath" value="${swt-cocoa-macosx-x86_32.jar}:"/>

        <antcall target="junit.run.local" inheritRefs="true" inheritAll="true"/>

        <mkdir dir="${build}/test/results-x32"/>
        <move todir="${build}/test/results-x32">
            <fileset dir="." includes="*.ps" />
            <fileset dir="." includes="*.pdf" />
            <fileset dir="." includes="*.png" />
            <fileset dir="." includes="*.pam" />
            <fileset dir="." includes="*.tga" />
            <fileset dir="." includes="hs_err_pid*.log" />
        </move>
        <move todir="${build}/test/results-x32">
            <fileset dir="${results.test}" includes="**" />
        </move>
        <mkdir dir="${results.test}"/>

        <var name="jvmDataModel.arg" unset="true"/>
        <var name="jvmDataModel.arg" value="-d64"/>
        <var name="junit_extra_classpath" unset="true"/>
        <var name="junit_extra_classpath" value=""/>
    </target>

    <target name="junit.run.local.java7" if="jvmJava7.exe">
        <var name="jvmJavaOrig.exe" value="${jvmJava.exe}"/>
        <var name="jvmJava.exe" unset="true"/>
        <var name="jvmJava.exe" value="${jvmJava7.exe}"/>

        <antcall target="junit.run.local" inheritRefs="true" inheritAll="true"/>

        <mkdir dir="${build}/test/results-java7"/>
        <move todir="${build}/test/results-java7">
            <fileset dir="." includes="*.ps" />
            <fileset dir="." includes="*.pdf" />
            <fileset dir="." includes="*.png" />
            <fileset dir="." includes="*.pam" />
            <fileset dir="." includes="*.tga" />
            <fileset dir="." includes="hs_err_pid*.log" />
        </move>
        <move todir="${build}/test/results-java7">
            <fileset dir="${results.test}" includes="**" />
        </move>
        <mkdir dir="${results.test}"/>

        <var name="jvmJava.exe" unset="true"/>
        <var name="jvmJava.exe" value="${jvmJavaOrig.exe}"/>
        <var name="jvmJavaOrig.exe" unset="true"/>
    </target>

    <target name="junit.run.remote.ssh.all" if="isCrosscompilation" unless="isAndroid">
        <echo message="#! /bin/sh${line.separator}" append="false" file="${build.test}/targetcommand.sh" />
        <echo message="${line.separator}
rsync -av --delete --delete-after --delete-excluded \${line.separator}
      --exclude 'build-x86*/' --exclude 'build-linux-x*/' --exclude 'build-android*/' --exclude 'build-win*/' --exclude 'build-mac*/' \${line.separator}
      --exclude 'classes/' --exclude 'src/' --exclude '.git/' --exclude '*-java-src.zip' \${line.separator}
      --exclude 'make/lib/external/' \${line.separator}
      ${env.HOST_UID}@${env.HOST_IP}::${env.HOST_RSYNC_ROOT}/${jogl.basename} ${env.TARGET_ROOT} ${line.separator}
cd ${env.TARGET_ROOT}/${jogl.basename}/${env.NODE_LABEL}/make ${line.separator}
" append="true" file="${build.test}/targetcommand.sh" />

        <for param="test.class.path.m" keepgoing="true">
            <!-- results in absolute path -->
            <fileset dir="${classes}">
                <include name="${java.dir.junit}/**/Test*NEWT*"/>
                <exclude name="**/*$$*"/>
            </fileset>
          <sequential>
            <var name="test.class.path" unset="true"/>
            <property name="test.class.path" basedir="${classes}" relative="true" location="@{test.class.path.m}"/>
            <var name="test.class.fqn" unset="true"/>
            <pathconvert property="test.class.fqn">
              <fileset file="${classes}${file.separator}${test.class.path}"/>
              <chainedmapper>
                  <globmapper    from="${classes.path}${file.separator}*" to="*"/> <!-- rel. -->
                  <packagemapper from="*.class"           to="*"/> <!-- FQCN -->
              </chainedmapper>
            </pathconvert>
            <var name="test.class.result.file" value="${results.test}/TEST-${test.class.fqn}.xml"/>
            <echo message="Testing ${test.class.fqn} -- ${test.class.result.file}"/>
            <echo message="${line.separator}
export DISPLAY=:0.0${line.separator}
java \${line.separator}
${junit.run.arg0}\${line.separator}
${junit.run.arg1}\${line.separator}
${jvmDataModel.arg}\${line.separator}
-cp ${junit_jogl_noawt.run.remote.jars}\${line.separator}
${jvmarg.headless}\${line.separator}
com.jogamp.newt.util.MainThread\${line.separator}
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner \${line.separator}
${test.class.fqn} \${line.separator}
filtertrace=true \${line.separator}
haltOnError=false \${line.separator}
haltOnFailure=false \${line.separator}
showoutput=true \${line.separator}
outputtoformatters=true \${line.separator}
logfailedtests=true \${line.separator}
logtestlistenerevents=true \${line.separator}
formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter \${line.separator}
formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.class.result.file} ${line.separator}
${line.separator}
" append="true" file="${build.test}/targetcommand.sh" />
          </sequential>
        </for>

        <for param="test.class.path.m" keepgoing="true">
            <!-- results in absolute path -->
            <fileset dir="${classes}">
                <include name="${java.dir.junit}/**/Test*AWT*"/>
                <exclude name="**/*$$*"/>
                <exclude name="**/*SWT*"/>
                <exclude name="${java.dir.junit}/**/Test*NEWT*"/>
            </fileset>
          <sequential>
            <var name="test.class.path" unset="true"/>
            <property name="test.class.path" basedir="${classes}" relative="true" location="@{test.class.path.m}"/>
            <var name="test.class.fqn" unset="true"/>
            <pathconvert property="test.class.fqn">
              <fileset file="${classes}${file.separator}${test.class.path}"/>
              <chainedmapper>
                  <globmapper    from="${classes.path}${file.separator}*" to="*"/> <!-- rel. -->
                  <packagemapper from="*.class"           to="*"/> <!-- FQCN -->
              </chainedmapper>
            </pathconvert>
            <var name="test.class.result.file" value="${results.test}/TEST-${test.class.fqn}.xml"/>
            <echo message="Testing ${test.class.fqn} -- ${test.class.result.file}"/>
            <echo message="${line.separator}
export DISPLAY=:0.0${line.separator}
java \${line.separator}
${junit.run.arg0}\${line.separator}
${junit.run.arg1}\${line.separator}
${jvmDataModel.arg}\${line.separator}
-cp ${junit_jogl_awt.run.remote.jars}\${line.separator}
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner \${line.separator}
${test.class.fqn} \${line.separator}
filtertrace=true \${line.separator}
haltOnError=false \${line.separator}
haltOnFailure=false \${line.separator}
showoutput=true \${line.separator}
outputtoformatters=true \${line.separator}
logfailedtests=true \${line.separator}
logtestlistenerevents=true \${line.separator}
formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter \${line.separator}
formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.class.result.file} ${line.separator}
${line.separator}
" append="true" file="${build.test}/targetcommand.sh" />
          </sequential>
        </for>
        <exec dir="." executable="sh" logError="true" failonerror="true" failifexecutionfails="true">
            <arg line='-x -c "
            chmod 0755 ${build.test}/targetcommand.sh ;
            scp ${build.test}/targetcommand.sh ${env.TARGET_UID}@${env.TARGET_IP}:${env.TARGET_ROOT}/jogl-targetcommand.sh ;
            ssh -x ${env.TARGET_UID}@${env.TARGET_IP} ${env.TARGET_ROOT}/jogl-targetcommand.sh ;
            scp -pr ${env.TARGET_UID}@${env.TARGET_IP}:${env.TARGET_ROOT}/${jogl.basename}/${env.NODE_LABEL}/make/${results.test}/* ${results.test}/ "'/>
        </exec>
    </target>

    <target name="junit.run.remote.ssh.newt" if="isCrosscompilation" unless="isAndroid">
        <echo message="#! /bin/sh${line.separator}" append="false" file="${build.test}/targetcommand.sh" />
        <echo message="${line.separator}
rsync -av --delete --delete-after --delete-excluded \${line.separator}
      --exclude 'build-x86*/' --exclude 'build-linux-x*/' --exclude 'build-android*/' --exclude 'build-win*/' --exclude 'build-mac*/' \${line.separator}
      --exclude 'classes/' --exclude 'src/' --exclude '.git/' --exclude '*-java-src.zip' \${line.separator}
      ${env.HOST_UID}@${env.HOST_IP}::${env.HOST_RSYNC_ROOT}/${jogl.basename} ${env.TARGET_ROOT} ${line.separator}
cd ${env.TARGET_ROOT}/${jogl.basename}/${env.NODE_LABEL}/make ${line.separator}
" append="true" file="${build.test}/targetcommand.sh" />

        <for param="test.class.path.m" keepgoing="true">
            <!-- results in absolute path -->
            <fileset dir="${classes}">
                <include name="${java.dir.junit}/**/Test*NEWT*"/>
                <exclude name="**/*$$*"/>
            </fileset>
          <sequential>
            <var name="test.class.path" unset="true"/>
            <property name="test.class.path" basedir="${classes}" relative="true" location="@{test.class.path.m}"/>
            <var name="test.class.fqn" unset="true"/>
            <pathconvert property="test.class.fqn">
              <fileset file="${classes}${file.separator}${test.class.path}"/>
              <chainedmapper>
                  <globmapper    from="${classes.path}${file.separator}*" to="*"/> <!-- rel. -->
                  <packagemapper from="*.class"           to="*"/> <!-- FQCN -->
              </chainedmapper>
            </pathconvert>
            <var name="test.class.result.file" value="${results.test}/TEST-${test.class.fqn}.xml"/>
            <echo message="Testing ${test.class.fqn} -- ${test.class.result.file}"/>
            <echo message="${line.separator}
export DISPLAY=:0.0${line.separator}
java \${line.separator}
${junit.run.arg0}\${line.separator}
${junit.run.arg1}\${line.separator}
${jvmDataModel.arg}\${line.separator}
-cp ${junit_jogl_noawt.run.remote.jars}\${line.separator}
${jvmarg.headless}\${line.separator}
com.jogamp.newt.util.MainThread\${line.separator}
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner \${line.separator}
${test.class.fqn} \${line.separator}
filtertrace=true \${line.separator}
haltOnError=false \${line.separator}
haltOnFailure=false \${line.separator}
showoutput=true \${line.separator}
outputtoformatters=true \${line.separator}
logfailedtests=true \${line.separator}
logtestlistenerevents=true \${line.separator}
formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter \${line.separator}
formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.class.result.file} ${line.separator}
${line.separator}
" append="true" file="${build.test}/targetcommand.sh" />
          </sequential>
        </for>

        <exec dir="." executable="sh" logError="true" failonerror="true" failifexecutionfails="true">
            <arg line='-x -c "
            chmod 0755 ${build.test}/targetcommand.sh ;
            scp ${build.test}/targetcommand.sh ${env.TARGET_UID}@${env.TARGET_IP}:${env.TARGET_ROOT}/jogl-targetcommand.sh ;
            ssh -x ${env.TARGET_UID}@${env.TARGET_IP} ${env.TARGET_ROOT}/jogl-targetcommand.sh ;
            scp -pr ${env.TARGET_UID}@${env.TARGET_IP}:${env.TARGET_ROOT}/${jogl.basename}/${env.NODE_LABEL}/make/${results.test}/* ${results.test}/ "'/>
        </exec>
    </target>

    <target name="junit.run.remote.ssh.awt" if="isCrosscompilation" unless="isAndroid">
        <echo message="#! /bin/sh${line.separator}" append="false" file="${build.test}/targetcommand.sh" />
        <echo message="${line.separator}
rsync -av --delete --delete-after --delete-excluded \${line.separator}
      --exclude 'build-x86*/' --exclude 'build-linux-x*/' --exclude 'build-android*/' --exclude 'build-win*/' --exclude 'build-mac*/' \${line.separator}
      --exclude 'classes/' --exclude 'src/' --exclude '.git/' --exclude '*-java-src.zip' \${line.separator}
      ${env.HOST_UID}@${env.HOST_IP}::${env.HOST_RSYNC_ROOT}/${jogl.basename} ${env.TARGET_ROOT} ${line.separator}
cd ${env.TARGET_ROOT}/${jogl.basename}/${env.NODE_LABEL}/make ${line.separator}
" append="true" file="${build.test}/targetcommand.sh" />

        <for param="test.class.path.m" keepgoing="true">
            <!-- results in absolute path -->
            <fileset dir="${classes}">
                <include name="${java.dir.junit}/**/Test*AWT*"/>
                <exclude name="**/*$$*"/>
                <exclude name="**/*SWT*"/>
                <exclude name="${java.dir.junit}/**/Test*NEWT*"/>
            </fileset>
          <sequential>
            <var name="test.class.path" unset="true"/>