<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
-->
<project xmlns:au="antlib:org.apache.ant.antunit">

  <target name="testInternalRuntimeForbidden">
    <!--
    public class Demo1 {
      static {
        (new com.sun.net.httpserver.Headers()).add("foo", "bar");
      }
    }
    -->
    <au:expectfailure expectedMessage="Check for forbidden API calls failed, see log">
      <forbiddenapis internalRuntimeForbidden="true">
        <fileset file="Demo1.class"/>
      </forbiddenapis>
    </au:expectfailure>
    <au:assertLogContains level="error" text="non-public internal runtime class"/> 
  </target>
  
</project>
<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
-->
<project xmlns:au="antlib:org.apache.ant.antunit">

  <available classname="com.sun.net.httpserver.Headers" property="hasSunHttpServer"/>

  <target name="testInternalRuntimeForbidden" if="hasSunHttpServer">
    <!--
    public class Demo1 {
      static {
        (new com.sun.net.httpserver.Headers()).add("foo", "bar");
      }
    }
    -->
    <au:expectfailure expectedMessage="Check for forbidden API calls failed, see log">
      <forbiddenapis internalRuntimeForbidden="true">
        <fileset file="Demo1.class"/>
      </forbiddenapis>
    </au:expectfailure>
    <au:assertLogContains level="error" text="non-public internal runtime class"/> 
  </target>
  
</project>
Fix test bug with Java 5 (Java 5 from Oracle does not have HttpServer in com.sun.*)
Fix test bug with Java 5 (Java 5 from Oracle does not have HttpServer in com.sun.*)

git-svn-id: 50b0c422a4e45306989420d5052835c941dc6296@44 d792475c-d26d-5892-9e01-79372957b29b
