-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2c979f4
commit e697133
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
compiler/src/test/java/org/hisrc/jsonix/xml/xsom/tests/MultiplicityCounterValue01Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package org.hisrc.jsonix.xml.xsom.tests; | ||
|
||
import org.hisrc.jsonix.xml.xsom.ParticleMultiplicityCounter; | ||
import org.hisrc.xml.bind.model.util.MModelInfoLoader; | ||
import org.hisrc.xml.xsom.XSFunctionApplier; | ||
import org.junit.Assert; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.jvnet.jaxb2_commons.xml.bind.model.MClassInfo; | ||
import org.jvnet.jaxb2_commons.xml.bind.model.MModelInfo; | ||
import org.jvnet.jaxb2_commons.xml.bind.model.MPropertyInfo; | ||
|
||
import com.sun.tools.xjc.model.Multiplicity; | ||
import com.sun.tools.xjc.model.nav.NClass; | ||
import com.sun.tools.xjc.model.nav.NType; | ||
|
||
public class MultiplicityCounterValue01Test { | ||
|
||
private MModelInfo<NType, NClass> model; | ||
|
||
@Before | ||
public void loadModel() throws Exception { | ||
model = MModelInfoLoader.INSTANCE | ||
.loadModel("jsonschema/minmaxoccurs/value01.xsd"); | ||
} | ||
|
||
@Test | ||
public void v01value() throws Exception { | ||
|
||
final MClassInfo<NType, NClass> v01Type = model | ||
.getClassInfo("test.V01"); | ||
|
||
Assert.assertNotNull(v01Type); | ||
|
||
final MPropertyInfo<NType, NClass> value = v01Type.getProperty("value"); | ||
|
||
Assert.assertNotNull(value); | ||
|
||
final Multiplicity multiplicity = new XSFunctionApplier<Multiplicity>( | ||
ParticleMultiplicityCounter.INSTANCE).apply(value.getOrigin()); | ||
|
||
Assert.assertNull(multiplicity); | ||
|
||
} | ||
} |