Skip to content

Commit

Permalink
Issues #50, #40, #33.
Browse files Browse the repository at this point in the history
  • Loading branch information
highsource committed Sep 12, 2015
1 parent 2c979f4 commit e697133
Showing 1 changed file with 45 additions and 0 deletions.
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);

}
}

0 comments on commit e697133

Please sign in to comment.