Example usage for org.springframework.core.env MapPropertySource getProperty

List of usage examples for org.springframework.core.env MapPropertySource getProperty

Introduction

In this page you can find the example usage for org.springframework.core.env MapPropertySource getProperty.

Prototype

@Override
    @Nullable
    public Object getProperty(String name) 

Source Link

Usage

From source file:net.ggtools.maven.DDLGeneratorMojoTest.java

@Test
public void createPropertySource() {
    MapPropertySource propertySource = mojo.createPropertySource();
    assertEquals(propertySource.getProperty(ENV_PREFIX + ".ddlFile"), ddlFile);
    assertEquals(propertySource.getProperty(ENV_PREFIX + ".defaultSchema"), SCHEMA);
    assertEquals(propertySource.getProperty(ENV_PREFIX + ".dialect"), Oracle10gDialect.class.getName());
    assertEquals(propertySource.getProperty(ENV_PREFIX + ".namingStrategy"),
            ImprovedNamingStrategy.class.getName());
    assertEquals(propertySource.getProperty(ENV_PREFIX + ".persistenceUnitName"), MY_PU);
    assertEquals(propertySource.getProperty(ENV_PREFIX + ".useNewGenerator"), true);
    assertEquals(propertySource.getProperty(ENV_PREFIX + ".persistenceXmlLocations"),
            PERSISTENCE_XML_LOCATIONS);//from ww  w .jav a  2s .  c o m
}