blob: 55a6479832cbe575181baf52074e8077ca213a44 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2009, 2011 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.jpa.eclipselink.core.tests.internal.context.persistence;
import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.jpa.core.JpaFacet;
import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetDataModelProperties;
import org.eclipse.jpt.jpa.core.tests.internal.context.persistence.PersistenceUnitTestCase;
import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
import org.eclipse.jpt.jpa.eclipselink.core.platform.EclipseLinkPlatform;
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();
}
}