Package org.greenrobot.greendao.test
Class AbstractDaoTestSinglePk<D extends AbstractDao<T,K>,T,K>
- java.lang.Object
-
- junit.framework.Assert
-
- junit.framework.TestCase
-
- android.test.AndroidTestCase
-
- org.greenrobot.greendao.test.DbTest
-
- org.greenrobot.greendao.test.AbstractDaoTest<D,T,K>
-
- org.greenrobot.greendao.test.AbstractDaoTestSinglePk<D,T,K>
-
- Type Parameters:
D- DAO classT- Entity type of the DAOK- Key type of the DAO
- All Implemented Interfaces:
junit.framework.Test
- Direct Known Subclasses:
AbstractDaoTestLongPk,AbstractDaoTestStringPk
public abstract class AbstractDaoTestSinglePk<D extends AbstractDao<T,K>,T,K> extends AbstractDaoTest<D,T,K>
Default tests for single-PK entities.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Set<K>usedPks-
Fields inherited from class org.greenrobot.greendao.test.AbstractDaoTest
dao, daoAccess, daoClass, identityScopeForDao
-
-
Constructor Summary
Constructors Constructor Description AbstractDaoTestSinglePk(java.lang.Class<D> daoClass)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected booleancheckKeyIsNullable()protected abstract TcreateEntity(K key)Creates an insertable entity.protected TcreateEntityWithRandomPk()protected abstract KcreateRandomPk()K does not have to be collision free, check nextPk for collision free PKs.protected KnextPk()Provides a collision free PK () not returned before in the current test.protected android.database.CursorqueryWithDummyColumnsInFront(int dummyCount, java.lang.String valueForColumn, K pk)protected voidrunLoadPkTest(int offset)protected voidsetUp()voidtestCount()voidtestDelete()voidtestDeleteAll()voidtestDeleteByKeyInTx()voidtestDeleteInTx()voidtestInsertAndLoad()voidtestInsertInTx()voidtestInsertOrReplaceInTx()voidtestInsertOrReplaceTwice()voidtestInsertTwice()voidtestLoadAll()voidtestLoadPk()voidtestLoadPkWithOffset()voidtestQuery()voidtestReadWithOffset()voidtestRowId()voidtestSave()voidtestSaveInTx()voidtestUpdate()-
Methods inherited from class org.greenrobot.greendao.test.AbstractDaoTest
clearIdentityScopeIfAny, logTableDump, setIdentityScopeBeforeSetUp, setUpTableForDao
-
Methods inherited from class org.greenrobot.greendao.test.DbTest
createApplication, createDatabase, getApplication, logTableDump, tearDown, terminateApplication
-
Methods inherited from class android.test.AndroidTestCase
assertActivityRequiresPermission, assertReadingContentUriRequiresPermission, assertWritingContentUriRequiresPermission, getContext, scrubClass, setContext, testAndroidTestCaseSetupProperly
-
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
-
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
-
-
-
-
Field Detail
-
usedPks
protected java.util.Set<K> usedPks
-
-
Constructor Detail
-
AbstractDaoTestSinglePk
public AbstractDaoTestSinglePk(java.lang.Class<D> daoClass)
-
-
Method Detail
-
setUp
protected void setUp() throws java.lang.Exception- Overrides:
setUpin classAbstractDaoTest<D extends AbstractDao<T,K>,T,K>- Throws:
java.lang.Exception
-
testInsertAndLoad
public void testInsertAndLoad()
-
testInsertInTx
public void testInsertInTx()
-
testCount
public void testCount()
-
testInsertTwice
public void testInsertTwice()
-
testInsertOrReplaceTwice
public void testInsertOrReplaceTwice()
-
testInsertOrReplaceInTx
public void testInsertOrReplaceInTx()
-
testDelete
public void testDelete()
-
testDeleteAll
public void testDeleteAll()
-
testDeleteInTx
public void testDeleteInTx()
-
testDeleteByKeyInTx
public void testDeleteByKeyInTx()
-
testRowId
public void testRowId()
-
testLoadAll
public void testLoadAll()
-
testQuery
public void testQuery()
-
testUpdate
public void testUpdate()
-
testReadWithOffset
public void testReadWithOffset()
-
testLoadPkWithOffset
public void testLoadPkWithOffset()
-
testLoadPk
public void testLoadPk()
-
testSave
public void testSave()
-
testSaveInTx
public void testSaveInTx()
-
runLoadPkTest
protected void runLoadPkTest(int offset)
-
queryWithDummyColumnsInFront
protected android.database.Cursor queryWithDummyColumnsInFront(int dummyCount, java.lang.String valueForColumn, K pk)
-
checkKeyIsNullable
protected boolean checkKeyIsNullable()
-
nextPk
protected K nextPk()
Provides a collision free PK () not returned before in the current test.
-
createEntityWithRandomPk
protected T createEntityWithRandomPk()
-
createRandomPk
protected abstract K createRandomPk()
K does not have to be collision free, check nextPk for collision free PKs.
-
-