Skip to content

Commit

Permalink
DaoTestAnnotation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
greenrobot committed Aug 3, 2016
1 parent f16e772 commit a6192e6
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 14 deletions.
1 change: 1 addition & 0 deletions tests/DaoTestEntityAnnotation/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ android {

greendao {
schemaVersion 1000
generateTests true
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.greenrobot.greendao.entityannotation;
package org.greenrobot.greendao.test.entityannotation;

import org.greenrobot.greendao.test.AbstractDaoSessionTest;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package org.greenrobot.greendao.test.entityannotation;

import org.greenrobot.greendao.test.AbstractDaoTestLongPk;

import java.util.concurrent.atomic.AtomicLong;

public class CustomerTest extends AbstractDaoTestLongPk<CustomerDao, Customer> {
private AtomicLong nameNumber = new AtomicLong();

public CustomerTest() {
super(CustomerDao.class);
}

@Override
protected Customer createEntity(Long key) {
Customer entity = new Customer();
entity.setId(key);
entity.setName("Ho " + nameNumber.incrementAndGet());
return entity;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.greenrobot.greendao.entityannotation;
package org.greenrobot.greendao.test.entityannotation;

import org.greenrobot.greendao.test.AbstractDaoTestLongPk;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.greenrobot.greendao.test.entityannotation;

import org.greenrobot.greendao.test.AbstractDaoTestLongPk;

public class OrderTest extends AbstractDaoTestLongPk<OrderDao, Order> {

public OrderTest() {
super(OrderDao.class);
}

@Override
protected Order createEntity(Long key) {
Order entity = new Order();
entity.setId(key);
entity.setCustomerId(1);
return entity;
}

}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.greenrobot.greendao.entityannotation;
package org.greenrobot.greendao.test.entityannotation;

import android.app.Application;

import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.entityannotation.DaoMaster.DevOpenHelper;
import org.greenrobot.greendao.test.entityannotation.DaoMaster.DevOpenHelper;

public class App extends Application {
private DaoSession daoSession;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.greenrobot.greendao.entityannotation;
package org.greenrobot.greendao.test.entityannotation;

import org.greenrobot.greendao.DaoException;
import org.greenrobot.greendao.annotation.Entity;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.greenrobot.greendao.entityannotation;
package org.greenrobot.greendao.test.entityannotation;

import org.greenrobot.greendao.annotation.Convert;
import org.greenrobot.greendao.annotation.Entity;
Expand Down Expand Up @@ -36,7 +36,7 @@ public Note(Long id) {
this.id = id;
}

@Generated(hash = 1686394253)
@Generated(hash = 59778150)
public Note(Long id, @NotNull String text, String comment, Date date, NoteType type) {
this.id = id;
this.text = text;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package org.greenrobot.greendao.test.entityannotation;

public enum NoteType {
TEXT, LIST, PICTURE
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.greenrobot.greendao.entityannotation;
package org.greenrobot.greendao.test.entityannotation;

import org.greenrobot.greendao.converter.PropertyConverter;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.greenrobot.greendao.entityannotation;
package org.greenrobot.greendao.test.entityannotation;

import org.greenrobot.greendao.DaoException;
import org.greenrobot.greendao.annotation.Entity;
Expand Down

0 comments on commit a6192e6

Please sign in to comment.