Skip to content

Commit

Permalink
TRUNK-3949: Yet another try at fixing the build
Browse files Browse the repository at this point in the history
  • Loading branch information
rkorytkowski committed Apr 2, 2013
1 parent 0c7564b commit a04064f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
Expand Up @@ -1033,7 +1033,6 @@ public void validateConceptReferenceTermUsesPersistedObjects_shouldAddErrorIfTer
* @verifies not save changes if there are validation errors
*/
@Test
@NotTransactional
public void onSubmit_shouldNotSaveChangesIfThereAreValidationErrors() throws Exception {
Integer conceptId = 792;

Expand All @@ -1047,6 +1046,8 @@ public void onSubmit_shouldNotSaveChangesIfThereAreValidationErrors() throws Exc
Response response = webTestHelper.handle(request);
assertThat(response.getErrors().hasFieldErrors("synonymsByLocale[en][1].name"), is(true));

Context.clearSession();

Concept concept = conceptService.getConcept(conceptId);
assertThat(concept.getPreferredName(Locale.ENGLISH).getName(), is("STAVUDINE LAMIVUDINE AND NEVIRAPINE"));
}
Expand Down
Expand Up @@ -25,7 +25,6 @@
import org.openmrs.web.test.WebTestHelper.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.test.annotation.NotTransactional;

/**`
* Tests {@link RoleFormController}.
Expand All @@ -40,7 +39,6 @@ public UserService getUS() {
}

@Test
@NotTransactional

This comment has been minimized.

Copy link
@rkorytkowski

rkorytkowski Apr 2, 2013

Author Member

Something bad happened to NotTransactional in 1.10. It doesn't seem to work correctly if running multiple tests (LazilyInitializationException), but does work when running a single test.

This comment has been minimized.

Copy link
@wluyima

wluyima Apr 2, 2013

Member

I think this started after that change that sped up the tests from 8sec to 4sec

public void shouldUpdateRoleWithParent() throws Exception {
Role child = new Role("child", "child");
getUS().saveRole(child);
Expand All @@ -61,8 +59,6 @@ public void shouldUpdateRoleWithParent() throws Exception {
wth.handle(requestPOST);

Assert.assertEquals("updated child", getUS().getRole("child").getDescription());

deleteAllData();
}

}
2 changes: 0 additions & 2 deletions web/src/test/java/org/openmrs/web/test/WebTestHelper.java
Expand Up @@ -135,8 +135,6 @@ public Response handle(final HttpServletRequest request) throws Exception {

Assert.assertTrue("The requested URI has no handlers: " + request.getRequestURI(), supported);

Context.clearSession();

return new Response(response, request.getSession(), modelAndView);
}

Expand Down

0 comments on commit a04064f

Please sign in to comment.