Remove gwt-test-utils and disabled tests that depend on it
gwt-test-utils is broken [1] and the tests that depend on it have been disabled for ages. It doesn't look like there's going to be any new release of a fixed version, and since Gerrit is moving away from GWT it's not worth trying to maintain it ourselves. Remove the disabled tests, and the dependency to gwt-test-utils. [1] https://github.com/gwt-test-utils/gwt-test-utils/issues/68 Change-Id: If7ae8d5790146ddfad528a1db2f6f6c3ae497970
This commit is contained in:
@@ -69,7 +69,6 @@ java_test(
|
||||
'//lib:junit',
|
||||
'//lib/gwt:dev',
|
||||
'//lib/gwt:user',
|
||||
'//lib/gwt:gwt-test-utils',
|
||||
],
|
||||
source_under_test = [':ui_module'],
|
||||
vm_args = ['-Xmx512m'],
|
||||
|
@@ -1,62 +0,0 @@
|
||||
// Copyright (C) 2015 The Android Open Source Project
|
||||
//
|
||||
// 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.gerrit.client;
|
||||
|
||||
import static com.google.gerrit.client.FormatUtil.formatBytes;
|
||||
import static com.google.gerrit.client.FormatUtil.formatPercentage;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import com.googlecode.gwt.test.GwtModule;
|
||||
import com.googlecode.gwt.test.GwtTest;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
@GwtModule("com.google.gerrit.GerritGwtUI")
|
||||
@Ignore
|
||||
public class FormatUtilTest extends GwtTest {
|
||||
@Test
|
||||
public void testFormatBytes() {
|
||||
assertEquals("+/- 0 B", formatBytes(0));
|
||||
assertEquals("+27 B", formatBytes(27));
|
||||
assertEquals("+999 B", formatBytes(999));
|
||||
assertEquals("+1000 B", formatBytes(1000));
|
||||
assertEquals("+1023 B", formatBytes(1023));
|
||||
assertEquals("+1.0 KiB", formatBytes(1024));
|
||||
assertEquals("+1.7 KiB", formatBytes(1728));
|
||||
assertEquals("+108.0 KiB", formatBytes(110592));
|
||||
assertEquals("+6.8 MiB", formatBytes(7077888));
|
||||
assertEquals("+432.0 MiB", formatBytes(452984832));
|
||||
assertEquals("+27.0 GiB", formatBytes(28991029248L));
|
||||
assertEquals("+1.7 TiB", formatBytes(1855425871872L));
|
||||
assertEquals("+8.0 EiB", formatBytes(9223372036854775807L));
|
||||
|
||||
assertEquals("-27 B", formatBytes(-27));
|
||||
assertEquals("-1.7 MiB", formatBytes(-1728));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFormatPercentage() {
|
||||
assertEquals("N/A", formatPercentage(0, 10));
|
||||
assertEquals("0%", formatPercentage(100, 0));
|
||||
assertEquals("+25%", formatPercentage(100, 25));
|
||||
assertEquals("-25%", formatPercentage(100, -25));
|
||||
assertEquals("+50%", formatPercentage(100, 50));
|
||||
assertEquals("-50%", formatPercentage(100, -50));
|
||||
assertEquals("+100%", formatPercentage(100, 100));
|
||||
assertEquals("-100%", formatPercentage(100, -100));
|
||||
assertEquals("+500%", formatPercentage(100, 500));
|
||||
}
|
||||
}
|
@@ -1,106 +0,0 @@
|
||||
// Copyright (C) 2013 The Android Open Source Project
|
||||
//
|
||||
// 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.gerrit.client.diff;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import com.google.gwt.core.client.JavaScriptObject;
|
||||
import com.google.gwt.core.client.JsArrayString;
|
||||
|
||||
import com.googlecode.gwt.test.GwtModule;
|
||||
import com.googlecode.gwt.test.GwtTest;
|
||||
|
||||
import net.codemirror.lib.Pos;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
/** Unit tests for EditIterator */
|
||||
@GwtModule("com.google.gerrit.GerritGwtUI")
|
||||
@Ignore
|
||||
// TODO(davido): Enable this again when gwt-test-utils lib is fixed.
|
||||
public class EditIteratorTest extends GwtTest {
|
||||
private JsArrayString lines;
|
||||
|
||||
private void assertLineChsEqual(Pos a, Pos b) {
|
||||
assertEquals(a.line() + "," + a.ch(), b.line() + "," + b.ch());
|
||||
}
|
||||
|
||||
@Before
|
||||
public void initialize() {
|
||||
lines = (JsArrayString) JavaScriptObject.createArray();
|
||||
lines.push("1st");
|
||||
lines.push("2nd");
|
||||
lines.push("3rd");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNegativeAdvance() {
|
||||
EditIterator i = new EditIterator(lines, 0);
|
||||
assertLineChsEqual(Pos.create(1, 1), i.advance(5));
|
||||
assertLineChsEqual(Pos.create(0, 3), i.advance(-2));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNoAdvance() {
|
||||
EditIterator iter = new EditIterator(lines, 0);
|
||||
assertLineChsEqual(Pos.create(0), iter.advance(0));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSimpleAdvance() {
|
||||
EditIterator iter = new EditIterator(lines, 0);
|
||||
assertLineChsEqual(Pos.create(0, 1), iter.advance(1));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEndsBeforeNewline() {
|
||||
EditIterator iter = new EditIterator(lines, 0);
|
||||
assertLineChsEqual(Pos.create(0, 3), iter.advance(3));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEndsOnNewline() {
|
||||
EditIterator iter = new EditIterator(lines, 0);
|
||||
assertLineChsEqual(Pos.create(1), iter.advance(4));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAcrossNewline() {
|
||||
EditIterator iter = new EditIterator(lines, 0);
|
||||
assertLineChsEqual(Pos.create(1, 1), iter.advance(5));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testContinueFromBeforeNewline() {
|
||||
EditIterator iter = new EditIterator(lines, 0);
|
||||
iter.advance(3);
|
||||
assertLineChsEqual(Pos.create(2, 2), iter.advance(7));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testContinueFromAfterNewline() {
|
||||
EditIterator iter = new EditIterator(lines, 0);
|
||||
iter.advance(4);
|
||||
assertLineChsEqual(Pos.create(2, 2), iter.advance(6));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAcrossMultipleLines() {
|
||||
EditIterator iter = new EditIterator(lines, 0);
|
||||
assertLineChsEqual(Pos.create(2, 2), iter.advance(10));
|
||||
}
|
||||
}
|
19
lib/gwt/BUCK
19
lib/gwt/BUCK
@@ -28,22 +28,3 @@ maven_jar(
|
||||
visibility = ['PUBLIC'],
|
||||
)
|
||||
|
||||
maven_jar(
|
||||
name = 'gwt-test-utils',
|
||||
id = 'com.googlecode.gwt-test-utils:gwt-test-utils:0.47',
|
||||
sha1 = '284749ed37d8034bac05e374070c09cce88db540',
|
||||
license = 'Apache2.0',
|
||||
deps = [
|
||||
':javassist',
|
||||
'//lib/log:api',
|
||||
],
|
||||
visibility = ['PUBLIC'],
|
||||
)
|
||||
|
||||
maven_jar(
|
||||
name = 'javassist',
|
||||
id = 'org.javassist:javassist:3.18.1-GA',
|
||||
sha1 = 'd9a09f7732226af26bf99f19e2cffe0ae219db5b',
|
||||
license = 'Apache2.0',
|
||||
visibility = ['PUBLIC'],
|
||||
)
|
||||
|
Reference in New Issue
Block a user