0

I've generated a class and test using greendao 1.3.1 Everything looks OK; However, I am unable to run the generated dao test. A java.lang.RuntimeException is raised stating that "Could not find test class". My other Android test cases run just fine.

Here is the code generated:

package com.amec.amecsurvey.test;

import de.greenrobot.dao.test.AbstractDaoTestLongPk;

import com.amec.amecsurvey.entities.Project;
import com.amec.amecsurvey.persistence.ProjectDao;

public class ProjectTest extends AbstractDaoTestLongPk<ProjectDao, Project> {

public ProjectTest() {
    super(ProjectDao.class);
}

public void testProjectDao() throws Exception{
    ProjectTest test = new ProjectTest();
    Project project = test.createEntity(1l);
    project.generateUUID();
    project.setProjectNumber("CCTEST");
    project.setName("Test Project");
    test.dao.insert(project);
    project = dao.load(1l);
    assertNotNull(project);
    Project dbProject = dao.load(1l);
    assertTrue(project.equals(dbProject));
}

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

}
Lee
  • 567
  • 5
  • 18
  • Tried extending from AbstractDaoSessionTest, Same exception – Lee Aug 16 '13 at 18:59
  • OK, Monday morning and it just started working. Don't know why, nothing has changed, build path and everything the same as on Friday. Bugfoot strikes again. – Lee Aug 19 '13 at 16:49

0 Answers0