mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Add Java buck tests
Summary: This diff adds some basic tests that ensure all of the e2e test components can compile with the interface is implemented (we also have these tests for cxx) Reviewed By: JoshuaGross, mdvacca Differential Revision: D16378756 fbshipit-source-id: d0c6dc976c74f6a388068e66b9a2135bc4ce4652
This commit is contained in:
1 parent
1783780a92
commit
32b812c05c
15 files changed
+461
-3
No files matched your search
@@ -1,9 +1,10 @@
|
||||
load("@fbsource//tools/build_defs:default_platform_defs.bzl", "ANDROID", "APPLE")
|
||||
load("@fbsource//tools/build_defs:fb_native_wrapper.bzl", "fb_native")
|
||||
load("@fbsource//tools/build_defs:fb_xplat_cxx_binary.bzl", "fb_xplat_cxx_binary")
|
||||
load("@fbsource//tools/build_defs/oss:rn_defs.bzl", "rn_xplat_cxx_library")
|
||||
load("@fbsource//tools/build_defs/oss:rn_defs.bzl", "rn_android_library", "rn_xplat_cxx_library")
|
||||
load("@fbsource//tools/build_defs/third_party:yarn_defs.bzl", "yarn_workspace")
|
||||
load("@fbsource//xplat/js/react-native-github/packages/react-native-codegen:DEFS.bzl", "rn_codegen")
|
||||
load("//tools/build_defs/oss:rn_defs.bzl", "react_native_target")
|
||||
|
||||
fb_native.sh_binary(
|
||||
name = "write_to_json",
|
||||
@@ -71,6 +72,21 @@ fb_xplat_cxx_binary(
|
||||
],
|
||||
)
|
||||
|
||||
rn_android_library(
|
||||
name = "rn_codegen_library_java",
|
||||
srcs = glob(["**/*.java"]),
|
||||
visibility = [
|
||||
"PUBLIC",
|
||||
],
|
||||
deps = [
|
||||
react_native_target("java/com/facebook/react/bridge:bridge"),
|
||||
react_native_target("java/com/facebook/react/common:common"),
|
||||
react_native_target("java/com/facebook/react/views/view:view"),
|
||||
react_native_target("java/com/facebook/react/uimanager:uimanager"),
|
||||
":generated_components_java-codegen_tests",
|
||||
],
|
||||
)
|
||||
|
||||
rn_xplat_cxx_library(
|
||||
name = "rn_codegen_library",
|
||||
srcs = ["buck_tests/emptyFile.cpp"],
|
||||
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
package com.facebook.react.uimanager;
|
||||
|
||||
import android.view.ViewGroup;
|
||||
import com.facebook.react.bridge.ReadableArray;
|
||||
import com.facebook.react.viewmanagers.ArrayPropsNativeComponentDelegate;
|
||||
import com.facebook.react.viewmanagers.ArrayPropsNativeComponentInterface;
|
||||
|
||||
public class ArrayPropsNativeComponentViewManager extends SimpleViewManager<ViewGroup>
|
||||
implements ArrayPropsNativeComponentInterface<ViewGroup> {
|
||||
|
||||
public static final String REACT_CLASS = "ArrayPropsNativeComponent";
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return REACT_CLASS;
|
||||
}
|
||||
|
||||
private void test() {
|
||||
ArrayPropsNativeComponentDelegate delegate = new ArrayPropsNativeComponentDelegate<ViewGroup>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ViewGroup createViewInstance(ThemedReactContext context) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setNames(ViewGroup view, ReadableArray value) {}
|
||||
|
||||
@Override
|
||||
public void setDisableds(ViewGroup view, ReadableArray value) {}
|
||||
|
||||
@Override
|
||||
public void setProgress(ViewGroup view, ReadableArray value) {}
|
||||
|
||||
@Override
|
||||
public void setRadii(ViewGroup view, ReadableArray value) {}
|
||||
|
||||
@Override
|
||||
public void setColors(ViewGroup view, ReadableArray value) {}
|
||||
|
||||
@Override
|
||||
public void setSrcs(ViewGroup view, ReadableArray value) {}
|
||||
|
||||
@Override
|
||||
public void setPoints(ViewGroup view, ReadableArray value) {}
|
||||
|
||||
@Override
|
||||
public void setSizes(ViewGroup view, ReadableArray value) {}
|
||||
}
|
||||
+20
-2
@@ -1,9 +1,27 @@
|
||||
package com.facebook.react.uimanager;
|
||||
|
||||
import android.view.ViewGroup;
|
||||
import com.facebook.react.viewmanagers.BooleanPropNativeComponentDelegate;
|
||||
import com.facebook.react.viewmanagers.BooleanPropNativeComponentInterface;
|
||||
|
||||
public class BooleanPropNativeComponentViewManager extends BaseViewManager
|
||||
implements BooleanPropNativeComponentInterface {
|
||||
public class BooleanPropNativeComponentViewManager extends SimpleViewManager<ViewGroup>
|
||||
implements BooleanPropNativeComponentInterface<ViewGroup> {
|
||||
public static final String REACT_CLASS = "BooleanPropNativeComponentView";
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return REACT_CLASS;
|
||||
}
|
||||
|
||||
private void test() {
|
||||
BooleanPropNativeComponentDelegate delegate =
|
||||
new BooleanPropNativeComponentDelegate<ViewGroup>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ViewGroup createViewInstance(ThemedReactContext context) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDisabled(ViewGroup view, boolean value) {}
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.facebook.react.uimanager;
|
||||
|
||||
import android.view.ViewGroup;
|
||||
import com.facebook.react.viewmanagers.ColorPropNativeComponentDelegate;
|
||||
import com.facebook.react.viewmanagers.ColorPropNativeComponentInterface;
|
||||
|
||||
public class ColorPropNativeComponentViewManager extends SimpleViewManager<ViewGroup>
|
||||
implements ColorPropNativeComponentInterface<ViewGroup> {
|
||||
|
||||
public static final String REACT_CLASS = "ColorPropNativeComponentView";
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return REACT_CLASS;
|
||||
}
|
||||
|
||||
private void test() {
|
||||
ColorPropNativeComponentDelegate delegate = new ColorPropNativeComponentDelegate<ViewGroup>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ViewGroup createViewInstance(ThemedReactContext context) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTintColor(ViewGroup view, Integer value) {}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.facebook.react.uimanager;
|
||||
|
||||
import android.view.ViewGroup;
|
||||
import com.facebook.react.viewmanagers.EnumPropNativeComponentDelegate;
|
||||
import com.facebook.react.viewmanagers.EnumPropNativeComponentInterface;
|
||||
|
||||
public class EnumPropNativeComponentViewManager extends SimpleViewManager<ViewGroup>
|
||||
implements EnumPropNativeComponentInterface<ViewGroup> {
|
||||
|
||||
public static final String REACT_CLASS = "EnumPropNativeComponentView";
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return REACT_CLASS;
|
||||
}
|
||||
|
||||
private void test() {
|
||||
EnumPropNativeComponentDelegate delegate = new EnumPropNativeComponentDelegate<ViewGroup>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ViewGroup createViewInstance(ThemedReactContext context) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAlignment(ViewGroup view, String value) {}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.facebook.react.uimanager;
|
||||
|
||||
import android.view.ViewGroup;
|
||||
import com.facebook.react.viewmanagers.EventNestedObjectPropsNativeComponentDelegate;
|
||||
import com.facebook.react.viewmanagers.EventNestedObjectPropsNativeComponentInterface;
|
||||
|
||||
public class EventNestedObjectPropsNativeComponentViewManager extends SimpleViewManager<ViewGroup>
|
||||
implements EventNestedObjectPropsNativeComponentInterface<ViewGroup> {
|
||||
|
||||
public static final String REACT_CLASS = "EventNestedObjectPropsNativeComponentView";
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return REACT_CLASS;
|
||||
}
|
||||
|
||||
private void test() {
|
||||
EventNestedObjectPropsNativeComponentDelegate delegate =
|
||||
new EventNestedObjectPropsNativeComponentDelegate<ViewGroup>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ViewGroup createViewInstance(ThemedReactContext context) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDisabled(ViewGroup view, boolean value) {}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.facebook.react.uimanager;
|
||||
|
||||
import android.view.ViewGroup;
|
||||
import com.facebook.react.viewmanagers.EventPropsNativeComponentDelegate;
|
||||
import com.facebook.react.viewmanagers.EventPropsNativeComponentInterface;
|
||||
|
||||
public class EventPropsNativeComponentViewManager extends SimpleViewManager<ViewGroup>
|
||||
implements EventPropsNativeComponentInterface<ViewGroup> {
|
||||
|
||||
public static final String REACT_CLASS = "EventPropsNativeComponentView";
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return REACT_CLASS;
|
||||
}
|
||||
|
||||
private void test() {
|
||||
EventPropsNativeComponentDelegate delegate = new EventPropsNativeComponentDelegate<ViewGroup>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ViewGroup createViewInstance(ThemedReactContext context) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDisabled(ViewGroup view, boolean value) {}
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package com.facebook.react.uimanager;
|
||||
|
||||
import android.view.ViewGroup;
|
||||
import com.facebook.react.viewmanagers.FloatPropsNativeComponentDelegate;
|
||||
import com.facebook.react.viewmanagers.FloatPropsNativeComponentInterface;
|
||||
|
||||
public class FloatPropsNativeComponentViewManager extends SimpleViewManager<ViewGroup>
|
||||
implements FloatPropsNativeComponentInterface<ViewGroup> {
|
||||
|
||||
public static final String REACT_CLASS = "FloatPropsNativeComponentView";
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return REACT_CLASS;
|
||||
}
|
||||
|
||||
private void test() {
|
||||
FloatPropsNativeComponentDelegate delegate = new FloatPropsNativeComponentDelegate<ViewGroup>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ViewGroup createViewInstance(ThemedReactContext context) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlurRadius(ViewGroup view, Float value) {}
|
||||
|
||||
@Override
|
||||
public void setBlurRadius2(ViewGroup view, Float value) {}
|
||||
|
||||
@Override
|
||||
public void setBlurRadius3(ViewGroup view, Float value) {}
|
||||
|
||||
@Override
|
||||
public void setBlurRadius4(ViewGroup view, Float value) {}
|
||||
|
||||
@Override
|
||||
public void setBlurRadius5(ViewGroup view, Float value) {}
|
||||
|
||||
@Override
|
||||
public void setBlurRadius6(ViewGroup view, Float value) {}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.facebook.react.uimanager;
|
||||
|
||||
import android.view.ViewGroup;
|
||||
import com.facebook.react.bridge.ReadableMap;
|
||||
import com.facebook.react.viewmanagers.ImagePropNativeComponentDelegate;
|
||||
import com.facebook.react.viewmanagers.ImagePropNativeComponentInterface;
|
||||
|
||||
public class ImagePropNativeComponentViewManager extends SimpleViewManager<ViewGroup>
|
||||
implements ImagePropNativeComponentInterface<ViewGroup> {
|
||||
|
||||
public static final String REACT_CLASS = "ImagePropNativeComponentView";
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return REACT_CLASS;
|
||||
}
|
||||
|
||||
private void test() {
|
||||
ImagePropNativeComponentDelegate delegate = new ImagePropNativeComponentDelegate<ViewGroup>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ViewGroup createViewInstance(ThemedReactContext context) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setThumbImage(ViewGroup view, ReadableMap value) {}
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package com.facebook.react.uimanager;
|
||||
|
||||
import android.view.ViewGroup;
|
||||
import com.facebook.react.viewmanagers.IntegerPropNativeComponentDelegate;
|
||||
import com.facebook.react.viewmanagers.IntegerPropNativeComponentInterface;
|
||||
|
||||
public class IntegerPropNativeComponentViewManager extends SimpleViewManager<ViewGroup>
|
||||
implements IntegerPropNativeComponentInterface<ViewGroup> {
|
||||
|
||||
public static final String REACT_CLASS = "IntegerPropNativeComponentView";
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return REACT_CLASS;
|
||||
}
|
||||
|
||||
private void test() {
|
||||
IntegerPropNativeComponentDelegate delegate =
|
||||
new IntegerPropNativeComponentDelegate<ViewGroup>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ViewGroup createViewInstance(ThemedReactContext context) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setProgress1(ViewGroup view, int value) {}
|
||||
|
||||
@Override
|
||||
public void setProgress2(ViewGroup view, int value) {}
|
||||
|
||||
@Override
|
||||
public void setProgress3(ViewGroup view, int value) {}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.facebook.react.uimanager;
|
||||
|
||||
import android.view.ViewGroup;
|
||||
import com.facebook.react.viewmanagers.InterfaceOnlyNativeComponentDelegate;
|
||||
import com.facebook.react.viewmanagers.InterfaceOnlyNativeComponentInterface;
|
||||
|
||||
public class InterfaceOnlyNativeComponentViewManager extends SimpleViewManager<ViewGroup>
|
||||
implements InterfaceOnlyNativeComponentInterface<ViewGroup> {
|
||||
|
||||
public static final String REACT_CLASS = "InterfaceOnlyNativeComponentView";
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return REACT_CLASS;
|
||||
}
|
||||
|
||||
private void test() {
|
||||
InterfaceOnlyNativeComponentDelegate delegate =
|
||||
new InterfaceOnlyNativeComponentDelegate<ViewGroup>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ViewGroup createViewInstance(ThemedReactContext context) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAccessibilityHint(ViewGroup view, String value) {}
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package com.facebook.react.uimanager;
|
||||
|
||||
import android.view.ViewGroup;
|
||||
import com.facebook.react.bridge.ReadableMap;
|
||||
import com.facebook.react.viewmanagers.MultiNativePropNativeComponentDelegate;
|
||||
import com.facebook.react.viewmanagers.MultiNativePropNativeComponentInterface;
|
||||
|
||||
public class MultiNativePropNativeComponentViewManager extends SimpleViewManager<ViewGroup>
|
||||
implements MultiNativePropNativeComponentInterface<ViewGroup> {
|
||||
|
||||
public static final String REACT_CLASS = "MultiNativePropNativeComponentView";
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return REACT_CLASS;
|
||||
}
|
||||
|
||||
private void test() {
|
||||
MultiNativePropNativeComponentDelegate delegate =
|
||||
new MultiNativePropNativeComponentDelegate<ViewGroup>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ViewGroup createViewInstance(ThemedReactContext context) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setThumbImage(ViewGroup view, ReadableMap value) {}
|
||||
|
||||
@Override
|
||||
public void setColor(ViewGroup view, Integer value) {}
|
||||
|
||||
@Override
|
||||
public void setThumbTintColor(ViewGroup view, Integer value) {}
|
||||
|
||||
@Override
|
||||
public void setPoint(ViewGroup view, ReadableMap value) {}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package com.facebook.react.uimanager;
|
||||
|
||||
import android.view.ViewGroup;
|
||||
import com.facebook.react.viewmanagers.NoPropsNoEventsNativeComponentDelegate;
|
||||
import com.facebook.react.viewmanagers.NoPropsNoEventsNativeComponentInterface;
|
||||
|
||||
public class NoPropsNoEventsNativeComponentViewManager extends SimpleViewManager<ViewGroup>
|
||||
implements NoPropsNoEventsNativeComponentInterface<ViewGroup> {
|
||||
|
||||
public static final String REACT_CLASS = "NoPropsNoEventsNativeComponentView";
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return REACT_CLASS;
|
||||
}
|
||||
|
||||
private void test() {
|
||||
NoPropsNoEventsNativeComponentDelegate delegate =
|
||||
new NoPropsNoEventsNativeComponentDelegate<ViewGroup>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ViewGroup createViewInstance(ThemedReactContext context) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.facebook.react.uimanager;
|
||||
|
||||
import android.view.ViewGroup;
|
||||
import com.facebook.react.bridge.ReadableMap;
|
||||
import com.facebook.react.viewmanagers.PointPropNativeComponentDelegate;
|
||||
import com.facebook.react.viewmanagers.PointPropNativeComponentInterface;
|
||||
|
||||
public class PointPropNativeComponentViewManager extends SimpleViewManager<ViewGroup>
|
||||
implements PointPropNativeComponentInterface<ViewGroup> {
|
||||
|
||||
public static final String REACT_CLASS = "PointPropNativeComponentView";
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return REACT_CLASS;
|
||||
}
|
||||
|
||||
private void test() {
|
||||
PointPropNativeComponentDelegate delegate = new PointPropNativeComponentDelegate<ViewGroup>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ViewGroup createViewInstance(ThemedReactContext context) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStartPoint(ViewGroup view, ReadableMap value) {}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.facebook.react.uimanager;
|
||||
|
||||
import android.view.ViewGroup;
|
||||
import com.facebook.react.viewmanagers.StringPropNativeComponentDelegate;
|
||||
import com.facebook.react.viewmanagers.StringPropNativeComponentInterface;
|
||||
|
||||
public class StringPropNativeComponentViewManager extends SimpleViewManager<ViewGroup>
|
||||
implements StringPropNativeComponentInterface<ViewGroup> {
|
||||
|
||||
public static final String REACT_CLASS = "StringPropNativeComponentView";
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return REACT_CLASS;
|
||||
}
|
||||
|
||||
private void test() {
|
||||
StringPropNativeComponentDelegate delegate = new StringPropNativeComponentDelegate<ViewGroup>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ViewGroup createViewInstance(ThemedReactContext context) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAccessibilityHint(ViewGroup view, String value) {}
|
||||
|
||||
@Override
|
||||
public void setAccessibilityRole(ViewGroup view, String value) {}
|
||||
}
|
||||
Reference in new issue
Block a user