1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.springframework.extensions.surf.api;
20
21 import org.springframework.extensions.surf.AbstractSurfAPITestCase;
22 import org.springframework.extensions.surf.ModelObject;
23 import org.springframework.extensions.surf.types.Component;
24
25
26
27
28
29
30 public class ModelObjectTest extends AbstractSurfAPITestCase
31 {
32 public boolean isReadOnly()
33 {
34 return false;
35 }
36
37 public void testProperties() throws Exception
38 {
39 ModelObject o = getModel().newObject("page");
40 getModel().saveObject(o);
41
42 o.setDescription("desc1");
43 assertEquals("desc1", o.getDescription());
44
45 o.setDescriptionId("descid2");
46 assertEquals("descid2", o.getDescriptionId());
47
48 o.setTitle("title1");
49 assertEquals("title1", o.getTitle());
50
51 o.setTitleId("titleId1");
52 assertEquals("titleId1", o.getTitleId());
53
54 o.setCustomProperty("customProperty1", "customPropertyValue1");
55 assertEquals("customPropertyValue1", o.getProperty("customProperty1"));
56
57 o.setProperty("customProperty2", "customPropertyValue2");
58 assertEquals("customPropertyValue2", o.getProperty("customProperty2"));
59 }
60 }