blob: ad9e450fe146b4d1dc5758f10273f4a9ddbec52e [file] [log] [blame]
/*
* Copyright (c) 2010-2012 Eike Stepper (Berlin, Germany) and others.
* 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:
* Martin Fluegge - initial API and implementation
*/
package org.eclipse.emf.cdo.tests.bugzilla;
import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.session.CDOSession;
import org.eclipse.emf.cdo.tests.AbstractCDOTest;
import org.eclipse.emf.cdo.transaction.CDOTransaction;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.impl.AdapterImpl;
import org.eclipse.emf.ecore.resource.Resource;
/**
* @author Martin Fluegge
*/
public class Bugzilla_325603_Test extends AbstractCDOTest
{
public void testModifyResource() throws Exception
{
CDOSession session = openSession();
CDOTransaction transaction = session.openTransaction();
CDOResource resource = transaction.createResource(getResourcePath("/r1"));
resource.eAdapters().add(new AdapterImpl()
{
@Override
public void notifyChanged(Notification notification)
{
if (notification.getFeatureID(Resource.class) == Resource.RESOURCE__IS_MODIFIED)
{
assertInstanceOf(Boolean.class, notification.getOldValue());
notification.getOldBooleanValue();
// passed if we do not get an exception here
}
}
});
resource.setModified(true);
}
}