public void checkJavaAttributesDeserialization() { if (File.Exists(expectedSpringMvcAttributeXmlFile) == false) { File.Delete(expectedSpringMvcAttributeXmlFile); AnnotationsHelper.executeJythonScript(testSpringMvcClassFile); } Assert.That(File.Exists(expectedSpringMvcAttributeXmlFile), "expectedSpringMvcAttributeXmlFile file did not exist: {0}", expectedSpringMvcAttributeXmlFile); var javaAttributeMappings = Serialize.getDeSerializedObjectFromXmlFile(expectedSpringMvcAttributeXmlFile, typeof(JavaAttributeMappings)); Assert.That(javaAttributeMappings != null, "javaAttributeMappings was null"); Assert.That(checkThatDeSerializedObjectMatchesXmlFile(expectedSpringMvcAttributeXmlFile, javaAttributeMappings), "checkThatDeSerializedObjectMatchesXmlFile failed"); DI.log.info("All ok"); }
[Test] // the errors that will appear in the logs are because we are not loading the CIR data file, for example "getTreeNodeWithAutoWiredObject, loaded cirData did not contained signature :org.springframework.samples.petclinic.web.EditOwnerForm.setupForm(int;org.springframework.ui.Model):java.lang.String" public void viewSpringMvcControllersObjectOnGui() { if (false == File.Exists(expectedSpringMvcAttributeXmlFile)) { AnnotationsHelper.executeJythonScript(testSpringMvcClassFile); } // create controllers var springMvcControllers = LoadSpringMvcData.createSpringMvcControllersFromXmlAttributeFile(expectedSpringMvcAttributeXmlFile); // create Gui var viewSpringMvcControllerName = "ascx_CreateSpringMvcMappings"; O2AscxGUI.openAscxAsForm(typeof(ascx_SpringMvcMappings), viewSpringMvcControllerName); var springMvcMappings = (ascx_SpringMvcMappings)O2AscxGUI.getAscx(viewSpringMvcControllerName); // load controllers on gui springMvcMappings.showSpringMvcControllers(springMvcControllers); O2AscxGUI.close(); //viewSpringMvcController }
public void convertClassFileInto() { // check that target class and Annotation.py exists Assert.That(File.Exists(testSpringMvcClassFile), "could not find test class to for test: {0}", testSpringMvcClassFile); Assert.That(File.Exists(AnnotationsHelper.jythonAnnotationScript), "could not find Annotations.py file {0}", AnnotationsHelper.jythonAnnotationScript); // exsure expectedSpringMvcAttributeXmlFile is not there if (File.Exists(expectedSpringMvcAttributeXmlFile)) { File.Delete(expectedSpringMvcAttributeXmlFile); } Assert.That(false == File.Exists(expectedSpringMvcAttributeXmlFile), "(at this stage) expected file should not exist: {0}", expectedSpringMvcAttributeXmlFile); // convert class file var executionResult = AnnotationsHelper.executeJythonScript(testSpringMvcClassFile); DI.log.debug("Execution Result: {0}", executionResult); Assert.That(File.Exists(expectedSpringMvcAttributeXmlFile), "expected file did not exist: {0}", expectedSpringMvcAttributeXmlFile); }