Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormtaal2009-03-15 23:26:03 +0000
committermtaal2009-03-15 23:26:03 +0000
commit746e52355a0af264f9d82810193e2b17f4bdbf9c (patch)
tree948a0c0df2e162b256f2b477588e948ed6cf8293 /tests/org.eclipse.emf.teneo.commontest
parent11684c692b3ac128576ccb9157a8e6a4d6922b48 (diff)
downloadorg.eclipse.emf.teneo-746e52355a0af264f9d82810193e2b17f4bdbf9c.tar.gz
org.eclipse.emf.teneo-746e52355a0af264f9d82810193e2b17f4bdbf9c.tar.xz
org.eclipse.emf.teneo-746e52355a0af264f9d82810193e2b17f4bdbf9c.zip
[267522]
Diffstat (limited to 'tests/org.eclipse.emf.teneo.commontest')
-rw-r--r--tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/emf/sample/LibraryNotifyingTestAction.java30
1 files changed, 27 insertions, 3 deletions
diff --git a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/emf/sample/LibraryNotifyingTestAction.java b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/emf/sample/LibraryNotifyingTestAction.java
index 1fd1488fc..133721ee7 100644
--- a/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/emf/sample/LibraryNotifyingTestAction.java
+++ b/tests/org.eclipse.emf.teneo.commontest/src/org/eclipse/emf/teneo/test/emf/sample/LibraryNotifyingTestAction.java
@@ -11,7 +11,7 @@
* Martin Taal
* </copyright>
*
- * $Id: LibraryNotifyingTestAction.java,v 1.1 2009/03/15 08:09:27 mtaal Exp $
+ * $Id: LibraryNotifyingTestAction.java,v 1.2 2009/03/15 23:26:03 mtaal Exp $
*/
package org.eclipse.emf.teneo.test.emf.sample;
@@ -37,7 +37,7 @@ import org.eclipse.emf.teneo.util.StoreUtil;
* persistentList in the adapter.
*
* @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class LibraryNotifyingTestAction extends AbstractTestAction {
public LibraryNotifyingTestAction() {
@@ -56,7 +56,6 @@ public class LibraryNotifyingTestAction extends AbstractTestAction {
writer.setName("JRR Tolkien");
final Book book = factory.createBook();
-
book.setAuthor(writer);
book.setPages(5);
book.setTitle("The Hobbit");
@@ -169,6 +168,31 @@ public class LibraryNotifyingTestAction extends AbstractTestAction {
checkEqualList(persistentWriterBooks, writerBooks);
}
}
+ {
+ store.beginTransaction();
+ final Library lib = store.getObject(Library.class);
+ final List<?> libBooks = lib.getBooks();
+ final List<?> libWriters = lib.getWriters();
+ lib.setName(lib.getName() + "0");
+ assertEquals(2, lib.getBooks().size());
+
+ assertTrue(libBooks == lib.getBooks());
+ assertTrue(libWriters == lib.getWriters());
+
+ final Book book = factory.createBook();
+ book.setAuthor(lib.getWriters().get(0));
+ book.setPages(5);
+ book.setTitle("The Hobbit AGAIN");
+ book.setCategory(BookCategory.SCIENCE_FICTION_LITERAL);
+ lib.getBooks().add(book);
+ store.commitTransaction();
+ }
+ {
+ store.beginTransaction();
+ final Library lib = store.getObject(Library.class);
+ assertEquals(3, lib.getBooks().size());
+ store.commitTransaction();
+ }
}
private void checkEqualList(List<?> l1, List<?> l2) {

Back to the top