Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

CFID-283: Add env and scripts to enable postgres testing easily from …

…command line

Change-Id: I62b9520b9a2253759080b16d688a4cceb4e46626
  • Loading branch information...
commit 445be969db80dca7afac0ccf3fbb8983118e7395 1 parent 76cb4b8
@dsyer dsyer authored
Showing with 113 additions and 101 deletions.
  1. +13 −0 .travis.yml
  2. +3 −0  common/pom.xml
  3. +5 −1 common/src/main/java/org/cloudfoundry/identity/uaa/ParentContextLoader.java
  4. +15 −7 common/src/main/java/org/cloudfoundry/identity/uaa/TestUtils.java
  5. +2 −1  common/src/main/java/org/cloudfoundry/identity/uaa/config/YamlProcessor.java
  6. +19 −14 common/src/main/java/org/cloudfoundry/identity/uaa/integration/TestProfileEnvironment.java
  7. +7 −7 common/src/test/java/org/cloudfoundry/identity/uaa/audit/JdbcAuditServiceTests.java
  8. +1 −1  common/src/test/java/org/cloudfoundry/identity/uaa/scim/JdbcPagingListTests.java
  9. +1 −1  common/src/test/java/org/cloudfoundry/identity/uaa/scim/JdbcScimUserProvisioningTests.java
  10. +1 −1  common/src/test/java/org/cloudfoundry/identity/uaa/user/JdbcUaaUserDatabaseTests.java
  11. +3 −14 common/src/test/resources/log4j.properties
  12. +1 −1  common/src/test/resources/test-data-source.xml
  13. +1 −2  uaa/.springBeans
  14. +1 −1  uaa/pom.xml
  15. +1 −0  uaa/src/main/resources/log4j.properties
  16. +12 −13 uaa/src/test/java/org/cloudfoundry/identity/uaa/scim/jobs/AbstractJobIntegrationTests.java
  17. +5 −6 uaa/src/test/java/org/cloudfoundry/identity/uaa/scim/jobs/BackwardMigrationJobIntegrationTests.java
  18. +0 −2  uaa/src/test/java/org/cloudfoundry/identity/uaa/scim/jobs/UserMigrationJobIntegrationTests.java
  19. +22 −0 uaa/src/test/resources/org/cloudfoundry/identity/uaa/cloud-controller-schema-postgresql.sql
  20. +0 −28 uaa/src/test/resources/test-data-source.xml
  21. +0 −1  uaa/src/test/resources/test/profiles/postgresql/uaa.yml
