Rolling back submission due to test flakiness. git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@10178 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/test/com/google/gwt/user/RPCSuite.gwt.xml b/user/test/com/google/gwt/user/RPCSuite.gwt.xml index 938877b..6ea787a 100644 --- a/user/test/com/google/gwt/user/RPCSuite.gwt.xml +++ b/user/test/com/google/gwt/user/RPCSuite.gwt.xml
@@ -21,8 +21,6 @@ <servlet path='/echo' class='com.google.gwt.user.server.rpc.MixedSerializableEchoServiceImpl' /> <servlet path='/collections' class='com.google.gwt.user.server.rpc.CollectionsTestServiceImpl' /> - <servlet path='/corejava' - class='com.google.gwt.user.server.rpc.CoreJavaTestServiceImpl' /> <servlet path='/customfieldserializers' class='com.google.gwt.user.server.rpc.CustomFieldSerializerTestServiceImpl' /> <servlet path='/enums'
diff --git a/user/test/com/google/gwt/user/RPCSuite.java b/user/test/com/google/gwt/user/RPCSuite.java index 4252113..42a0881 100644 --- a/user/test/com/google/gwt/user/RPCSuite.java +++ b/user/test/com/google/gwt/user/RPCSuite.java
@@ -28,7 +28,6 @@ import com.google.gwt.rpc.client.RpcValueTypesTest; import com.google.gwt.user.client.rpc.CollectionsTest; import com.google.gwt.user.client.rpc.CollectionsTestWithTypeObfuscation; -import com.google.gwt.user.client.rpc.CoreJavaTest; import com.google.gwt.user.client.rpc.CustomFieldSerializerTest; import com.google.gwt.user.client.rpc.CustomFieldSerializerTestWithTypeObfuscation; import com.google.gwt.user.client.rpc.EnumsTest; @@ -103,7 +102,6 @@ suite.addTestSuite(EnumsTest.class); suite.addTestSuite(InheritanceTest.class); suite.addTestSuite(CollectionsTest.class); - suite.addTestSuite(CoreJavaTest.class); suite.addTestSuite(CustomFieldSerializerTest.class); suite.addTestSuite(ExceptionsTest.class); suite.addTestSuite(ObjectGraphTest.class);
diff --git a/user/test/com/google/gwt/user/client/rpc/CoreJavaTest.java b/user/test/com/google/gwt/user/client/rpc/CoreJavaTest.java deleted file mode 100644 index f9065fb..0000000 --- a/user/test/com/google/gwt/user/client/rpc/CoreJavaTest.java +++ /dev/null
@@ -1,166 +0,0 @@ -/* - * Copyright 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.gwt.user.client.rpc; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.logging.impl.LevelImplRegular; - -import java.math.MathContext; -import java.math.RoundingMode; -import java.util.logging.LogRecord; - -/** - * Test cases for Generic Collections in GWT RPC. - * - */ -public class CoreJavaTest extends RpcTestBase { - - private static final LogRecord expectedLogRecord = createLogRecord(); - - public static boolean isValid(LogRecord value, boolean compareTrace) { - if (!expectedLogRecord.getLevel().toString().equals(value.getLevel().toString())) { - return false; - } - - if (!expectedLogRecord.getMessage().equals(value.getMessage())) { - return false; - } - - if (expectedLogRecord.getMillis() != value.getMillis()) { - return false; - } - - if (!expectedLogRecord.getLoggerName().equals(value.getLoggerName())) { - return false; - } - - Throwable expectedCause = expectedLogRecord.getThrown(); - Throwable valueCause = value.getThrown(); - while (expectedCause != null) { - if (valueCause == null) { - return false; - } - - if (!expectedCause.getMessage().equals(valueCause.getMessage())) { - return false; - } - - if (compareTrace) { - StackTraceElement[] expectedTrace = expectedCause.getStackTrace(); - StackTraceElement[] valueTrace = valueCause.getStackTrace(); - if ((expectedTrace == null) != (valueTrace == null)) { - return false; - } - if (expectedTrace != null) { - if (expectedTrace.length != valueTrace.length) { - return false; - } - for (int i = 0; i < expectedTrace.length; ++i) { - StackTraceElement expectedElement = expectedTrace[i]; - StackTraceElement valueElement = valueTrace[i]; - - if (!expectedElement.equals(valueElement)) { - return false; - } - } - } - } - - expectedCause = expectedCause.getCause(); - valueCause = valueCause.getCause(); - } - if (valueCause != null) { - return false; - } - - return true; - } - - public static boolean isValid(MathContext value) { - return createMathContext().equals(value); - } - - private static LogRecord createLogRecord() { - /* - * A LevelImplRegular log level is created here in order to circumvent - * normal logging system behavior. Without this, the Level is null unless - * logging is active, which we do not want for testing. Standard usage - * is new LogRecord(Level.INFO, "Test Log Record"); - */ - LevelImplRegular logLevel = new LevelImplRegular(); - LogRecord result = new LogRecord(logLevel.info(), "Test Log Record"); - - // Only set serialized fields. - - result.setLoggerName("Test Logger Name"); - result.setMillis(1234567); - - Throwable thrown = new Throwable("Test LogRecord Throwable 1"); - thrown.initCause(new Throwable("Test LogRecord Throwable cause")); - result.setThrown(thrown); - - return result; - } - - private static MathContext createMathContext() { - return new MathContext(5, RoundingMode.CEILING); - } - - private CoreJavaTestServiceAsync coreJavaTestService; - - public void testLogRecord() { - CoreJavaTestServiceAsync service = getServiceAsync(); - delayTestFinishForRpc(); - service.echoLogRecord(expectedLogRecord, new AsyncCallback<LogRecord>() { - public void onFailure(Throwable caught) { - TestSetValidator.rethrowException(caught); - } - - public void onSuccess(LogRecord result) { - assertNotNull(result); - assertTrue(isValid(result, true)); - finishTest(); - } - }); - finishTest(); - } - - public void testMathContext() { - CoreJavaTestServiceAsync service = getServiceAsync(); - final MathContext expected = createMathContext(); - - delayTestFinishForRpc(); - service.echoMathContext(expected, new AsyncCallback<MathContext>() { - public void onFailure(Throwable caught) { - TestSetValidator.rethrowException(caught); - } - - public void onSuccess(MathContext result) { - assertNotNull(result); - assertTrue(isValid(result)); - finishTest(); - } - }); - } - - private CoreJavaTestServiceAsync getServiceAsync() { - if (coreJavaTestService == null) { - coreJavaTestService = (CoreJavaTestServiceAsync) GWT.create(CoreJavaTestService.class); - } - return coreJavaTestService; - } -}
diff --git a/user/test/com/google/gwt/user/client/rpc/CoreJavaTestService.java b/user/test/com/google/gwt/user/client/rpc/CoreJavaTestService.java deleted file mode 100644 index 8745ad5..0000000 --- a/user/test/com/google/gwt/user/client/rpc/CoreJavaTestService.java +++ /dev/null
@@ -1,42 +0,0 @@ -/* - * Copyright 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.gwt.user.client.rpc; - -import java.math.MathContext; -import java.util.logging.LogRecord; - -/** - * Test service for serialization of GWT core.java emulations. - */ -@RemoteServiceRelativePath("corejava") -public interface CoreJavaTestService extends RemoteService { - /** - * A custom exception for the CoreJava test. - */ - final class CoreJavaTestServiceException extends Exception { - public CoreJavaTestServiceException() { - } - - public CoreJavaTestServiceException(String msg) { - super(msg); - } - } - - LogRecord echoLogRecord(LogRecord value) throws CoreJavaTestServiceException; - - MathContext echoMathContext(MathContext value) throws CoreJavaTestServiceException; -}
diff --git a/user/test/com/google/gwt/user/client/rpc/CoreJavaTestServiceAsync.java b/user/test/com/google/gwt/user/client/rpc/CoreJavaTestServiceAsync.java deleted file mode 100644 index 524c2a1..0000000 --- a/user/test/com/google/gwt/user/client/rpc/CoreJavaTestServiceAsync.java +++ /dev/null
@@ -1,31 +0,0 @@ -/* - * Copyright 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - - -package com.google.gwt.user.client.rpc; - -import java.math.MathContext; -import java.util.logging.LogRecord; - -/** - * Async interface for serialization of GWT core.java emulations. - */ -public interface CoreJavaTestServiceAsync { - - void echoLogRecord(LogRecord value, AsyncCallback<LogRecord> callback); - - void echoMathContext(MathContext expected, AsyncCallback<MathContext> asyncCallback); -}
diff --git a/user/test/com/google/gwt/user/client/rpc/CustomFieldSerializerTest.java b/user/test/com/google/gwt/user/client/rpc/CustomFieldSerializerTest.java index 3fa2eb5..4c67fdd 100644 --- a/user/test/com/google/gwt/user/client/rpc/CustomFieldSerializerTest.java +++ b/user/test/com/google/gwt/user/client/rpc/CustomFieldSerializerTest.java
@@ -57,9 +57,7 @@ } /** - * Tests that the custom field serializers are actually called when the - * custom field serializer does not derive from - * {@link CustomFieldSerializer} + * Tests that the custom field serializers are actually called. */ public void testCustomFieldSerialization() { CustomFieldSerializerTestServiceAsync service = getServiceAsync(); @@ -85,9 +83,6 @@ /** * Test that custom serializers that call readObject() inside instantiate (as * is required for most immutable classes) work. - * - * This also checks that custom <code>instantiate</code> works when the - * custom serializer does not implement {@link CustomFieldSerializer}. */ public void testSerializableImmutables() { CustomFieldSerializerTestServiceAsync service = getServiceAsync();
diff --git a/user/test/com/google/gwt/user/server/rpc/CoreJavaTestServiceImpl.java b/user/test/com/google/gwt/user/server/rpc/CoreJavaTestServiceImpl.java deleted file mode 100644 index 9941c96..0000000 --- a/user/test/com/google/gwt/user/server/rpc/CoreJavaTestServiceImpl.java +++ /dev/null
@@ -1,50 +0,0 @@ -/* - * Copyright 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.gwt.user.server.rpc; - -import com.google.gwt.user.client.rpc.CoreJavaTest; -import com.google.gwt.user.client.rpc.CoreJavaTestService; - -import java.math.MathContext; -import java.util.logging.LogRecord; - -/** - * Remote service implementation for serialization of GWT core.java emulations. - */ -public class CoreJavaTestServiceImpl extends HybridServiceServlet implements CoreJavaTestService { - - public LogRecord echoLogRecord(LogRecord value) throws CoreJavaTestServiceException { - /* - * Don't check the stack trace on the server side, because the expected result - * it is comparing against came from a server-side instance of CoreJavaTest, and - * hence has a different stack trace from the streamed version. - */ - if (!CoreJavaTest.isValid(value, false)) { - throw new CoreJavaTestServiceException(); - } - - return value; - } - - public MathContext echoMathContext(MathContext value) throws CoreJavaTestServiceException { - if (!CoreJavaTest.isValid(value)) { - throw new CoreJavaTestServiceException(); - } - - return value; - } -}