Fixed ElementTest.testStyleCamelCase() so it only tests the assertions on Style if assertions are enabled.
Patch by: jlabanca
Review by: jgw (desk)
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@3668 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/test/com/google/gwt/dom/client/ElementTest.java b/user/test/com/google/gwt/dom/client/ElementTest.java
index 9eb5775..f51fe92 100644
--- a/user/test/com/google/gwt/dom/client/ElementTest.java
+++ b/user/test/com/google/gwt/dom/client/ElementTest.java
@@ -280,23 +280,25 @@
assertEquals("10px", div.getStyle().getProperty("marginLeft"));
// Use a hyphenated style
- try {
- div.getStyle().setProperty("background-color", "red");
- fail("Expected assertion error: background-color should be in camelCase");
- } catch (AssertionError e) {
- // expected
- }
- try {
- div.getStyle().setPropertyPx("margin-left", 20);
- fail("Expected assertion error: margin-left should be in camelCase");
- } catch (AssertionError e) {
- // expected
- }
- try {
- div.getStyle().getProperty("margin-right");
- fail("Expected assertion error: margin-right should be in camelCase");
- } catch (AssertionError e) {
- // expected
+ if (Style.class.desiredAssertionStatus()) {
+ try {
+ div.getStyle().setProperty("background-color", "red");
+ fail("Expected assertion error: background-color should be in camelCase");
+ } catch (AssertionError e) {
+ // expected
+ }
+ try {
+ div.getStyle().setPropertyPx("margin-left", 20);
+ fail("Expected assertion error: margin-left should be in camelCase");
+ } catch (AssertionError e) {
+ // expected
+ }
+ try {
+ div.getStyle().getProperty("margin-right");
+ fail("Expected assertion error: margin-right should be in camelCase");
+ } catch (AssertionError e) {
+ // expected
+ }
}
}