public static object[] createModel() { TestModelParser modelParser = new TestModelParser(); ModelInstance modelInstance = modelParser.EmptyModel; Animals animals = modelInstance.newInstance(typeof(Animals)); modelInstance.DocumentElement = animals; // add a tns namespace prefix for QName testing animals.DomElement.registerNamespace("tns", MODEL_NAMESPACE); FlyingAnimal tweety = createBird(modelInstance, "tweety", Gender.Female); FlyingAnimal hedwig = createBird(modelInstance, "hedwig", Gender.Male); FlyingAnimal birdo = createBird(modelInstance, "birdo", Gender.Female); FlyingAnimal plucky = createBird(modelInstance, "plucky", Gender.Unknown); FlyingAnimal fiffy = createBird(modelInstance, "fiffy", Gender.Female); createBird(modelInstance, "timmy", Gender.Male); createBird(modelInstance, "daisy", Gender.Female); tweety.FlightInstructor = hedwig; tweety.FlightPartnerRefs.Add(hedwig); tweety.FlightPartnerRefs.Add(birdo); tweety.FlightPartnerRefs.Add(plucky); tweety.FlightPartnerRefs.Add(fiffy); return(new object[] { "created", modelInstance, modelParser }); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Before public void parseModel() public virtual void parseModel() { TestModelParser modelParser = new TestModelParser(); string testXml = "org/camunda/bpm/model/xml/testmodel/instance/UnknownAnimalTest.xml"; Stream testXmlAsStream = this.GetType().ClassLoader.getResourceAsStream(testXml); modelInstance = modelParser.parseModelFromStream(testXmlAsStream); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Before public void getTypes() public virtual void getTypes() { TestModelParser modelParser = new TestModelParser(); modelInstance = modelParser.EmptyModel; model = modelInstance.Model; animalsType = model.getType(typeof(Animals)); animalType = model.getType(typeof(Animal)); flyingAnimalType = model.getType(typeof(FlyingAnimal)); birdType = model.getType(typeof(Bird)); }
public static object[] createModel() { TestModelParser modelParser = new TestModelParser(); ModelInstance modelInstance = modelParser.EmptyModel; Animals animals = modelInstance.newInstance(typeof(Animals)); modelInstance.DocumentElement = animals; createBird(modelInstance, "tweety", Gender.Female); return(new object[] { "created", modelInstance, modelParser }); }
public static object[] createModel() { TestModelParser modelParser = new TestModelParser(); ModelInstance modelInstance = modelParser.EmptyModel; Animals animals = modelInstance.newInstance(typeof(Animals)); modelInstance.DocumentElement = animals; // add a tns namespace prefix for QName testing animals.DomElement.registerNamespace("tns", MODEL_NAMESPACE); Bird tweety = createBird(modelInstance, "tweety", Gender.Female); Bird hedwig = createBird(modelInstance, "hedwig", Gender.Female); Bird timmy = createBird(modelInstance, "timmy", Gender.Female); Egg egg1 = createEgg(modelInstance, "egg1"); egg1.Mother = tweety; ICollection <Animal> guards = egg1.Guardians; guards.Add(hedwig); guards.Add(timmy); Egg egg2 = createEgg(modelInstance, "egg2"); egg2.Mother = tweety; guards = egg2.Guardians; guards.Add(hedwig); guards.Add(timmy); Egg egg3 = createEgg(modelInstance, "egg3"); guards = egg3.Guardians; guards.Add(timmy); tweety.Spouse = hedwig; tweety.Eggs.Add(egg1); tweety.Eggs.Add(egg2); tweety.Eggs.Add(egg3); ICollection <Egg> guardedEggs = hedwig.GuardedEggs; guardedEggs.Add(egg1); guardedEggs.Add(egg2); GuardEgg guardEgg = modelInstance.newInstance(typeof(GuardEgg)); guardEgg.TextContent = egg1.Id + " " + egg2.Id; timmy.GuardedEggRefs.Add(guardEgg); timmy.GuardedEggs.Add(egg3); return(new object[] { "created", modelInstance, modelParser }); }
private static object[] createModel() { TestModelParser modelParser = new TestModelParser(); ModelInstance modelInstance = modelParser.EmptyModel; Animals animals = modelInstance.newInstance(typeof(Animals)); modelInstance.DocumentElement = animals; Description description = modelInstance.newInstance(typeof(Description)); description.DomElement.addCDataSection("CDATA <test>"); animals.addChildElement(description); return(new object[] { "created", modelInstance, modelParser }); }
public static object[] createModel() { TestModelParser modelParser = new TestModelParser(); ModelInstance modelInstance = modelParser.EmptyModel; Animals animals = modelInstance.newInstance(typeof(Animals)); modelInstance.DocumentElement = animals; // add a tns namespace prefix for QName testing animals.DomElement.registerNamespace("tns", MODEL_NAMESPACE); Animal tweety = createBird(modelInstance, "tweety", Gender.Female); Animal hedwig = createBird(modelInstance, "hedwig", Gender.Male); Animal birdo = createBird(modelInstance, "birdo", Gender.Female); Animal plucky = createBird(modelInstance, "plucky", Gender.Unknown); Animal fiffy = createBird(modelInstance, "fiffy", Gender.Female); createBird(modelInstance, "timmy", Gender.Male); createBird(modelInstance, "daisy", Gender.Female); // create and add some relationships RelationshipDefinition hedwigRelationship = createRelationshipDefinition(modelInstance, hedwig, typeof(ChildRelationshipDefinition)); addRelationshipDefinition(tweety, hedwigRelationship); RelationshipDefinition birdoRelationship = createRelationshipDefinition(modelInstance, birdo, typeof(ChildRelationshipDefinition)); addRelationshipDefinition(tweety, birdoRelationship); RelationshipDefinition pluckyRelationship = createRelationshipDefinition(modelInstance, plucky, typeof(FriendRelationshipDefinition)); addRelationshipDefinition(tweety, pluckyRelationship); RelationshipDefinition fiffyRelationship = createRelationshipDefinition(modelInstance, fiffy, typeof(FriendRelationshipDefinition)); addRelationshipDefinition(tweety, fiffyRelationship); tweety.RelationshipDefinitionRefs.Add(hedwigRelationship); tweety.RelationshipDefinitionRefs.Add(birdoRelationship); tweety.RelationshipDefinitionRefs.Add(pluckyRelationship); tweety.RelationshipDefinitionRefs.Add(fiffyRelationship); tweety.BestFriends.Add(birdo); tweety.BestFriends.Add(plucky); return(new object[] { "created", modelInstance, modelParser }); }
private static object[] createModel() { TestModelParser modelParser = new TestModelParser(); ModelInstance modelInstance = modelParser.EmptyModel; Animals animals = modelInstance.newInstance(typeof(Animals)); modelInstance.DocumentElement = animals; createBird(modelInstance, "tweety", Gender.Female); Bird donald = createBird(modelInstance, "donald", Gender.Male); Bird daisy = createBird(modelInstance, "daisy", Gender.Female); Bird hedwig = createBird(modelInstance, "hedwig", Gender.Male); donald.TextContent = "some text content"; daisy.TextContent = "\n some text content with outer line breaks\n "; hedwig.TextContent = "\n some text content with inner\n line breaks\n "; return(new object[] { "created", modelInstance, modelParser }); }
public static object[] createModel() { TestModelParser modelParser = new TestModelParser(); ModelInstance modelInstance = modelParser.EmptyModel; Animals animals = modelInstance.newInstance(typeof(Animals)); modelInstance.DocumentElement = animals; Bird tweety = createBird(modelInstance, "tweety", Gender.Female); Bird daffy = createBird(modelInstance, "daffy", Gender.Male); Bird daisy = createBird(modelInstance, "daisy", Gender.Female); Bird plucky = createBird(modelInstance, "plucky", Gender.Male); createBird(modelInstance, "birdo", Gender.Female); tweety.FlightInstructor = daffy; tweety.FlightPartnerRefs.Add(daisy); tweety.FlightPartnerRefs.Add(plucky); return(new object[] { "created", modelInstance, modelParser }); }