01: package org.compass.core.test.genericsprop;
02:
03: import org.compass.core.CompassSession;
04: import org.compass.core.CompassTransaction;
05: import org.compass.core.test.AbstractTestCase;
06:
07: /**
08: * @author kimchy
09: */
10: public class GenericsPropTests extends AbstractTestCase {
11:
12: protected String[] getMappings() {
13: return new String[] { "genericsprop/genericsprop.cpm.xml" };
14: }
15:
16: public void testXmlMappingWithGenericsCollection() throws Exception {
17: CompassSession session = openSession();
18: CompassTransaction tr = session.beginTransaction();
19:
20: A a = new A();
21: a.id = 1;
22: a.values.add("value1");
23: a.values.add("value2");
24: session.save(a);
25:
26: a = (A) session.load(A.class, 1);
27: assertEquals(2, a.values.size());
28: assertEquals("value1", a.values.get(0));
29: assertEquals("value2", a.values.get(1));
30:
31: tr.commit();
32: session.close();
33: }
34:
35: }
|