Skip to content

Commit

Permalink
Automatic code cleanup.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 327628582
  • Loading branch information
java-team-github-bot authored and cgdecker committed Aug 27, 2020
1 parent b8d3497 commit 794ed1b
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 63 deletions.
60 changes: 32 additions & 28 deletions core/src/main/java/com/google/common/truth/Truth.gwt.xml
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<module>

<source path="">

<!-- Hack to keep collect from hiding collect.testing supersource: -->

<exclude name="**/testing/**"/>

</source>

<!-- We used to set this only for packages that had manual supersource. That worked everywhere that I know of except for one place: when running the GWT util.concurrent tests under Guava. The problem is that GWT responds poorly to two .gwt.xml files in the same Java package: https://goo.gl/pRV3Yn The summary is that it ignores one file in favor of the other. util.concurrent, like nearly all our packages, has two .gwt.xml files: one for prod and one for tests. util.concurrent, unlike our other packages, has, as of this writing, test supersource but no prod supersource. GWT happens to use the prod .gwt.xml, so it looks for no supersource for tests, either. This causes it to fail to find AtomicLongMapTest. Our workaround is to tell GWT that util.concurrent and all other packages have prod supersource, even if they have none. GWT is happy to ignore us when we specify a nonexistent path. (I hope that this workaround does not cause its own problems in the future.) -->

<super-source path="super"/>

<inherits name="com.google.gwt.user.User"/>

<inherits name="com.google.common.annotations.Annotations"/>

<inherits name="com.google.common.base.Base"/>

<inherits name="com.google.common.collect.Collect"/>

<inherits name="com.google.common.primitives.Primitives"/>

<inherits name="com.google.common.util.concurrent.Concurrent"/>

<inherits name="com.google.gwt.core.Core"/>

<source path="">
<!-- Hack to keep collect from hiding collect.testing supersource: -->
<exclude name="**/testing/**"/>
</source>

<!--
We used to set this only for packages that had manual supersource.
That worked everywhere that I know of except for one place:
when running the GWT util.concurrent tests under Guava.
The problem is that GWT responds poorly to two .gwt.xml files in the same Java package:
https://goo.gl/pRV3Yn
The summary is that it ignores one file in favor of the other.
util.concurrent, like nearly all our packages, has two .gwt.xml files: one for prod and one for tests.
util.concurrent, unlike our other packages, has, as of this writing, test supersource but no prod supersource.
GWT happens to use the prod .gwt.xml, so it looks for no supersource for tests, either.
This causes it to fail to find AtomicLongMapTest.
Our workaround is to tell GWT that util.concurrent and all other packages have prod supersource, even if they have none.
GWT is happy to ignore us when we specify a nonexistent path.
(I hope that this workaround does not cause its own problems in the future.)
-->
<super-source path="super"/>
<inherits name="com.google.gwt.user.User" />

<inherits name="com.google.common.annotations.Annotations" />
<inherits name="com.google.common.base.Base" />
<inherits name="com.google.common.collect.Collect" />
<inherits name="com.google.common.primitives.Primitives" />
<inherits name="com.google.common.util.concurrent.Concurrent" />



<inherits name="com.google.gwt.core.Core" />
</module>
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.google.common.truth;


import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<module>

<inherits name="com.google.common.base.Base"/>

<inherits name="com.google.common.collect.Collect"/>

<inherits name="com.google.common.primitives.Primitives"/>

<inherits name="com.google.common.truth.Truth"/>

<!-- TODO(cpovirk): Test Truth8 separately. -->

<!-- TODO(cpovirk): Test Truth8 separately. -->
<inherits name="com.google.gwt.junit.JUnit"/>

</module>
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<module>

<source path="">

<!-- Hack to keep collect from hiding collect.testing supersource: -->

<exclude name="**/testing/**"/>

</source>