View
13 .travis.yml
@@ -1,2 +1,15 @@
language: java
+
+before_script:
+ - if [ "$CLOUD_FOUNDRY_CONFIG_PATH" != "" ]; then psql -c 'create database cloud_controller;' -U postgres; fi
+ - if [ "$CLOUD_FOUNDRY_CONFIG_PATH" != "" ]; then psql -c 'create database uaa;' -U postgres; fi
+ - if [ "$CLOUD_FOUNDRY_CONFIG_PATH" != "" ]; then psql -c 'create role root NOSUPERUSER LOGIN INHERIT CREATEDB;' -U postgres; fi
+ - if [ "$CLOUD_FOUNDRY_CONFIG_PATH" != "" ]; then psql -c "alter role root with password 'changeme';" -U postgres; fi
+
install: mvn -U install --quiet -DskipTests=true
+script: mvn clean test
+
+env:
+ -
+ - CLOUD_FOUNDRY_CONFIG_PATH=src/test/resources/test/profiles/postgresql SPRING_PROFILES_ACTIVE=test,postgresql
+
View
3  common/pom.xml
@@ -71,6 +71,9 @@
<excludes>
<exclude>**/Abstract*.java</exclude>
</excludes>
+ <systemPropertyVariables>
+ <spring.profiles.active>${SPRING_PROFILES_ACTIVE}</spring.profiles.active>
+ </systemPropertyVariables>
</configuration>
</plugin>
</plugins>
View
6 common/src/main/java/org/cloudfoundry/identity/uaa/ParentContextLoader.java
@@ -13,6 +13,7 @@
package org.cloudfoundry.identity.uaa;
+import org.cloudfoundry.identity.uaa.integration.TestProfileEnvironment;
import org.springframework.context.support.GenericApplicationContext;
import org.springframework.context.support.GenericXmlApplicationContext;
import org.springframework.test.context.support.GenericXmlContextLoader;
@@ -35,7 +36,10 @@
@Override
protected void customizeContext(GenericApplicationContext context) {
- GenericXmlApplicationContext parent = new GenericXmlApplicationContext(parentLocation);
+ GenericXmlApplicationContext parent = new GenericXmlApplicationContext();
+ parent.setEnvironment(TestProfileEnvironment.getEnvironment());
+ parent.load(parentLocation);
+ parent.refresh();
super.customizeContext(context);
context.setParent(parent);
}
View
22 common/src/main/java/org/cloudfoundry/identity/uaa/TestUtils.java
@@ -18,6 +18,8 @@
import javax.sql.DataSource;
+import org.cloudfoundry.identity.uaa.integration.TestProfileEnvironment;
+import org.springframework.core.env.Environment;
import org.springframework.core.io.ClassPathResource;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.datasource.DataSourceUtils;
@@ -26,11 +28,16 @@
/**
* Common methods for DB manipulation and so on.
- *
+ *
* @author Luke Taylor
+ * @author Dave Syer
+ *
*/
public class TestUtils {
- private static String platform = System.getProperty("PLATFORM", "hsqldb");
+
+ private static Environment environment = TestProfileEnvironment.getEnvironment();
+
+ private static String platform = environment.acceptsProfiles("postgresql") ? "postgresql" : "hsqldb";
public static void runScript(DataSource dataSource, String stem) throws Exception {
ResourceDatabasePopulator populator = new ResourceDatabasePopulator();
@@ -38,9 +45,11 @@ public static void runScript(DataSource dataSource, String stem) throws Exceptio
Connection connection = dataSource.getConnection();
try {
populator.populate(connection);
- } catch (ScriptStatementFailedException e) {
+ }
+ catch (ScriptStatementFailedException e) {
// ignore
- } finally {
+ }
+ finally {
DataSourceUtils.releaseConnection(connection, dataSource);
}
}
@@ -55,13 +64,12 @@ public static void dropSchema(DataSource dataSource) throws Exception {
public static void deleteFrom(DataSource dataSource, String... tables) throws Exception {
for (String table : tables) {
- new JdbcTemplate(dataSource).update("delete from " + table);
+ new JdbcTemplate(dataSource).update("delete from " + table);
}
}
public static void assertNoSuchUser(JdbcTemplate template, String column, String value) {
- assertEquals(0, template.queryForInt("select count(id) from users where " + column +"='"+value+"'"));
+ assertEquals(0, template.queryForInt("select count(id) from users where " + column + "='" + value + "'"));
}
-
}
View
3  common/src/main/java/org/cloudfoundry/identity/uaa/config/YamlProcessor.java
@@ -132,12 +132,13 @@ protected void process(MatchCallback callback) {
logger.info("Loading from YAML: " + resource);
for (Object object : yaml.loadAll(resource.getInputStream())) {
if (resolutionMethod != ResolutionMethod.FIRST_FOUND || !found) {
+ int count = 0;
@SuppressWarnings("unchecked")
Map<String, Object> map = (Map<String, Object>) object;
if (map != null) {
process(map, callback);
found = true;
- logger.debug("Loaded from YAML: " + map);
+ logger.debug("Loaded " + (count++) + " documents from YAML: " + resource);
}
}
}
View
33 common/src/main/java/org/cloudfoundry/identity/uaa/integration/TestProfileEnvironment.java
@@ -12,7 +12,10 @@
*/
package org.cloudfoundry.identity.uaa.integration;
+import java.util.ArrayList;
+import java.util.Collections;
import java.util.Enumeration;
+import java.util.List;
import java.util.Map;
import java.util.Properties;
@@ -21,7 +24,7 @@
import org.cloudfoundry.identity.uaa.config.EnvironmentPropertiesFactoryBean;
import org.cloudfoundry.identity.uaa.config.YamlProcessor.ResolutionMethod;
import org.cloudfoundry.identity.uaa.config.YamlPropertiesFactoryBean;
-import org.springframework.core.env.Environment;
+import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.PropertiesPropertySource;
import org.springframework.core.env.StandardEnvironment;
import org.springframework.core.io.DefaultResourceLoader;
@@ -47,21 +50,23 @@
private TestProfileEnvironment() {
- Resource resource = null;
-
- Properties properties = new Properties();
+ List<Resource> resources = new ArrayList<Resource>();
for (String location : DEFAULT_PROFILE_CONFIG_FILE_LOCATIONS) {
location = environment.resolvePlaceholders(location);
- resource = recourceLoader.getResource(location);
+ Resource resource = recourceLoader.getResource(location);
if (resource != null && resource.exists()) {
- YamlPropertiesFactoryBean factory = new YamlPropertiesFactoryBean();
- factory.setResources(new Resource[] {resource});
- factory.setResolutionMethod(ResolutionMethod.OVERRIDE_AND_IGNORE);
- properties.putAll(factory.getObject());
+ resources.add(resource);
}
}
+ YamlPropertiesFactoryBean factory = new YamlPropertiesFactoryBean();
+ factory.setResources(resources.toArray(new Resource[resources.size()]));
+ factory.setDocumentMatchers(Collections.singletonMap("platform",
+ environment.acceptsProfiles("postgresql") ? "postgresql" : "hsqldb"));
+ factory.setResolutionMethod(ResolutionMethod.OVERRIDE_AND_IGNORE);
+ Properties properties = factory.getObject();
+
logger.debug("Decoding environment properties: " + properties.size());
if (!properties.isEmpty()) {
for (Enumeration<?> names = properties.propertyNames(); names.hasMoreElements();) {
@@ -79,17 +84,17 @@ private TestProfileEnvironment() {
environment.getPropertySources().addLast(new PropertiesPropertySource("uaa.yml", properties));
}
- EnvironmentPropertiesFactoryBean factory = new EnvironmentPropertiesFactoryBean();
- factory.setEnvironment(environment);
- factory.setDefaultProperties(properties);
- Map<String, ?> debugProperties = factory.getObject();
+ EnvironmentPropertiesFactoryBean environmentProperties = new EnvironmentPropertiesFactoryBean();
+ environmentProperties.setEnvironment(environment);
+ environmentProperties.setDefaultProperties(properties);
+ Map<String, ?> debugProperties = environmentProperties.getObject();
logger.debug("Environment properties: " + debugProperties);
}
/**
* @return the environment
*/
- public static Environment getEnvironment() {
+ public static ConfigurableEnvironment getEnvironment() {
return instance.environment;
}
View
14 common/src/test/java/org/cloudfoundry/identity/uaa/audit/JdbcAuditServiceTests.java
@@ -12,16 +12,16 @@
*/
package org.cloudfoundry.identity.uaa.audit;
-import java.sql.Timestamp;
-import java.util.List;
-import javax.sql.DataSource;
-
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
+import java.sql.Timestamp;
+import java.util.List;
+
+import javax.sql.DataSource;
+
import org.cloudfoundry.identity.uaa.NullSafeSystemProfileValueSource;
-import org.cloudfoundry.identity.uaa.TestUtils;
import org.cloudfoundry.identity.uaa.authentication.UaaAuthenticationDetails;
import org.cloudfoundry.identity.uaa.user.UaaUser;
import org.junit.Before;
@@ -40,7 +40,7 @@
*/
@ContextConfiguration ("classpath:/test-data-source.xml")
@RunWith (SpringJUnit4ClassRunner.class)
-@IfProfileValue (name = "spring.profiles.active", values = { "" , "hsqldb" })
+@IfProfileValue (name = "spring.profiles.active", values = { "" , "hsqldb", "test,postgresql" })
@ProfileValueSourceConfiguration (NullSafeSystemProfileValueSource.class)
public class JdbcAuditServiceTests {
@@ -56,8 +56,8 @@
@Before
public void createService() throws Exception {
template = new JdbcTemplate(dataSource);
- TestUtils.createSchema(dataSource);
auditService = new JdbcAuditService(dataSource);
+ template.execute("DELETE FROM SEC_AUDIT WHERE principal_id='1' or principal_id='clientA' or principal_id='clientB'");
MockHttpServletRequest request = new MockHttpServletRequest();
request.setRemoteAddr("1.1.1.1");
View
2  common/src/test/java/org/cloudfoundry/identity/uaa/scim/JdbcPagingListTests.java
@@ -42,7 +42,7 @@
*/
@ContextConfiguration("classpath:/test-data-source.xml")
@RunWith(SpringJUnit4ClassRunner.class)
-@IfProfileValue(name = "spring.profiles.active", values = { "", "test,postgresql", "hsqldb", "empty,postgresql" })
+@IfProfileValue(name = "spring.profiles.active", values = { "", "test,postgresql", "hsqldb" })
@ProfileValueSourceConfiguration(NullSafeSystemProfileValueSource.class)
public class JdbcPagingListTests {
View
2  common/src/test/java/org/cloudfoundry/identity/uaa/scim/JdbcScimUserProvisioningTests.java
@@ -42,7 +42,7 @@
*/
@ContextConfiguration("classpath:/test-data-source.xml")
@RunWith(SpringJUnit4ClassRunner.class)
-@IfProfileValue(name = "spring.profiles.active", values = { "", "test,postgresql", "hsqldb", "empty,postgresql" })
+@IfProfileValue(name = "spring.profiles.active", values = { "", "test,postgresql", "hsqldb" })
@ProfileValueSourceConfiguration(NullSafeSystemProfileValueSource.class)
public class JdbcScimUserProvisioningTests {
View
2  common/src/test/java/org/cloudfoundry/identity/uaa/user/JdbcUaaUserDatabaseTests.java
@@ -39,7 +39,7 @@
*/
@ContextConfiguration("classpath:/test-data-source.xml")
@RunWith(SpringJUnit4ClassRunner.class)
-@IfProfileValue(name = "spring.profiles.active", values = { "" , "hsqldb", "test,postgresql", "empty,postgresql" })
+@IfProfileValue(name = "spring.profiles.active", values = { "" , "hsqldb", "test,postgresql" })
@ProfileValueSourceConfiguration(NullSafeSystemProfileValueSource.class)
public class JdbcUaaUserDatabaseTests {
View
17 common/src/test/resources/log4j.properties
@@ -11,12 +11,9 @@
# subcomponent's license, as noted in the LICENSE file.
#
-log4j.rootCategory=INFO, CONSOLE, FILE
+log4j.rootCategory=INFO, CONSOLE
PID=????
-catalina.base=/tmp
-LOG_PATH=${catalina.base}/logs
-LOG_FILE=${LOG_PATH}/uaa.log
LOG_PATTERN=[%d{yyyy-MM-dd HH:mm:ss.SSS}] uaa - ${PID} [%t] .... %5p --- %c{1}: %m%n
# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
@@ -24,18 +21,10 @@ log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=${LOG_PATTERN}
-log4j.appender.FILE=org.apache.log4j.RollingFileAppender
-log4j.appender.FILE.File=${LOG_FILE}
-log4j.appender.FILE.MaxFileSize=10MB
-log4j.appender.FILE.layout = org.apache.log4j.PatternLayout
-log4j.appender.FILE.layout.ConversionPattern=${LOG_PATTERN}
-
log4j.category.org.springframework.security=DEBUG
log4j.category.org.cloudfoundry.identity=DEBUG
-log4j.category.org.springframework.web=DEBUG
+log4j.category.org.springframework.web=INFO
log4j.category.org.springframework.jdbc.datasource=DEBUG
log4j.category.org.springframework.jdbc.datasource.DataSourceUtils=INFO
-#log4j.category.UAA.Audit=TRACE
-#log4j.category.org.springframework.beans.factory.support=DEBUG
+log4j.category.org.springframework.beans.factory.support=DEBUG
log4j.category.org.springframework.web.context.support.StandardServletEnvironment=INFO
-# log4j.category.org.apache.http.wire=DEBUG
View
2  common/src/test/resources/test-data-source.xml
@@ -42,7 +42,7 @@
</beans>
<beans profile="postgresql">
- <context:property-placeholder location="postgresql.properties"/>
+ <context:property-placeholder location="${POSTGRESQL_PROPERTIES:postgresql.properties}"/>
<bean id="platform" class="java.lang.String">
<constructor-arg value="postgresql" />
</bean>
View
3  uaa/.springBeans
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<beansProjectDescription>
<version>1</version>
- <pluginVersion><![CDATA[2.8.0.201110170010-RELEASE]]></pluginVersion>
+ <pluginVersion><![CDATA[2.9.1.201203220057-RELEASE]]></pluginVersion>
<configSuffixes>
<configSuffix><![CDATA[xml]]></configSuffix>
</configSuffixes>
@@ -12,7 +12,6 @@
<config>src/main/webapp/WEB-INF/oauth-clients.xml</config>
<config>src/main/webapp/WEB-INF/spring-data-source.xml</config>
<config>src/main/webapp/WEB-INF/spring-scim.xml</config>
- <config>src/test/resources/test-data-source.xml</config>
<config>src/test/resources/test/config/test-override.xml</config>
</configs>
<configSets>
View
2  uaa/pom.xml
@@ -18,7 +18,6 @@
<properties>
<m2eclipse.wtp.contextRoot>/uaa</m2eclipse.wtp.contextRoot>
<uaa.path>/uaa</uaa.path>
- <CLOUD_FOUNDRY_CONFIG_PATH></CLOUD_FOUNDRY_CONFIG_PATH>
<!-- Brain dead install plugin (Maven 3) cannot extract this stuff from its own configuration -->
<file>target/${project.artifactId}-${project.version}.war</file>
<groupId>${project.groupId}</groupId>
@@ -150,6 +149,7 @@
<exclude>**/Abstract*.java</exclude>
</excludes>
<systemPropertyVariables>
+ <spring.profiles.active>${SPRING_PROFILES_ACTIVE}</spring.profiles.active>
<CLOUD_FOUNDRY_CONFIG_PATH>${CLOUD_FOUNDRY_CONFIG_PATH}</CLOUD_FOUNDRY_CONFIG_PATH>
</systemPropertyVariables>
</configuration>
View
1  uaa/src/main/resources/log4j.properties
@@ -33,6 +33,7 @@ log4j.appender.FILE.layout.ConversionPattern=${LOG_PATTERN}
log4j.category.org.springframework.security=DEBUG
log4j.category.org.cloudfoundry.identity=DEBUG
log4j.category.org.springframework.web=DEBUG
+log4j.category.org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping=INFO
log4j.category.org.springframework.jdbc.datasource=DEBUG
log4j.category.org.springframework.jdbc.datasource.DataSourceUtils=INFO
log4j.category.org.springframework.jdbc.datasource.DataSourceTransactionManager=INFO
View
25 uaa/src/test/java/org/cloudfoundry/identity/uaa/scim/jobs/AbstractJobIntegrationTests.java
@@ -39,7 +39,7 @@
@ContextConfiguration(locations = { "file:./src/main/webapp/WEB-INF/applicationContext.xml",
"file:./src/main/webapp/WEB-INF/batch-servlet.xml", "classpath*:/META-INF/spring/batch/jobs/jobs.xml" }, loader = ParentContextLoader.class)
@RunWith(SpringJUnit4ClassRunner.class)
-@IfProfileValue(name = "spring.profiles.active", values = { "", "test,postgresql", "hsqldb", "empty,postgresql" })
+@IfProfileValue(name = "spring.profiles.active", values = { "", "test,postgresql", "hsqldb" })
@ProfileValueSourceConfiguration(NullSafeSystemProfileValueSource.class)
public abstract class AbstractJobIntegrationTests {
@@ -77,22 +77,21 @@ public void setJobRepository(JobRepository jobRepository) throws Exception {
@Before
public void setUpData() throws Exception {
TestUtils.runScript(cloudControllerDataSource, "cloud-controller-schema");
- TestUtils.runScript(uaaDataSource, "schema");
- new JdbcTemplate(cloudControllerDataSource)
- .update("insert into users (id, active, email, crypted_password, created_at, updated_at) values (?, ?, ?, ?, ?, ?)",
- 0, true, "marissa@test.org", "ENCRYPT_ME", new Date(), new Date());
- new JdbcTemplate(cloudControllerDataSource)
- .update("insert into users (id, active, email, crypted_password, created_at, updated_at) values (?, ?, ?, ?, ?, ?)",
- 1, true, "vcap_tester@vmware.com", "ENCRYPT_ME", new Date(), new Date());
- new JdbcTemplate(cloudControllerDataSource)
- .update("insert into users (id, active, email, crypted_password, created_at, updated_at) values (?, ?, ?, ?, ?, ?)",
- 2, true, "dale@test.org", "ENCRYPT_ME", new Date(), new Date());
+ new JdbcTemplate(cloudControllerDataSource).update(
+ "insert into users (active, email, crypted_password, created_at, updated_at) values (?, ?, ?, ?, ?)",
+ true, "marissa@test.org", "ENCRYPT_ME", new Date(), new Date());
+ new JdbcTemplate(cloudControllerDataSource).update(
+ "insert into users (active, email, crypted_password, created_at, updated_at) values (?, ?, ?, ?, ?)",
+ true, "vcap_tester@vmware.com", "ENCRYPT_ME", new Date(), new Date());
+ new JdbcTemplate(cloudControllerDataSource).update(
+ "insert into users (active, email, crypted_password, created_at, updated_at) values (?, ?, ?, ?, ?)",
+ true, "dale@test.org", "ENCRYPT_ME", new Date(), new Date());
}
@After
public void clearUp() {
- new JdbcTemplate(cloudControllerDataSource).update("delete from users");
- new JdbcTemplate(uaaDataSource).update("delete from users");
+ new JdbcTemplate(cloudControllerDataSource).update("delete from users where crypted_password='ENCRYPT_ME'");
+ new JdbcTemplate(uaaDataSource).update("delete from users where password='ENCRYPT_ME'");
}
}
View
11 ...st/java/org/cloudfoundry/identity/uaa/scim/jobs/BackwardMigrationJobIntegrationTests.java
@@ -24,13 +24,11 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.test.context.ContextConfiguration;
/**
* @author Dave Syer
*
*/
-@ContextConfiguration
public class BackwardMigrationJobIntegrationTests extends AbstractJobIntegrationTests {
@Autowired
@@ -39,10 +37,11 @@
@Test
public void testJobRuns() throws Exception {
- new JdbcTemplate(uaaDataSource)
- .update("insert into users (id, active, userName, email, password, familyName, givenName, created, lastModified) values (?, ?, ?, ?, ?, ?, ?, ?, ?)",
- "FOO", true, "uniqua", "uniqua@test.org", "ENCRYPT_ME", "Una", "Uniqua", new Date(),
- new Date());
+ JdbcTemplate uaaTemplate = new JdbcTemplate(uaaDataSource);
+ uaaTemplate.update("insert into users "
+ + "(id, active, userName, email, password, familyName, givenName, created, lastModified) "
+ + "values (?, ?, ?, ?, ?, ?, ?, ?, ?)", "FOO", true, "uniqua", "uniqua@test.org", "ENCRYPT_ME", "Una",
+ "Uniqua", new Date(), new Date());
JobExecution execution = jobLauncher.run(job, new JobParametersBuilder().addDate("start.date", new Date(0L))
.toJobParameters());
assertEquals(BatchStatus.COMPLETED, execution.getStatus());
View
2  ...c/test/java/org/cloudfoundry/identity/uaa/scim/jobs/UserMigrationJobIntegrationTests.java
@@ -25,13 +25,11 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.test.context.ContextConfiguration;
/**
* @author Dave Syer
*
*/
-@ContextConfiguration
public class UserMigrationJobIntegrationTests extends AbstractJobIntegrationTests {
@Autowired
View
22 uaa/src/test/resources/org/cloudfoundry/identity/uaa/cloud-controller-schema-postgresql.sql
@@ -0,0 +1,22 @@
+--
+-- Cloud Foundry 2012.02.03 Beta
+-- Copyright (c) [2009-2012] VMware, Inc. All Rights Reserved.
+--
+-- This product is licensed to you under the Apache License, Version 2.0 (the "License").
+-- You may not use this product except in compliance with the License.
+--
+-- This product includes a number of subcomponents with
+-- separate copyright notices and license terms. Your use of these
+-- subcomponents is subject to the terms and conditions of the
+-- subcomponent's license, as noted in the LICENSE file.
+--
+
+CREATE TABLE USERS (
+ id SERIAL primary key,
+ created_at TIMESTAMP default current_timestamp not null,
+ updated_at TIMESTAMP default current_timestamp not null,
+ active boolean default true not null,
+ crypted_password VARCHAR(255) not null,
+ email VARCHAR(255) not null,
+ constraint unique_uk_1 unique(email)
+) ;
View
28 uaa/src/test/resources/test-data-source.xml
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Cloud Foundry 2012.02.03 Beta
- Copyright (c) [2009-2012] VMware, Inc. All Rights Reserved.
-
- This product is licensed to you under the Apache License, Version 2.0 (the "License").
- You may not use this product except in compliance with the License.
-
- This product includes a number of subcomponents with
- separate copyright notices and license terms. Your use of these
- subcomponents is subject to the terms and conditions of the
- subcomponent's license, as noted in the LICENSE file.
-
--->
-<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:context="http://www.springframework.org/schema/context"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
-
- <import resource="file:./src/main/webapp/WEB-INF/spring-data-source.xml"/>
- <import resource="file:./src/main/webapp/WEB-INF/env-context.xml"/>
-
- <context:property-placeholder properties-ref="applicationProperties"/>
-
- <context:mbean-server id="mbeanServer" />
-
-</beans>
View
1  uaa/src/test/resources/test/profiles/postgresql/uaa.yml
@@ -1,5 +1,4 @@
uaa:
- integration.test: true
test:
username: marissa
password: dr0WssaPH@ck
Please sign in to comment.
Something went wrong with that request. Please try again.