← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13722: Test fixes

 

------------------------------------------------------------
revno: 13722
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-01-14 12:49:45 +0100
message:
  Test fixes
modified:
  dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/concept/ConceptServiceTest.java
  dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/setting/SystemSettingStoreTest.java
  dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/validation/ValidationRuleStoreTest.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/concept/ConceptServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/concept/ConceptServiceTest.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/concept/ConceptServiceTest.java	2014-01-14 11:49:45 +0000
@@ -193,24 +193,4 @@
         assertEq( 'C', conceptService.getConceptByName( "ConceptC" ) );
         assertEq( 'D', conceptService.getConceptByName( "ConceptD" ) );
     }
-    
-//    @Test
-//    public void testGetByConcept()
-//    {        
-//        Concept aConcept = conceptStore.getByName("ConceptA");
-//        Concept bConcept = conceptStore.getByName("ConceptB");
-//        
-//        categoryOptionA = new DataElementCategoryOption( "CategoryOptionA" );
-//        categoryOptionA.setConcept(aConcept);
-//        categoryOptionB = new DataElementCategoryOption( "CategoryOptionB" );
-//        categoryOptionB.setConcept(aConcept);
-//        categoryOptionC = new DataElementCategoryOption( "CategoryOptionC" );
-//        categoryOptionC.setConcept(bConcept);
-//        
-//        categoryService.addDataElementCategoryOption(categoryOptionA);
-//        
-//        assertEquals(2, categoryOptionStore.getByConcept(aConcept).size());
-//        assertEquals(1, categoryOptionStore.getByConcept(bConcept).size());
-//    }
-
 }

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/setting/SystemSettingStoreTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/setting/SystemSettingStoreTest.java	2014-01-14 11:43:48 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/setting/SystemSettingStoreTest.java	2014-01-14 11:49:45 +0000
@@ -110,14 +110,14 @@
     @Test
     public void testDeleteSystemSetting()
     {
-        systemSettingStore.save( settingA );
-        systemSettingStore.save( settingB );
+        int idA = systemSettingStore.save( settingA );
+        int idB = systemSettingStore.save( settingB );
         systemSettingStore.save( settingC );
 
-        systemSettingStore.delete( systemSettingStore.getByName( settingA.getName() ) );
+        systemSettingStore.delete( settingA );
 
-        assertNull( systemSettingStore.getByName( settingA.getName() ) );
-        assertEquals( 2, systemSettingStore.getAll().size() );
+        assertNull( systemSettingStore.get( idA ) );
+        assertNotNull( systemSettingStore.get( idB ) );
     }
 
     @Test

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/validation/ValidationRuleStoreTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/validation/ValidationRuleStoreTest.java	2014-01-07 08:22:52 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/validation/ValidationRuleStoreTest.java	2014-01-14 11:49:45 +0000
@@ -236,59 +236,6 @@
         assertEquals( rule.getName(), "ValidationRuleA" );
     }
 
-//    @Test
-//    public void testGetValidationRulesByDataElements()
-//    {
-//        Set<DataElement> dataElementsA = new HashSet<DataElement>();
-//        dataElementsA.add( dataElementA );
-//        dataElementsA.add( dataElementB );
-//
-//        Set<DataElement> dataElementsB = new HashSet<DataElement>();
-//        dataElementsB.add( dataElementC );
-//        dataElementsB.add( dataElementD );
-//
-//        Set<DataElement> dataElementsC = new HashSet<DataElement>();
-//
-//        Set<DataElement> dataElementsD = new HashSet<DataElement>();
-//        dataElementsD.addAll( dataElementsA );
-//        dataElementsD.addAll( dataElementsB );
-//
-//        Expression expression1 = new Expression( "Expression1", "Expression1", dataElementsA, optionCombos );
-//        Expression expression2 = new Expression( "Expression2", "Expression2", dataElementsB, optionCombos );
-//        Expression expression3 = new Expression( "Expression3", "Expression3", dataElementsC, optionCombos );
-//
-//        expressionService.addExpression( expression1 );
-//        expressionService.addExpression( expression2 );
-//        expressionService.addExpression( expression3 );
-//
-//        ValidationRule ruleA = createValidationRule( 'A', equal_to, expression1, expression3, periodType );
-//        ValidationRule ruleB = createValidationRule( 'B', equal_to, expression2, expression3, periodType );
-//        ValidationRule ruleC = createValidationRule( 'C', equal_to, expression3, expression3, periodType );
-//
-//        validationRuleStore.save( ruleA );
-//        validationRuleStore.save( ruleB );
-//        validationRuleStore.save( ruleC );
-//        
-//        Collection<ValidationRule> rules = validationRuleStore.getValidationRulesByDataElements( dataElementsA );
-//
-//        assertNotNull( rules );
-//        assertEquals( 1, rules.size() );
-//        assertTrue( rules.contains( ruleA ) );
-//
-//        rules = validationRuleStore.getValidationRulesByDataElements( dataElementsB );
-//
-//        assertNotNull( rules );
-//        assertEquals( 1, rules.size() );
-//        assertTrue( rules.contains( ruleB ) );
-//
-//        rules = validationRuleStore.getValidationRulesByDataElements( dataElementsD );
-//
-//        assertNotNull( rules );
-//        assertEquals( 2, rules.size() );
-//        assertTrue( rules.contains( ruleA ) );
-//        assertTrue( rules.contains( ruleB ) );
-//    }
-
     @Test
     public void testGetValidationRuleCount()
     {