| /******************************************************************************* |
| * Copyright (c) 2010-2012 Oracle. All rights reserved. |
| * This program and the accompanying materials are made available under the |
| * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 |
| * which accompanies this distribution. |
| * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html |
| * and the Eclipse Distribution License is available at |
| * http://www.eclipse.org/org/documents/edl-v10.php. |
| * |
| * Contributors: |
| * dclarke - EclipseLink 2.4 - MySports Demo Bug 344608 |
| ******************************************************************************/ |
| package eclipselink.example.mysports.admin.test; |
| |
| import static org.eclipse.persistence.config.PersistenceUnitProperties.CONNECTION_POOL; |
| import static org.eclipse.persistence.config.PersistenceUnitProperties.CONNECTION_POOL_INITIAL; |
| import static org.eclipse.persistence.config.PersistenceUnitProperties.CONNECTION_POOL_MIN; |
| import static org.eclipse.persistence.config.PersistenceUnitProperties.CONNECTION_POOL_READ; |
| import static org.eclipse.persistence.config.PersistenceUnitProperties.NON_JTA_DATASOURCE; |
| import static org.eclipse.persistence.config.PersistenceUnitProperties.TRANSACTION_TYPE; |
| |
| import java.util.HashMap; |
| import java.util.Map; |
| |
| public class PersistenceTesting { |
| |
| public static Map<String, Object> add(Map<String, Object> properties) { |
| Map<String, Object> props = properties; |
| |
| if (props == null) { |
| props = new HashMap<String, Object>(); |
| } |
| props.put(TRANSACTION_TYPE, "RESOURCE_LOCAL"); |
| props.put(NON_JTA_DATASOURCE, ""); |
| |
| props.put(CONNECTION_POOL_READ + CONNECTION_POOL_INITIAL, "1"); |
| props.put(CONNECTION_POOL_READ + CONNECTION_POOL_MIN, "1"); |
| props.put(CONNECTION_POOL + CONNECTION_POOL_INITIAL, "1"); |
| props.put(CONNECTION_POOL + CONNECTION_POOL_MIN, "1"); |
| |
| ExamplePropertiesLoader.loadProperties(props); |
| return props; |
| } |
| |
| public static Map<String, Object> get() { |
| return add(null); |
| } |
| |
| } |