]> SALOME platform Git repositories - tools/siman.git/commitdiff
Salome HOME
Fix of unit tests taking into account sorting and new steps configuration.
authorrkv <rkv@opencascade.com>
Fri, 5 Apr 2013 07:03:18 +0000 (07:03 +0000)
committerrkv <rkv@opencascade.com>
Fri, 5 Apr 2013 07:03:18 +0000 (07:03 +0000)
Workspace/Siman-Common/src/test/splat/dao/TestKnowledgeElementDAO.java
Workspace/Siman-Common/src/test/splat/dao/TestStudyDAO.java
Workspace/Siman-Common/src/test/splat/service/TestProjectSettingsService.java

index 79513b4a0cd1bd614f4a9d0191ad265a571fdbcf..177205d08316bf6af4ebcc7e58806b5b1c0f3b8d 100644 (file)
@@ -134,7 +134,7 @@ public class TestKnowledgeElementDAO extends BaseTest {
 
                LOG.debug("Created second id: " + id2);
 
-               res = _knowledgeElementDAO.getAll();
+               res = _knowledgeElementDAO.getAll(Order.asc("rid"));
                _knowledgeElementDAO.flush();
 
                Assert.assertNotNull(res,
index 9f887af755c44911150beb193645204fbd599727..f171307fd09b9c2a76b3a7473f376a0b6ced4609 100644 (file)
@@ -20,13 +20,13 @@ import org.hibernate.criterion.Order;
 import org.hibernate.criterion.Restrictions;
 import org.splat.dal.bo.kernel.User;
 import org.splat.dal.bo.som.Document;
+import org.splat.dal.bo.som.Document.Properties;
 import org.splat.dal.bo.som.DocumentType;
 import org.splat.dal.bo.som.ProgressState;
 import org.splat.dal.bo.som.ProjectElement;
 import org.splat.dal.bo.som.Publication;
 import org.splat.dal.bo.som.Scenario;
 import org.splat.dal.bo.som.Study;
-import org.splat.dal.bo.som.Document.Properties;
 import org.splat.dal.dao.som.Database;
 import org.splat.dal.dao.som.DocumentDAO;
 import org.splat.dal.dao.som.StudyDAO;
@@ -186,7 +186,7 @@ public class TestStudyDAO extends BaseTest {
 
                LOG.debug("Created second id: " + id2);
 
-               res = _studyDAO.getAll();
+               res = _studyDAO.getAll(Order.asc("rid"));
                _studyDAO.flush();
 
                Assert.assertNotNull(res,
index 5d9e769c0a65881e7e6cc27d71fa7782976a644e..74ae7836aaff4282ffdecd4cd6d143a8dcbbc107 100644 (file)
@@ -22,8 +22,8 @@ import org.splat.service.DocumentTypeService;
 import org.splat.service.KnowledgeElementTypeService;
 import org.splat.service.SimulationContextService;
 import org.splat.service.technical.ProjectSettingsService;
-import org.splat.service.technical.StepsConfigService;
 import org.splat.service.technical.ProjectSettingsService.Step;
+import org.splat.service.technical.StepsConfigService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.dao.DuplicateKeyException;
@@ -378,6 +378,37 @@ public class TestProjectSettingsService extends BaseTest {
                                                        .getDefaultDocumentType(step, "xml").getName(),
                                                        "memorandum");
                                        break;
+                               case 6:
+                                       Assert.assertEquals(defTypes.size(), 2);
+                                       Assert.assertNull(_projectSettings.getDefaultDocumentType(
+                                                       step, "pdf"));
+                                       Assert.assertNull(_projectSettings
+                                                       .getDefaultDocumentType(step, "med"));
+                                       Assert.assertNotNull(_projectSettings
+                                                       .getDefaultDocumentType(step, "py"));
+                                       Assert.assertEquals(_projectSettings
+                                                       .getDefaultDocumentType(step, "py").getName(),
+                                                       "visualisation");
+                                       Assert.assertNotNull(_projectSettings
+                                                       .getDefaultDocumentType(step, "srd"));
+                                       Assert.assertEquals(_projectSettings
+                                                       .getDefaultDocumentType(step, "srd").getName(),
+                                                       "coparisonResult");
+                                       break;
+                               case 7:
+                                       Assert.assertEquals(defTypes.size(), 1);
+                                       Assert.assertNull(_projectSettings.getDefaultDocumentType(
+                                                       step, "pdf"));
+                                       Assert.assertNull(_projectSettings
+                                                       .getDefaultDocumentType(step, "med"));
+                                       Assert.assertNull(_projectSettings
+                                                       .getDefaultDocumentType(step, "py"));
+                                       Assert.assertNotNull(_projectSettings
+                                                       .getDefaultDocumentType(step, "xml"));
+                                       Assert.assertEquals(_projectSettings
+                                                       .getDefaultDocumentType(step, "xml").getName(),
+                                                       "schema");
+                                       break;
                                default:
                                        Assert.assertEquals(defTypes.size(), 0);
                                        Assert.assertNull(_projectSettings.getDefaultDocumentType(