dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #39692
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20112: Cleanup
------------------------------------------------------------
revno: 20112
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2015-09-13 19:45:53 +0200
message:
Cleanup
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/hierarchy/HierarchyViolationException.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/calendar/DefaultCalendarService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/DataApprovalPermissionsEvaluator.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/hibernate/HibernateDataApprovalStore.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/help/DefaultHelpManager.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/node/serializers/CsvNodeSerializer.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/node/serializers/StAXNodeSerializer.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/period/DefaultPeriodService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/query/CriteriaQueryEngine.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/schema/Jackson2PropertyIntrospectorService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/security/oauth2/DefaultClientDetailsService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/DefaultSmsSender.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/SmsMessageSender.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/command/SMSCommand.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/listener/DataValueSMSListener.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/listener/J2MEDataValueSMSListener.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/listener/ProgramStageDataEntrySMSListener.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/listener/TrackedEntityRegistrationSMSListener.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/outbound/DefaultOutboundSmsTransportService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/ExpressionUpgrader.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentityattributevalue/DefaultTrackedEntityAttributeValueService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueDeletionHandler.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/validation/ValidatorThread.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/constant/ConstantServiceTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalLevelServiceTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalServiceCategoryOptionGroupTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalServiceTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalStoreTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataelement/DataElementStoreTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataentryform/DataEntryFormStoreTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/DataSetServiceTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/DataSetStoreTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/datavalue/DataValueServiceTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/expression/ExpressionServiceTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/i18n/I18nServiceTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/indicator/IndicatorGroupStoreTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/indicator/IndicatorServiceTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/indicator/IndicatorStoreTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/minmax/MinMaxDataElementStoreTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/organisationunit/OrganisationUnitServiceTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/period/PeriodServiceTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/period/PeriodStoreTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/setting/SystemSettingManagerTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/setting/SystemSettingStoreTest.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-api/src/main/java/org/hisp/dhis/hierarchy/HierarchyViolationException.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/hierarchy/HierarchyViolationException.java 2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/hierarchy/HierarchyViolationException.java 2015-09-13 17:45:53 +0000
@@ -35,7 +35,7 @@
* @version $Id: HierarchyViolationException.java 2869 2007-02-20 14:26:09Z andegje $
*/
public class HierarchyViolationException
- extends Exception
+ extends RuntimeException
{
/**
* Determines if a de-serialized file is compatible with this class.
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/calendar/DefaultCalendarService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/calendar/DefaultCalendarService.java 2015-02-19 09:18:17 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/calendar/DefaultCalendarService.java 2015-09-13 17:45:53 +0000
@@ -109,7 +109,7 @@
String calendarKey = getSystemCalendarKey();
String dateFormat = getSystemDateFormatKey();
- Calendar calendar;
+ Calendar calendar = null;
if ( calendarMap.containsKey( calendarKey ) )
{
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/DataApprovalPermissionsEvaluator.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/DataApprovalPermissionsEvaluator.java 2015-08-30 14:51:28 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/DataApprovalPermissionsEvaluator.java 2015-09-13 17:45:53 +0000
@@ -218,7 +218,7 @@
private DataApprovalLevel getUserApprovalLevelWithCache( DataApproval da )
{
- DataApprovalLevel userApprovalLevel;
+ DataApprovalLevel userApprovalLevel = null;
final DataApproval dataApproval = da;
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/hibernate/HibernateDataApprovalStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/hibernate/HibernateDataApprovalStore.java 2015-09-03 03:11:47 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/hibernate/HibernateDataApprovalStore.java 2015-09-13 17:45:53 +0000
@@ -217,7 +217,7 @@
PeriodType dataSetPeriodType = validDataSets.iterator().next().getPeriodType();
- List<Period> periods;
+ List<Period> periods = Lists.newArrayList();
if ( period.getPeriodType().equals( dataSetPeriodType ) )
{
@@ -250,7 +250,7 @@
boolean isDefaultCombo = categoryService.getDefaultDataElementCategoryOptionCombo().equals( attributeOptionCombo );
- final String categoryComboIds;
+ String categoryComboIds = null;
if ( isDefaultCombo )
{
@@ -287,9 +287,9 @@
return new ArrayList<>(); // Unapprovable.
}
- int orgUnitLevel;
- String orgUnitJoinOn;
- String highestApprovedOrgUnitCompare;
+ int orgUnitLevel = 0;
+ String orgUnitJoinOn = null;
+ String highestApprovedOrgUnitCompare = null;
if ( orgUnit != null )
{
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/help/DefaultHelpManager.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/help/DefaultHelpManager.java 2015-06-15 13:44:20 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/help/DefaultHelpManager.java 2015-09-13 17:45:53 +0000
@@ -35,9 +35,12 @@
import javax.xml.transform.Result;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
+
+import java.io.IOException;
import java.io.OutputStream;
import java.util.Locale;
@@ -102,7 +105,7 @@
// -------------------------------------------------------------------------
private Transformer getTransformer( String stylesheetName )
- throws Exception
+ throws IOException, TransformerConfigurationException
{
Source stylesheet = new StreamSource( new ClassPathResource( stylesheetName ).getInputStream(), ENCODING_UTF8 );
@@ -111,9 +114,9 @@
private ClassPathResource resolveHelpFileResource( Locale locale )
{
- String helpFile;
+ String helpFile = null;
- ClassPathResource classPathResource;
+ ClassPathResource classPathResource = null;
if ( locale != null && locale.getDisplayLanguage() != null )
{
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/node/serializers/CsvNodeSerializer.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/node/serializers/CsvNodeSerializer.java 2015-07-16 06:27:31 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/node/serializers/CsvNodeSerializer.java 2015-09-13 17:45:53 +0000
@@ -57,9 +57,9 @@
{
private static final String[] CONTENT_TYPES = { "application/csv", "text/csv" };
- private static CsvMapper csvMapper = new CsvMapper();
+ private static final CsvMapper CSV_MAPPER = new CsvMapper();
- private static CsvFactory csvFactory = csvMapper.getFactory();
+ private static final CsvFactory CSV_FACTORY = CSV_MAPPER.getFactory();
private CsvGenerator csvGenerator;
@@ -72,7 +72,7 @@
@Override
protected void startSerialize( RootNode rootNode, OutputStream outputStream ) throws Exception
{
- csvGenerator = csvFactory.createGenerator( outputStream );
+ csvGenerator = CSV_FACTORY.createGenerator( outputStream );
CsvSchema.Builder schemaBuilder = CsvSchema.builder()
.setUseHeader( true );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/node/serializers/StAXNodeSerializer.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/node/serializers/StAXNodeSerializer.java 2015-07-16 06:27:31 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/node/serializers/StAXNodeSerializer.java 2015-09-13 17:45:53 +0000
@@ -108,7 +108,7 @@
@Override
protected void startWriteSimpleNode( SimpleNode simpleNode ) throws Exception
{
- String value;
+ String value = null;
if ( simpleNode.getValue() != null && Date.class.isAssignableFrom( simpleNode.getValue().getClass() ) )
{
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitService.java 2015-09-09 08:45:33 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitService.java 2015-09-13 17:45:53 +0000
@@ -566,7 +566,7 @@
public int getNumberOfOrganisationalLevels()
{
int maxDepth = 0;
- int depth;
+ int depth = 0;
for ( OrganisationUnit root : getRootOrganisationUnits() )
{
@@ -588,7 +588,7 @@
private int getDepth( OrganisationUnit parent, int currentLevel )
{
int maxDepth = currentLevel;
- int depth;
+ int depth = 0;
for ( OrganisationUnit child : parent.getChildren() )
{
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/period/DefaultPeriodService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/period/DefaultPeriodService.java 2015-07-03 01:33:37 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/period/DefaultPeriodService.java 2015-09-13 17:45:53 +0000
@@ -241,9 +241,9 @@
for ( int i = 0; i < historyLength; ++i )
{
- Period p = getPeriodFromDates( lastPeriod.getStartDate(), lastPeriod.getEndDate(), periodType );
+ Period pe = getPeriodFromDates( lastPeriod.getStartDate(), lastPeriod.getEndDate(), periodType );
- periods.add( p != null ? p : lastPeriod );
+ periods.add( pe != null ? pe : lastPeriod );
lastPeriod = periodType.getPreviousPeriod( lastPeriod );
}
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java 2015-09-11 11:54:53 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java 2015-09-13 17:45:53 +0000
@@ -289,7 +289,7 @@
{
ProgramStageInstance programStageInstance = null;
Date currentDate = new Date();
- Date dateCreatedEvent;
+ Date dateCreatedEvent = null;
if ( programStage.getGeneratedByEnrollmentDate() )
{
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/query/CriteriaQueryEngine.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/query/CriteriaQueryEngine.java 2015-08-25 08:45:42 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/query/CriteriaQueryEngine.java 2015-09-13 17:45:53 +0000
@@ -289,7 +289,7 @@
return null;
}
- org.hibernate.criterion.Order criteriaOrder;
+ org.hibernate.criterion.Order criteriaOrder = null;
if ( order.isAscending() )
{
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/schema/Jackson2PropertyIntrospectorService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/schema/Jackson2PropertyIntrospectorService.java 2015-05-30 13:36:07 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/schema/Jackson2PropertyIntrospectorService.java 2015-09-13 17:45:53 +0000
@@ -242,7 +242,7 @@
private String getFieldName( Method method )
{
- String name;
+ String name = null;
String[] getters = new String[]{
"is", "has", "get"
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/security/oauth2/DefaultClientDetailsService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/security/oauth2/DefaultClientDetailsService.java 2015-07-14 07:21:33 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/security/oauth2/DefaultClientDetailsService.java 2015-09-13 17:45:53 +0000
@@ -46,7 +46,7 @@
@Autowired
private OAuth2ClientService oAuth2ClientService;
- private final Set<String> SCOPES = Sets.newHashSet( "ALL" );
+ private static final Set<String> SCOPES = Sets.newHashSet( "ALL" );
@Override
public ClientDetails loadClientByClientId( String clientId ) throws ClientRegistrationException
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/DefaultSmsSender.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/DefaultSmsSender.java 2015-02-22 20:02:00 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/DefaultSmsSender.java 2015-09-13 17:45:53 +0000
@@ -292,7 +292,7 @@
{
String firstTempString = null;
String secondTempString = null;
- int indexToCut;
+ int indexToCut = 0;
firstTempString = message.substring( 0, MAX_CHAR );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/SmsMessageSender.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/SmsMessageSender.java 2015-03-26 14:13:53 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/SmsMessageSender.java 2015-09-13 17:45:53 +0000
@@ -254,7 +254,7 @@
{
String firstTempString = null;
String secondTempString = null;
- int indexToCut;
+ int indexToCut = 0;
firstTempString = message.substring( 0, MAX_CHAR );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/command/SMSCommand.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/command/SMSCommand.java 2015-06-23 15:59:19 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/command/SMSCommand.java 2015-09-13 17:45:53 +0000
@@ -163,7 +163,7 @@
this.separator = separator;
this.dataset = dataset;
this.codes = codes;
- this.setCodeSeparator( codeSeparator );
+ this.codeSeparator = codeSeparator;
}
public SMSCommand( String name, String parser, String separator, DataSet dataset, Set<SMSCode> codes )
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/listener/DataValueSMSListener.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/listener/DataValueSMSListener.java 2015-09-04 07:11:50 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/listener/DataValueSMSListener.java 2015-09-13 17:45:53 +0000
@@ -263,12 +263,12 @@
pattern = Pattern.compile( x );
}
- Matcher m = pattern.matcher( sms );
+ Matcher matcher = pattern.matcher( sms );
- while ( m.find() )
+ while ( matcher.find() )
{
- String key = m.group( 1 );
- String value = m.group( 2 );
+ String key = matcher.group( 1 );
+ String value = matcher.group( 2 );
if ( !StringUtils.isEmpty( key ) && !StringUtils.isEmpty( value ) )
{
@@ -371,7 +371,7 @@
private Period getPeriod( SMSCommand command, Date date )
{
- Period period;
+ Period period = null;
period = command.getDataset().getPeriodType().createPeriod();
CalendarPeriodType cpt = (CalendarPeriodType) period.getPeriodType();
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/listener/J2MEDataValueSMSListener.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/listener/J2MEDataValueSMSListener.java 2015-09-04 07:11:50 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/listener/J2MEDataValueSMSListener.java 2015-09-13 17:45:53 +0000
@@ -427,7 +427,8 @@
{
String pattern = "yyyy-MM-dd";
SimpleDateFormat formatter = new SimpleDateFormat( pattern );
- Date date;
+ Date date = null;
+
try
{
date = formatter.parse( periodName );
@@ -437,15 +438,15 @@
throw new IllegalArgumentException( "Couldn't make a period of type " + periodType.getName()
+ " and name " + periodName, e );
}
+
return periodType.createPeriod( date );
-
}
if ( periodType instanceof WeeklyPeriodType )
{
String pattern = "yyyy-MM-dd";
SimpleDateFormat formatter = new SimpleDateFormat( pattern );
- Date date;
+ Date date = null;
try
{
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/listener/ProgramStageDataEntrySMSListener.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/listener/ProgramStageDataEntrySMSListener.java 2015-08-25 08:45:42 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/listener/ProgramStageDataEntrySMSListener.java 2015-09-13 17:45:53 +0000
@@ -144,11 +144,11 @@
+ smsCommand.getSeparator().trim() + "|$)*\\s*";
pattern = Pattern.compile( x );
}
- Matcher m = pattern.matcher( message );
- while ( m.find() )
+ Matcher matcher = pattern.matcher( message );
+ while ( matcher.find() )
{
- String key = m.group( 1 );
- String value = m.group( 2 );
+ String key = matcher.group( 1 );
+ String value = matcher.group( 2 );
if ( !StringUtils.isEmpty( key ) && !StringUtils.isEmpty( value ) )
{
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/listener/TrackedEntityRegistrationSMSListener.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/listener/TrackedEntityRegistrationSMSListener.java 2015-06-23 15:59:19 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/listener/TrackedEntityRegistrationSMSListener.java 2015-09-13 17:45:53 +0000
@@ -275,11 +275,11 @@
+ smsCommand.getSeparator().trim() + "|$)*\\s*";
pattern = Pattern.compile( x );
}
- Matcher m = pattern.matcher( message );
- while ( m.find() )
+ Matcher matcher = pattern.matcher( message );
+ while ( matcher.find() )
{
- String key = m.group( 1 );
- String value = m.group( 2 );
+ String key = matcher.group( 1 );
+ String value = matcher.group( 2 );
if ( !StringUtils.isEmpty( key ) && !StringUtils.isEmpty( value ) )
{
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/outbound/DefaultOutboundSmsTransportService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/outbound/DefaultOutboundSmsTransportService.java 2015-09-10 16:35:55 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/outbound/DefaultOutboundSmsTransportService.java 2015-09-13 17:45:53 +0000
@@ -288,7 +288,7 @@
return null;
}
- String gatewayId;
+ String gatewayId = null;
if ( gatewayConfig instanceof BulkSmsGatewayConfig )
{
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/ExpressionUpgrader.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/ExpressionUpgrader.java 2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/ExpressionUpgrader.java 2015-09-13 17:45:53 +0000
@@ -65,8 +65,8 @@
private static final String OLD_OPERAND_EXPRESSION = "\\[(\\d+)\\.?(\\d*)\\]";
private static final String OLD_CONSTANT_EXPRESSION = "\\[C(\\d+?)\\]";
- private final Pattern OLD_OPERAND_PATTERN = Pattern.compile( OLD_OPERAND_EXPRESSION );
- private final Pattern OLD_CONSTANT_PATTERN = Pattern.compile( OLD_CONSTANT_EXPRESSION );
+ private static final Pattern OLD_OPERAND_PATTERN = Pattern.compile( OLD_OPERAND_EXPRESSION );
+ private static final Pattern OLD_CONSTANT_PATTERN = Pattern.compile( OLD_CONSTANT_EXPRESSION );
private static final Log log = LogFactory.getLog( ExpressionUpgrader.class );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2015-09-11 13:17:50 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2015-09-13 17:45:53 +0000
@@ -1037,7 +1037,7 @@
while ( rs.next() )
{
- RelativePeriods r = new RelativePeriods( false, rs.getBoolean( "reportingmonth" ), false, false,
+ RelativePeriods rps = new RelativePeriods( false, rs.getBoolean( "reportingmonth" ), false, false,
rs.getBoolean( "reportingquarter" ), false, rs.getBoolean( "lastsixmonth" ), false,
rs.getBoolean( "monthsthisyear" ), rs.getBoolean( "quartersthisyear" ),
rs.getBoolean( "thisyear" ), false, false, rs.getBoolean( "lastyear" ),
@@ -1047,9 +1047,9 @@
int chartId = rs.getInt( "chartid" );
- if ( !r.isEmpty() )
+ if ( !rps.isEmpty() )
{
- int relativePeriodsId = batchHandler.insertObject( r, true );
+ int relativePeriodsId = batchHandler.insertObject( rps, true );
String update = "update chart set relativeperiodsid=" + relativePeriodsId + " where chartid="
+ chartId;
@@ -1096,7 +1096,7 @@
while ( rs.next() )
{
- RelativePeriods r = new RelativePeriods( false, rs.getBoolean( "reportingmonth" ), false, false,
+ RelativePeriods rps = new RelativePeriods( false, rs.getBoolean( "reportingmonth" ), false, false,
rs.getBoolean( "reportingbimonth" ), false, rs.getBoolean( "reportingquarter" ),
rs.getBoolean( "lastsixmonth" ), rs.getBoolean( "monthsthisyear" ),
rs.getBoolean( "quartersthisyear" ), rs.getBoolean( "thisyear" ),
@@ -1109,9 +1109,9 @@
int reportTableId = rs.getInt( "reporttableid" );
- if ( !r.isEmpty() )
+ if ( !rps.isEmpty() )
{
- int relativePeriodsId = batchHandler.insertObject( r, true );
+ int relativePeriodsId = batchHandler.insertObject( rps, true );
String update = "update reporttable set relativeperiodsid=" + relativePeriodsId
+ " where reporttableid=" + reportTableId;
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java 2015-09-07 13:13:33 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java 2015-09-13 17:45:53 +0000
@@ -63,10 +63,6 @@
{
private static final Log log = LogFactory.getLog( TableAlteror.class );
- final Pattern INPUT_PATTERN = Pattern.compile( "(<input.*?)[/]?>", Pattern.DOTALL );
-
- final Pattern IDENTIFIER_PATTERN_FIELD = Pattern.compile( "id=\"(\\d+)-(\\d+)-val\"" );
-
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentityattributevalue/DefaultTrackedEntityAttributeValueService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentityattributevalue/DefaultTrackedEntityAttributeValueService.java 2015-06-23 15:59:19 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentityattributevalue/DefaultTrackedEntityAttributeValueService.java 2015-09-13 17:45:53 +0000
@@ -127,10 +127,10 @@
for ( TrackedEntityAttributeValue attributeValue : getTrackedEntityAttributeValues( source ) )
{
- TrackedEntityAttributeValue _attributeValue = new TrackedEntityAttributeValue(
+ TrackedEntityAttributeValue value = new TrackedEntityAttributeValue(
attributeValue.getAttribute(), destination, attributeValue.getValue() );
- addTrackedEntityAttributeValue( _attributeValue );
+ addTrackedEntityAttributeValue( value );
}
}
}
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueDeletionHandler.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueDeletionHandler.java 2015-06-23 15:59:19 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueDeletionHandler.java 2015-09-13 17:45:53 +0000
@@ -33,7 +33,6 @@
import org.hisp.dhis.program.ProgramStage;
import org.hisp.dhis.program.ProgramStageInstance;
import org.hisp.dhis.system.deletion.DeletionHandler;
-import org.hisp.dhis.trackedentitydatavalue.TrackedEntityDataValue;
import org.springframework.jdbc.core.JdbcTemplate;
/**
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/validation/ValidatorThread.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/validation/ValidatorThread.java 2015-09-10 16:35:55 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/validation/ValidatorThread.java 2015-09-13 17:45:53 +0000
@@ -345,7 +345,7 @@
ValidationRule rule, MapMap<Integer, DataElementOperand, Double> currentValueMap,
Collection<DataElement> sourceDataElements )
{
- Map<Integer, Double> rightSideValues;
+ Map<Integer, Double> rightSideValues = null;
// If ruleType is VALIDATION, the right side is evaluated using the same
// (current) data values. If ruleType is SURVEILLANCE but there are no
@@ -584,7 +584,7 @@
+ "] recursiveDataElements[" + recursiveDataElements.size()
+ "] allowedPeriodTypes[" + allowedPeriodTypes.size() + "]" );
- MapMap<Integer, DataElementOperand, Double> dataValueMap;
+ MapMap<Integer, DataElementOperand, Double> dataValueMap = null;
if ( dataElementsToGet.isEmpty() )
{
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/constant/ConstantServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/constant/ConstantServiceTest.java 2015-06-16 05:11:29 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/constant/ConstantServiceTest.java 2015-09-13 17:45:53 +0000
@@ -127,7 +127,6 @@
@Test
public void testGetConstantByName()
- throws Exception
{
Constant constantA = createConstant( 'A', 1.23 );
Constant constantB = createConstant( 'B', 3.21 );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalLevelServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalLevelServiceTest.java 2015-03-31 12:36:25 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalLevelServiceTest.java 2015-09-13 17:45:53 +0000
@@ -115,7 +115,7 @@
// -------------------------------------------------------------------------
@Override
- public void setUpTest() throws Exception
+ public void setUpTest()
{
// ---------------------------------------------------------------------
// Add supporting data
@@ -197,7 +197,7 @@
// -------------------------------------------------------------------------
@Test
- public void testAddDataApprovalLevel() throws Exception
+ public void testAddDataApprovalLevel()
{
dataApprovalLevelService.addDataApprovalLevel( level2C, 1 );
dataApprovalLevelService.addDataApprovalLevel( level3, 2 );
@@ -225,7 +225,7 @@
}
@Test
- public void testDeleteDataApprovalLevel() throws Exception
+ public void testDeleteDataApprovalLevel()
{
int id1 = dataApprovalLevelService.addDataApprovalLevel( level1A, 1 );
int id2 = dataApprovalLevelService.addDataApprovalLevel( level2B, 2 );
@@ -245,7 +245,7 @@
}
@Test
- public void testExists() throws Exception
+ public void testExists()
{
dataApprovalLevelService.addDataApprovalLevel( level1, 1 );
dataApprovalLevelService.addDataApprovalLevel( level2, 2 );
@@ -270,7 +270,7 @@
}
@Test
- public void testCanMoveDown() throws Exception
+ public void testCanMoveDown()
{
dataApprovalLevelService.addDataApprovalLevel( level1, 1 );
dataApprovalLevelService.addDataApprovalLevel( level1A, 2 );
@@ -298,7 +298,7 @@
}
@Test
- public void testCanMoveUp() throws Exception
+ public void testCanMoveUp()
{
dataApprovalLevelService.addDataApprovalLevel( level1, 1 );
dataApprovalLevelService.addDataApprovalLevel( level1A, 2 );
@@ -326,7 +326,7 @@
}
@Test
- public void testMoveDown() throws Exception
+ public void testMoveDown()
{
int id1 = dataApprovalLevelService.addDataApprovalLevel( level1, 1 );
int id2 = dataApprovalLevelService.addDataApprovalLevel( level1A, 2 );
@@ -350,7 +350,7 @@
}
@Test
- public void testMoveUp() throws Exception
+ public void testMoveUp()
{
int id1 = dataApprovalLevelService.addDataApprovalLevel( level1, 1 );
int id2 = dataApprovalLevelService.addDataApprovalLevel( level1A, 2 );
@@ -374,7 +374,7 @@
}
@Test
- public void testGetUserReadApprovalLevels_1A() throws Exception
+ public void testGetUserReadApprovalLevels_1A()
{
//
// Test 1: Like when a user may capture data within their own district
@@ -410,7 +410,7 @@
}
@Test
- public void testGetUserReadApprovalLevels_1B() throws Exception
+ public void testGetUserReadApprovalLevels_1B()
{
//
// Test 1: Like when a user may capture data within their own district
@@ -446,7 +446,7 @@
}
@Test
- public void testGetUserReadApprovalLevels_1C() throws Exception
+ public void testGetUserReadApprovalLevels_1C()
{
//
// Test 1: Like when a user may capture data within their own district
@@ -481,7 +481,7 @@
}
@Test
- public void testGetUserReadApprovalLevels_1D() throws Exception
+ public void testGetUserReadApprovalLevels_1D()
{
//
// Test 1: Like when a user may capture data within their own district
@@ -524,7 +524,7 @@
//TODO: add tests for getUserDataApprovalLevels where the user can access the CategoryOptionGroupSets
@Test
- public void testGetUserDataApprovalLevelsApproveHere() throws Exception
+ public void testGetUserDataApprovalLevelsApproveHere()
{
dataApprovalLevelService.addDataApprovalLevel( level4B );
dataApprovalLevelService.addDataApprovalLevel( level4A );
@@ -554,7 +554,7 @@
}
@Test
- public void testGetUserDataApprovalLevelsApproveLower() throws Exception
+ public void testGetUserDataApprovalLevelsApproveLower()
{
dataApprovalLevelService.addDataApprovalLevel( level4B );
dataApprovalLevelService.addDataApprovalLevel( level4A );
@@ -584,7 +584,7 @@
}
@Test
- public void testGetUserDataApprovalLevelsApproveHereAndLower() throws Exception
+ public void testGetUserDataApprovalLevelsApproveHereAndLower()
{
dataApprovalLevelService.addDataApprovalLevel( level4B );
dataApprovalLevelService.addDataApprovalLevel( level4A );
@@ -614,7 +614,7 @@
}
@Test
- public void testGetUserDataApprovalLevelsAcceptLower() throws Exception
+ public void testGetUserDataApprovalLevelsAcceptLower()
{
dataApprovalLevelService.addDataApprovalLevel( level4B );
dataApprovalLevelService.addDataApprovalLevel( level4A );
@@ -644,7 +644,7 @@
}
@Test
- public void testGetUserDataApprovalLevelsAcceptMuchLower() throws Exception
+ public void testGetUserDataApprovalLevelsAcceptMuchLower()
{
dataApprovalLevelService.addDataApprovalLevel( level4 );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalServiceCategoryOptionGroupTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalServiceCategoryOptionGroupTest.java 2015-08-25 08:45:42 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalServiceCategoryOptionGroupTest.java 2015-09-13 17:45:53 +0000
@@ -539,20 +539,20 @@
private String getStatusString( DataApprovalStatus status )
{
- DataApproval a = status.getDataApproval();
- String approval = a == null ? "approval=null" :
- "ou=" + ( a.getOrganisationUnit() == null ? "(null)" : a.getOrganisationUnit().getName() )
- + " mechanism=" + ( a.getAttributeOptionCombo() == null ? "(null)" : getOptionNamesFromCombo( a.getAttributeOptionCombo() ) )
- + " level=" + ( a.getDataApprovalLevel() == null ? "(null)" : a.getDataApprovalLevel().getLevel() );
+ DataApproval da = status.getDataApproval();
+ String approval = da == null ? "approval=null" :
+ "ou=" + ( da.getOrganisationUnit() == null ? "(null)" : da.getOrganisationUnit().getName() )
+ + " mechanism=" + ( da.getAttributeOptionCombo() == null ? "(null)" : getOptionNamesFromCombo( da.getAttributeOptionCombo() ) )
+ + " level=" + ( da.getDataApprovalLevel() == null ? "(null)" : da.getDataApprovalLevel().getLevel() );
- DataApprovalPermissions p = status.getPermissions();
+ DataApprovalPermissions permissions = status.getPermissions();
return approval + " " + status.getState().toString()
- + " approve=" + ( p.isMayApprove() ? "T" : "F" )
- + " unapprove=" + ( p.isMayUnapprove() ? "T" : "F" )
- + " accept=" + ( p.isMayAccept() ? "T" : "F" )
- + " unaccept=" + ( p.isMayUnaccept() ? "T" : "F" )
- + " read=" + ( p.isMayReadData() ? "T" : "F" );
+ + " approve=" + ( permissions.isMayApprove() ? "T" : "F" )
+ + " unapprove=" + ( permissions.isMayUnapprove() ? "T" : "F" )
+ + " accept=" + ( permissions.isMayAccept() ? "T" : "F" )
+ + " unaccept=" + ( permissions.isMayUnaccept() ? "T" : "F" )
+ + " read=" + ( permissions.isMayReadData() ? "T" : "F" );
}
private String[] getUserApprovalsAndPermissions( CurrentUserService mockUserService, DataSet dataSet, Period period, OrganisationUnit orgUnit )
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalServiceTest.java 2015-06-01 23:57:56 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalServiceTest.java 2015-09-13 17:45:53 +0000
@@ -191,7 +191,7 @@
// -------------------------------------------------------------------------
@Override
- public void setUpTest() throws Exception
+ public void setUpTest()
{
userService = _userService;
@@ -323,7 +323,7 @@
// Set Up Categories
// ---------------------------------------------------------------------
- private void setUpCategories() throws Exception
+ private void setUpCategories()
{
optionA = new DataElementCategoryOption( "CategoryOptionA" );
optionB = new DataElementCategoryOption( "CategoryOptionB" );
@@ -430,7 +430,7 @@
}
@Test
- public void testAddAllAndGetDataApproval() throws Exception
+ public void testAddAllAndGetDataApproval()
{
dataApprovalLevelService.addDataApprovalLevel( level1, 1 );
dataApprovalLevelService.addDataApprovalLevel( level2, 2 );
@@ -457,20 +457,16 @@
dataApprovalService.approveData( newArrayList(dataApprovalB, dataApprovalC, dataApprovalD) ); // Must be approved before A.
dataApprovalService.approveData( newArrayList(dataApprovalA) );
- DataApprovalStatus status;
- DataApproval da;
- DataApprovalLevel level;
-
- status = dataApprovalService.getDataApprovalStatus( dataSetA, periodA, organisationUnitA, defaultCombo );
+ DataApprovalStatus status = dataApprovalService.getDataApprovalStatus( dataSetA, periodA, organisationUnitA, defaultCombo );
assertEquals( DataApprovalState.APPROVED_HERE, status.getState() );
- da = status.getDataApproval();
+ DataApproval da = status.getDataApproval();
assertNotNull( da );
assertEquals( dataSetA, da.getDataSet() );
assertEquals( periodA, da.getPeriod() );
assertEquals( organisationUnitA.getId(), da.getOrganisationUnit().getId() );
assertEquals( date, da.getCreated() );
assertEquals( userA.getId(), da.getCreator().getId() );
- level = status.getDataApprovalLevel();
+ DataApprovalLevel level = status.getDataApprovalLevel();
assertNotNull( level );
assertEquals( level1, level );
@@ -522,7 +518,7 @@
@Ignore //TODO Fails with DataMayNotBeApproved
@Test
- public void testAddDuplicateDataApproval() throws Exception
+ public void testAddDuplicateDataApproval()
{
dataApprovalLevelService.addDataApprovalLevel( level1 );
@@ -546,7 +542,7 @@
@Test
@Ignore
- public void testDeleteDataApproval() throws Exception
+ public void testDeleteDataApproval()
{
dataApprovalLevelService.addDataApprovalLevel( level1 );
dataApprovalLevelService.addDataApprovalLevel( level2 );
@@ -586,7 +582,7 @@
}
@Test
- public void testGetDataApprovalState() throws Exception
+ public void testGetDataApprovalState()
{
dataApprovalLevelService.addDataApprovalLevel( level1 );
dataApprovalLevelService.addDataApprovalLevel( level2 );
@@ -703,7 +699,7 @@
}
@Test
- public void testGetDataApprovalStateAbove() throws Exception
+ public void testGetDataApprovalStateAbove()
{
dataApprovalLevelService.addDataApprovalLevel( level3 );
@@ -729,7 +725,7 @@
}
@Test
- public void testGetDataApprovalStateWithMultipleChildren() throws Exception
+ public void testGetDataApprovalStateWithMultipleChildren()
{
dataApprovalLevelService.addDataApprovalLevel( level1 );
dataApprovalLevelService.addDataApprovalLevel( level2 );
@@ -789,7 +785,7 @@
}
@Test
- public void testGetDataApprovalStateOtherPeriodTypes() throws Exception
+ public void testGetDataApprovalStateOtherPeriodTypes()
{
dataApprovalLevelService.addDataApprovalLevel( level1 );
dataApprovalLevelService.addDataApprovalLevel( level2 );
@@ -817,7 +813,7 @@
}
@Test
- public void testMayApproveSameLevel() throws Exception
+ public void testMayApproveSameLevel()
{
dataApprovalLevelService.addDataApprovalLevel( level1 );
dataApprovalLevelService.addDataApprovalLevel( level2 );
@@ -928,7 +924,7 @@
}
@Test
- public void testMayApproveLowerLevels() throws Exception
+ public void testMayApproveLowerLevels()
{
dataApprovalLevelService.addDataApprovalLevel( level1 );
dataApprovalLevelService.addDataApprovalLevel( level2 );
@@ -1008,7 +1004,7 @@
}
@Test
- public void testMayApproveSameAndLowerLevels() throws Exception
+ public void testMayApproveSameAndLowerLevels()
{
dataApprovalLevelService.addDataApprovalLevel( level1 );
dataApprovalLevelService.addDataApprovalLevel( level2 );
@@ -1078,7 +1074,7 @@
}
@Test
- public void testMayApproveNoAuthority() throws Exception
+ public void testMayApproveNoAuthority()
{
dataApprovalLevelService.addDataApprovalLevel( level1 );
dataApprovalLevelService.addDataApprovalLevel( level2 );
@@ -1115,7 +1111,7 @@
}
@Test
- public void testMayUnapproveSameLevel() throws Exception
+ public void testMayUnapproveSameLevel()
{
dataApprovalLevelService.addDataApprovalLevel( level1 );
dataApprovalLevelService.addDataApprovalLevel( level2 );
@@ -1187,7 +1183,7 @@
}
@Test
- public void testMayUnapproveLowerLevels() throws Exception
+ public void testMayUnapproveLowerLevels()
{
dataApprovalLevelService.addDataApprovalLevel( level1 );
dataApprovalLevelService.addDataApprovalLevel( level2 );
@@ -1259,7 +1255,7 @@
@Ignore //TODO Fails
@Test
- public void testMayUnapproveWithAcceptAuthority() throws Exception
+ public void testMayUnapproveWithAcceptAuthority()
{
dataApprovalLevelService.addDataApprovalLevel( level1 );
dataApprovalLevelService.addDataApprovalLevel( level2 );
@@ -1330,7 +1326,7 @@
}
@Test
- public void testMayUnapproveNoAuthority() throws Exception
+ public void testMayUnapproveNoAuthority()
{
dataApprovalLevelService.addDataApprovalLevel( level1 );
dataApprovalLevelService.addDataApprovalLevel( level2 );
@@ -1405,7 +1401,7 @@
@Ignore //TODO Get this test working
@Test
- public void testApprovalStateWithCategories() throws Exception
+ public void testApprovalStateWithCategories()
{
setUpCategories();
@@ -1545,7 +1541,7 @@
@Ignore //TODO get this test working
@Test
- public void testApprovalLevelWithCategories() throws Exception
+ public void testApprovalLevelWithCategories()
{
setUpCategories();
@@ -1690,7 +1686,7 @@
@Ignore //TODO get this test working
@Test
- public void testCategoriesWithOrgUnitLevels() throws Exception
+ public void testCategoriesWithOrgUnitLevels()
{
setUpCategories();
@@ -1771,14 +1767,14 @@
{
DataApprovalStatus status = dataApprovalService.getDataApprovalStatusAndPermissions( dataSet, period, organisationUnit, attributeOptionCombo );
- DataApprovalPermissions p = status.getPermissions();
+ DataApprovalPermissions permissions = status.getPermissions();
return status.getState().toString()
+ " level=" + ( status.getDataApprovalLevel() == null ? "null" : status.getDataApprovalLevel().getLevel() )
- + " approve=" + ( p.isMayApprove() ? "T" : "F" )
- + " unapprove=" + ( p.isMayUnapprove() ? "T" : "F" )
- + " accept=" + ( p.isMayAccept() ? "T" : "F" )
- + " unaccept=" + ( p.isMayUnaccept() ? "T" : "F" )
- + " read=" + ( p.isMayReadData() ? "T" : "F" );
+ + " approve=" + ( permissions.isMayApprove() ? "T" : "F" )
+ + " unapprove=" + ( permissions.isMayUnapprove() ? "T" : "F" )
+ + " accept=" + ( permissions.isMayAccept() ? "T" : "F" )
+ + " unaccept=" + ( permissions.isMayUnaccept() ? "T" : "F" )
+ + " read=" + ( permissions.isMayReadData() ? "T" : "F" );
}
}
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalStoreTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalStoreTest.java 2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalStoreTest.java 2015-09-13 17:45:53 +0000
@@ -170,7 +170,7 @@
DataApproval dataApprovalB = new DataApproval( level2, dataSetA, periodA, sourceB, categoryOptionCombo, false, date, userA );
DataApproval dataApprovalC = new DataApproval( level1, dataSetA, periodB, sourceA, categoryOptionCombo, false, date, userA );
DataApproval dataApprovalD = new DataApproval( level1, dataSetB, periodA, sourceA, categoryOptionCombo, false, date, userA );
- DataApproval dataApprovalE;
+ DataApproval dataApprovalE = null;
dataApprovalStore.addDataApproval( dataApprovalA );
dataApprovalStore.addDataApproval( dataApprovalB );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataelement/DataElementStoreTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataelement/DataElementStoreTest.java 2015-09-04 09:29:23 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataelement/DataElementStoreTest.java 2015-09-13 17:45:53 +0000
@@ -103,7 +103,6 @@
@Test
public void testDeleteAndGetDataElement()
- throws Exception
{
DataElement dataElementA = createDataElement( 'A' );
DataElement dataElementB = createDataElement( 'B' );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataentryform/DataEntryFormStoreTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataentryform/DataEntryFormStoreTest.java 2015-06-16 05:11:29 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataentryform/DataEntryFormStoreTest.java 2015-09-13 17:45:53 +0000
@@ -128,9 +128,7 @@
@Test
public void testGetDataEntryFormByName()
- throws Exception
{
-
DataEntryForm dataEntryForm = new DataEntryForm( "DataEntryForm-A" );
int id = dataEntryFormStore.save( dataEntryForm );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/DataSetServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/DataSetServiceTest.java 2015-08-26 06:45:38 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/DataSetServiceTest.java 2015-09-13 17:45:53 +0000
@@ -186,7 +186,6 @@
@Test
public void testGetDataSetByName()
- throws Exception
{
DataSet dataSetA = createDataSet( 'A', periodType );
DataSet dataSetB = createDataSet( 'B', periodType );
@@ -201,7 +200,6 @@
@Test
public void testGetDataSetByShortName()
- throws Exception
{
DataSet dataSetA = createDataSet( 'A', periodType );
DataSet dataSetB = createDataSet( 'B', periodType );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/DataSetStoreTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/DataSetStoreTest.java 2015-06-16 05:11:29 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/DataSetStoreTest.java 2015-09-13 17:45:53 +0000
@@ -186,7 +186,6 @@
@Test
public void testGetDataSetByName()
- throws Exception
{
DataSet dataSetA = createDataSet( 'A', periodType );
DataSet dataSetB = createDataSet( 'B', periodType );
@@ -201,7 +200,6 @@
@Test
public void testGetDataSetByShortName()
- throws Exception
{
DataSet dataSetA = createDataSet( 'A', periodType );
DataSet dataSetB = createDataSet( 'B', periodType );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/datavalue/DataValueServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/datavalue/DataValueServiceTest.java 2015-06-16 05:11:29 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/datavalue/DataValueServiceTest.java 2015-09-13 17:45:53 +0000
@@ -147,7 +147,6 @@
@Test
public void testAddDataValue()
- throws Exception
{
DataValue dataValueA = new DataValue( dataElementA, periodA, sourceA, optionCombo, optionCombo );
dataValueA.setValue( "1" );
@@ -187,7 +186,6 @@
@Test
public void testUpdataDataValue()
- throws Exception
{
DataValue dataValueA = new DataValue( dataElementA, periodA, sourceA, optionCombo, optionCombo );
dataValueA.setValue( "1" );
@@ -214,7 +212,6 @@
@Test
public void testDeleteAndGetDataValue()
- throws Exception
{
DataValue dataValueA = new DataValue( dataElementA, periodA, sourceA, optionCombo, optionCombo );
dataValueA.setValue( "1" );
@@ -262,7 +259,6 @@
@Test
public void testDeleteDataValuesBySource()
- throws Exception
{
DataValue dataValueA = new DataValue( dataElementA, periodA, sourceA, optionCombo, optionCombo );
dataValueA.setValue( "1" );
@@ -310,7 +306,6 @@
@Test
public void testDeleteDataValuesByDataElement()
- throws Exception
{
DataValue dataValueA = new DataValue( dataElementA, periodA, sourceA, optionCombo, optionCombo );
dataValueA.setValue( "1" );
@@ -362,7 +357,6 @@
@Test
public void testGetAllDataValues()
- throws Exception
{
DataValue dataValueA = new DataValue( dataElementA, periodA, sourceA, optionCombo, optionCombo );
dataValueA.setValue( "1" );
@@ -385,7 +379,6 @@
@Test
public void testGetDataValuesSourcePeriod()
- throws Exception
{
DataValue dataValueA = new DataValue( dataElementA, periodA, sourceA, optionCombo, optionCombo );
dataValueA.setValue( "1" );
@@ -416,7 +409,6 @@
@Test
public void testGetDataValuesSourceDataElement()
- throws Exception
{
DataValue dataValueA = new DataValue( dataElementA, periodA, sourceA, optionCombo, optionCombo );
dataValueA.setValue( "1" );
@@ -447,7 +439,6 @@
@Test
public void testGetDataValuesSourcesDataElement()
- throws Exception
{
DataValue dataValueA = new DataValue( dataElementA, periodA, sourceA, optionCombo, optionCombo );
dataValueA.setValue( "1" );
@@ -482,7 +473,6 @@
@Test
public void testGetDataValuesSourcePeriodDataElements()
- throws Exception
{
DataValue dataValueA = new DataValue( dataElementA, periodA, sourceA, optionCombo, optionCombo );
dataValueA.setValue( "1" );
@@ -517,7 +507,6 @@
@Test
public void testGetDataValuesDataElementPeriodsSources()
- throws Exception
{
DataValue dataValueA = new DataValue( dataElementA, periodA, sourceB, optionCombo, optionCombo );
dataValueA.setValue( "1" );
@@ -550,7 +539,6 @@
@Test
public void testGetDataValuesOptionComboDataElementPeriodsSources()
- throws Exception
{
DataValue dataValueA = new DataValue( dataElementA, periodA, sourceB, optionCombo, optionCombo );
dataValueA.setValue( "1" );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/expression/ExpressionServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/expression/ExpressionServiceTest.java 2015-07-10 21:08:24 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/expression/ExpressionServiceTest.java 2015-09-13 17:45:53 +0000
@@ -432,8 +432,8 @@
public void testGenerateExpressionMap()
{
Map<DataElementOperand, Double> valueMap = new HashMap<>();
- valueMap.put( new DataElementOperand( dataElementA.getUid(), categoryOptionCombo.getUid() ), new Double( 12 ) );
- valueMap.put( new DataElementOperand( dataElementB.getUid(), categoryOptionCombo.getUid() ), new Double( 34 ) );
+ valueMap.put( new DataElementOperand( dataElementA.getUid(), categoryOptionCombo.getUid() ), 12d );
+ valueMap.put( new DataElementOperand( dataElementB.getUid(), categoryOptionCombo.getUid() ), 34d );
Map<String, Double> constantMap = new HashMap<>();
constantMap.put( constantA.getUid(), 2.0 );
@@ -468,8 +468,8 @@
Expression expH = createExpression( 'H', expressionH, null, null );
Map<DataElementOperand, Double> valueMap = new HashMap<>();
- valueMap.put( new DataElementOperand( dataElementA.getUid(), categoryOptionCombo.getUid() ), new Double( 12 ) );
- valueMap.put( new DataElementOperand( dataElementB.getUid(), categoryOptionCombo.getUid() ), new Double( 34 ) );
+ valueMap.put( new DataElementOperand( dataElementA.getUid(), categoryOptionCombo.getUid() ), 12d );
+ valueMap.put( new DataElementOperand( dataElementB.getUid(), categoryOptionCombo.getUid() ), 34d );
Map<String, Double> constantMap = new HashMap<>();
constantMap.put( constantA.getUid(), 2.0 );
@@ -492,8 +492,8 @@
indicatorA.setDenominator( expressionF );
Map<DataElementOperand, Double> valueMap = new HashMap<>();
- valueMap.put( new DataElementOperand( dataElementA.getUid(), categoryOptionCombo.getUid() ), new Double( 12 ) );
- valueMap.put( new DataElementOperand( dataElementB.getUid(), categoryOptionCombo.getUid() ), new Double( 34 ) );
+ valueMap.put( new DataElementOperand( dataElementA.getUid(), categoryOptionCombo.getUid() ), 12d );
+ valueMap.put( new DataElementOperand( dataElementB.getUid(), categoryOptionCombo.getUid() ), 34d );
Map<String, Double> constantMap = new HashMap<>();
constantMap.put( constantA.getUid(), 2.0 );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/i18n/I18nServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/i18n/I18nServiceTest.java 2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/i18n/I18nServiceTest.java 2015-09-13 17:45:53 +0000
@@ -63,7 +63,6 @@
@Test
public void testUpdateTranslation()
- throws Exception
{
Locale locale = Locale.FRANCE;
String className = DataElement.class.getSimpleName();
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/indicator/IndicatorGroupStoreTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/indicator/IndicatorGroupStoreTest.java 2015-06-16 05:11:29 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/indicator/IndicatorGroupStoreTest.java 2015-09-13 17:45:53 +0000
@@ -53,7 +53,6 @@
@Test
public void testAddIndicatorGroup()
- throws Exception
{
IndicatorGroup groupA = new IndicatorGroup( "IndicatorGroupA" );
IndicatorGroup groupB = new IndicatorGroup( "IndicatorGroupB" );
@@ -72,7 +71,6 @@
@Test
public void testUpdateIndicatorGroup()
- throws Exception
{
IndicatorGroup groupA = new IndicatorGroup( "IndicatorGroupA" );
int idA = indicatorGroupStore.save( groupA );
@@ -88,7 +86,6 @@
@Test
public void testGetAndDeleteIndicatorGroup()
- throws Exception
{
IndicatorGroup groupA = new IndicatorGroup( "IndicatorGroupA" );
IndicatorGroup groupB = new IndicatorGroup( "IndicatorGroupB" );
@@ -112,7 +109,6 @@
@Test
public void testGetAllIndicatorGroups()
- throws Exception
{
IndicatorGroup groupA = new IndicatorGroup( "IndicatorGroupA" );
IndicatorGroup groupB = new IndicatorGroup( "IndicatorGroupB" );
@@ -129,7 +125,6 @@
@Test
public void testGetIndicatorGroupByName()
- throws Exception
{
IndicatorGroup groupA = new IndicatorGroup( "IndicatorGroupA" );
IndicatorGroup groupB = new IndicatorGroup( "IndicatorGroupB" );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/indicator/IndicatorServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/indicator/IndicatorServiceTest.java 2015-08-25 10:03:15 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/indicator/IndicatorServiceTest.java 2015-09-13 17:45:53 +0000
@@ -67,7 +67,6 @@
@Test
public void testAddIndicatorType()
- throws Exception
{
IndicatorType typeA = new IndicatorType( "IndicatorTypeA", 100, false );
IndicatorType typeB = new IndicatorType( "IndicatorTypeB", 1, false );
@@ -102,7 +101,6 @@
@Test
public void testGetAndDeleteIndicatorType()
- throws Exception
{
IndicatorType typeA = new IndicatorType( "IndicatorTypeA", 100, false );
IndicatorType typeB = new IndicatorType( "IndicatorTypeB", 1, false );
@@ -126,7 +124,6 @@
@Test
public void testGetAllIndicatorTypes()
- throws Exception
{
IndicatorType typeA = new IndicatorType( "IndicatorTypeA", 100, false );
IndicatorType typeB = new IndicatorType( "IndicatorTypeB", 1, false );
@@ -143,7 +140,6 @@
@Test
public void testGetIndicatorTypeByName()
- throws Exception
{
IndicatorType typeA = new IndicatorType( "IndicatorTypeA", 100, false );
IndicatorType typeB = new IndicatorType( "IndicatorTypeB", 1, false );
@@ -168,7 +164,6 @@
@Test
public void testAddIndicatorGroup()
- throws Exception
{
IndicatorGroup groupA = new IndicatorGroup( "IndicatorGroupA" );
IndicatorGroup groupB = new IndicatorGroup( "IndicatorGroupB" );
@@ -187,7 +182,6 @@
@Test
public void testUpdateIndicatorGroup()
- throws Exception
{
IndicatorGroup groupA = new IndicatorGroup( "IndicatorGroupA" );
int idA = indicatorService.addIndicatorGroup( groupA );
@@ -203,7 +197,6 @@
@Test
public void testGetAndDeleteIndicatorGroup()
- throws Exception
{
IndicatorGroup groupA = new IndicatorGroup( "IndicatorGroupA" );
IndicatorGroup groupB = new IndicatorGroup( "IndicatorGroupB" );
@@ -227,7 +220,6 @@
@Test
public void testGetAllIndicatorGroups()
- throws Exception
{
IndicatorGroup groupA = new IndicatorGroup( "IndicatorGroupA" );
IndicatorGroup groupB = new IndicatorGroup( "IndicatorGroupB" );
@@ -244,7 +236,6 @@
@Test
public void testGetIndicatorGroupByName()
- throws Exception
{
IndicatorGroup groupA = new IndicatorGroup( "IndicatorGroupA" );
IndicatorGroup groupB = new IndicatorGroup( "IndicatorGroupB" );
@@ -268,7 +259,6 @@
@Test
public void testAddIndicator()
- throws Exception
{
IndicatorType type = new IndicatorType( "IndicatorType", 100, false );
@@ -291,7 +281,6 @@
@Test
public void testUpdateIndicator()
- throws Exception
{
IndicatorType type = new IndicatorType( "IndicatorType", 100, false );
@@ -311,7 +300,6 @@
@Test
public void testGetAndDeleteIndicator()
- throws Exception
{
IndicatorType type = new IndicatorType( "IndicatorType", 100, false );
@@ -339,7 +327,6 @@
@Test
public void testGetAllIndicators()
- throws Exception
{
IndicatorType type = new IndicatorType( "IndicatorType", 100, false );
@@ -360,7 +347,6 @@
@Test
public void testGetIndicatorByName()
- throws Exception
{
IndicatorType type = new IndicatorType( "IndicatorType", 100, false );
@@ -384,7 +370,6 @@
@Test
public void testGetIndicatorByShortName()
- throws Exception
{
IndicatorType type = new IndicatorType( "IndicatorType", 100, false );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/indicator/IndicatorStoreTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/indicator/IndicatorStoreTest.java 2015-06-16 05:11:29 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/indicator/IndicatorStoreTest.java 2015-09-13 17:45:53 +0000
@@ -73,7 +73,6 @@
@Test
public void testAddIndicatorType()
- throws Exception
{
IndicatorType typeA = new IndicatorType( "IndicatorTypeA", 100, false );
IndicatorType typeB = new IndicatorType( "IndicatorTypeB", 1, false );
@@ -92,7 +91,6 @@
@Test
public void testUpdateIndicatorType()
- throws Exception
{
IndicatorType typeA = new IndicatorType( "IndicatorTypeA", 100, false );
int idA = indicatorTypeStore.save( typeA );
@@ -108,7 +106,6 @@
@Test
public void testGetAndDeleteIndicatorType()
- throws Exception
{
IndicatorType typeA = new IndicatorType( "IndicatorTypeA", 100, false );
IndicatorType typeB = new IndicatorType( "IndicatorTypeB", 1, false );
@@ -132,7 +129,6 @@
@Test
public void testGetAllIndicatorTypes()
- throws Exception
{
IndicatorType typeA = new IndicatorType( "IndicatorTypeA", 100, false );
IndicatorType typeB = new IndicatorType( "IndicatorTypeB", 1, false );
@@ -149,7 +145,6 @@
@Test
public void testGetIndicatorTypeByName()
- throws Exception
{
IndicatorType typeA = new IndicatorType( "IndicatorTypeA", 100, false );
IndicatorType typeB = new IndicatorType( "IndicatorTypeB", 1, false );
@@ -175,7 +170,6 @@
@Test
public void testAddIndicator()
- throws Exception
{
IndicatorType type = new IndicatorType( "IndicatorType", 100, false );
@@ -198,7 +192,6 @@
@Test
public void testUpdateIndicator()
- throws Exception
{
IndicatorType type = new IndicatorType( "IndicatorType", 100, false );
@@ -218,7 +211,6 @@
@Test
public void testGetAndDeleteIndicator()
- throws Exception
{
IndicatorType type = new IndicatorType( "IndicatorType", 100, false );
@@ -246,7 +238,6 @@
@Test
public void testGetAllIndicators()
- throws Exception
{
IndicatorType type = new IndicatorType( "IndicatorType", 100, false );
@@ -267,7 +258,6 @@
@Test
public void testGetIndicatorByName()
- throws Exception
{
IndicatorType type = new IndicatorType( "IndicatorType", 100, false );
@@ -292,7 +282,6 @@
@Test
public void testGetIndicatorByShortName()
- throws Exception
{
IndicatorType type = new IndicatorType( "IndicatorType", 100, false );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/minmax/MinMaxDataElementStoreTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/minmax/MinMaxDataElementStoreTest.java 2015-09-04 09:29:23 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/minmax/MinMaxDataElementStoreTest.java 2015-09-13 17:45:53 +0000
@@ -66,7 +66,6 @@
@Test
public void testBasic()
- throws Exception
{
OrganisationUnit source1 = createOrganisationUnit( 'A' );
OrganisationUnit source2 = createOrganisationUnit( 'B' );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/organisationunit/OrganisationUnitServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/organisationunit/OrganisationUnitServiceTest.java 2015-09-09 08:45:33 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/organisationunit/OrganisationUnitServiceTest.java 2015-09-13 17:45:53 +0000
@@ -68,7 +68,6 @@
@Test
public void testBasicOrganisationUnitCoarseGrained()
- throws Exception
{
OrganisationUnit organisationUnit1 = createOrganisationUnit( 'A' );
@@ -92,7 +91,6 @@
@Test
public void testUpdateOrganisationUnit()
- throws Exception
{
String updatedName = "updatedName";
String updatedShortName = "updatedShortName";
@@ -194,7 +192,6 @@
@Test
public void testGetOrganisationUnitWithChildrenWithCorrectLevel()
- throws Exception
{
OrganisationUnit unit1 = createOrganisationUnit( 'A' );
OrganisationUnit unit2 = createOrganisationUnit( 'B', unit1 );
@@ -218,7 +215,6 @@
@Test
public void testGetOrganisationUnitsByFields()
- throws Exception
{
String oU1Name = "OU1name";
String oU2Name = "OU2name";
@@ -241,8 +237,8 @@
OrganisationUnit unit1 = organisationUnitService.getOrganisationUnitByName( oU1Name ).get( 0 );
assertEquals( unit1.getName(), oU1Name );
- List<OrganisationUnit> foo = organisationUnitService.getOrganisationUnitByName( "foo" );
- assertTrue( foo.isEmpty() );
+ List<OrganisationUnit> units = organisationUnitService.getOrganisationUnitByName( "foo" );
+ assertTrue( units.isEmpty() );
unit1 = organisationUnitService.getOrganisationUnitByCode( oU1Code );
assertEquals( unit1.getName(), oU1Name );
@@ -253,7 +249,6 @@
@Test
public void testGetOrganisationUnitGraph()
- throws Exception
{
OrganisationUnit organisationUnit1 = createOrganisationUnit( 'A' );
OrganisationUnit organisationUnit2 = createOrganisationUnit( 'B', organisationUnit1 );
@@ -276,7 +271,6 @@
@Test
public void testGetAllOrganisationUnitsAndGetRootOrganisationUnit()
- throws Exception
{
// creating a tree with two roots ( id1 and id4 )
@@ -312,7 +306,6 @@
@Test
public void testGetOrganisationUnitsAtLevel()
- throws Exception
{
OrganisationUnit unit1 = createOrganisationUnit( '1' );
organisationUnitService.addOrganisationUnit( unit1 );
@@ -465,7 +458,6 @@
@Test
public void testGetOrganisationUnitAtLevelAndBranches()
- throws Exception
{
OrganisationUnit unitA = createOrganisationUnit( 'A' );
OrganisationUnit unitB = createOrganisationUnit( 'B', unitA );
@@ -539,7 +531,6 @@
@Test
public void testAddAndDelOrganisationUnitGroup()
- throws Exception
{
OrganisationUnitGroup organisationUnitGroup1 = new OrganisationUnitGroup( "OUGname" );
@@ -560,7 +551,6 @@
@Test
@Ignore
public void testUpdateOrganisationUnitGroup()
- throws Exception
{
OrganisationUnitGroup organisationUnitGroup = new OrganisationUnitGroup( "OUGname" );
@@ -586,7 +576,6 @@
@Test
public void testGetAllOrganisationUnitGroups()
- throws Exception
{
OrganisationUnitGroup group1 = new OrganisationUnitGroup( "organisationUnitGroupName1" );
OrganisationUnitGroup group2 = new OrganisationUnitGroup( "organisationUnitGroupName2" );
@@ -624,7 +613,6 @@
@Test
public void testGetOrganisationUnitGroupByName()
- throws Exception
{
String oUG1Name = "OUG1Name";
String oUG2Name = "OUG2Name";
@@ -648,7 +636,6 @@
@Test
public void testAddGetOrganisationUnitHierarchy()
- throws Exception
{
// creates a tree
OrganisationUnit unit1 = new OrganisationUnit( "orgUnitName1", "shortName1", "organisationUnitCode1",
@@ -704,7 +691,6 @@
@Test
public void testOrganisationUnitGroupSetsBasic()
- throws Exception
{
OrganisationUnitGroup organisationUnitGroup1 = new OrganisationUnitGroup();
organisationUnitGroup1.setName( "oug1" );
@@ -762,7 +748,6 @@
@Test
public void testGetOrganisationUnitGroupSetsByName()
- throws Exception
{
OrganisationUnitGroup organisationUnitGroup1 = new OrganisationUnitGroup();
organisationUnitGroup1.setName( "oug1" );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/period/PeriodServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/period/PeriodServiceTest.java 2015-06-16 05:11:29 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/period/PeriodServiceTest.java 2015-09-13 17:45:53 +0000
@@ -267,7 +267,6 @@
@Test
public void testGetIntersectingPeriodsByPeriodType()
- throws Exception
{
PeriodType ypt = PeriodType.getPeriodTypeByName( YearlyPeriodType.NAME );
@@ -518,7 +517,6 @@
@Test
public void testGetAndGetAllPeriodTypes()
- throws Exception
{
List<PeriodType> periodTypes = periodService.getAllPeriodTypes();
Iterator<PeriodType> it = periodTypes.iterator();
@@ -535,7 +533,6 @@
@Test
public void testGetPeriodTypeByName()
- throws Exception
{
List<PeriodType> periodTypes = periodService.getAllPeriodTypes();
Iterator<PeriodType> it = periodTypes.iterator();
@@ -553,7 +550,6 @@
@Test
public void testDeleteAndGetPeriodType()
- throws Exception
{
List<PeriodType> periodTypes = periodService.getAllPeriodTypes();
Iterator<PeriodType> it = periodTypes.iterator();
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/period/PeriodStoreTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/period/PeriodStoreTest.java 2015-06-16 05:11:29 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/period/PeriodStoreTest.java 2015-09-13 17:45:53 +0000
@@ -58,7 +58,6 @@
@Test
public void testAddPeriod()
- throws Exception
{
List<PeriodType> periodTypes = periodStore.getAllPeriodTypes();
Iterator<PeriodType> it = periodTypes.iterator();
@@ -96,7 +95,6 @@
@Test
public void testDeleteAndGetPeriod()
- throws Exception
{
List<PeriodType> periodTypes = periodStore.getAllPeriodTypes();
Iterator<PeriodType> it = periodTypes.iterator();
@@ -144,7 +142,6 @@
@Test
public void testGetPeriod()
- throws Exception
{
List<PeriodType> periodTypes = periodStore.getAllPeriodTypes();
Iterator<PeriodType> it = periodTypes.iterator();
@@ -206,7 +203,6 @@
@Test
public void testGetAllPeriods()
- throws Exception
{
PeriodType periodType = periodStore.getAllPeriodTypes().iterator().next();
@@ -229,7 +225,6 @@
@Test
public void testGetPeriodsBetweenDates()
- throws Exception
{
List<PeriodType> periodTypes = periodStore.getAllPeriodTypes();
Iterator<PeriodType> it = periodTypes.iterator();
@@ -272,7 +267,6 @@
@Test
public void testGetPeriodsBetweenOrSpanningDates()
- throws Exception
{
List<PeriodType> periodTypes = periodStore.getAllPeriodTypes();
Iterator<PeriodType> it = periodTypes.iterator();
@@ -320,7 +314,6 @@
@Test
public void testGetIntersectingPeriodsByPeriodType()
- throws Exception
{
PeriodType ypt = PeriodType.getPeriodTypeByName( YearlyPeriodType.NAME );
@@ -398,7 +391,6 @@
@Test
public void testGetIntersectingPeriods()
- throws Exception
{
PeriodType type = periodStore.getAllPeriodTypes().iterator().next();
@@ -440,7 +432,6 @@
@Test
public void testGetPeriodsByPeriodType()
- throws Exception
{
List<PeriodType> periodTypes = periodStore.getAllPeriodTypes();
Iterator<PeriodType> it = periodTypes.iterator();
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/setting/SystemSettingManagerTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/setting/SystemSettingManagerTest.java 2015-09-10 16:35:55 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/setting/SystemSettingManagerTest.java 2015-09-13 17:45:53 +0000
@@ -57,15 +57,15 @@
systemSettingManager.saveSystemSetting( "settingA", "valueA" );
systemSettingManager.saveSystemSetting( "settingB", "valueB" );
- assertEquals( new String( "valueA" ), systemSettingManager.getSystemSetting( "settingA" ) );
- assertEquals( new String( "valueB" ), systemSettingManager.getSystemSetting( "settingB" ) );
+ assertEquals( "valueA", systemSettingManager.getSystemSetting( "settingA" ) );
+ assertEquals( "valueB", systemSettingManager.getSystemSetting( "settingB" ) );
}
@Test
public void testGetDefaultSystemSetting()
{
- assertEquals( new String( "valueA" ), systemSettingManager.getSystemSetting( "settingA", "valueA" ) );
- assertEquals( new String( "valueB" ), systemSettingManager.getSystemSetting( "settingB", "valueB" ) );
+ assertEquals( "valueA", systemSettingManager.getSystemSetting( "settingA", "valueA" ) );
+ assertEquals( "valueB", systemSettingManager.getSystemSetting( "settingB", "valueB" ) );
}
@Test
=== 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 2015-09-10 16:35:55 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/setting/SystemSettingStoreTest.java 2015-09-13 17:45:53 +0000
@@ -138,15 +138,15 @@
@Test
public void testGetAllSystemSettings()
{
- List<SystemSetting> m = systemSettingStore.getAll();
- assertNotNull( m );
- assertEquals( 0, m.size() );
+ List<SystemSetting> settings = systemSettingStore.getAll();
+ assertNotNull( settings );
+ assertEquals( 0, settings.size() );
systemSettingStore.save( settingA );
systemSettingStore.save( settingB );
- m = systemSettingStore.getAll();
- assertNotNull( m );
- assertEquals( 2, m.size() );
+ settings = systemSettingStore.getAll();
+ assertNotNull( settings );
+ assertEquals( 2, settings.size() );
}
}