package jeelab.model.dao;

import static org.junit.Assert.*;

import org.junit.Test;

import jeelab.test.AbstractDeployableTest;

public class RoleDaoTest extends AbstractDeployableTest {

	@Test
	public void testGetByName() {
		fail("Not yet implemented");
	}

	@Test
	public void testSave() {
		fail("Not yet implemented");
	}

	@Test
	public void testGet() {
		fail("Not yet implemented");
	}

}

@@ -66,329 +66,1236 @@
 ort 
-org.junit.Test;%0A%0Aimport jeelab.test.AbstractDeployableTest;%0A%0Apublic class RoleDaoTest extends AbstractDeployableTest %7B%0A%0A%09@Test%0A%09public void testGetByName() %7B%0A%09%09fail(%22Not yet implemented%22);%0A%09%7D%0A%0A%09@Test%0A%09public void testSave() %7B%0A%09%09fail(%22Not yet implemented%22);%0A%09%7D%0A%0A%09@Test%0A%09public void testGet() %7B%0A%09%09fail(%22Not yet implemented%22
+javax.inject.Inject;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport jeelab.model.builder.RoleBuilder;%0Aimport jeelab.model.entity.Role;%0Aimport jeelab.setup.RolesInitializer;%0Aimport jeelab.test.AbstractDeployableTest;%0A%0A/**%0A * Test pro RoleDao%0A * @author Petr Kalivoda%0A *%0A */%0Apublic class RoleDaoTest extends AbstractDeployableTest %7B%0A%09%0A%09private @Inject RoleDao roleDao;%0A%09private @Inject RoleBuilder roleBuilder;%0A%09%0A%09public @Before void clearBuilder() %7B%0A%09%09this.roleBuilder.clear();%0A%09%7D%0A%0A%09@Test%0A%09public void testGetByName() %7B%0A%09%09Role r = roleDao.getByName(RolesInitializer.ROLE_ADMIN);%0A%09%09assertTrue(r instanceof Role);%0A%09%09%0A%09%09Role r2 = roleDao.getByName(%22this role sure as hell doesn't exist%22);%0A%09%09assertNull(r2);%09%09%0A%09%7D%0A%0A%09@Test%0A%09public void testSave() %7B%0A%09%09Role r = roleBuilder.name(%22testSave%22).build();%0A%09%09roleDao.save(r);%0A%09%09%0A%09%09Role created = roleDao.getByName(%22testSave%22);%0A%09%09assertTrue(created instanceof Role);%0A%09%7D%0A%0A%09@Test%0A%09public void testGet() %7B%0A%09%09Role r = roleBuilder.name(%22testGet%22).build();%0A%09%09roleDao.save(r);%0A%09%09%0A%09%09Role created = roleDao.getByName(%22testGet%22);%0A%09%09Role actual = roleDao.get(created.getId());%0A%09%09assertTrue(actual instanceof Role);%0A%09%09assertEquals(created.getId(), actual.getId());%0A%09%09%0A%09%09assertNull(roleDao.get(-1L)
 );%0A%09

test pro roleDao