<!-- We used to set this only for packages that had manual supersource. That worked everywhere that I know of except for one place: when running the GWT util.concurrent tests under Guava. The problem is that GWT responds poorly to two .gwt.xml files in the same Java package: https://goo.gl/pRV3Yn The summary is that it ignores one file in favor of the other. util.concurrent, like nearly all our packages, has two .gwt.xml files: one for prod and one for tests. util.concurrent, unlike our other packages, has, as of this writing, test supersource but no prod supersource. GWT happens to use the prod .gwt.xml, so it looks for no supersource for tests, either. This causes it to fail to find AtomicLongMapTest. Our workaround is to tell GWT that util.concurrent and all other packages have prod supersource, even if they have none. GWT is happy to ignore us when we specify a nonexistent path. (I hope that this workaround does not cause its own problems in the future.) -->

<super-source path="super"/>

<inherits name="com.google.gwt.user.User"/>

<inherits name="com.google.common.annotations.Annotations"/>

<inherits name="com.google.common.truth.Truth"/>

<inherits name="com.google.gwt.core.Core"/>

<source path="">
<!-- Hack to keep collect from hiding collect.testing supersource: -->
<exclude name="**/testing/**"/>
</source>

<!--
We used to set this only for packages that had manual supersource.
That worked everywhere that I know of except for one place:
when running the GWT util.concurrent tests under Guava.
The problem is that GWT responds poorly to two .gwt.xml files in the same Java package:
https://goo.gl/pRV3Yn
The summary is that it ignores one file in favor of the other.
util.concurrent, like nearly all our packages, has two .gwt.xml files: one for prod and one for tests.
util.concurrent, unlike our other packages, has, as of this writing, test supersource but no prod supersource.
GWT happens to use the prod .gwt.xml, so it looks for no supersource for tests, either.
This causes it to fail to find AtomicLongMapTest.
Our workaround is to tell GWT that util.concurrent and all other packages have prod supersource, even if they have none.
GWT is happy to ignore us when we specify a nonexistent path.
(I hope that this workaround does not cause its own problems in the future.)
-->
<super-source path="super"/>
<inherits name="com.google.gwt.user.User" />

<inherits name="com.google.common.annotations.Annotations" />


<inherits name="com.google.common.truth.Truth" />
<inherits name="com.google.gwt.core.Core" />
</module>
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public ProtoTruthMessageDifferencer load(Descriptor descriptor) {

abstract FieldScopeLogicMap<Correspondence<Number, Number>> floatCorrespondenceMap();


abstract boolean compareExpectedFieldsOnly();

// The full list of non-null Messages in the 'expected' part of the assertion. When set, the
Expand Down Expand Up @@ -433,6 +434,7 @@ abstract Builder setDoubleCorrespondenceMap(
abstract Builder setFloatCorrespondenceMap(
FieldScopeLogicMap<Correspondence<Number, Number>> floatCorrespondenceMap);


abstract Builder setCompareExpectedFieldsOnly(boolean compare);

abstract Builder setExpectedMessages(ImmutableList<Message> messages);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,5 +360,4 @@ public void testMultimapOverloads_objects_actuallyNotMessages() {
assertThat(altActualObjects).doesNotContainEntry("a", message1);
assertThat(altActualObjects).doesNotContainEntry("b", message2);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,6 @@ public void testDoubleTolerance() {
expectThat(diffMessage).usingDoubleTolerance(0.2).isEqualTo(message);
expectThat(diffMessage).usingDoubleTolerance(0.05).isNotEqualTo(message);
expectThat(diffMessage).usingFloatTolerance(0.2f).isNotEqualTo(message);

}

@Test
Expand Down Expand Up @@ -457,7 +456,6 @@ public void testFloatTolerance() {
expectThat(diffMessage).usingFloatTolerance(0.2f).isEqualTo(message);
expectThat(diffMessage).usingFloatTolerance(0.05f).isNotEqualTo(message);
expectThat(diffMessage).usingDoubleTolerance(0.2).isNotEqualTo(message);

}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public Message defaultInstance() {
public boolean isProto3() {
return this == PROTO3;
}

}

private static final TypeRegistry typeRegistry =
Expand Down

0 comments on commit 794ed1b

Please sign in to comment.