mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Format Java code in xplat/js/react-native-github
Summary: This diff formats the Java class files inside xplat/js/react-native-github. Since google-java-format was enabled in D16071401 we want to codemode the existing code so that users don't have to deal with formatter lint noise at diff-time. ```arc f --paths-cmd 'hg files -I "**/*.java"'``` drop-conflicts Reviewed By: cpojer Differential Revision: D16071725 fbshipit-source-id: fc6e3852e45742c109f0c5ac4065d64201c74204
This commit is contained in:
committed by
Facebook Github Bot
parent
61e95e5cbf
commit
6c0f73b322
+17
-34
@@ -1,35 +1,28 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
|
||||
* directory of this source tree.
|
||||
*/
|
||||
|
||||
package com.facebook.react.uimanager;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import com.facebook.react.uimanager.annotations.ReactProp;
|
||||
import com.facebook.react.uimanager.annotations.ReactPropGroup;
|
||||
|
||||
import org.powermock.core.classloader.annotations.PowerMockIgnore;
|
||||
import org.powermock.modules.junit4.rule.PowerMockRule;
|
||||
import java.util.Date;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.powermock.core.classloader.annotations.PowerMockIgnore;
|
||||
import org.powermock.modules.junit4.rule.PowerMockRule;
|
||||
import org.robolectric.RobolectricTestRunner;
|
||||
|
||||
/**
|
||||
* Test that verifies that spec of methods annotated with @ReactProp is correct
|
||||
*/
|
||||
/** Test that verifies that spec of methods annotated with @ReactProp is correct */
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
@PowerMockIgnore({"org.mockito.*", "org.robolectric.*", "androidx.*", "android.*"})
|
||||
public class ReactPropAnnotationSetterSpecTest {
|
||||
|
||||
@Rule
|
||||
public PowerMockRule rule = new PowerMockRule();
|
||||
@Rule public PowerMockRule rule = new PowerMockRule();
|
||||
|
||||
private abstract class BaseViewManager extends ViewManager<View, ReactShadowNode> {
|
||||
|
||||
@@ -54,16 +47,14 @@ public class ReactPropAnnotationSetterSpecTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateExtraData(View root, Object extraData) {
|
||||
}
|
||||
public void updateExtraData(View root, Object extraData) {}
|
||||
}
|
||||
|
||||
@Test(expected = RuntimeException.class)
|
||||
public void testMethodWithWongNumberOfParams() {
|
||||
new BaseViewManager() {
|
||||
@ReactProp(name = "prop")
|
||||
public void setterWithIncorrectNumberOfArgs(View v, boolean value, boolean otherValue) {
|
||||
}
|
||||
public void setterWithIncorrectNumberOfArgs(View v, boolean value, boolean otherValue) {}
|
||||
}.getNativeProps();
|
||||
}
|
||||
|
||||
@@ -71,8 +62,7 @@ public class ReactPropAnnotationSetterSpecTest {
|
||||
public void testMethodWithTooFewParams() {
|
||||
new BaseViewManager() {
|
||||
@ReactProp(name = "prop")
|
||||
public void setterWithTooFewParams(View v) {
|
||||
}
|
||||
public void setterWithTooFewParams(View v) {}
|
||||
}.getNativeProps();
|
||||
}
|
||||
|
||||
@@ -80,8 +70,7 @@ public class ReactPropAnnotationSetterSpecTest {
|
||||
public void testUnsupportedPropValueType() {
|
||||
new BaseViewManager() {
|
||||
@ReactProp(name = "prop")
|
||||
public void setterWithUnsupportedValueType(View v, Date value) {
|
||||
}
|
||||
public void setterWithUnsupportedValueType(View v, Date value) {}
|
||||
}.getNativeProps();
|
||||
}
|
||||
|
||||
@@ -89,8 +78,7 @@ public class ReactPropAnnotationSetterSpecTest {
|
||||
public void testSetterWIthNonViewParam() {
|
||||
new BaseViewManager() {
|
||||
@ReactProp(name = "prop")
|
||||
public void setterWithNonViewParam(Object v, boolean value) {
|
||||
}
|
||||
public void setterWithNonViewParam(Object v, boolean value) {}
|
||||
}.getNativeProps();
|
||||
}
|
||||
|
||||
@@ -98,8 +86,7 @@ public class ReactPropAnnotationSetterSpecTest {
|
||||
public void testGroupInvalidNumberOfParams() {
|
||||
new BaseViewManager() {
|
||||
@ReactPropGroup(names = {"prop1", "prop2"})
|
||||
public void setterWIthInvalidNumberOfParams(View v, int index, float value, float other) {
|
||||
}
|
||||
public void setterWIthInvalidNumberOfParams(View v, int index, float value, float other) {}
|
||||
}.getNativeProps();
|
||||
}
|
||||
|
||||
@@ -107,8 +94,7 @@ public class ReactPropAnnotationSetterSpecTest {
|
||||
public void testGroupTooFewParams() {
|
||||
new BaseViewManager() {
|
||||
@ReactPropGroup(names = {"prop1", "prop2"})
|
||||
public void setterWIthTooFewParams(View v, int index) {
|
||||
}
|
||||
public void setterWIthTooFewParams(View v, int index) {}
|
||||
}.getNativeProps();
|
||||
}
|
||||
|
||||
@@ -116,8 +102,7 @@ public class ReactPropAnnotationSetterSpecTest {
|
||||
public void testGroupNoIndexParam() {
|
||||
new BaseViewManager() {
|
||||
@ReactPropGroup(names = {"prop1", "prop2"})
|
||||
public void setterWithoutIndexParam(View v, float value, float sth) {
|
||||
}
|
||||
public void setterWithoutIndexParam(View v, float value, float sth) {}
|
||||
}.getNativeProps();
|
||||
}
|
||||
|
||||
@@ -125,8 +110,7 @@ public class ReactPropAnnotationSetterSpecTest {
|
||||
public void testGroupNoViewParam() {
|
||||
new BaseViewManager() {
|
||||
@ReactPropGroup(names = {"prop1", "prop2"})
|
||||
public void setterWithoutViewParam(Object v, int index, float value) {
|
||||
}
|
||||
public void setterWithoutViewParam(Object v, int index, float value) {}
|
||||
}.getNativeProps();
|
||||
}
|
||||
|
||||
@@ -134,8 +118,7 @@ public class ReactPropAnnotationSetterSpecTest {
|
||||
public void testGroupUnsupportedPropType() {
|
||||
new BaseViewManager() {
|
||||
@ReactPropGroup(names = {"prop1", "prop2"})
|
||||
public void setterWithUnsupportedPropType(View v, int index, long value) {
|
||||
}
|
||||
public void setterWithUnsupportedPropType(View v, int index, long value) {}
|
||||
}.getNativeProps();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user