Created
February 6, 2012 18:17
-
-
Save ctataryn/1753833 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Transactional(readOnly=false, value="dwTransactionManager") | |
@RunWith(SpringJUnit4ClassRunner.class) | |
@ContextConfiguration(locations="/integration/test/config/spring/integrationTestBeans.xml") | |
public class PlayerManagementDaoJpaTest { | |
@Resource | |
private PlayerManagementDao dao; | |
@Resource(name="dwDataSource") | |
private DataSource dataSource; | |
@Before | |
public void setup() { | |
JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); | |
jdbcTemplate.update("SET IDENTITY_INSERT Player ON"); | |
jdbcTemplate.update("insert into player (player_id, first_name, last_name, street, city, province, postal_code, created_by_user, last_updated_by_user) " + | |
"values (?, ?, ?, ?, ?, ?, ?, ?, ?)", | |
-99,"Rusty", "Shackleford", "1234 Anywhere St.", "Winnipeg", | |
"MB", "H0H0H0", "test", "test"); | |
} | |
@Test | |
public void testRetrievePlayerById() { | |
//List<Player> players = dao.getPlayers(new DataWarehousePlayer(TestConfig.TEST_PLAYER_ID)); | |
List<Player> players = dao.getPlayers(new DataWarehousePlayer(-99)); | |
assertNotNull("Players List was null", players); | |
assertTrue("Players List was empty", players.size() > 0); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment