Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2013-08-31 23:45:21 +0000
committerChristian W. Damus2013-08-31 23:45:21 +0000
commitb29a7843c0874837b93011a2f9d292c18ea2c6ff (patch)
tree691ea6d74cfa54354fd5c3220fc86f8c1815387e /plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests
parent7a0e02414adcc7db93927658153cd18400e3eeeb (diff)
downloadcdo-b29a7843c0874837b93011a2f9d292c18ea2c6ff.tar.gz
cdo-b29a7843c0874837b93011a2f9d292c18ea2c6ff.tar.xz
cdo-b29a7843c0874837b93011a2f9d292c18ea2c6ff.zip
416298: Reflective access to CDOResourceNode::path
https://bugs.eclipse.org/bugs/show_bug.cgi?id=416298
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests')
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_416298_Test.java60
1 files changed, 60 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_416298_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_416298_Test.java
new file mode 100644
index 0000000000..aaec704ee1
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_416298_Test.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2013 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:
+ * Christian W. Damus (CEA LIST) - initial API and implementation
+ */
+package org.eclipse.emf.cdo.tests.bugzilla;
+
+import static org.eclipse.emf.cdo.eresource.EresourcePackage.Literals.CDO_RESOURCE_NODE__PATH;
+
+import org.eclipse.emf.cdo.eresource.CDOResource;
+import org.eclipse.emf.cdo.eresource.CDOResourceFolder;
+import org.eclipse.emf.cdo.session.CDOSession;
+import org.eclipse.emf.cdo.tests.AbstractCDOTest;
+import org.eclipse.emf.cdo.transaction.CDOTransaction;
+
+/**
+ * Bug 416298: Tests that resource nodes provide proper reflective access to the derived 'path' attribute.
+ *
+ * @author Christian W. Damus (CEA LIST)
+ */
+public class Bugzilla_416298_Test extends AbstractCDOTest
+{
+ public void testGetSetResourcePath() throws Exception
+ {
+ CDOSession session = openSession();
+
+ CDOTransaction transaction = session.openTransaction();
+
+ CDOResource res = transaction.getOrCreateResource("/path/to/resource.model1");
+
+ assertEquals("/path/to/resource.model1", res.eGet(CDO_RESOURCE_NODE__PATH));
+
+ res.eSet(CDO_RESOURCE_NODE__PATH, "/new/folder/resource.model1");
+
+ assertNotNull(res.getFolder());
+ assertEquals("/new/folder", res.getFolder().getPath());
+ }
+
+ public void testGetSetFolderPath() throws Exception
+ {
+ CDOSession session = openSession();
+
+ CDOTransaction transaction = session.openTransaction();
+
+ CDOResourceFolder folder = transaction.getOrCreateResourceFolder("/path/to/folder");
+
+ assertEquals("/path/to/folder", folder.eGet(CDO_RESOURCE_NODE__PATH));
+
+ folder.eSet(CDO_RESOURCE_NODE__PATH, "/atRoot");
+
+ assertNull(folder.getFolder());
+ assertEquals("atRoot", folder.getName());
+ }
+
+}

Back to the top