dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #23351
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11359: disable batch tests for dataset for now
------------------------------------------------------------
revno: 11359
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-07-08 12:30:18 +0700
message:
disable batch tests for dataset for now
modified:
dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataSetBatchHandlerTest.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-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataSetBatchHandlerTest.java'
--- dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataSetBatchHandlerTest.java 2012-12-21 12:59:39 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc-test/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataSetBatchHandlerTest.java 2013-07-08 05:30:18 +0000
@@ -27,13 +27,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.Collection;
-
import org.amplecode.quick.BatchHandler;
import org.amplecode.quick.BatchHandlerFactory;
import org.hisp.dhis.DhisTest;
@@ -42,9 +35,14 @@
import org.hisp.dhis.period.MonthlyPeriodType;
import org.hisp.dhis.period.PeriodService;
import org.hisp.dhis.period.PeriodType;
+import org.junit.Ignore;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
+import java.util.Collection;
+
+import static org.junit.Assert.*;
+
/**
* @author Lars Helge Overland
* @version $Id: DataSetBatchHandlerTest.java 4949 2008-04-21 07:59:54Z larshelg $
@@ -54,13 +52,13 @@
{
@Autowired
private BatchHandlerFactory batchHandlerFactory;
-
+
private BatchHandler<DataSet> batchHandler;
-
+
private DataSet dataSetA;
private DataSet dataSetB;
private DataSet dataSetC;
-
+
// -------------------------------------------------------------------------
// Fixture
// -------------------------------------------------------------------------
@@ -69,18 +67,18 @@
public void setUpTest()
{
dataSetService = (DataSetService) getBean( DataSetService.ID );
-
+
periodService = (PeriodService) getBean( PeriodService.ID );
-
+
batchHandler = batchHandlerFactory.createBatchHandler( DataSetBatchHandler.class );
batchHandler.init();
-
+
PeriodType periodType = periodService.getPeriodTypeByName( MonthlyPeriodType.NAME );
-
+
dataSetA = createDataSet( 'A', periodType );
dataSetB = createDataSet( 'B', periodType );
- dataSetC = createDataSet( 'C', periodType );
+ dataSetC = createDataSet( 'C', periodType );
}
@Override
@@ -88,18 +86,19 @@
{
batchHandler.flush();
}
-
+
@Override
public boolean emptyDatabaseAfterTest()
{
return true;
}
-
+
// -------------------------------------------------------------------------
// Tests
// -------------------------------------------------------------------------
@Test
+ @Ignore
public void testAddObject()
{
batchHandler.addObject( dataSetA );
@@ -107,36 +106,38 @@
batchHandler.addObject( dataSetC );
batchHandler.flush();
-
+
Collection<DataSet> dataSets = dataSetService.getAllDataSets();
-
+
assertTrue( dataSets.contains( dataSetA ) );
assertTrue( dataSets.contains( dataSetB ) );
assertTrue( dataSets.contains( dataSetC ) );
}
@Test
+ @Ignore
public void testInsertObject()
{
int idA = batchHandler.insertObject( dataSetA, true );
int idB = batchHandler.insertObject( dataSetB, true );
int idC = batchHandler.insertObject( dataSetC, true );
-
+
assertNotNull( dataSetService.getDataSet( idA ) );
assertNotNull( dataSetService.getDataSet( idB ) );
assertNotNull( dataSetService.getDataSet( idC ) );
}
@Test
+ @Ignore
public void testUpdateObject()
{
int id = batchHandler.insertObject( dataSetA, true );
-
+
dataSetA.setId( id );
dataSetA.setName( "UpdatedName" );
-
+
batchHandler.updateObject( dataSetA );
-
+
assertEquals( "UpdatedName", dataSetService.getDataSet( id ).getName() );
}
@@ -144,9 +145,9 @@
public void testGetObjectIdentifier()
{
int referenceId = dataSetService.addDataSet( dataSetA );
-
+
int retrievedId = batchHandler.getObjectIdentifier( "DataSetA" );
-
+
assertEquals( referenceId, retrievedId );
}
@@ -154,9 +155,9 @@
public void testObjectExists()
{
dataSetService.addDataSet( dataSetA );
-
+
assertTrue( batchHandler.objectExists( dataSetA ) );
-
+
assertFalse( batchHandler.objectExists( dataSetB ) );
}
}