dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #22458
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10787: Removed system.out.println statements. Added missing licenses.
------------------------------------------------------------
revno: 10787
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-05-09 19:21:51 +0200
message:
Removed system.out.println statements. Added missing licenses.
modified:
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/user/UserStoreTest.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/ValidationRuleConverter.java
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/caseaggregation/jdbc/JdbcCaseAggregationConditionManager.java
dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/incoming/SMPPInboundNotification.java
dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/outbound/SmsSender.java
dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/outbound/TestOutboundSmsService.java
dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/parse/DefaultParserManager.java
dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/parse/IParser.java
dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/parse/SMSConsumer.java
dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/parse/SMSParserKeyValue.java
dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/queue/DatabaseSupportedInternalMemoryMessageQueue.java
dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/queue/MessageQueue.java
dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/smslib/AdvanceHttpPostGateWay.java
dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/external/location/LocationManagerTest.java
dhis-2/dhis-support/dhis-support-xml/src/test/java/org/amplecode/staxwax/framework/XMLPipeTest.java
dhis-2/dhis-support/dhis-support-xml/src/test/java/org/amplecode/staxwax/writer/XMLWriterTest.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/user/UserStoreTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/user/UserStoreTest.java 2012-11-20 17:04:08 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/user/UserStoreTest.java 2013-05-09 17:21:51 +0000
@@ -181,8 +181,6 @@
assertEquals( userCredentialsStore.getUserCredentials( user ).getPassword(), iloveyou );
// Test getUserCredentialsByUsername
- // System.out.println( userStore.getUserCredentialsByUsername( someone
- // ).getPassword() );
assertEquals( userCredentialsStore.getUserCredentialsByUsername( someone ).getPassword(), userCredentials.getPassword() );
assertEquals( userCredentialsStore.getUserCredentialsByUsername( someone ).getClass(), userCredentials.getClass() );
@@ -219,9 +217,7 @@
// Test updateUserSetting
userSetting.setValue( value1 );
- // System.out.println( userSetting.getName() );
userCredentialsStore.updateUserSetting( userSetting );
- // System.out.println( userSetting.getName() );
assertEquals( value1, userCredentialsStore.getUserSetting( user, name ).getValue() );
// Test getUserSetting
@@ -233,7 +229,6 @@
assertEquals( userCredentialsStore.getAllUserSettings( user ).size(), 1 );
for ( int i = 1; i <= userCredentialsStore.getAllUserSettings( user ).size(); i++ )
{
- // System.out.println( "UserSettings" + i );
assertEquals( userCredentialsStore.getUserSetting( user, name ).getValue(), "value" + i );
}
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/ValidationRuleConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/ValidationRuleConverter.java 2013-01-05 15:22:55 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/ValidationRuleConverter.java 2013-05-09 17:21:51 +0000
@@ -171,9 +171,6 @@
validationRule.getLeftSide().setExpression( values.get( FIELD_LEFTSIDE_EXPRESSION ) );
validationRule.getLeftSide().setDescription( values.get( FIELD_LEFTSIDE_DESCRIPTION ) );
- System.out.println("exp " + expressionService );
- System.out.println("val " + validationRule.getLeftSide() );
- System.out.println("exp " + validationRule.getLeftSide().getExpression());
validationRule.getLeftSide().setDataElementsInExpression(
expressionService.getDataElementsInExpression( validationRule.getLeftSide().getExpression() ) );
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/caseaggregation/jdbc/JdbcCaseAggregationConditionManager.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/caseaggregation/jdbc/JdbcCaseAggregationConditionManager.java 2013-05-03 03:13:36 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/caseaggregation/jdbc/JdbcCaseAggregationConditionManager.java 2013-05-09 17:21:51 +0000
@@ -343,7 +343,7 @@
}
sql = sql.replaceAll( "COMBINE", "" );
- System.out.println( "\n\n ==== \n " + sql );
+
return sql;
}
=== modified file 'dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/incoming/SMPPInboundNotification.java'
--- dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/incoming/SMPPInboundNotification.java 2012-11-20 13:34:03 +0000
+++ dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/incoming/SMPPInboundNotification.java 2013-05-09 17:21:51 +0000
@@ -1,5 +1,32 @@
package org.hisp.dhis.sms.incoming;
+/*
+ * Copyright (c) 2004-2012, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
import org.smslib.AGateway;
import org.smslib.IInboundMessageNotification;
import org.smslib.InboundMessage;
@@ -7,16 +34,12 @@
public class SMPPInboundNotification
implements IInboundMessageNotification
-{
-
+{
private IncomingSmsService incomingSmsService;
@Override
public void process( AGateway gateway, MessageTypes msgType, InboundMessage msg )
{
-
- System.out.println( msg );
-
IncomingSms incomingSms = new IncomingSms();
incomingSms.setOriginator( msg.getOriginator() );
@@ -43,5 +66,4 @@
{
this.incomingSmsService = incomingSmsService;
}
-
}
=== modified file 'dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/outbound/SmsSender.java'
--- dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/outbound/SmsSender.java 2013-05-09 17:17:28 +0000
+++ dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/outbound/SmsSender.java 2013-05-09 17:21:51 +0000
@@ -24,6 +24,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
package org.hisp.dhis.sms.outbound;
import java.util.HashSet;
=== modified file 'dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/outbound/TestOutboundSmsService.java'
--- dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/outbound/TestOutboundSmsService.java 2013-01-22 08:31:21 +0000
+++ dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/outbound/TestOutboundSmsService.java 2013-05-09 17:21:51 +0000
@@ -1,5 +1,32 @@
package org.hisp.dhis.sms.outbound;
+/*
+ * Copyright (c) 2004-2012, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
import java.util.HashMap;
import java.util.List;
import java.util.Map;
=== modified file 'dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/parse/DefaultParserManager.java'
--- dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/parse/DefaultParserManager.java 2013-04-22 14:32:22 +0000
+++ dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/parse/DefaultParserManager.java 2013-05-09 17:21:51 +0000
@@ -1,5 +1,32 @@
package org.hisp.dhis.sms.parse;
+/*
+ * Copyright (c) 2004-2012, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@@ -12,8 +39,6 @@
import java.util.Map;
import java.util.TreeMap;
-import jxl.biff.DataValidation;
-
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -50,7 +75,6 @@
import org.springframework.transaction.annotation.Transactional;
/**
- *
* @author Christian and Magnus
*/
public class DefaultParserManager
=== modified file 'dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/parse/IParser.java'
--- dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/parse/IParser.java 2012-08-30 12:47:05 +0000
+++ dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/parse/IParser.java 2013-05-09 17:21:51 +0000
@@ -10,12 +10,11 @@
*
* @author Christian
*/
-public interface IParser {
-
- static final String DATA_ENTRY_KEYWORD = "DHISDATAENTRYKEYWORD";
+public interface IParser
+{
+ final String DATA_ENTRY_KEYWORD = "DHISDATAENTRYKEYWORD";
public Map<String, String> parse(String sms);
- public void setSeparator(String separator);
-
+ public void setSeparator(String separator);
}
=== modified file 'dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/parse/SMSConsumer.java'
--- dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/parse/SMSConsumer.java 2013-04-04 18:06:19 +0000
+++ dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/parse/SMSConsumer.java 2013-05-09 17:21:51 +0000
@@ -1,11 +1,41 @@
package org.hisp.dhis.sms.parse;
+/*
+ * Copyright (c) 2004-2012, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.hisp.dhis.sms.incoming.IncomingSms;
import org.hisp.dhis.sms.queue.MessageQueue;
-// IEatSMS
public class SMSConsumer
{
+ private static final Log log = LogFactory.getLog( SMSConsumer.class );
+
private ParserManager parserManager;
private MessageQueue messageQueue;
@@ -71,7 +101,7 @@
}
catch ( Exception e )
{
- System.out.println( e.getMessage() );
+ log.error( e );
}
messageQueue.remove( message );
@@ -95,5 +125,4 @@
{
this.parserManager = parserManager;
}
-
}
=== modified file 'dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/parse/SMSParserKeyValue.java'
--- dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/parse/SMSParserKeyValue.java 2013-03-05 17:06:26 +0000
+++ dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/parse/SMSParserKeyValue.java 2013-05-09 17:21:51 +0000
@@ -34,7 +34,7 @@
{
String key = m.group( 1 );
String value = m.group( 2 );
- System.out.println( "Key: " + key + " Value: " + value );
+
if ( !StringUtils.isEmpty( key ) && !StringUtils.isEmpty( value ) )
{
output.put( key.toUpperCase(), value );
@@ -49,5 +49,4 @@
String x = "(\\w+)\\s*\\" + separator.trim() + "\\s*([\\w ]+)\\s*(\\" + separator.trim() + "|$)*\\s*";
pattern = Pattern.compile( x );
}
-
}
=== modified file 'dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/queue/DatabaseSupportedInternalMemoryMessageQueue.java'
--- dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/queue/DatabaseSupportedInternalMemoryMessageQueue.java 2012-11-20 13:34:03 +0000
+++ dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/queue/DatabaseSupportedInternalMemoryMessageQueue.java 2013-05-09 17:21:51 +0000
@@ -10,7 +10,6 @@
public class DatabaseSupportedInternalMemoryMessageQueue
implements MessageQueue
{
-
List<IncomingSms> queue = new ArrayList<IncomingSms>();
private IncomingSmsStore smsStore;
@@ -49,5 +48,4 @@
{
this.smsStore = smsStore;
}
-
}
=== modified file 'dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/queue/MessageQueue.java'
--- dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/queue/MessageQueue.java 2012-11-20 13:34:03 +0000
+++ dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/queue/MessageQueue.java 2013-05-09 17:21:51 +0000
@@ -1,10 +1,36 @@
package org.hisp.dhis.sms.queue;
+/*
+ * Copyright (c) 2004-2012, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
import org.hisp.dhis.sms.incoming.IncomingSms;
public interface MessageQueue
{
-
public void put( IncomingSms message );
public IncomingSms get();
@@ -12,5 +38,4 @@
public void remove( IncomingSms message );
public void initialize();
-
}
=== modified file 'dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/smslib/AdvanceHttpPostGateWay.java'
--- dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/smslib/AdvanceHttpPostGateWay.java 2013-04-22 06:42:29 +0000
+++ dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/smslib/AdvanceHttpPostGateWay.java 2013-05-09 17:21:51 +0000
@@ -47,7 +47,6 @@
public class AdvanceHttpPostGateWay
extends AGateway
{
-
private static final String SENDER = "sender";
private static final String RECIPIENT = "recipient";
=== modified file 'dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/external/location/LocationManagerTest.java'
--- dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/external/location/LocationManagerTest.java 2012-12-21 12:59:39 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/external/location/LocationManagerTest.java 2013-05-09 17:21:51 +0000
@@ -36,6 +36,8 @@
import java.io.InputStream;
import java.io.OutputStream;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.hisp.dhis.DhisSpringTest;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
@@ -46,7 +48,9 @@
*/
public class LocationManagerTest
extends DhisSpringTest
-{
+{
+ private static final Log log = LogFactory.getLog( LocationManagerTest.class );
+
private InputStream in;
private OutputStream out;
@@ -111,7 +115,7 @@
}
catch ( LocationManagerException ex )
{
- System.out.println( "External directory not set or the file does not exist" );
+ log.debug( "External directory not set or the file does not exist" );
}
try
@@ -139,11 +143,11 @@
assertTrue( file.getAbsolutePath().length() > 0 );
- System.out.println( "File for reading: " + file.getAbsolutePath() );
+ log.debug( "File for reading: " + file.getAbsolutePath() );
}
catch ( LocationManagerException ex )
{
- System.out.println( "External directory not set or the file does not exist" );
+ log.debug( "External directory not set or the file does not exist" );
}
try
@@ -167,11 +171,11 @@
assertTrue( file.getAbsolutePath().length() > 0 );
- System.out.println( "File for reading with dirs: " + file.getAbsolutePath() );
+ log.debug( "File for reading with dirs: " + file.getAbsolutePath() );
}
catch ( LocationManagerException ex )
{
- System.out.println( "External directory not set or the file does not exist" );
+ log.debug( "External directory not set or the file does not exist" );
}
try
@@ -192,11 +196,11 @@
{
File dir = locationManager.buildDirectory( "test", "dir" );
- System.out.println( "Built directory: " + dir.getAbsolutePath() );
+ log.debug( "Built directory: " + dir.getAbsolutePath() );
}
catch ( LocationManagerException ex )
{
- System.out.println( "External directory not set" );
+ log.debug( "External directory not set" );
}
}
@@ -215,7 +219,7 @@
}
catch ( LocationManagerException ex )
{
- System.out.println( "External directory not set" );
+ log.debug( "External directory not set" );
}
}
@@ -230,7 +234,7 @@
}
catch ( LocationManagerException ex )
{
- System.out.println( "External directory not set" );
+ log.debug( "External directory not set" );
}
}
@@ -247,11 +251,11 @@
assertTrue( file.getAbsolutePath().length() > 0 );
- System.out.println( "File for writing: " + file.getAbsolutePath() );
+ log.debug( "File for writing: " + file.getAbsolutePath() );
}
catch ( LocationManagerException ex )
{
- System.out.println( "External directory not set" );
+ log.debug( "External directory not set" );
}
try
@@ -260,11 +264,11 @@
assertTrue( file.getAbsolutePath().length() > 0 );
- System.out.println( "File for writing which does not exist: " + file.getAbsolutePath() );
+ log.debug( "File for writing which does not exist: " + file.getAbsolutePath() );
}
catch ( LocationManagerException ex )
{
- System.out.println( "External directory not set" );
+ log.debug( "External directory not set" );
}
}
@@ -277,11 +281,11 @@
assertTrue( file.getAbsolutePath().length() > 0 );
- System.out.println( "File for writing with dirs: " + file.getAbsolutePath() );
+ log.debug( "File for writing with dirs: " + file.getAbsolutePath() );
}
catch ( LocationManagerException ex )
{
- System.out.println( "External directory not set" );
+ log.debug( "External directory not set" );
}
try
@@ -290,11 +294,11 @@
assertTrue( file.getAbsolutePath().length() > 0 );
- System.out.println( "File for writing with dirs which does not exist: " + file.getAbsolutePath() );
+ log.debug( "File for writing with dirs which does not exist: " + file.getAbsolutePath() );
}
catch ( LocationManagerException ex )
{
- System.out.println( "External directory not set" );
+ log.debug( "External directory not set" );
}
}
@@ -311,11 +315,11 @@
assertTrue( file.getAbsolutePath().length() > 0 );
- System.out.println( "External directory: " + file.getAbsolutePath() );
+ log.debug( "External directory: " + file.getAbsolutePath() );
}
catch ( LocationManagerException ex )
{
- System.out.println( "External directory not set" );
+ log.debug( "External directory not set" );
}
}
@@ -326,11 +330,11 @@
if ( set )
{
- System.out.println( "External directory set" );
+ log.debug( "External directory set" );
}
else
{
- System.out.println( "External directory not set" );
+ log.debug( "External directory not set" );
}
}
@@ -339,6 +343,6 @@
{
String env = locationManager.getEnvironmentVariable();
- System.out.println( "Environment variable: " + env );
+ log.debug( "Environment variable: " + env );
}
}
=== modified file 'dhis-2/dhis-support/dhis-support-xml/src/test/java/org/amplecode/staxwax/framework/XMLPipeTest.java'
--- dhis-2/dhis-support/dhis-support-xml/src/test/java/org/amplecode/staxwax/framework/XMLPipeTest.java 2010-07-02 12:37:38 +0000
+++ dhis-2/dhis-support/dhis-support-xml/src/test/java/org/amplecode/staxwax/framework/XMLPipeTest.java 2013-05-09 17:21:51 +0000
@@ -1,6 +1,5 @@
package org.amplecode.staxwax.framework;
-
import java.io.InputStream;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -40,19 +39,23 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
- *
+ *
* @author bobj
* @version created 15-Jan-2010
*/
-public class XMLPipeTest extends TestCase
+public class XMLPipeTest
+ extends TestCase
{
private InputStream inputStreamB;
+
private InputStream inputStreamDXF;
+
private InputStream inputStreamDXFcopy;
@Override
- protected void setUp() throws Exception
+ protected void setUp()
+ throws Exception
{
super.setUp();
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
@@ -70,7 +73,8 @@
inputStreamDXFcopy.close();
}
- public synchronized void testReadWrite() throws XMLStreamException
+ public synchronized void testReadWrite()
+ throws XMLStreamException
{
XMLPipe pipe = new XMLPipe();
XMLEventWriter pipeinput = pipe.getInput();
@@ -83,12 +87,13 @@
{
events1++;
XMLEvent ev = reader.nextEvent();
- // System.out.println( "Got an event " + ev.toString() );
pipeinput.add( ev );
}
- // XMLOutputFactory2 factory = (XMLOutputFactory2) XMLOutputFactory.newInstance();
- // XMLEventWriter stdoutWriter = factory.createXMLEventWriter( System.out );
+ // XMLOutputFactory2 factory = (XMLOutputFactory2)
+ // XMLOutputFactory.newInstance();
+ // XMLEventWriter stdoutWriter = factory.createXMLEventWriter(
+ // System.out );
// read the other end of the pipe
int events2 = 0;
@@ -100,11 +105,10 @@
}
assertEquals( "Number of events in and out of pipe", events1, events2 );
- System.out.println( "Number of events : " + events1 );
-
}
- public void testReadWriteContents() throws XMLStreamException
+ public void testReadWriteContents()
+ throws XMLStreamException
{
XMLPipe pipe = new XMLPipe();
XMLEventWriter pipeinput = pipe.getInput();
@@ -125,20 +129,22 @@
{
XMLEvent ev = pipeoutput.nextEvent();
XMLEvent evCopy = dxfCopy.nextEvent();
- assertEquals(ev.getEventType(), evCopy.getEventType());
- if (ev.isCharacters()) {
- assertEquals(ev.asCharacters().getData(), evCopy.asCharacters().getData());
+ assertEquals( ev.getEventType(), evCopy.getEventType() );
+ if ( ev.isCharacters() )
+ {
+ assertEquals( ev.asCharacters().getData(), evCopy.asCharacters().getData() );
}
-
+
}
}
- public synchronized void testMTReadWrite() throws XMLStreamException
+ public synchronized void testMTReadWrite()
{
// Create a thread to write one end of the pipe
- class Writer implements Runnable
+ class Writer
+ implements Runnable
{
protected XMLPipe pipe;
@@ -156,14 +162,13 @@
{
XMLEventReader reader = XMLFactory.getXMLEventReader( inputStreamB ).getXmlEventReader();
- int events1 = 0;
while ( reader.hasNext() )
{
- events1++;
XMLEvent ev = reader.nextEvent();
pipe.getInput().add( ev );
}
- } catch ( Exception ex )
+ }
+ catch ( Exception ex )
{
assertTrue( ex.getMessage(), false );
}
@@ -171,8 +176,8 @@
}
}
-
- class Reader implements Runnable
+ class Reader
+ implements Runnable
{
protected XMLPipe pipe;
@@ -188,10 +193,6 @@
try
{
-// XMLOutputFactory2 factory = (XMLOutputFactory2) XMLOutputFactory.newInstance();
-// XMLEventWriter stdoutWriter = factory.createXMLEventWriter( System.out );
-
-
int events1 = 0;
XMLEvent ev = null;
@@ -199,13 +200,13 @@
{
events1++;
ev = pipe.output.nextEvent();
-// stdoutWriter.add( ev );
}
while ( !ev.isEndDocument() );
assertEquals( "Number of events in and out of pipe", 80, events1 );
- } catch ( Exception ex )
+ }
+ catch ( Exception ex )
{
assertTrue( ex.getMessage(), false );
}
@@ -218,11 +219,11 @@
XMLPipe pipe = new XMLPipe();
w.setPipe( pipe );
- // take a nap ...
try
{
Thread.sleep( 1000 );
- } catch ( InterruptedException ex )
+ }
+ catch ( InterruptedException ex )
{
Logger.getLogger( XMLPipeTest.class.getName() ).log( Level.SEVERE, null, ex );
}
=== modified file 'dhis-2/dhis-support/dhis-support-xml/src/test/java/org/amplecode/staxwax/writer/XMLWriterTest.java'
--- dhis-2/dhis-support/dhis-support-xml/src/test/java/org/amplecode/staxwax/writer/XMLWriterTest.java 2010-02-19 18:38:02 +0000
+++ dhis-2/dhis-support/dhis-support-xml/src/test/java/org/amplecode/staxwax/writer/XMLWriterTest.java 2013-05-09 17:21:51 +0000
@@ -261,8 +261,6 @@
int c1 = read( in1 );
int c2 = read( in2 );
- // Debug: System.out.println( "'" + (char)c1 + "' '" + (char)c2 + "'" );
-
if ( c1 == -1 && c2 == -1 )
{
return true;