# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with this # work for additional information regarding copyright ownership. The ASF # licenses this file to you 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. require File.expand_path('../spec_helpers', File.dirname(__FILE__)) if Java.java.lang.System.getProperty("java.runtime.version") >= "1.6" Sandbox.require_optional_extension 'buildr/jaxb_xjc' XSD_CONTENT = < The name of the district WITHOUT the "FIRE DISTRICT" suffix. This is a grid reference in lat/long format. XSD describe Buildr::JaxbXjc do describe "compiled with specified xsd" do before do write "src/main/xsd/wildfire-1.3.xsd", XSD_CONTENT @foo = define "foo" do project.version = "2.1.3" compile.from compile_jaxb("src/main/xsd/wildfire-1.3.xsd", "-quiet", :package => "org.foo.api") package :jar end task('compile').invoke end it "produce .java files in the correct location" do File.should be_exist(@foo._("target/generated/jaxb/org/foo/api/Agency.java")) File.should be_exist(@foo._("target/generated/jaxb/org/foo/api/LatLongCoordinate.java")) File.should be_exist(@foo._("target/generated/jaxb/org/foo/api/ObjectFactory.java")) File.should be_exist(@foo._("target/generated/jaxb/org/foo/api/Wildfire.java")) end it "produce .class files in the correct location" do File.should be_exist(@foo._("target/classes/org/foo/api/Agency.class")) File.should be_exist(@foo._("target/classes/org/foo/api/LatLongCoordinate.class")) File.should be_exist(@foo._("target/classes/org/foo/api/ObjectFactory.class")) File.should be_exist(@foo._("target/classes/org/foo/api/Wildfire.class")) end end end elsif Buildr::VERSION >= '1.5' raise "JVM version guard in #{__FILE__} should be removed since it is assumed that Java 1.5 is no longer supported." end