Author: euluis
Date: 2008-05-15 16:29:50-0700
New Revision: 14749
Modified:
trunk/src/argouml-core-model-mdr/tests/org/argouml/model/mdr/TestMDRModelImplementation.java
trunk/src/argouml-core-model-mdr/tests/org/argouml/model/mdr/TestMDRModelImplementationCreate.java
Log:
simple improvements in tests
Modified: trunk/src/argouml-core-model-mdr/tests/org/argouml/model/mdr/TestMDRModelImplementation.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-mdr/tests/org/argouml/model/mdr/TestMDRModelImplementation.java?view=diff&rev=14749&p1=trunk/src/argouml-core-model-mdr/tests/org/argouml/model/mdr/TestMDRModelImplementation.java&p2=trunk/src/argouml-core-model-mdr/tests/org/argouml/model/mdr/TestMDRModelImplementation.java&r1=14748&r2=14749
==============================================================================
--- trunk/src/argouml-core-model-mdr/tests/org/argouml/model/mdr/TestMDRModelImplementation.java (original)
+++ trunk/src/argouml-core-model-mdr/tests/org/argouml/model/mdr/TestMDRModelImplementation.java 2008-05-15 16:29:50-0700
@@ -24,8 +24,9 @@
package org.argouml.model.mdr;
-import java.io.FileNotFoundException;
+import java.io.File;
import java.io.FileOutputStream;
+import java.io.IOException;
import junit.framework.TestCase;
@@ -293,11 +294,11 @@
/**
* @throws UmlException If an error occur
- * @throws FileNotFoundException If the file isn't found
+ * @throws IOException If the file isn't found
*/
- public void testGetXmiWriter() throws UmlException, FileNotFoundException {
+ public void testGetXmiWriter() throws UmlException, IOException {
assertNotNull(modelImplementation.getXmiWriter(
- "dummyModel", new FileOutputStream("dummy.txt"), null));
+ "dummyModel", new FileOutputStream(
+ File.createTempFile("dummy", null)), null));
}
}
-
Modified: trunk/src/argouml-core-model-mdr/tests/org/argouml/model/mdr/TestMDRModelImplementationCreate.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-mdr/tests/org/argouml/model/mdr/TestMDRModelImplementationCreate.java?view=diff&rev=14749&p1=trunk/src/argouml-core-model-mdr/tests/org/argouml/model/mdr/TestMDRModelImplementationCreate.java&p2=trunk/src/argouml-core-model-mdr/tests/org/argouml/model/mdr/TestMDRModelImplementationCreate.java&r1=14748&r2=14749
==============================================================================
--- trunk/src/argouml-core-model-mdr/tests/org/argouml/model/mdr/TestMDRModelImplementationCreate.java (original)
+++ trunk/src/argouml-core-model-mdr/tests/org/argouml/model/mdr/TestMDRModelImplementationCreate.java 2008-05-15 16:29:50-0700
@@ -74,23 +74,23 @@
createPackage();
mi.getCoreHelper().setNamespace(p, m);
UmlClass c = (UmlClass) mi.getCoreFactory().buildClass(m);
- Model m1 = (Model) mi.getFacade().getModel(c);
+ Model m1 = (Model) mi.getFacade().getRoot(c);
assertNotNull(m1);
- Model m2 = (Model) mi.getFacade().getModel(p);
+ Model m2 = (Model) mi.getFacade().getRoot(p);
assertNotNull(m2);
assertEquals(m1, m);
assertEquals(m2, m);
XmiReader xmiReader = mi.getXmiReader();
URL modelUrl = getClass().getClassLoader().getResource(
- "testmodels/test.xmi"); //!"ALittleBit.xmi";
+ "testmodels/test.xmi");
assertNotNull(modelUrl);
File fileModel = new File(modelUrl.getPath());
assertTrue(fileModel.exists());
InputSource source = new InputSource(new FileInputStream(fileModel));
- //Model aLittleBit = (Model) xmiReader.parse(source);
Collection modelElements = xmiReader.parse(source, false);
assertNotNull(modelElements);
assertEquals(1, modelElements.size());
+ assertNotNull(modelElements.iterator().next());
}
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.