Author: tfmorris Date: 2008-01-06 22:42:57-0800 New Revision: 14026 Modified: trunk/tests/org/argouml/persistence/TestXmiFilePersister.java
Log: Test linked profiles and clean up working files Modified: trunk/tests/org/argouml/persistence/TestXmiFilePersister.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/tests/org/argouml/persistence/TestXmiFilePersister.java?view=diff&rev=14026&p1=trunk/tests/org/argouml/persistence/TestXmiFilePersister.java&p2=trunk/tests/org/argouml/persistence/TestXmiFilePersister.java&r1=14025&r2=14026 ============================================================================== --- trunk/tests/org/argouml/persistence/TestXmiFilePersister.java (original) +++ trunk/tests/org/argouml/persistence/TestXmiFilePersister.java 2008-01-06 22:42:57-0800 @@ -98,13 +98,21 @@ * * @throws Exception when any of the activities fails */ - public void testCreateSaveAndLoadYeldsCorrectModel() throws Exception { + public void testCreateSaveAndLoadYieldsCorrectModel() throws Exception { Project project = ProjectManager.getManager().makeEmptyProject(); Object model = project.getModel(); assertNotNull(model); - Model.getCoreFactory().buildClass("Foo", model); + Object classifier = Model.getCoreFactory().buildClass("Foo", model); assertNotNull(project.findType("Foo", false)); - File file = new File("testCreateSaveAndLoadYeldsCorrectModel.xmi"); + // TODO: We should really set up our own profile instead of depending + // on the default. + // This depends on the default profile configuration containing the + // type Integer to test properly. Otherwise it will get created in + // the main project, defeating the purpose + Object intType = project.findType("Integer"); + Object attribute = + Model.getCoreFactory().buildAttribute2(classifier, intType); + File file = File.createTempFile("ArgoTestCreateSaveAndLoad", "xmi"); XmiFilePersister persister = new XmiFilePersister(); project.preSave(); persister.save(project, file); @@ -115,6 +123,7 @@ persister = new XmiFilePersister(); project = persister.doLoad(file); assertNotNull(project.findType("Foo", false)); + file.delete(); } /** --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
