@Test
public void testOdataJpaAccessFactory() {
ODataJPAFactoryImpl oDataJPAFactoryImpl = new ODataJPAFactoryImpl();
ODataJPAAccessFactory jpaAccessFactory = oDataJPAFactoryImpl.getODataJPAAccessFactory();
ODataJPAContextImpl oDataJPAContextImpl = new ODataJPAContextImpl();
EntityManagerFactory emf = new EntityManagerFactory() {
@Override
public boolean isOpen() {
// TODO Auto-generated method stub
return false;
}
@Override
public Map<String, Object> getProperties() {
// TODO Auto-generated method stub
return null;
}
@Override
public PersistenceUnitUtil getPersistenceUnitUtil() {
// TODO Auto-generated method stub
return null;
}
@Override
public Metamodel getMetamodel() {
// TODO Auto-generated method stub
return null;
}
@Override
public CriteriaBuilder getCriteriaBuilder() {
// TODO Auto-generated method stub
return null;
}
@Override
public Cache getCache() {
// TODO Auto-generated method stub
return null;
}
@SuppressWarnings("rawtypes")
@Override
public EntityManager createEntityManager(final Map arg0) {
// TODO Auto-generated method stub
return null;
}
@Override
public EntityManager createEntityManager() {
// TODO Auto-generated method stub
return null;
}
@Override
public void close() {
// TODO Auto-generated method stub
}
};
oDataJPAContextImpl.setEntityManagerFactory(emf);
oDataJPAContextImpl.setPersistenceUnitName("pUnit");
assertNotNull(jpaAccessFactory.getODataJPAMessageService(new Locale("en")));
assertNotNull(jpaAccessFactory.createODataJPAContext());
assertNotNull(jpaAccessFactory.createJPAEdmProvider(oDataJPAContextImpl));
assertNotNull(jpaAccessFactory.createODataProcessor(oDataJPAContextImpl));
}