package org.springframework.cloud.service.relational;

import java.util.ArrayList;
import java.util.List;

import javax.sql.DataSource;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.springframework.cloud.service.common.MysqlServiceInfo;

public class PooledDataSourceCreatorsTest {
	@Mock private MysqlServiceInfo mockMysqlServiceInfo;

	// Just to grab driver class name and validation query string 
	private MysqlDataSourceCreator mysqlDataSourceCreator = new MysqlDataSourceCreator();
	
	@Before
	public void setup() {
		MockitoAnnotations.initMocks(this);
	}

	@Test
	public void pooledDataSourceCreation() {
		List<PooledDataSourceCreator<MysqlServiceInfo>> pooledDataSourceCreators = new ArrayList<PooledDataSourceCreator<MysqlServiceInfo>>();

		pooledDataSourceCreators.add(new BasicDbcpPooledDataSourceCreator<MysqlServiceInfo>());
		pooledDataSourceCreators.add(new TomcatDbcpPooledDataSourceCreator<MysqlServiceInfo>());
		pooledDataSourceCreators.add(new TomcatHighPerformancePooledDataSourceCreator<MysqlServiceInfo>());

		for (PooledDataSourceCreator<MysqlServiceInfo> testCreator : pooledDataSourceCreators) {
			DataSource ds = testCreator.create(mockMysqlServiceInfo, null, 
					                           mysqlDataSourceCreator.getDriverClassName(mockMysqlServiceInfo), 
					                           "select 1");
			
			Assert.assertNotNull(ds);
		}
	}
}

@@ -1460,16 +1460,94 @@
 NotNull(
+%22Failed to create datasource with %22 + testCreator.getClass().getSimpleName(), 
 ds);%0A%09%09%7D

Add descripting message in PooledDataSourceCreatorsTest to better understand test failure in CI