Reformat code using Eclipse Mars

This commit is contained in:
Phillip Webb
2015-10-07 23:37:10 -07:00
parent e473364e4e
commit c9fb9916b8
408 changed files with 2831 additions and 2652 deletions

View File

@@ -61,8 +61,8 @@ public abstract class AbstractConfigurationMetadataTests {
}
protected InputStream getInputStreamFor(String name) throws IOException {
Resource r = new ClassPathResource("metadata/configuration-metadata-" + name
+ ".json");
Resource r = new ClassPathResource(
"metadata/configuration-metadata-" + name + ".json");
return r.getInputStream();
}

View File

@@ -31,8 +31,8 @@ import static org.junit.Assert.assertTrue;
*
* @author Stephane Nicoll
*/
public class ConfigurationMetadataRepositoryJsonBuilderTests extends
AbstractConfigurationMetadataTests {
public class ConfigurationMetadataRepositoryJsonBuilderTests
extends AbstractConfigurationMetadataTests {
@Test
public void nullResource() throws IOException {
@@ -48,8 +48,8 @@ public class ConfigurationMetadataRepositoryJsonBuilderTests extends
.create(foo).build();
validateFoo(repo);
assertEquals(1, repo.getAllGroups().size());
contains(repo.getAllProperties(), "spring.foo.name",
"spring.foo.description", "spring.foo.counter");
contains(repo.getAllProperties(), "spring.foo.name", "spring.foo.description",
"spring.foo.counter");
assertEquals(3, repo.getAllProperties().size());
}
finally {
@@ -67,9 +67,9 @@ public class ConfigurationMetadataRepositoryJsonBuilderTests extends
validateFoo(repo);
validateBar(repo);
assertEquals(2, repo.getAllGroups().size());
contains(repo.getAllProperties(), "spring.foo.name",
"spring.foo.description", "spring.foo.counter", "spring.bar.name",
"spring.bar.description", "spring.bar.counter");
contains(repo.getAllProperties(), "spring.foo.name", "spring.foo.description",
"spring.foo.counter", "spring.bar.name", "spring.bar.description",
"spring.bar.counter");
assertEquals(6, repo.getAllProperties().size());
}
finally {
@@ -88,9 +88,8 @@ public class ConfigurationMetadataRepositoryJsonBuilderTests extends
validateFoo(repo);
assertEquals(2, repo.getAllGroups().size());
contains(repo.getAllProperties(), "spring.foo.name",
"spring.foo.description", "spring.foo.counter", "spring.root.name",
"spring.root2.name");
contains(repo.getAllProperties(), "spring.foo.name", "spring.foo.description",
"spring.foo.counter", "spring.root.name", "spring.root2.name");
assertEquals(5, repo.getAllProperties().size());
}
finally {
@@ -114,9 +113,8 @@ public class ConfigurationMetadataRepositoryJsonBuilderTests extends
contains(group.getProperties(), "spring.foo.name", "spring.foo.description",
"spring.foo.counter", "spring.foo.enabled", "spring.foo.type");
assertEquals(5, group.getProperties().size());
contains(repo.getAllProperties(), "spring.foo.name",
"spring.foo.description", "spring.foo.counter", "spring.foo.enabled",
"spring.foo.type");
contains(repo.getAllProperties(), "spring.foo.name", "spring.foo.description",
"spring.foo.counter", "spring.foo.enabled", "spring.foo.type");
assertEquals(5, repo.getAllProperties().size());
}
finally {
@@ -159,12 +157,13 @@ public class ConfigurationMetadataRepositoryJsonBuilderTests extends
ConfigurationMetadataSource source = group.getSources().get("org.acme.Foo");
contains(source.getProperties(), "spring.foo.name", "spring.foo.description");
assertEquals(2, source.getProperties().size());
ConfigurationMetadataSource source2 = group.getSources().get(
"org.springframework.boot.FooProperties");
ConfigurationMetadataSource source2 = group.getSources()
.get("org.springframework.boot.FooProperties");
contains(source2.getProperties(), "spring.foo.name", "spring.foo.counter");
assertEquals(2, source2.getProperties().size());
validatePropertyHints(repo.getAllProperties().get("spring.foo.name"), 0, 0);
validatePropertyHints(repo.getAllProperties().get("spring.foo.description"), 0, 0);
validatePropertyHints(repo.getAllProperties().get("spring.foo.description"), 0,
0);
validatePropertyHints(repo.getAllProperties().get("spring.foo.counter"), 1, 1);
}
@@ -175,12 +174,13 @@ public class ConfigurationMetadataRepositoryJsonBuilderTests extends
ConfigurationMetadataSource source = group.getSources().get("org.acme.Bar");
contains(source.getProperties(), "spring.bar.name", "spring.bar.description");
assertEquals(2, source.getProperties().size());
ConfigurationMetadataSource source2 = group.getSources().get(
"org.springframework.boot.BarProperties");
ConfigurationMetadataSource source2 = group.getSources()
.get("org.springframework.boot.BarProperties");
contains(source2.getProperties(), "spring.bar.name", "spring.bar.counter");
assertEquals(2, source2.getProperties().size());
validatePropertyHints(repo.getAllProperties().get("spring.bar.name"), 0, 0);
validatePropertyHints(repo.getAllProperties().get("spring.bar.description"), 2, 2);
validatePropertyHints(repo.getAllProperties().get("spring.bar.description"), 2,
2);
validatePropertyHints(repo.getAllProperties().get("spring.bar.counter"), 0, 0);
}

View File

@@ -33,22 +33,22 @@ public class DescriptionExtractorTests {
@Test
public void extractShortDescription() {
String description = this.extractor.getShortDescription("My short "
+ "description. More stuff.");
String description = this.extractor
.getShortDescription("My short " + "description. More stuff.");
assertEquals("My short description.", description);
}
@Test
public void extractShortDescriptionNewLineBeforeDot() {
String description = this.extractor.getShortDescription("My short" + NEW_LINE
+ "description." + NEW_LINE + "More stuff.");
String description = this.extractor.getShortDescription(
"My short" + NEW_LINE + "description." + NEW_LINE + "More stuff.");
assertEquals("My short description.", description);
}
@Test
public void extractShortDescriptionNewLineBeforeDotWithSpaces() {
String description = this.extractor.getShortDescription("My short " + NEW_LINE
+ " description. " + NEW_LINE + "More stuff.");
String description = this.extractor.getShortDescription(
"My short " + NEW_LINE + " description. " + NEW_LINE + "More stuff.");
assertEquals("My short description.", description);
}
@@ -60,8 +60,8 @@ public class DescriptionExtractorTests {
@Test
public void extractShortDescriptionNoDotMultipleLines() {
String description = this.extractor.getShortDescription("My short description "
+ NEW_LINE + " More stuff");
String description = this.extractor
.getShortDescription("My short description " + NEW_LINE + " More stuff");
assertEquals("My short description", description);
}

View File

@@ -92,7 +92,8 @@ public class JsonReaderTests extends AbstractConfigurationMetadataTests {
ValueProvider valueProvider = hint.getValueProviders().get(0);
assertEquals("handle-as", valueProvider.getName());
assertEquals(1, valueProvider.getParameters().size());
assertEquals(Integer.class.getName(), valueProvider.getParameters().get("target"));
assertEquals(Integer.class.getName(),
valueProvider.getParameters().get("target"));
}
@Test
@@ -141,8 +142,8 @@ public class JsonReaderTests extends AbstractConfigurationMetadataTests {
ConfigurationMetadataItem item = items.get(0);
assertProperty(item, "server.port", "server.port", Integer.class, null);
assertTrue(item.isDeprecated());
assertEquals("Server namespace has moved to spring.server", item.getDeprecation()
.getReason());
assertEquals("Server namespace has moved to spring.server",
item.getDeprecation().getReason());
assertEquals("server.spring.port", item.getDeprecation().getReplacement());
ConfigurationMetadataItem item2 = items.get(1);