| /******************************************************************************* |
| * Copyright (c) 2009, 2010 Oracle. All rights reserved. |
| * This program and the accompanying materials are made available under the |
| * terms of the Eclipse Public License v1.0, which accompanies this distribution |
| * and is available at http://www.eclipse.org/legal/epl-v10.html. |
| * |
| * Contributors: |
| * Oracle - initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.jpt.eclipselink2_0.core.tests.internal.context.persistence; |
| |
| import org.eclipse.jpt.core.JpaFacet; |
| import org.eclipse.jpt.core.internal.facet.JpaFacetDataModelProperties; |
| import org.eclipse.jpt.core.tests.internal.context.persistence.PersistenceUnitTestCase; |
| import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnit; |
| import org.eclipse.jpt.eclipselink.core.platform.EclipseLinkPlatform; |
| import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel; |
| import org.eclipse.jpt.utility.model.value.PropertyValueModel; |
| import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties; |
| import org.eclipse.wst.common.frameworks.datamodel.IDataModel; |
| |
| /** |
| * EclipseLink2_0PersistenceUnitTestCase |
| */ |
| public abstract class EclipseLink2_0PersistenceUnitTestCase extends PersistenceUnitTestCase |
| { |
| protected EclipseLinkPersistenceUnit subject; |
| |
| protected PropertyValueModel<EclipseLinkPersistenceUnit> subjectHolder; |
| |
| // ********** constructors ********** |
| protected EclipseLink2_0PersistenceUnitTestCase(String name) { |
| super(name); |
| } |
| |
| @Override |
| protected void setUp() throws Exception { |
| super.setUp(); |
| this.subject = this.getPersistenceUnit(); |
| this.subjectHolder = new SimplePropertyValueModel<EclipseLinkPersistenceUnit>(this.subject); |
| this.populatePu(); |
| } |
| |
| @Override |
| protected IDataModel buildJpaConfigDataModel() { |
| IDataModel dataModel = super.buildJpaConfigDataModel(); |
| dataModel.setProperty(IFacetDataModelProperties.FACET_VERSION_STR, JpaFacet.VERSION_2_0.getVersionString()); |
| dataModel.setProperty(JpaFacetDataModelProperties.PLATFORM, EclipseLinkPlatform.VERSION_2_0); |
| return dataModel; |
| } |
| |
| @Override |
| protected EclipseLinkPersistenceUnit getPersistenceUnit() { |
| return (EclipseLinkPersistenceUnit) super.getPersistenceUnit(); |
| } |
| |
| } |