Fix eclipse errors and warnings

Fix some eclipse errors and warnings caused by XSD validation errors and
classes in the wrong place.
This commit is contained in:
Phillip Webb
2015-02-24 12:44:19 -08:00
parent 236f51a841
commit 8e594c790e
8 changed files with 11 additions and 5 deletions

View File

@@ -1,69 +0,0 @@
/*
* Copyright 2012-2015 the original author or authors.
*
* 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.
*/
package org.springframework.boot.gradle;
import java.io.IOException;
import org.gradle.tooling.ProjectConnection;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
import org.springframework.boot.dependency.tools.ManagedDependencies;
import org.springframework.boot.test.OutputCapture;
import static org.hamcrest.Matchers.containsString;
import static org.junit.Assert.assertThat;
/**
* Integration tests for bootRun's resource handling
*
* @author Andy Wilkinson
*/
public class BootRunResourceTests {
private static final String BOOT_VERSION = ManagedDependencies.get()
.find("spring-boot").getVersion();
private static ProjectConnection project;
@Rule
public OutputCapture output = new OutputCapture();
@BeforeClass
public static void createProject() throws IOException {
project = new ProjectCreator().createProject("boot-run-resources");
}
@Test
public void resourcesDirectlyFromSource() {
project.newBuild().forTasks("clean", "bootRun")
.withArguments("-PbootVersion=" + BOOT_VERSION, "-PaddResources=true")
.run();
assertThat(this.output.toString(), containsString("src/main/resources/test.txt"));
}
@Test
public void resourcesFromBuildOutput() {
project.newBuild().forTasks("clean", "bootRun")
.withArguments("-PbootVersion=" + BOOT_VERSION, "-PaddResources=false")
.run();
assertThat(this.output.toString(),
containsString("build/resources/main/test.txt"));
}
}

View File

@@ -1,15 +0,0 @@
buildscript {
repositories {
mavenLocal()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${project.bootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'spring-boot'
bootRun {
addResources = Boolean.valueOf(project.addResources)
}

View File

@@ -1,24 +0,0 @@
/*
* Copyright 2012-2015 the original author or authors.
*
* 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.
*/
public class BootRunResourcesApplication {
public static void main(String[] args) {
ClassLoader classLoader = BootRunResourcesApplication.class.getClassLoader();
System.out.println(classLoader.getResource("test.txt"));
}
}