File tree Expand file tree Collapse file tree 2 files changed +54
-0
lines changed
java/org/codehaus/modello/core Expand file tree Collapse file tree 2 files changed +54
-0
lines changed Original file line number Diff line number Diff line change @@ -81,4 +81,11 @@ public void testModelWithDuplicateAssociations()
81
81
assertEquals ( "Duplicate field in MyClass: MyAssociation." , ex .getMessage () );
82
82
}
83
83
}
84
+
85
+ public void testRecursion () throws Exception
86
+ {
87
+ ModelloCore modello = (ModelloCore ) lookup ( ModelloCore .ROLE );
88
+
89
+ modello .loadModel ( getTestFile ( "src/test/resources/models/recursion.mdo" ) );
90
+ }
84
91
}
Original file line number Diff line number Diff line change
1
+ <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
2
+ license agreements. See the NOTICE file distributed with this work for additional
3
+ information regarding copyright ownership. The ASF licenses this file to
4
+ you under the Apache License, Version 2.0 (the "License"); you may not use
5
+ this file except in compliance with the License. You may obtain a copy of
6
+ the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
7
+ by applicable law or agreed to in writing, software distributed under the
8
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific
10
+ language governing permissions and limitations under the License. -->
11
+
12
+ <model xmlns="http://codehaus-plexus.github.io/MODELLO/1.8.0"
13
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
14
+ xsi:schemaLocation="http://codehaus-plexus.github.io/MODELLO/1.8.0 http://codehaus-plexus.github.io/modello/xsd/modello-1.8.0.xsd">
15
+ <id>recursion</id>
16
+ <name>RecursionNode</name>
17
+ <defaults>
18
+ <default>
19
+ <key>package</key>
20
+ <value>com.github.jasminb.jsonapi.models.recursion</value>
21
+ </default>
22
+ </defaults>
23
+
24
+ <classes>
25
+ <class rootElement="true">
26
+ <name>RecursionNode</name>
27
+ <version>0.0.0+</version>
28
+ <fields>
29
+ <field>
30
+ <name>parent</name>
31
+ <association>
32
+ <multiplicity>1</multiplicity>
33
+ <type>RecursionNode</type>
34
+ </association>
35
+ </field>
36
+ <field>
37
+ <name>children</name>
38
+ <type>List</type>
39
+ <association>
40
+ <type>RecursionNode</type>
41
+ <multiplicity>*</multiplicity>
42
+ </association>
43
+ </field>
44
+ </fields>
45
+ </class>
46
+ </classes>
47
+ </model>
You can’t perform that action at this time.
0 commit comments