target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void canSearchForPopertiesAngGetOriginalPropertyCase() throws IOException { Properties properties = givenDefaultSearchProperties(); DefaultPropertyLoader loader = new DefaultPropertyLoader(properties); Map<String, String> found = loader.getPropertiesStartingWith("a."); assertThat(found.values().size(), is(...
@Override public Map<String, String> getPropertiesStartingWith(String keyPrefix) { return getPropertiesStartingWith(keyPrefix, false); }
DefaultPropertyLoader implements PropertyLoader { @Override public Map<String, String> getPropertiesStartingWith(String keyPrefix) { return getPropertiesStartingWith(keyPrefix, false); } }
DefaultPropertyLoader implements PropertyLoader { @Override public Map<String, String> getPropertiesStartingWith(String keyPrefix) { return getPropertiesStartingWith(keyPrefix, false); } DefaultPropertyLoader(Properties properties); }
DefaultPropertyLoader implements PropertyLoader { @Override public Map<String, String> getPropertiesStartingWith(String keyPrefix) { return getPropertiesStartingWith(keyPrefix, false); } DefaultPropertyLoader(Properties properties); String getEnvironment(); @Override String getProperty(String key); @Override String get...
DefaultPropertyLoader implements PropertyLoader { @Override public Map<String, String> getPropertiesStartingWith(String keyPrefix) { return getPropertiesStartingWith(keyPrefix, false); } DefaultPropertyLoader(Properties properties); String getEnvironment(); @Override String getProperty(String key); @Override String get...
@Test public void canSearchForPopertiesAngGetKeysWithoutPrefix() throws IOException { Properties properties = givenDefaultSearchProperties(); DefaultPropertyLoader loader = new DefaultPropertyLoader(properties); Map<String, String> found = loader.getPropertiesStartingWith("a.setting.", true); assertThat(found.values()....
@Override public Map<String, String> getPropertiesStartingWith(String keyPrefix) { return getPropertiesStartingWith(keyPrefix, false); }
DefaultPropertyLoader implements PropertyLoader { @Override public Map<String, String> getPropertiesStartingWith(String keyPrefix) { return getPropertiesStartingWith(keyPrefix, false); } }
DefaultPropertyLoader implements PropertyLoader { @Override public Map<String, String> getPropertiesStartingWith(String keyPrefix) { return getPropertiesStartingWith(keyPrefix, false); } DefaultPropertyLoader(Properties properties); }
DefaultPropertyLoader implements PropertyLoader { @Override public Map<String, String> getPropertiesStartingWith(String keyPrefix) { return getPropertiesStartingWith(keyPrefix, false); } DefaultPropertyLoader(Properties properties); String getEnvironment(); @Override String getProperty(String key); @Override String get...
DefaultPropertyLoader implements PropertyLoader { @Override public Map<String, String> getPropertiesStartingWith(String keyPrefix) { return getPropertiesStartingWith(keyPrefix, false); } DefaultPropertyLoader(Properties properties); String getEnvironment(); @Override String getProperty(String key); @Override String get...
@Test public void userPropertiesOverrideConfigProperties() { String defaultProperties = "a.setting=false"; String userProperties = "a.setting=true"; Properties properties = new DefaultPropertiesLoader(defaultProperties, "").getProperties(); assertThat(properties.getProperty("a.setting"), is("false")); properties = new ...
@Override public Properties getProperties() { return properties; }
DefaultPropertiesLoader implements PropertiesLoader { @Override public Properties getProperties() { return properties; } }
DefaultPropertiesLoader implements PropertiesLoader { @Override public Properties getProperties() { return properties; } protected DefaultPropertiesLoader(String properties, String userProperties); private DefaultPropertiesLoader(); }
DefaultPropertiesLoader implements PropertiesLoader { @Override public Properties getProperties() { return properties; } protected DefaultPropertiesLoader(String properties, String userProperties); private DefaultPropertiesLoader(); static DefaultPropertiesLoader getInstance(); @Override Properties getProperties(); }
DefaultPropertiesLoader implements PropertiesLoader { @Override public Properties getProperties() { return properties; } protected DefaultPropertiesLoader(String properties, String userProperties); private DefaultPropertiesLoader(); static DefaultPropertiesLoader getInstance(); @Override Properties getProperties(); ...
@Test public void isRegisteredReturnsFalseIfNotRegistered() { assertFalse(test1.isRegistered(resource0, ResourceScope.SPECIFICATION)); }
@Override public boolean isRegistered(Closeable resource, ResourceScope scope) { return getResourcePairFromScope(resource, scope).isPresent(); }
ConcordionBase implements ResourceRegistry { @Override public boolean isRegistered(Closeable resource, ResourceScope scope) { return getResourcePairFromScope(resource, scope).isPresent(); } }
ConcordionBase implements ResourceRegistry { @Override public boolean isRegistered(Closeable resource, ResourceScope scope) { return getResourcePairFromScope(resource, scope).isPresent(); } }
ConcordionBase implements ResourceRegistry { @Override public boolean isRegistered(Closeable resource, ResourceScope scope) { return getResourcePairFromScope(resource, scope).isPresent(); } @Override void registerCloseableResource(Closeable resource, ResourceScope scope); @Override void registerCloseableResource(Close...
ConcordionBase implements ResourceRegistry { @Override public boolean isRegistered(Closeable resource, ResourceScope scope) { return getResourcePairFromScope(resource, scope).isPresent(); } @Override void registerCloseableResource(Closeable resource, ResourceScope scope); @Override void registerCloseableResource(Close...
@Test public void reusesBrowsersForSameKey() { BrowserProvider mockProvider = mock(BrowserProvider.class); Browser browser1 = test1.getBrowser("X", mockProvider); Browser browser2 = test1.getBrowser("X", mockProvider); assertThat(browser1, is(browser2)); }
@Override public Browser getBrowser() { return getBrowser(threadBrowserId.get()); }
ConcordionBrowserFixture extends ConcordionFixture implements BrowserBasedTest { @Override public Browser getBrowser() { return getBrowser(threadBrowserId.get()); } }
ConcordionBrowserFixture extends ConcordionFixture implements BrowserBasedTest { @Override public Browser getBrowser() { return getBrowser(threadBrowserId.get()); } }
ConcordionBrowserFixture extends ConcordionFixture implements BrowserBasedTest { @Override public Browser getBrowser() { return getBrowser(threadBrowserId.get()); } static void setScreenshotTakerClass(Class<? extends ScreenshotTaker> screenshotTaker); @Override Browser getBrowser(); Browser getBrowser(String key); Bro...
ConcordionBrowserFixture extends ConcordionFixture implements BrowserBasedTest { @Override public Browser getBrowser() { return getBrowser(threadBrowserId.get()); } static void setScreenshotTakerClass(Class<? extends ScreenshotTaker> screenshotTaker); @Override Browser getBrowser(); Browser getBrowser(String key); Bro...
@Test public void testReportSpan() { PrometheusMetricsReporter reporter = PrometheusMetricsReporter.newMetricsReporter() .withCollectorRegistry(collectorRegistry) .withConstLabel("span.kind", Tags.SPAN_KIND_CLIENT) .build(); Map<String,Object> spanTags = new HashMap<String,Object>(); spanTags.put(Tags.SPAN_KIND.getKey(...
@Override public void reportSpan(SpanData spanData) { String[] labelValues = getLabelValues(spanData); if (labelValues != null) { this.histogram.labels(labelValues).observe(spanData.getDuration() / (double)1000000); } }
PrometheusMetricsReporter extends AbstractMetricsReporter implements MetricsReporter { @Override public void reportSpan(SpanData spanData) { String[] labelValues = getLabelValues(spanData); if (labelValues != null) { this.histogram.labels(labelValues).observe(spanData.getDuration() / (double)1000000); } } }
PrometheusMetricsReporter extends AbstractMetricsReporter implements MetricsReporter { @Override public void reportSpan(SpanData spanData) { String[] labelValues = getLabelValues(spanData); if (labelValues != null) { this.histogram.labels(labelValues).observe(spanData.getDuration() / (double)1000000); } } private Prom...
PrometheusMetricsReporter extends AbstractMetricsReporter implements MetricsReporter { @Override public void reportSpan(SpanData spanData) { String[] labelValues = getLabelValues(spanData); if (labelValues != null) { this.histogram.labels(labelValues).observe(spanData.getDuration() / (double)1000000); } } private Prom...
PrometheusMetricsReporter extends AbstractMetricsReporter implements MetricsReporter { @Override public void reportSpan(SpanData spanData) { String[] labelValues = getLabelValues(spanData); if (labelValues != null) { this.histogram.labels(labelValues).observe(spanData.getDuration() / (double)1000000); } } private Prom...
@Test public void testAsChildOf() { MetricsReporter reporter = Mockito.mock(MetricsReporter.class); MockTracer tracer = new MockTracer(); Tracer metricsTracer = Metrics.decorate(tracer, reporter); Scope parentSpan = metricsTracer.buildSpan("parent") .withTag("spanName","parent") .startActive(true); parentSpan.span().se...
public static Tracer decorate(Tracer tracer, MetricsReporter reporter) { return decorate(tracer, Collections.singleton(reporter)); }
Metrics { public static Tracer decorate(Tracer tracer, MetricsReporter reporter) { return decorate(tracer, Collections.singleton(reporter)); } }
Metrics { public static Tracer decorate(Tracer tracer, MetricsReporter reporter) { return decorate(tracer, Collections.singleton(reporter)); } }
Metrics { public static Tracer decorate(Tracer tracer, MetricsReporter reporter) { return decorate(tracer, Collections.singleton(reporter)); } static Tracer decorate(Tracer tracer, MetricsReporter reporter); static Tracer decorate(Tracer tracer, Set<MetricsReporter> reporters); }
Metrics { public static Tracer decorate(Tracer tracer, MetricsReporter reporter) { return decorate(tracer, Collections.singleton(reporter)); } static Tracer decorate(Tracer tracer, MetricsReporter reporter); static Tracer decorate(Tracer tracer, Set<MetricsReporter> reporters); }
@Test public void testReportSpan() { SpanData spanData = defaultMockSpanData(); when(spanData.getTags()).thenReturn(Collections.singletonMap(Tags.SPAN_KIND.getKey(), Tags.SPAN_KIND_CLIENT)); MicrometerMetricsReporter reporter = MicrometerMetricsReporter.newMetricsReporter() .withConstLabel("span.kind", Tags.SPAN_KIND_C...
@Override public void reportSpan(SpanData spanData) { boolean skip = Arrays.stream(this.metricLabels).anyMatch(m -> m.value(spanData) == null); if (skip) { return; } List<Tag> tags = Arrays.stream(this.metricLabels) .map(m -> new ImmutableTag(m.name(), m.value(spanData).toString())) .collect(Collectors.toList()); Timer...
MicrometerMetricsReporter extends AbstractMetricsReporter implements MetricsReporter { @Override public void reportSpan(SpanData spanData) { boolean skip = Arrays.stream(this.metricLabels).anyMatch(m -> m.value(spanData) == null); if (skip) { return; } List<Tag> tags = Arrays.stream(this.metricLabels) .map(m -> new Imm...
MicrometerMetricsReporter extends AbstractMetricsReporter implements MetricsReporter { @Override public void reportSpan(SpanData spanData) { boolean skip = Arrays.stream(this.metricLabels).anyMatch(m -> m.value(spanData) == null); if (skip) { return; } List<Tag> tags = Arrays.stream(this.metricLabels) .map(m -> new Imm...
MicrometerMetricsReporter extends AbstractMetricsReporter implements MetricsReporter { @Override public void reportSpan(SpanData spanData) { boolean skip = Arrays.stream(this.metricLabels).anyMatch(m -> m.value(spanData) == null); if (skip) { return; } List<Tag> tags = Arrays.stream(this.metricLabels) .map(m -> new Imm...
MicrometerMetricsReporter extends AbstractMetricsReporter implements MetricsReporter { @Override public void reportSpan(SpanData spanData) { boolean skip = Arrays.stream(this.metricLabels).anyMatch(m -> m.value(spanData) == null); if (skip) { return; } List<Tag> tags = Arrays.stream(this.metricLabels) .map(m -> new Imm...
@Test public void testConvertLabel() { assertEquals("Hello9", PrometheusMetricsReporter.convertLabel("Hello9")); assertEquals("Hello_there", PrometheusMetricsReporter.convertLabel("Hello there")); assertEquals("_tag1", PrometheusMetricsReporter.convertLabel("1tag1")); assertEquals("tag_:_", PrometheusMetricsReporter.co...
protected static String convertLabel(String label) { StringBuilder builder = new StringBuilder(label); for (int i=0; i < builder.length(); i++) { char ch = builder.charAt(i); if (!(ch == '_' || ch == ':' || Character.isLetter(ch) || (i > 0 && Character.isDigit(ch)))) { builder.setCharAt(i, '_'); } } return builder.toSt...
PrometheusMetricsReporter extends AbstractMetricsReporter implements MetricsReporter { protected static String convertLabel(String label) { StringBuilder builder = new StringBuilder(label); for (int i=0; i < builder.length(); i++) { char ch = builder.charAt(i); if (!(ch == '_' || ch == ':' || Character.isLetter(ch) || ...
PrometheusMetricsReporter extends AbstractMetricsReporter implements MetricsReporter { protected static String convertLabel(String label) { StringBuilder builder = new StringBuilder(label); for (int i=0; i < builder.length(); i++) { char ch = builder.charAt(i); if (!(ch == '_' || ch == ':' || Character.isLetter(ch) || ...
PrometheusMetricsReporter extends AbstractMetricsReporter implements MetricsReporter { protected static String convertLabel(String label) { StringBuilder builder = new StringBuilder(label); for (int i=0; i < builder.length(); i++) { char ch = builder.charAt(i); if (!(ch == '_' || ch == ':' || Character.isLetter(ch) || ...
PrometheusMetricsReporter extends AbstractMetricsReporter implements MetricsReporter { protected static String convertLabel(String label) { StringBuilder builder = new StringBuilder(label); for (int i=0; i < builder.length(); i++) { char ch = builder.charAt(i); if (!(ch == '_' || ch == ':' || Character.isLetter(ch) || ...
@Test public void testLabelFromTagWithValue() { MetricLabel label = new TagMetricLabel(TEST_LABEL, TEST_LABEL_DEFAULT); Map<String,Object> tags = new HashMap<String,Object>(); tags.put(TEST_LABEL, "TagValue"); SpanData spanData = mock(SpanData.class); when(spanData.getTags()).thenReturn(tags); assertEquals("TagValue", ...
@Override public Object value(SpanData spanData) { Object ret = spanData.getTags().get(name()); return ret == null ? defaultValue : ret; }
TagMetricLabel implements MetricLabel { @Override public Object value(SpanData spanData) { Object ret = spanData.getTags().get(name()); return ret == null ? defaultValue : ret; } }
TagMetricLabel implements MetricLabel { @Override public Object value(SpanData spanData) { Object ret = spanData.getTags().get(name()); return ret == null ? defaultValue : ret; } TagMetricLabel(String name, Object defaultValue); }
TagMetricLabel implements MetricLabel { @Override public Object value(SpanData spanData) { Object ret = spanData.getTags().get(name()); return ret == null ? defaultValue : ret; } TagMetricLabel(String name, Object defaultValue); @Override String name(); @Override Object defaultValue(); @Override Object value(SpanData s...
TagMetricLabel implements MetricLabel { @Override public Object value(SpanData spanData) { Object ret = spanData.getTags().get(name()); return ret == null ? defaultValue : ret; } TagMetricLabel(String name, Object defaultValue); @Override String name(); @Override Object defaultValue(); @Override Object value(SpanData s...
@Test public void testLabelFromTagWithNull() { MetricLabel label = new TagMetricLabel(TEST_LABEL, TEST_LABEL_DEFAULT); Map<String,Object> tags = new HashMap<String,Object>(); tags.put(TEST_LABEL, null); SpanData spanData = mock(SpanData.class); when(spanData.getTags()).thenReturn(tags); assertEquals(TEST_LABEL_DEFAULT,...
@Override public Object value(SpanData spanData) { Object ret = spanData.getTags().get(name()); return ret == null ? defaultValue : ret; }
TagMetricLabel implements MetricLabel { @Override public Object value(SpanData spanData) { Object ret = spanData.getTags().get(name()); return ret == null ? defaultValue : ret; } }
TagMetricLabel implements MetricLabel { @Override public Object value(SpanData spanData) { Object ret = spanData.getTags().get(name()); return ret == null ? defaultValue : ret; } TagMetricLabel(String name, Object defaultValue); }
TagMetricLabel implements MetricLabel { @Override public Object value(SpanData spanData) { Object ret = spanData.getTags().get(name()); return ret == null ? defaultValue : ret; } TagMetricLabel(String name, Object defaultValue); @Override String name(); @Override Object defaultValue(); @Override Object value(SpanData s...
TagMetricLabel implements MetricLabel { @Override public Object value(SpanData spanData) { Object ret = spanData.getTags().get(name()); return ret == null ? defaultValue : ret; } TagMetricLabel(String name, Object defaultValue); @Override String name(); @Override Object defaultValue(); @Override Object value(SpanData s...
@Test public void testLabelFromBaggage() { MetricLabel label = new BaggageMetricLabel(TEST_LABEL, TEST_LABEL_DEFAULT); SpanData spanData = mock(SpanData.class); when(spanData.getBaggageItem(anyString())).thenReturn("BaggageValue"); assertEquals("BaggageValue", label.value(spanData)); verify(spanData, times(1)).getBagga...
@Override public Object value(SpanData spanData) { Object ret = spanData.getBaggageItem(name()); return ret == null ? defaultValue : ret; }
BaggageMetricLabel implements MetricLabel { @Override public Object value(SpanData spanData) { Object ret = spanData.getBaggageItem(name()); return ret == null ? defaultValue : ret; } }
BaggageMetricLabel implements MetricLabel { @Override public Object value(SpanData spanData) { Object ret = spanData.getBaggageItem(name()); return ret == null ? defaultValue : ret; } BaggageMetricLabel(String name, Object defaultValue); }
BaggageMetricLabel implements MetricLabel { @Override public Object value(SpanData spanData) { Object ret = spanData.getBaggageItem(name()); return ret == null ? defaultValue : ret; } BaggageMetricLabel(String name, Object defaultValue); @Override String name(); @Override Object defaultValue(); @Override Object value(S...
BaggageMetricLabel implements MetricLabel { @Override public Object value(SpanData spanData) { Object ret = spanData.getBaggageItem(name()); return ret == null ? defaultValue : ret; } BaggageMetricLabel(String name, Object defaultValue); @Override String name(); @Override Object defaultValue(); @Override Object value(S...
@Test public void testWithSpecifiedTagValues() { AbstractMetricsReporter reporter = new AbstractMetricsReporter( Collections.<MetricLabel>emptyList()) { @Override public void reportSpan(SpanData spanData) { } }; Map<String,Object> spanTags = new HashMap<String,Object>(); spanTags.put(Tags.SPAN_KIND.getKey(), Tags.SPAN_...
protected String[] getLabelValues(SpanData spanData) { String[] values = new String[metricLabels.length]; for (int i=0; i < values.length; i++) { Object value = metricLabels[i].value(spanData); if (value == null) { return null; } values[i] = value.toString(); } return values; }
AbstractMetricsReporter implements MetricsReporter { protected String[] getLabelValues(SpanData spanData) { String[] values = new String[metricLabels.length]; for (int i=0; i < values.length; i++) { Object value = metricLabels[i].value(spanData); if (value == null) { return null; } values[i] = value.toString(); } retur...
AbstractMetricsReporter implements MetricsReporter { protected String[] getLabelValues(SpanData spanData) { String[] values = new String[metricLabels.length]; for (int i=0; i < values.length; i++) { Object value = metricLabels[i].value(spanData); if (value == null) { return null; } values[i] = value.toString(); } retur...
AbstractMetricsReporter implements MetricsReporter { protected String[] getLabelValues(SpanData spanData) { String[] values = new String[metricLabels.length]; for (int i=0; i < values.length; i++) { Object value = metricLabels[i].value(spanData); if (value == null) { return null; } values[i] = value.toString(); } retur...
AbstractMetricsReporter implements MetricsReporter { protected String[] getLabelValues(SpanData spanData) { String[] values = new String[metricLabels.length]; for (int i=0; i < values.length; i++) { Object value = metricLabels[i].value(spanData); if (value == null) { return null; } values[i] = value.toString(); } retur...
@Test public void testWithSpecifiedOverriddenTagValue() { MetricLabel errorMetricTag = new MetricLabel() { @Override public String name() { return Tags.ERROR.getKey(); } @Override public Object defaultValue() { return null; } @Override public Object value(SpanData spanData) { Object error = spanData.getTags().containsK...
protected String[] getLabelValues(SpanData spanData) { String[] values = new String[metricLabels.length]; for (int i=0; i < values.length; i++) { Object value = metricLabels[i].value(spanData); if (value == null) { return null; } values[i] = value.toString(); } return values; }
AbstractMetricsReporter implements MetricsReporter { protected String[] getLabelValues(SpanData spanData) { String[] values = new String[metricLabels.length]; for (int i=0; i < values.length; i++) { Object value = metricLabels[i].value(spanData); if (value == null) { return null; } values[i] = value.toString(); } retur...
AbstractMetricsReporter implements MetricsReporter { protected String[] getLabelValues(SpanData spanData) { String[] values = new String[metricLabels.length]; for (int i=0; i < values.length; i++) { Object value = metricLabels[i].value(spanData); if (value == null) { return null; } values[i] = value.toString(); } retur...
AbstractMetricsReporter implements MetricsReporter { protected String[] getLabelValues(SpanData spanData) { String[] values = new String[metricLabels.length]; for (int i=0; i < values.length; i++) { Object value = metricLabels[i].value(spanData); if (value == null) { return null; } values[i] = value.toString(); } retur...
AbstractMetricsReporter implements MetricsReporter { protected String[] getLabelValues(SpanData spanData) { String[] values = new String[metricLabels.length]; for (int i=0; i < values.length; i++) { Object value = metricLabels[i].value(spanData); if (value == null) { return null; } values[i] = value.toString(); } retur...
@Test public void testStandardUsage() { Map<String,Object> sysTags = new HashMap<String,Object>(); sysTags.put("service", "TestService"); MetricsReporter reporter = Mockito.mock(MetricsReporter.class); MockTracer tracer = new MockTracer(); Tracer metricsTracer = Metrics.decorate(tracer, reporter); Scope parent = metric...
public static Tracer decorate(Tracer tracer, MetricsReporter reporter) { return decorate(tracer, Collections.singleton(reporter)); }
Metrics { public static Tracer decorate(Tracer tracer, MetricsReporter reporter) { return decorate(tracer, Collections.singleton(reporter)); } }
Metrics { public static Tracer decorate(Tracer tracer, MetricsReporter reporter) { return decorate(tracer, Collections.singleton(reporter)); } }
Metrics { public static Tracer decorate(Tracer tracer, MetricsReporter reporter) { return decorate(tracer, Collections.singleton(reporter)); } static Tracer decorate(Tracer tracer, MetricsReporter reporter); static Tracer decorate(Tracer tracer, Set<MetricsReporter> reporters); }
Metrics { public static Tracer decorate(Tracer tracer, MetricsReporter reporter) { return decorate(tracer, Collections.singleton(reporter)); } static Tracer decorate(Tracer tracer, MetricsReporter reporter); static Tracer decorate(Tracer tracer, Set<MetricsReporter> reporters); }
@Test public void testWithTags() { MetricsReporter reporter = Mockito.mock(MetricsReporter.class); MockTracer tracer = new MockTracer(); Tracer metricsTracer = Metrics.decorate(tracer, reporter); Scope parent = metricsTracer.buildSpan("parent") .withTag("booleanTag", true) .withTag("numericTag", new Integer(100)) .star...
public static Tracer decorate(Tracer tracer, MetricsReporter reporter) { return decorate(tracer, Collections.singleton(reporter)); }
Metrics { public static Tracer decorate(Tracer tracer, MetricsReporter reporter) { return decorate(tracer, Collections.singleton(reporter)); } }
Metrics { public static Tracer decorate(Tracer tracer, MetricsReporter reporter) { return decorate(tracer, Collections.singleton(reporter)); } }
Metrics { public static Tracer decorate(Tracer tracer, MetricsReporter reporter) { return decorate(tracer, Collections.singleton(reporter)); } static Tracer decorate(Tracer tracer, MetricsReporter reporter); static Tracer decorate(Tracer tracer, Set<MetricsReporter> reporters); }
Metrics { public static Tracer decorate(Tracer tracer, MetricsReporter reporter) { return decorate(tracer, Collections.singleton(reporter)); } static Tracer decorate(Tracer tracer, MetricsReporter reporter); static Tracer decorate(Tracer tracer, Set<MetricsReporter> reporters); }
@Test public void testWithStartTimestamp() throws InterruptedException { MetricsReporter reporter = Mockito.mock(MetricsReporter.class); MockTracer tracer = new MockTracer(); Tracer metricsTracer = Metrics.decorate(tracer, reporter); long start = System.currentTimeMillis() * 687; Thread.sleep(100); Scope parent = metri...
public static Tracer decorate(Tracer tracer, MetricsReporter reporter) { return decorate(tracer, Collections.singleton(reporter)); }
Metrics { public static Tracer decorate(Tracer tracer, MetricsReporter reporter) { return decorate(tracer, Collections.singleton(reporter)); } }
Metrics { public static Tracer decorate(Tracer tracer, MetricsReporter reporter) { return decorate(tracer, Collections.singleton(reporter)); } }
Metrics { public static Tracer decorate(Tracer tracer, MetricsReporter reporter) { return decorate(tracer, Collections.singleton(reporter)); } static Tracer decorate(Tracer tracer, MetricsReporter reporter); static Tracer decorate(Tracer tracer, Set<MetricsReporter> reporters); }
Metrics { public static Tracer decorate(Tracer tracer, MetricsReporter reporter) { return decorate(tracer, Collections.singleton(reporter)); } static Tracer decorate(Tracer tracer, MetricsReporter reporter); static Tracer decorate(Tracer tracer, Set<MetricsReporter> reporters); }
@Test public void verifyViewEnabledStatesForEmptyState() { createNewViewAndPresenter(MODE_12HR); mPresenters[MODE_12HR].presentState(NumberPadTimePickerState.EMPTY); verifyInitialization(MODE_12HR); verify(mViews[MODE_12HR]).setOkButtonEnabled(false); createNewViewAndPresenter(MODE_24HR); mPresenters[MODE_24HR].present...
@Override public void presentState(@NonNull INumberPadTimePicker.State state) { initialize(state); if (!mIs24HourMode) { mView.setAmPmDisplayIndex(mLocaleModel.isAmPmWrittenBeforeTime() ? 0 : 1); final CharSequence amPmDisplayText; switch (state.getAmPmState()) { case AM: amPmDisplayText = mAltTexts[0]; break; case PM:...
NumberPadTimePickerPresenter implements INumberPadTimePicker.Presenter, DigitwiseTimeModel.OnInputChangeListener { @Override public void presentState(@NonNull INumberPadTimePicker.State state) { initialize(state); if (!mIs24HourMode) { mView.setAmPmDisplayIndex(mLocaleModel.isAmPmWrittenBeforeTime() ? 0 : 1); f...
NumberPadTimePickerPresenter implements INumberPadTimePicker.Presenter, DigitwiseTimeModel.OnInputChangeListener { @Override public void presentState(@NonNull INumberPadTimePicker.State state) { initialize(state); if (!mIs24HourMode) { mView.setAmPmDisplayIndex(mLocaleModel.isAmPmWrittenBeforeTime() ? 0 : 1); f...
NumberPadTimePickerPresenter implements INumberPadTimePicker.Presenter, DigitwiseTimeModel.OnInputChangeListener { @Override public void presentState(@NonNull INumberPadTimePicker.State state) { initialize(state); if (!mIs24HourMode) { mView.setAmPmDisplayIndex(mLocaleModel.isAmPmWrittenBeforeTime() ? 0 : 1); f...
NumberPadTimePickerPresenter implements INumberPadTimePicker.Presenter, DigitwiseTimeModel.OnInputChangeListener { @Override public void presentState(@NonNull INumberPadTimePicker.State state) { initialize(state); if (!mIs24HourMode) { mView.setAmPmDisplayIndex(mLocaleModel.isAmPmWrittenBeforeTime() ? 0 : 1); f...
@Test public void mode12Hr_VerifyOnTimeSetCallback() { for (int time = 100; time <= 1259; time++) { if (time % 100 > 59) { System.out.println("Skipping invalid time " + time); continue; } System.out.println("Testing time " + time); for (int amOrPm = 0; amOrPm < 2; amOrPm++) { createNewViewAndPresenter(MODE_12HR); if (t...
@Override public void onAltKeyClick(CharSequence altKeyText) { final String altKeyString = altKeyText.toString(); final int[] altDigits = mTextModel.altDigits(altKeyString); if (count() <= 2) { insertDigits(altDigits); } if (!is24HourFormat()) { mAmPmState = altKeyString.equalsIgnoreCase(mAltTexts[0]) ? AM : PM; mView....
NumberPadTimePickerPresenter implements INumberPadTimePicker.Presenter, DigitwiseTimeModel.OnInputChangeListener { @Override public void onAltKeyClick(CharSequence altKeyText) { final String altKeyString = altKeyText.toString(); final int[] altDigits = mTextModel.altDigits(altKeyString); if (count() <= 2) { ins...
NumberPadTimePickerPresenter implements INumberPadTimePicker.Presenter, DigitwiseTimeModel.OnInputChangeListener { @Override public void onAltKeyClick(CharSequence altKeyText) { final String altKeyString = altKeyText.toString(); final int[] altDigits = mTextModel.altDigits(altKeyString); if (count() <= 2) { ins...
NumberPadTimePickerPresenter implements INumberPadTimePicker.Presenter, DigitwiseTimeModel.OnInputChangeListener { @Override public void onAltKeyClick(CharSequence altKeyText) { final String altKeyString = altKeyText.toString(); final int[] altDigits = mTextModel.altDigits(altKeyString); if (count() <= 2) { ins...
NumberPadTimePickerPresenter implements INumberPadTimePicker.Presenter, DigitwiseTimeModel.OnInputChangeListener { @Override public void onAltKeyClick(CharSequence altKeyText) { final String altKeyString = altKeyText.toString(); final int[] altDigits = mTextModel.altDigits(altKeyString); if (count() <= 2) { ins...
@Test public void intercept() throws Exception { String sql = "INSERT INTO person (id, name) VALUES (1, 'KK')"; CCJSqlParserManager pm = new CCJSqlParserManager(); Insert insert = (Insert) pm.parse(new StringReader(sql)); Insert insertProxy = new InsertOrReplaceProxy().getInstance(Insert.class, insert); Table table = i...
@Override public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable { if (method.getName().equals("toString") && args.length == 0) { String sql = toString((String) proxy.invoke(realInsert, args)); return sql; } return proxy.invoke(realInsert, args); }
InsertOrReplaceProxy implements MethodInterceptor { @Override public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable { if (method.getName().equals("toString") && args.length == 0) { String sql = toString((String) proxy.invoke(realInsert, args)); return sql; } return proxy....
InsertOrReplaceProxy implements MethodInterceptor { @Override public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable { if (method.getName().equals("toString") && args.length == 0) { String sql = toString((String) proxy.invoke(realInsert, args)); return sql; } return proxy....
InsertOrReplaceProxy implements MethodInterceptor { @Override public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable { if (method.getName().equals("toString") && args.length == 0) { String sql = toString((String) proxy.invoke(realInsert, args)); return sql; } return proxy....
InsertOrReplaceProxy implements MethodInterceptor { @Override public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable { if (method.getName().equals("toString") && args.length == 0) { String sql = toString((String) proxy.invoke(realInsert, args)); return sql; } return proxy....
@Test public void getString() throws Exception { Assert.assertEquals("KBUnitTest", resources.getString(R.string.test_string)); }
public String getString(@StringRes int id) throws NotFoundException { return getText(id).toString(); }
ShadowResources { public String getString(@StringRes int id) throws NotFoundException { return getText(id).toString(); } }
ShadowResources { public String getString(@StringRes int id) throws NotFoundException { return getText(id).toString(); } ShadowResources(); }
ShadowResources { public String getString(@StringRes int id) throws NotFoundException { return getText(id).toString(); } ShadowResources(); String getString(@StringRes int id); @NonNull String[] getStringArray(@ArrayRes int id); @NonNull int[] getIntArray(@ArrayRes int id); String getPackageName(); }
ShadowResources { public String getString(@StringRes int id) throws NotFoundException { return getText(id).toString(); } ShadowResources(); String getString(@StringRes int id); @NonNull String[] getStringArray(@ArrayRes int id); @NonNull int[] getIntArray(@ArrayRes int id); String getPackageName(); }
@Test public void getStringArray() throws Exception { String[] array = resources.getStringArray(R.array.arrayName); Assert.assertEquals("item0", array[0]); Assert.assertEquals("item1", array[1]); }
@NonNull public String[] getStringArray(@ArrayRes int id) throws NotFoundException { Map<Integer, String> idNameMap = getArrayIdTable(); Map<String, List<String>> stringArrayMap = getResourceStringArrayMap(); if (idNameMap.containsKey(id)) { String name = idNameMap.get(id); if (stringArrayMap.containsKey(name)) { List<...
ShadowResources { @NonNull public String[] getStringArray(@ArrayRes int id) throws NotFoundException { Map<Integer, String> idNameMap = getArrayIdTable(); Map<String, List<String>> stringArrayMap = getResourceStringArrayMap(); if (idNameMap.containsKey(id)) { String name = idNameMap.get(id); if (stringArrayMap.contains...
ShadowResources { @NonNull public String[] getStringArray(@ArrayRes int id) throws NotFoundException { Map<Integer, String> idNameMap = getArrayIdTable(); Map<String, List<String>> stringArrayMap = getResourceStringArrayMap(); if (idNameMap.containsKey(id)) { String name = idNameMap.get(id); if (stringArrayMap.contains...
ShadowResources { @NonNull public String[] getStringArray(@ArrayRes int id) throws NotFoundException { Map<Integer, String> idNameMap = getArrayIdTable(); Map<String, List<String>> stringArrayMap = getResourceStringArrayMap(); if (idNameMap.containsKey(id)) { String name = idNameMap.get(id); if (stringArrayMap.contains...
ShadowResources { @NonNull public String[] getStringArray(@ArrayRes int id) throws NotFoundException { Map<Integer, String> idNameMap = getArrayIdTable(); Map<String, List<String>> stringArrayMap = getResourceStringArrayMap(); if (idNameMap.containsKey(id)) { String name = idNameMap.get(id); if (stringArrayMap.contains...
@Test public void getIntArray() { int[] intArray = resources.getIntArray(R.array.intArray); Assert.assertEquals(0, intArray[0]); Assert.assertEquals(1, intArray[1]); int[] intArrayNoItem = resources.getIntArray(R.array.intArrayNoItem); Assert.assertEquals(0, intArrayNoItem.length); }
@NonNull public int[] getIntArray(@ArrayRes int id) throws NotFoundException { Map<Integer, String> idNameMap = getArrayIdTable(); Map<String, List<Integer>> intArrayMap = getResourceIntArrayMap(); if (idNameMap.containsKey(id)) { String name = idNameMap.get(id); if (intArrayMap.containsKey(name)) { List<Integer> intLi...
ShadowResources { @NonNull public int[] getIntArray(@ArrayRes int id) throws NotFoundException { Map<Integer, String> idNameMap = getArrayIdTable(); Map<String, List<Integer>> intArrayMap = getResourceIntArrayMap(); if (idNameMap.containsKey(id)) { String name = idNameMap.get(id); if (intArrayMap.containsKey(name)) { L...
ShadowResources { @NonNull public int[] getIntArray(@ArrayRes int id) throws NotFoundException { Map<Integer, String> idNameMap = getArrayIdTable(); Map<String, List<Integer>> intArrayMap = getResourceIntArrayMap(); if (idNameMap.containsKey(id)) { String name = idNameMap.get(id); if (intArrayMap.containsKey(name)) { L...
ShadowResources { @NonNull public int[] getIntArray(@ArrayRes int id) throws NotFoundException { Map<Integer, String> idNameMap = getArrayIdTable(); Map<String, List<Integer>> intArrayMap = getResourceIntArrayMap(); if (idNameMap.containsKey(id)) { String name = idNameMap.get(id); if (intArrayMap.containsKey(name)) { L...
ShadowResources { @NonNull public int[] getIntArray(@ArrayRes int id) throws NotFoundException { Map<Integer, String> idNameMap = getArrayIdTable(); Map<String, List<Integer>> intArrayMap = getResourceIntArrayMap(); if (idNameMap.containsKey(id)) { String name = idNameMap.get(id); if (intArrayMap.containsKey(name)) { L...
@Test public void getPackageName() throws Exception { Assert.assertEquals("net.kb.test.library", resources.getPackageName()); }
public String getPackageName() { if (!TextUtils.isEmpty(mPackageName)) { return mPackageName; } String manifestPath = "build/intermediates/bundles/debug/AndroidManifest.xml"; if (!new File(manifestPath).exists()) { manifestPath = "build/intermediates/bundles/release/AndroidManifest.xml"; } FileReader reader = new FileR...
ShadowResources { public String getPackageName() { if (!TextUtils.isEmpty(mPackageName)) { return mPackageName; } String manifestPath = "build/intermediates/bundles/debug/AndroidManifest.xml"; if (!new File(manifestPath).exists()) { manifestPath = "build/intermediates/bundles/release/AndroidManifest.xml"; } FileReader ...
ShadowResources { public String getPackageName() { if (!TextUtils.isEmpty(mPackageName)) { return mPackageName; } String manifestPath = "build/intermediates/bundles/debug/AndroidManifest.xml"; if (!new File(manifestPath).exists()) { manifestPath = "build/intermediates/bundles/release/AndroidManifest.xml"; } FileReader ...
ShadowResources { public String getPackageName() { if (!TextUtils.isEmpty(mPackageName)) { return mPackageName; } String manifestPath = "build/intermediates/bundles/debug/AndroidManifest.xml"; if (!new File(manifestPath).exists()) { manifestPath = "build/intermediates/bundles/release/AndroidManifest.xml"; } FileReader ...
ShadowResources { public String getPackageName() { if (!TextUtils.isEmpty(mPackageName)) { return mPackageName; } String manifestPath = "build/intermediates/bundles/debug/AndroidManifest.xml"; if (!new File(manifestPath).exists()) { manifestPath = "build/intermediates/bundles/release/AndroidManifest.xml"; } FileReader ...
@Test public void parse() throws Exception { String sql = "INSERT or replace INTO person (id, name) VALUES (?, ?)"; Insert insert = (Insert) new KbSqlParserManager().parse(sql); Assert.assertEquals("INSERT OR REPLACE INTO person (id, name) VALUES (?, ?)", insert.toString()); }
public Statement parse(String sql) throws JSQLParserException { sql = sql.trim(); boolean isInsertOrReplace = false; if (sql.toUpperCase().startsWith("INSERT OR REPLACE")) { isInsertOrReplace = true; String[] sqlParts = new String[2]; sqlParts[0] = sql.substring(0, "INSERT OR REPLACE".length()); sqlParts[1] = sql.subst...
KbSqlParserManager { public Statement parse(String sql) throws JSQLParserException { sql = sql.trim(); boolean isInsertOrReplace = false; if (sql.toUpperCase().startsWith("INSERT OR REPLACE")) { isInsertOrReplace = true; String[] sqlParts = new String[2]; sqlParts[0] = sql.substring(0, "INSERT OR REPLACE".length()); sq...
KbSqlParserManager { public Statement parse(String sql) throws JSQLParserException { sql = sql.trim(); boolean isInsertOrReplace = false; if (sql.toUpperCase().startsWith("INSERT OR REPLACE")) { isInsertOrReplace = true; String[] sqlParts = new String[2]; sqlParts[0] = sql.substring(0, "INSERT OR REPLACE".length()); sq...
KbSqlParserManager { public Statement parse(String sql) throws JSQLParserException { sql = sql.trim(); boolean isInsertOrReplace = false; if (sql.toUpperCase().startsWith("INSERT OR REPLACE")) { isInsertOrReplace = true; String[] sqlParts = new String[2]; sqlParts[0] = sql.substring(0, "INSERT OR REPLACE".length()); sq...
KbSqlParserManager { public Statement parse(String sql) throws JSQLParserException { sql = sql.trim(); boolean isInsertOrReplace = false; if (sql.toUpperCase().startsWith("INSERT OR REPLACE")) { isInsertOrReplace = true; String[] sqlParts = new String[2]; sqlParts[0] = sql.substring(0, "INSERT OR REPLACE".length()); sq...
@Test public void getString() throws Exception { List<String> columns = Arrays.asList("first", "second", "third"); List<Object> datas = Arrays.asList("test", null, new Object()); ShadowCursor cursor = new ShadowCursor(columns, Arrays.asList(datas)); cursor.moveToNext(); Assert.assertEquals("test", cursor.getString(0));...
@Override public String getString(int columnIndex) { Object obj = getObject(columnIndex); return obj == null ? null : obj.toString(); }
ShadowCursor implements Cursor { @Override public String getString(int columnIndex) { Object obj = getObject(columnIndex); return obj == null ? null : obj.toString(); } }
ShadowCursor implements Cursor { @Override public String getString(int columnIndex) { Object obj = getObject(columnIndex); return obj == null ? null : obj.toString(); } ShadowCursor(List<String> columns, List<List<Object>> datas); }
ShadowCursor implements Cursor { @Override public String getString(int columnIndex) { Object obj = getObject(columnIndex); return obj == null ? null : obj.toString(); } ShadowCursor(List<String> columns, List<List<Object>> datas); @Override int getCount(); @Override int getPosition(); @Override boolean move(int offset)...
ShadowCursor implements Cursor { @Override public String getString(int columnIndex) { Object obj = getObject(columnIndex); return obj == null ? null : obj.toString(); } ShadowCursor(List<String> columns, List<List<Object>> datas); @Override int getCount(); @Override int getPosition(); @Override boolean move(int offset)...
@Test public void bindSelectArgs() throws Exception { Object[] args = new Object[]{1, 10, 20, "test"}; String sql = "select * from person where id=? and (uid BETWEEN ? and ?) and test LIKE ? order by id"; String boundSql = KbSqlParser.bindArgs(sql, args); System.out.println(boundSql); Assert.assertEquals("SELECT * FROM...
public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } bindArgs = replaceBoolean(bindArgs); try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expression> expressionS...
KbSqlParser { public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } bindArgs = replaceBoolean(bindArgs); try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expressio...
KbSqlParser { public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } bindArgs = replaceBoolean(bindArgs); try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expressio...
KbSqlParser { public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } bindArgs = replaceBoolean(bindArgs); try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expressio...
KbSqlParser { public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } bindArgs = replaceBoolean(bindArgs); try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expressio...
@Test public void bindInsertArgs() { Object[] args = new Object[]{1, "kk"}; String sql = "INSERT INTO person (id, name) VALUES (?, ?)"; String boundSql = KbSqlParser.bindArgs(sql, args); Assert.assertEquals("INSERT INTO person (id, name) VALUES (1, 'kk')", boundSql); }
public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } bindArgs = replaceBoolean(bindArgs); try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expression> expressionS...
KbSqlParser { public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } bindArgs = replaceBoolean(bindArgs); try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expressio...
KbSqlParser { public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } bindArgs = replaceBoolean(bindArgs); try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expressio...
KbSqlParser { public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } bindArgs = replaceBoolean(bindArgs); try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expressio...
KbSqlParser { public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } bindArgs = replaceBoolean(bindArgs); try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expressio...
@Test public void bindDeleteArgs() { Object[] args = new Object[]{1}; String sql = "DELETE FROM person WHERE id = ?"; String boundSql = KbSqlParser.bindArgs(sql, args); Assert.assertEquals("DELETE FROM person WHERE id = 1", boundSql); }
public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } bindArgs = replaceBoolean(bindArgs); try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expression> expressionS...
KbSqlParser { public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } bindArgs = replaceBoolean(bindArgs); try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expressio...
KbSqlParser { public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } bindArgs = replaceBoolean(bindArgs); try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expressio...
KbSqlParser { public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } bindArgs = replaceBoolean(bindArgs); try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expressio...
KbSqlParser { public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } bindArgs = replaceBoolean(bindArgs); try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expressio...
@Test public void bindUpdateArgs() { Object[] args = new Object[]{"kk", 1}; String sql = "UPDATE person SET name = ? WHERE id = ?"; String boundSql = KbSqlParser.bindArgs(sql, args); Assert.assertEquals("UPDATE person SET name = 'kk' WHERE id = 1", boundSql); }
public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } bindArgs = replaceBoolean(bindArgs); try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expression> expressionS...
KbSqlParser { public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } bindArgs = replaceBoolean(bindArgs); try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expressio...
KbSqlParser { public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } bindArgs = replaceBoolean(bindArgs); try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expressio...
KbSqlParser { public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } bindArgs = replaceBoolean(bindArgs); try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expressio...
KbSqlParser { public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } bindArgs = replaceBoolean(bindArgs); try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expressio...
@Test public void getBindArgsCount() throws Exception { String sql0 = "select * from person where id=? and (uid BETWEEN ? and ?) and test LIKE ? order by id"; String sql1 = "INSERT INTO person (id, name) VALUES (?, ?)"; String sql2 = "DELETE FROM person WHERE id in (?,?)"; String sql3 = "UPDATE person SET name = ? WHER...
protected static int getBindArgsCount(String sql) { Set<Expression> expressionSet = findBindArgsExpressions(sql); int count = 0; for (Expression expression : expressionSet) { count += getBindArgsCount(expression); } return count; }
KbSqlParser { protected static int getBindArgsCount(String sql) { Set<Expression> expressionSet = findBindArgsExpressions(sql); int count = 0; for (Expression expression : expressionSet) { count += getBindArgsCount(expression); } return count; } }
KbSqlParser { protected static int getBindArgsCount(String sql) { Set<Expression> expressionSet = findBindArgsExpressions(sql); int count = 0; for (Expression expression : expressionSet) { count += getBindArgsCount(expression); } return count; } }
KbSqlParser { protected static int getBindArgsCount(String sql) { Set<Expression> expressionSet = findBindArgsExpressions(sql); int count = 0; for (Expression expression : expressionSet) { count += getBindArgsCount(expression); } return count; } static String bindArgs(String sql, @Nullable Object[] bindArgs); static O...
KbSqlParser { protected static int getBindArgsCount(String sql) { Set<Expression> expressionSet = findBindArgsExpressions(sql); int count = 0; for (Expression expression : expressionSet) { count += getBindArgsCount(expression); } return count; } static String bindArgs(String sql, @Nullable Object[] bindArgs); static O...
@Test public void findJdbcParamExpressions() throws Exception { String sql = "DELETE FROM person WHERE id = ?"; Set<Expression> expressionSet = KbSqlParser.findBindArgsExpressions(sql); System.out.println(); }
protected static Set<Expression> findBindArgsExpressions(String sql) { if (sql == null || sql.startsWith("PRAGMA") || !sql.contains("?")) { return new LinkedHashSet<>(); } KbSqlParserManager pm = new KbSqlParserManager(); try { Statement statement = pm.parse(sql); Set<Expression> expressionSet = findBindArgsExpressions...
KbSqlParser { protected static Set<Expression> findBindArgsExpressions(String sql) { if (sql == null || sql.startsWith("PRAGMA") || !sql.contains("?")) { return new LinkedHashSet<>(); } KbSqlParserManager pm = new KbSqlParserManager(); try { Statement statement = pm.parse(sql); Set<Expression> expressionSet = findBindA...
KbSqlParser { protected static Set<Expression> findBindArgsExpressions(String sql) { if (sql == null || sql.startsWith("PRAGMA") || !sql.contains("?")) { return new LinkedHashSet<>(); } KbSqlParserManager pm = new KbSqlParserManager(); try { Statement statement = pm.parse(sql); Set<Expression> expressionSet = findBindA...
KbSqlParser { protected static Set<Expression> findBindArgsExpressions(String sql) { if (sql == null || sql.startsWith("PRAGMA") || !sql.contains("?")) { return new LinkedHashSet<>(); } KbSqlParserManager pm = new KbSqlParserManager(); try { Statement statement = pm.parse(sql); Set<Expression> expressionSet = findBindA...
KbSqlParser { protected static Set<Expression> findBindArgsExpressions(String sql) { if (sql == null || sql.startsWith("PRAGMA") || !sql.contains("?")) { return new LinkedHashSet<>(); } KbSqlParserManager pm = new KbSqlParserManager(); try { Statement statement = pm.parse(sql); Set<Expression> expressionSet = findBindA...
@Test public void deleteAllTempDir() throws Exception { ShadowContext.deleteAllTempDir(); }
public static void deleteAllTempDir() { FileUtils.deletePath(DB_PATH); FileUtils.deletePath(DATA_DIR); FileUtils.deletePath(EXT_DIR); }
ShadowContext implements Shadow { public static void deleteAllTempDir() { FileUtils.deletePath(DB_PATH); FileUtils.deletePath(DATA_DIR); FileUtils.deletePath(EXT_DIR); } }
ShadowContext implements Shadow { public static void deleteAllTempDir() { FileUtils.deletePath(DB_PATH); FileUtils.deletePath(DATA_DIR); FileUtils.deletePath(EXT_DIR); } ShadowContext(Resources resources); }
ShadowContext implements Shadow { public static void deleteAllTempDir() { FileUtils.deletePath(DB_PATH); FileUtils.deletePath(DATA_DIR); FileUtils.deletePath(EXT_DIR); } ShadowContext(Resources resources); @NonNull final String getString(@StringRes int resId); Resources getResources(); SharedPreferences getSharedPrefer...
ShadowContext implements Shadow { public static void deleteAllTempDir() { FileUtils.deletePath(DB_PATH); FileUtils.deletePath(DATA_DIR); FileUtils.deletePath(EXT_DIR); } ShadowContext(Resources resources); @NonNull final String getString(@StringRes int resId); Resources getResources(); SharedPreferences getSharedPrefer...
@Test public void testRun() { context.checking( new Expectations() { { exactly(3).of(control).createDatabaseName("test"); will(returnValue("bbb")); } }); new NoOpWorkflowClientFactoryImpl().getClient("test").run(); }
@Override public void run() { System.out.println("Run called"); run(0); }
NoOpWorkflowImpl implements NoOpWorkflow { @Override public void run() { System.out.println("Run called"); run(0); } }
NoOpWorkflowImpl implements NoOpWorkflow { @Override public void run() { System.out.println("Run called"); run(0); } }
NoOpWorkflowImpl implements NoOpWorkflow { @Override public void run() { System.out.println("Run called"); run(0); } @Override void run(); }
NoOpWorkflowImpl implements NoOpWorkflow { @Override public void run() { System.out.println("Run called"); run(0); } @Override void run(); }
@Test public void testRun() { final Identity identity = Identity.of("a", "b", "c"); WorkerOptions workerOptions = new WorkerOptions(); RunJobRequest request = new RunJobRequest(); request.setWorkerOptions(workerOptions); final Job job = new CommandLineJob(); request.setIdentity(identity); request.setJob(job); final Cre...
@Override public void executeCommand(final RunJobRequest request) { this.request = request; this.workflowId = contextProvider .getDecisionContext() .getWorkflowContext() .getWorkflowExecution() .getWorkflowId(); final String masterRoleName = "dm-master-role-" + workflowId; final String agentProfileName = "dm-profile-" ...
JobWorkflowImpl implements JobWorkflow { @Override public void executeCommand(final RunJobRequest request) { this.request = request; this.workflowId = contextProvider .getDecisionContext() .getWorkflowContext() .getWorkflowExecution() .getWorkflowId(); final String masterRoleName = "dm-master-role-" + workflowId; final...
JobWorkflowImpl implements JobWorkflow { @Override public void executeCommand(final RunJobRequest request) { this.request = request; this.workflowId = contextProvider .getDecisionContext() .getWorkflowContext() .getWorkflowExecution() .getWorkflowId(); final String masterRoleName = "dm-master-role-" + workflowId; final...
JobWorkflowImpl implements JobWorkflow { @Override public void executeCommand(final RunJobRequest request) { this.request = request; this.workflowId = contextProvider .getDecisionContext() .getWorkflowContext() .getWorkflowExecution() .getWorkflowId(); final String masterRoleName = "dm-master-role-" + workflowId; final...
JobWorkflowImpl implements JobWorkflow { @Override public void executeCommand(final RunJobRequest request) { this.request = request; this.workflowId = contextProvider .getDecisionContext() .getWorkflowContext() .getWorkflowExecution() .getWorkflowId(); final String masterRoleName = "dm-master-role-" + workflowId; final...
@Test public void testReplaceQueryParam() { URI uri = new UriBuilderImpl().path("http: assertEquals("http: }
@Override public UriBuilder replaceQueryParam(String name, Object... values) { checkSsp(); if (queryParams == null) { queryParams = UriComponent.decodeQuery(query.toString(), false); query.setLength(0); } name = encode(name, UriComponent.Type.QUERY_PARAM); queryParams.remove(name); if (values == null) { return this; } ...
UriBuilderImpl extends UriBuilder { @Override public UriBuilder replaceQueryParam(String name, Object... values) { checkSsp(); if (queryParams == null) { queryParams = UriComponent.decodeQuery(query.toString(), false); query.setLength(0); } name = encode(name, UriComponent.Type.QUERY_PARAM); queryParams.remove(name); i...
UriBuilderImpl extends UriBuilder { @Override public UriBuilder replaceQueryParam(String name, Object... values) { checkSsp(); if (queryParams == null) { queryParams = UriComponent.decodeQuery(query.toString(), false); query.setLength(0); } name = encode(name, UriComponent.Type.QUERY_PARAM); queryParams.remove(name); i...
UriBuilderImpl extends UriBuilder { @Override public UriBuilder replaceQueryParam(String name, Object... values) { checkSsp(); if (queryParams == null) { queryParams = UriComponent.decodeQuery(query.toString(), false); query.setLength(0); } name = encode(name, UriComponent.Type.QUERY_PARAM); queryParams.remove(name); i...
UriBuilderImpl extends UriBuilder { @Override public UriBuilder replaceQueryParam(String name, Object... values) { checkSsp(); if (queryParams == null) { queryParams = UriComponent.decodeQuery(query.toString(), false); query.setLength(0); } name = encode(name, UriComponent.Type.QUERY_PARAM); queryParams.remove(name); i...
@Test public void testHello() throws FileNotFoundException { demoAO.hello("抠逼阵儿"); }
public void hello(String name) throws FileNotFoundException { System.out.println(demoService.sayHello(name)); }
DemoAO { public void hello(String name) throws FileNotFoundException { System.out.println(demoService.sayHello(name)); } }
DemoAO { public void hello(String name) throws FileNotFoundException { System.out.println(demoService.sayHello(name)); } }
DemoAO { public void hello(String name) throws FileNotFoundException { System.out.println(demoService.sayHello(name)); } void hello(String name); }
DemoAO { public void hello(String name) throws FileNotFoundException { System.out.println(demoService.sayHello(name)); } void hello(String name); }
@Test public void testParseStackFrameWithMethod() { final StackFrame frame = StackTraceHelper.convertJsStackTrace( "render@Test.bundle:1:2000")[0]; assertThat(frame.getMethod()).isEqualTo("render"); assertThat(frame.getFileName()).isEqualTo("Test.bundle"); assertThat(frame.getLine()).isEqualTo(1); assertThat(frame.getC...
public static StackFrame[] convertJsStackTrace(@Nullable ReadableArray stack) { int size = stack != null ? stack.size() : 0; StackFrame[] result = new StackFrame[size]; for (int i = 0; i < size; i++) { ReadableMap frame = stack.getMap(i); String methodName = frame.getString("methodName"); String fileName = frame.getStr...
StackTraceHelper { public static StackFrame[] convertJsStackTrace(@Nullable ReadableArray stack) { int size = stack != null ? stack.size() : 0; StackFrame[] result = new StackFrame[size]; for (int i = 0; i < size; i++) { ReadableMap frame = stack.getMap(i); String methodName = frame.getString("methodName"); String file...
StackTraceHelper { public static StackFrame[] convertJsStackTrace(@Nullable ReadableArray stack) { int size = stack != null ? stack.size() : 0; StackFrame[] result = new StackFrame[size]; for (int i = 0; i < size; i++) { ReadableMap frame = stack.getMap(i); String methodName = frame.getString("methodName"); String file...
StackTraceHelper { public static StackFrame[] convertJsStackTrace(@Nullable ReadableArray stack) { int size = stack != null ? stack.size() : 0; StackFrame[] result = new StackFrame[size]; for (int i = 0; i < size; i++) { ReadableMap frame = stack.getMap(i); String methodName = frame.getString("methodName"); String file...
StackTraceHelper { public static StackFrame[] convertJsStackTrace(@Nullable ReadableArray stack) { int size = stack != null ? stack.size() : 0; StackFrame[] result = new StackFrame[size]; for (int i = 0; i < size; i++) { ReadableMap frame = stack.getMap(i); String methodName = frame.getString("methodName"); String file...
@Test public void testParseStackFrameWithoutMethod() { final StackFrame frame = StackTraceHelper.convertJsStackTrace( "Test.bundle:1:2000")[0]; assertThat(frame.getMethod()).isEqualTo("(unknown)"); assertThat(frame.getFileName()).isEqualTo("Test.bundle"); assertThat(frame.getLine()).isEqualTo(1); assertThat(frame.getCo...
public static StackFrame[] convertJsStackTrace(@Nullable ReadableArray stack) { int size = stack != null ? stack.size() : 0; StackFrame[] result = new StackFrame[size]; for (int i = 0; i < size; i++) { ReadableMap frame = stack.getMap(i); String methodName = frame.getString("methodName"); String fileName = frame.getStr...
StackTraceHelper { public static StackFrame[] convertJsStackTrace(@Nullable ReadableArray stack) { int size = stack != null ? stack.size() : 0; StackFrame[] result = new StackFrame[size]; for (int i = 0; i < size; i++) { ReadableMap frame = stack.getMap(i); String methodName = frame.getString("methodName"); String file...
StackTraceHelper { public static StackFrame[] convertJsStackTrace(@Nullable ReadableArray stack) { int size = stack != null ? stack.size() : 0; StackFrame[] result = new StackFrame[size]; for (int i = 0; i < size; i++) { ReadableMap frame = stack.getMap(i); String methodName = frame.getString("methodName"); String file...
StackTraceHelper { public static StackFrame[] convertJsStackTrace(@Nullable ReadableArray stack) { int size = stack != null ? stack.size() : 0; StackFrame[] result = new StackFrame[size]; for (int i = 0; i < size; i++) { ReadableMap frame = stack.getMap(i); String methodName = frame.getString("methodName"); String file...
StackTraceHelper { public static StackFrame[] convertJsStackTrace(@Nullable ReadableArray stack) { int size = stack != null ? stack.size() : 0; StackFrame[] result = new StackFrame[size]; for (int i = 0; i < size; i++) { ReadableMap frame = stack.getMap(i); String methodName = frame.getString("methodName"); String file...
@Test public void testParseStackFrameWithInvalidFrame() { try { StackTraceHelper.convertJsStackTrace("Test.bundle:ten:twenty"); failBecauseExceptionWasNotThrown(IllegalArgumentException.class); } catch (Exception e) { assertThat(e).isInstanceOf(IllegalArgumentException.class); } }
public static StackFrame[] convertJsStackTrace(@Nullable ReadableArray stack) { int size = stack != null ? stack.size() : 0; StackFrame[] result = new StackFrame[size]; for (int i = 0; i < size; i++) { ReadableMap frame = stack.getMap(i); String methodName = frame.getString("methodName"); String fileName = frame.getStr...
StackTraceHelper { public static StackFrame[] convertJsStackTrace(@Nullable ReadableArray stack) { int size = stack != null ? stack.size() : 0; StackFrame[] result = new StackFrame[size]; for (int i = 0; i < size; i++) { ReadableMap frame = stack.getMap(i); String methodName = frame.getString("methodName"); String file...
StackTraceHelper { public static StackFrame[] convertJsStackTrace(@Nullable ReadableArray stack) { int size = stack != null ? stack.size() : 0; StackFrame[] result = new StackFrame[size]; for (int i = 0; i < size; i++) { ReadableMap frame = stack.getMap(i); String methodName = frame.getString("methodName"); String file...
StackTraceHelper { public static StackFrame[] convertJsStackTrace(@Nullable ReadableArray stack) { int size = stack != null ? stack.size() : 0; StackFrame[] result = new StackFrame[size]; for (int i = 0; i < size; i++) { ReadableMap frame = stack.getMap(i); String methodName = frame.getString("methodName"); String file...
StackTraceHelper { public static StackFrame[] convertJsStackTrace(@Nullable ReadableArray stack) { int size = stack != null ? stack.size() : 0; StackFrame[] result = new StackFrame[size]; for (int i = 0; i < size; i++) { ReadableMap frame = stack.getMap(i); String methodName = frame.getString("methodName"); String file...
@Test public void testSimpleCase() throws IOException { ByteString response = ByteString.encodeUtf8( "preable, should be ignored\r\n" + "--sample_boundary\r\n" + "Content-Type: application/json; charset=utf-8\r\n" + "Content-Length: 2\r\n\r\n" + "{}\r\n" + "--sample_boundary--\r\n" + "epilogue, should be ignored"); Buf...
public boolean readAllParts(ChunkCallback callback) throws IOException { ByteString delimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + CRLF); ByteString closeDelimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + "--" + CRLF); int bufferLen = 4 * 1024; long chunkStart = 0; long bytesSeen = 0; Buffer conte...
MultipartStreamReader { public boolean readAllParts(ChunkCallback callback) throws IOException { ByteString delimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + CRLF); ByteString closeDelimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + "--" + CRLF); int bufferLen = 4 * 1024; long chunkStart = 0; long byt...
MultipartStreamReader { public boolean readAllParts(ChunkCallback callback) throws IOException { ByteString delimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + CRLF); ByteString closeDelimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + "--" + CRLF); int bufferLen = 4 * 1024; long chunkStart = 0; long byt...
MultipartStreamReader { public boolean readAllParts(ChunkCallback callback) throws IOException { ByteString delimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + CRLF); ByteString closeDelimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + "--" + CRLF); int bufferLen = 4 * 1024; long chunkStart = 0; long byt...
MultipartStreamReader { public boolean readAllParts(ChunkCallback callback) throws IOException { ByteString delimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + CRLF); ByteString closeDelimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + "--" + CRLF); int bufferLen = 4 * 1024; long chunkStart = 0; long byt...
@Test public void testMultipleParts() throws IOException { ByteString response = ByteString.encodeUtf8( "preable, should be ignored\r\n" + "--sample_boundary\r\n" + "1\r\n" + "--sample_boundary\r\n" + "2\r\n" + "--sample_boundary\r\n" + "3\r\n" + "--sample_boundary--\r\n" + "epilogue, should be ignored"); Buffer source...
public boolean readAllParts(ChunkCallback callback) throws IOException { ByteString delimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + CRLF); ByteString closeDelimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + "--" + CRLF); int bufferLen = 4 * 1024; long chunkStart = 0; long bytesSeen = 0; Buffer conte...
MultipartStreamReader { public boolean readAllParts(ChunkCallback callback) throws IOException { ByteString delimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + CRLF); ByteString closeDelimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + "--" + CRLF); int bufferLen = 4 * 1024; long chunkStart = 0; long byt...
MultipartStreamReader { public boolean readAllParts(ChunkCallback callback) throws IOException { ByteString delimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + CRLF); ByteString closeDelimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + "--" + CRLF); int bufferLen = 4 * 1024; long chunkStart = 0; long byt...
MultipartStreamReader { public boolean readAllParts(ChunkCallback callback) throws IOException { ByteString delimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + CRLF); ByteString closeDelimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + "--" + CRLF); int bufferLen = 4 * 1024; long chunkStart = 0; long byt...
MultipartStreamReader { public boolean readAllParts(ChunkCallback callback) throws IOException { ByteString delimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + CRLF); ByteString closeDelimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + "--" + CRLF); int bufferLen = 4 * 1024; long chunkStart = 0; long byt...
@Test public void testNoDelimiter() throws IOException { ByteString response = ByteString.encodeUtf8("Yolo"); Buffer source = new Buffer(); source.write(response); MultipartStreamReader reader = new MultipartStreamReader(source, "sample_boundary"); CallCountTrackingChunkCallback callback = new CallCountTrackingChunkCal...
public boolean readAllParts(ChunkCallback callback) throws IOException { ByteString delimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + CRLF); ByteString closeDelimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + "--" + CRLF); int bufferLen = 4 * 1024; long chunkStart = 0; long bytesSeen = 0; Buffer conte...
MultipartStreamReader { public boolean readAllParts(ChunkCallback callback) throws IOException { ByteString delimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + CRLF); ByteString closeDelimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + "--" + CRLF); int bufferLen = 4 * 1024; long chunkStart = 0; long byt...
MultipartStreamReader { public boolean readAllParts(ChunkCallback callback) throws IOException { ByteString delimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + CRLF); ByteString closeDelimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + "--" + CRLF); int bufferLen = 4 * 1024; long chunkStart = 0; long byt...
MultipartStreamReader { public boolean readAllParts(ChunkCallback callback) throws IOException { ByteString delimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + CRLF); ByteString closeDelimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + "--" + CRLF); int bufferLen = 4 * 1024; long chunkStart = 0; long byt...
MultipartStreamReader { public boolean readAllParts(ChunkCallback callback) throws IOException { ByteString delimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + CRLF); ByteString closeDelimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + "--" + CRLF); int bufferLen = 4 * 1024; long chunkStart = 0; long byt...
@Test public void testNoCloseDelimiter() throws IOException { ByteString response = ByteString.encodeUtf8( "preable, should be ignored\r\n" + "--sample_boundary\r\n" + "Content-Type: application/json; charset=utf-8\r\n" + "Content-Length: 2\r\n\r\n" + "{}\r\n" + "--sample_boundary\r\n" + "incomplete message..."); Buffe...
public boolean readAllParts(ChunkCallback callback) throws IOException { ByteString delimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + CRLF); ByteString closeDelimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + "--" + CRLF); int bufferLen = 4 * 1024; long chunkStart = 0; long bytesSeen = 0; Buffer conte...
MultipartStreamReader { public boolean readAllParts(ChunkCallback callback) throws IOException { ByteString delimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + CRLF); ByteString closeDelimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + "--" + CRLF); int bufferLen = 4 * 1024; long chunkStart = 0; long byt...
MultipartStreamReader { public boolean readAllParts(ChunkCallback callback) throws IOException { ByteString delimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + CRLF); ByteString closeDelimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + "--" + CRLF); int bufferLen = 4 * 1024; long chunkStart = 0; long byt...
MultipartStreamReader { public boolean readAllParts(ChunkCallback callback) throws IOException { ByteString delimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + CRLF); ByteString closeDelimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + "--" + CRLF); int bufferLen = 4 * 1024; long chunkStart = 0; long byt...
MultipartStreamReader { public boolean readAllParts(ChunkCallback callback) throws IOException { ByteString delimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + CRLF); ByteString closeDelimiter = ByteString.encodeUtf8(CRLF + "--" + mBoundary + "--" + CRLF); int bufferLen = 4 * 1024; long chunkStart = 0; long byt...
@Test public void testSetString() { mClipboardModule.setString(TEST_CONTENT); assertTrue(mClipboardManager.getText().equals(TEST_CONTENT)); mClipboardModule.setString(null); assertFalse(mClipboardManager.hasText()); mClipboardModule.setString(""); assertFalse(mClipboardManager.hasText()); mClipboardModule.setString(" "...
@SuppressLint("DeprecatedMethod") @ReactMethod public void setString(String text) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { ClipData clipdata = ClipData.newPlainText(null, text); ClipboardManager clipboard = getClipboardService(); clipboard.setPrimaryClip(clipdata); } else { ClipboardManager clipb...
ClipboardModule extends ContextBaseJavaModule { @SuppressLint("DeprecatedMethod") @ReactMethod public void setString(String text) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { ClipData clipdata = ClipData.newPlainText(null, text); ClipboardManager clipboard = getClipboardService(); clipboard.setPrimar...
ClipboardModule extends ContextBaseJavaModule { @SuppressLint("DeprecatedMethod") @ReactMethod public void setString(String text) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { ClipData clipdata = ClipData.newPlainText(null, text); ClipboardManager clipboard = getClipboardService(); clipboard.setPrimar...
ClipboardModule extends ContextBaseJavaModule { @SuppressLint("DeprecatedMethod") @ReactMethod public void setString(String text) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { ClipData clipdata = ClipData.newPlainText(null, text); ClipboardManager clipboard = getClipboardService(); clipboard.setPrimar...
ClipboardModule extends ContextBaseJavaModule { @SuppressLint("DeprecatedMethod") @ReactMethod public void setString(String text) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { ClipData clipdata = ClipData.newPlainText(null, text); ClipboardManager clipboard = getClipboardService(); clipboard.setPrimar...
@Test public void testGetWithoutHeaders() throws Exception { OkHttpClient httpClient = mock(OkHttpClient.class); when(httpClient.newCall(any(Request.class))).thenAnswer(new Answer<Object>() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { Call callMock = mock(Call.class); return callMock...
@ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = new Request.Builder().url(url); if (requestId != 0) { re...
NetworkingModule extends ReactContextBaseJavaModule { @ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = ne...
NetworkingModule extends ReactContextBaseJavaModule { @ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = ne...
NetworkingModule extends ReactContextBaseJavaModule { @ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = ne...
NetworkingModule extends ReactContextBaseJavaModule { @ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = ne...
@Test public void testFailGetWithInvalidHeadersStruct() throws Exception { RCTDeviceEventEmitter emitter = mock(RCTDeviceEventEmitter.class); ReactApplicationContext context = mock(ReactApplicationContext.class); when(context.getJSModule(any(Class.class))).thenReturn(emitter); OkHttpClient httpClient = mock(OkHttpClien...
@ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = new Request.Builder().url(url); if (requestId != 0) { re...
NetworkingModule extends ReactContextBaseJavaModule { @ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = ne...
NetworkingModule extends ReactContextBaseJavaModule { @ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = ne...
NetworkingModule extends ReactContextBaseJavaModule { @ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = ne...
NetworkingModule extends ReactContextBaseJavaModule { @ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = ne...
@Test public void testFailPostWithoutContentType() throws Exception { RCTDeviceEventEmitter emitter = mock(RCTDeviceEventEmitter.class); ReactApplicationContext context = mock(ReactApplicationContext.class); when(context.getJSModule(any(Class.class))).thenReturn(emitter); OkHttpClient httpClient = mock(OkHttpClient.cla...
@ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = new Request.Builder().url(url); if (requestId != 0) { re...
NetworkingModule extends ReactContextBaseJavaModule { @ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = ne...
NetworkingModule extends ReactContextBaseJavaModule { @ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = ne...
NetworkingModule extends ReactContextBaseJavaModule { @ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = ne...
NetworkingModule extends ReactContextBaseJavaModule { @ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = ne...
@Test public void testSuccessfulPostRequest() throws Exception { OkHttpClient httpClient = mock(OkHttpClient.class); when(httpClient.newCall(any(Request.class))).thenAnswer(new Answer<Object>() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { Call callMock = mock(Call.class); return call...
@ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = new Request.Builder().url(url); if (requestId != 0) { re...
NetworkingModule extends ReactContextBaseJavaModule { @ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = ne...
NetworkingModule extends ReactContextBaseJavaModule { @ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = ne...
NetworkingModule extends ReactContextBaseJavaModule { @ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = ne...
NetworkingModule extends ReactContextBaseJavaModule { @ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = ne...
@Test public void testHeaders() throws Exception { OkHttpClient httpClient = mock(OkHttpClient.class); when(httpClient.newCall(any(Request.class))).thenAnswer(new Answer<Object>() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { Call callMock = mock(Call.class); return callMock; } }); Ok...
@ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = new Request.Builder().url(url); if (requestId != 0) { re...
NetworkingModule extends ReactContextBaseJavaModule { @ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = ne...
NetworkingModule extends ReactContextBaseJavaModule { @ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = ne...
NetworkingModule extends ReactContextBaseJavaModule { @ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = ne...
NetworkingModule extends ReactContextBaseJavaModule { @ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = ne...
@Test public void testMultipartPostRequestSimple() throws Exception { PowerMockito.mockStatic(RequestBodyUtil.class); when(RequestBodyUtil.getFileInputStream(any(ReactContext.class), any(String.class))) .thenReturn(mock(InputStream.class)); when(RequestBodyUtil.create(any(MediaType.class), any(InputStream.class))) .the...
@ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = new Request.Builder().url(url); if (requestId != 0) { re...
NetworkingModule extends ReactContextBaseJavaModule { @ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = ne...
NetworkingModule extends ReactContextBaseJavaModule { @ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = ne...
NetworkingModule extends ReactContextBaseJavaModule { @ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = ne...
NetworkingModule extends ReactContextBaseJavaModule { @ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = ne...
@Test public void testMultipartPostRequestHeaders() throws Exception { PowerMockito.mockStatic(RequestBodyUtil.class); when(RequestBodyUtil.getFileInputStream(any(ReactContext.class), any(String.class))) .thenReturn(mock(InputStream.class)); when(RequestBodyUtil.create(any(MediaType.class), any(InputStream.class))) .th...
@ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = new Request.Builder().url(url); if (requestId != 0) { re...
NetworkingModule extends ReactContextBaseJavaModule { @ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = ne...
NetworkingModule extends ReactContextBaseJavaModule { @ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = ne...
NetworkingModule extends ReactContextBaseJavaModule { @ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = ne...
NetworkingModule extends ReactContextBaseJavaModule { @ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = ne...
@Test public void testMultipartPostRequestBody() throws Exception { InputStream inputStream = mock(InputStream.class); PowerMockito.mockStatic(RequestBodyUtil.class); when(RequestBodyUtil.getFileInputStream(any(ReactContext.class), any(String.class))) .thenReturn(inputStream); when(RequestBodyUtil.create(any(MediaType....
@ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = new Request.Builder().url(url); if (requestId != 0) { re...
NetworkingModule extends ReactContextBaseJavaModule { @ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = ne...
NetworkingModule extends ReactContextBaseJavaModule { @ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = ne...
NetworkingModule extends ReactContextBaseJavaModule { @ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = ne...
NetworkingModule extends ReactContextBaseJavaModule { @ReactMethod public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentials) { Request.Builder requestBuilder = ne...
@Test public void testNoCustomConstants() { List<ViewManager> viewManagers = Arrays.asList(mock(ViewManager.class)); UIManagerModule uiManagerModule = new UIManagerModule( mReactContext, viewManagers, mUIImplementationProvider, false); Map<String, Object> constants = uiManagerModule.getConstants(); assertThat(constants...
public static Map<String, Object> getConstants() { HashMap<String, Object> constants = new HashMap<String, Object>(); constants.put( "UIView", MapBuilder.of( "ContentMode", MapBuilder.of( "ScaleAspectFit", ImageView.ScaleType.FIT_CENTER.ordinal(), "ScaleAspectFill", ImageView.ScaleType.CENTER_CROP.ordinal(), "ScaleAspe...
UIManagerModuleConstants { public static Map<String, Object> getConstants() { HashMap<String, Object> constants = new HashMap<String, Object>(); constants.put( "UIView", MapBuilder.of( "ContentMode", MapBuilder.of( "ScaleAspectFit", ImageView.ScaleType.FIT_CENTER.ordinal(), "ScaleAspectFill", ImageView.ScaleType.CENTER...
UIManagerModuleConstants { public static Map<String, Object> getConstants() { HashMap<String, Object> constants = new HashMap<String, Object>(); constants.put( "UIView", MapBuilder.of( "ContentMode", MapBuilder.of( "ScaleAspectFit", ImageView.ScaleType.FIT_CENTER.ordinal(), "ScaleAspectFill", ImageView.ScaleType.CENTER...
UIManagerModuleConstants { public static Map<String, Object> getConstants() { HashMap<String, Object> constants = new HashMap<String, Object>(); constants.put( "UIView", MapBuilder.of( "ContentMode", MapBuilder.of( "ScaleAspectFit", ImageView.ScaleType.FIT_CENTER.ordinal(), "ScaleAspectFill", ImageView.ScaleType.CENTER...
UIManagerModuleConstants { public static Map<String, Object> getConstants() { HashMap<String, Object> constants = new HashMap<String, Object>(); constants.put( "UIView", MapBuilder.of( "ContentMode", MapBuilder.of( "ScaleAspectFit", ImageView.ScaleType.FIT_CENTER.ordinal(), "ScaleAspectFill", ImageView.ScaleType.CENTER...
@Test public void testCustomBubblingEvents() { ViewManager mockViewManager = mock(ViewManager.class); List<ViewManager> viewManagers = Arrays.asList(mockViewManager); when(mockViewManager.getExportedCustomBubblingEventTypeConstants()) .thenReturn(MapBuilder.of("onTwirl", TWIRL_BUBBLING_EVENT_MAP)); UIManagerModule uiMa...
public static Map<String, Object> getConstants() { HashMap<String, Object> constants = new HashMap<String, Object>(); constants.put( "UIView", MapBuilder.of( "ContentMode", MapBuilder.of( "ScaleAspectFit", ImageView.ScaleType.FIT_CENTER.ordinal(), "ScaleAspectFill", ImageView.ScaleType.CENTER_CROP.ordinal(), "ScaleAspe...
UIManagerModuleConstants { public static Map<String, Object> getConstants() { HashMap<String, Object> constants = new HashMap<String, Object>(); constants.put( "UIView", MapBuilder.of( "ContentMode", MapBuilder.of( "ScaleAspectFit", ImageView.ScaleType.FIT_CENTER.ordinal(), "ScaleAspectFill", ImageView.ScaleType.CENTER...
UIManagerModuleConstants { public static Map<String, Object> getConstants() { HashMap<String, Object> constants = new HashMap<String, Object>(); constants.put( "UIView", MapBuilder.of( "ContentMode", MapBuilder.of( "ScaleAspectFit", ImageView.ScaleType.FIT_CENTER.ordinal(), "ScaleAspectFill", ImageView.ScaleType.CENTER...
UIManagerModuleConstants { public static Map<String, Object> getConstants() { HashMap<String, Object> constants = new HashMap<String, Object>(); constants.put( "UIView", MapBuilder.of( "ContentMode", MapBuilder.of( "ScaleAspectFit", ImageView.ScaleType.FIT_CENTER.ordinal(), "ScaleAspectFill", ImageView.ScaleType.CENTER...
UIManagerModuleConstants { public static Map<String, Object> getConstants() { HashMap<String, Object> constants = new HashMap<String, Object>(); constants.put( "UIView", MapBuilder.of( "ContentMode", MapBuilder.of( "ScaleAspectFit", ImageView.ScaleType.FIT_CENTER.ordinal(), "ScaleAspectFill", ImageView.ScaleType.CENTER...
@Test public void testCustomDirectEvents() { ViewManager mockViewManager = mock(ViewManager.class); List<ViewManager> viewManagers = Arrays.asList(mockViewManager); when(mockViewManager.getExportedCustomDirectEventTypeConstants()) .thenReturn(MapBuilder.of("onTwirl", TWIRL_DIRECT_EVENT_MAP)); UIManagerModule uiManagerM...
public static Map<String, Object> getConstants() { HashMap<String, Object> constants = new HashMap<String, Object>(); constants.put( "UIView", MapBuilder.of( "ContentMode", MapBuilder.of( "ScaleAspectFit", ImageView.ScaleType.FIT_CENTER.ordinal(), "ScaleAspectFill", ImageView.ScaleType.CENTER_CROP.ordinal(), "ScaleAspe...
UIManagerModuleConstants { public static Map<String, Object> getConstants() { HashMap<String, Object> constants = new HashMap<String, Object>(); constants.put( "UIView", MapBuilder.of( "ContentMode", MapBuilder.of( "ScaleAspectFit", ImageView.ScaleType.FIT_CENTER.ordinal(), "ScaleAspectFill", ImageView.ScaleType.CENTER...
UIManagerModuleConstants { public static Map<String, Object> getConstants() { HashMap<String, Object> constants = new HashMap<String, Object>(); constants.put( "UIView", MapBuilder.of( "ContentMode", MapBuilder.of( "ScaleAspectFit", ImageView.ScaleType.FIT_CENTER.ordinal(), "ScaleAspectFill", ImageView.ScaleType.CENTER...
UIManagerModuleConstants { public static Map<String, Object> getConstants() { HashMap<String, Object> constants = new HashMap<String, Object>(); constants.put( "UIView", MapBuilder.of( "ContentMode", MapBuilder.of( "ScaleAspectFit", ImageView.ScaleType.FIT_CENTER.ordinal(), "ScaleAspectFill", ImageView.ScaleType.CENTER...
UIManagerModuleConstants { public static Map<String, Object> getConstants() { HashMap<String, Object> constants = new HashMap<String, Object>(); constants.put( "UIView", MapBuilder.of( "ContentMode", MapBuilder.of( "ScaleAspectFit", ImageView.ScaleType.FIT_CENTER.ordinal(), "ScaleAspectFill", ImageView.ScaleType.CENTER...
@Test public void testCustomViewConstants() { ViewManager mockViewManager = mock(ViewManager.class); List<ViewManager> viewManagers = Arrays.asList(mockViewManager); when(mockViewManager.getName()).thenReturn("RedPandaPhotoOfTheDayView"); when(mockViewManager.getExportedViewConstants()) .thenReturn(MapBuilder.of("Photo...
public static Map<String, Object> getConstants() { HashMap<String, Object> constants = new HashMap<String, Object>(); constants.put( "UIView", MapBuilder.of( "ContentMode", MapBuilder.of( "ScaleAspectFit", ImageView.ScaleType.FIT_CENTER.ordinal(), "ScaleAspectFill", ImageView.ScaleType.CENTER_CROP.ordinal(), "ScaleAspe...
UIManagerModuleConstants { public static Map<String, Object> getConstants() { HashMap<String, Object> constants = new HashMap<String, Object>(); constants.put( "UIView", MapBuilder.of( "ContentMode", MapBuilder.of( "ScaleAspectFit", ImageView.ScaleType.FIT_CENTER.ordinal(), "ScaleAspectFill", ImageView.ScaleType.CENTER...
UIManagerModuleConstants { public static Map<String, Object> getConstants() { HashMap<String, Object> constants = new HashMap<String, Object>(); constants.put( "UIView", MapBuilder.of( "ContentMode", MapBuilder.of( "ScaleAspectFit", ImageView.ScaleType.FIT_CENTER.ordinal(), "ScaleAspectFill", ImageView.ScaleType.CENTER...
UIManagerModuleConstants { public static Map<String, Object> getConstants() { HashMap<String, Object> constants = new HashMap<String, Object>(); constants.put( "UIView", MapBuilder.of( "ContentMode", MapBuilder.of( "ScaleAspectFit", ImageView.ScaleType.FIT_CENTER.ordinal(), "ScaleAspectFill", ImageView.ScaleType.CENTER...
UIManagerModuleConstants { public static Map<String, Object> getConstants() { HashMap<String, Object> constants = new HashMap<String, Object>(); constants.put( "UIView", MapBuilder.of( "ContentMode", MapBuilder.of( "ScaleAspectFit", ImageView.ScaleType.FIT_CENTER.ordinal(), "ScaleAspectFill", ImageView.ScaleType.CENTER...
@Test public void testNativeProps() { ViewManager mockViewManager = mock(ViewManager.class); List<ViewManager> viewManagers = Arrays.asList(mockViewManager); when(mockViewManager.getName()).thenReturn("SomeView"); when(mockViewManager.getNativeProps()) .thenReturn(MapBuilder.of("fooProp", "number")); UIManagerModule ui...
public static Map<String, Object> getConstants() { HashMap<String, Object> constants = new HashMap<String, Object>(); constants.put( "UIView", MapBuilder.of( "ContentMode", MapBuilder.of( "ScaleAspectFit", ImageView.ScaleType.FIT_CENTER.ordinal(), "ScaleAspectFill", ImageView.ScaleType.CENTER_CROP.ordinal(), "ScaleAspe...
UIManagerModuleConstants { public static Map<String, Object> getConstants() { HashMap<String, Object> constants = new HashMap<String, Object>(); constants.put( "UIView", MapBuilder.of( "ContentMode", MapBuilder.of( "ScaleAspectFit", ImageView.ScaleType.FIT_CENTER.ordinal(), "ScaleAspectFill", ImageView.ScaleType.CENTER...
UIManagerModuleConstants { public static Map<String, Object> getConstants() { HashMap<String, Object> constants = new HashMap<String, Object>(); constants.put( "UIView", MapBuilder.of( "ContentMode", MapBuilder.of( "ScaleAspectFit", ImageView.ScaleType.FIT_CENTER.ordinal(), "ScaleAspectFill", ImageView.ScaleType.CENTER...
UIManagerModuleConstants { public static Map<String, Object> getConstants() { HashMap<String, Object> constants = new HashMap<String, Object>(); constants.put( "UIView", MapBuilder.of( "ContentMode", MapBuilder.of( "ScaleAspectFit", ImageView.ScaleType.FIT_CENTER.ordinal(), "ScaleAspectFill", ImageView.ScaleType.CENTER...
UIManagerModuleConstants { public static Map<String, Object> getConstants() { HashMap<String, Object> constants = new HashMap<String, Object>(); constants.put( "UIView", MapBuilder.of( "ContentMode", MapBuilder.of( "ScaleAspectFit", ImageView.ScaleType.FIT_CENTER.ordinal(), "ScaleAspectFill", ImageView.ScaleType.CENTER...
@Test public void testMergeConstants() { ViewManager managerX = mock(ViewManager.class); when(managerX.getExportedCustomDirectEventTypeConstants()).thenReturn(MapBuilder.of( "onTwirl", MapBuilder.of( "registrationName", "onTwirl", "keyToOverride", "valueX", "mapToMerge", MapBuilder.of("keyToOverride", "innerValueX", "a...
public static Map<String, Object> getConstants() { HashMap<String, Object> constants = new HashMap<String, Object>(); constants.put( "UIView", MapBuilder.of( "ContentMode", MapBuilder.of( "ScaleAspectFit", ImageView.ScaleType.FIT_CENTER.ordinal(), "ScaleAspectFill", ImageView.ScaleType.CENTER_CROP.ordinal(), "ScaleAspe...
UIManagerModuleConstants { public static Map<String, Object> getConstants() { HashMap<String, Object> constants = new HashMap<String, Object>(); constants.put( "UIView", MapBuilder.of( "ContentMode", MapBuilder.of( "ScaleAspectFit", ImageView.ScaleType.FIT_CENTER.ordinal(), "ScaleAspectFill", ImageView.ScaleType.CENTER...
UIManagerModuleConstants { public static Map<String, Object> getConstants() { HashMap<String, Object> constants = new HashMap<String, Object>(); constants.put( "UIView", MapBuilder.of( "ContentMode", MapBuilder.of( "ScaleAspectFit", ImageView.ScaleType.FIT_CENTER.ordinal(), "ScaleAspectFill", ImageView.ScaleType.CENTER...
UIManagerModuleConstants { public static Map<String, Object> getConstants() { HashMap<String, Object> constants = new HashMap<String, Object>(); constants.put( "UIView", MapBuilder.of( "ContentMode", MapBuilder.of( "ScaleAspectFit", ImageView.ScaleType.FIT_CENTER.ordinal(), "ScaleAspectFill", ImageView.ScaleType.CENTER...
UIManagerModuleConstants { public static Map<String, Object> getConstants() { HashMap<String, Object> constants = new HashMap<String, Object>(); constants.put( "UIView", MapBuilder.of( "ContentMode", MapBuilder.of( "ScaleAspectFit", ImageView.ScaleType.FIT_CENTER.ordinal(), "ScaleAspectFill", ImageView.ScaleType.CENTER...
@Test public void testReplaceExistingNonRootView() { UIManagerModule uiManager = getUIManagerModule(); TestMoveDeleteHierarchy hierarchy = createMoveDeleteHierarchy(uiManager); int newViewTag = 1234; uiManager.createView( newViewTag, ReactViewManager.REACT_CLASS, hierarchy.rootView, JavaOnlyMap.of("backgroundColor", Co...
@ReactMethod public void replaceExistingNonRootView(int oldTag, int newTag) { mUIImplementation.replaceExistingNonRootView(oldTag, newTag); }
UIManagerModule extends ReactContextBaseJavaModule implements OnBatchCompleteListener, LifecycleEventListener, PerformanceCounter { @ReactMethod public void replaceExistingNonRootView(int oldTag, int newTag) { mUIImplementation.replaceExistingNonRootView(oldTag, newTag); } }
UIManagerModule extends ReactContextBaseJavaModule implements OnBatchCompleteListener, LifecycleEventListener, PerformanceCounter { @ReactMethod public void replaceExistingNonRootView(int oldTag, int newTag) { mUIImplementation.replaceExistingNonRootView(oldTag, newTag); } UIManagerModule( ReactApplicationCon...
UIManagerModule extends ReactContextBaseJavaModule implements OnBatchCompleteListener, LifecycleEventListener, PerformanceCounter { @ReactMethod public void replaceExistingNonRootView(int oldTag, int newTag) { mUIImplementation.replaceExistingNonRootView(oldTag, newTag); } UIManagerModule( ReactApplicationCon...
UIManagerModule extends ReactContextBaseJavaModule implements OnBatchCompleteListener, LifecycleEventListener, PerformanceCounter { @ReactMethod public void replaceExistingNonRootView(int oldTag, int newTag) { mUIImplementation.replaceExistingNonRootView(oldTag, newTag); } UIManagerModule( ReactApplicationCon...
@Test public void testRemoveSubviewsFromContainerWithID() { UIManagerModule uiManager = getUIManagerModule(); ReactRootView rootView = new ReactRootView(RuntimeEnvironment.application.getApplicationContext()); int rootTag = uiManager.addMeasuredRootView(rootView); final int containerTag = rootTag + 1; final int contain...
@ReactMethod public void removeSubviewsFromContainerWithID(int containerTag) { mUIImplementation.removeSubviewsFromContainerWithID(containerTag); }
UIManagerModule extends ReactContextBaseJavaModule implements OnBatchCompleteListener, LifecycleEventListener, PerformanceCounter { @ReactMethod public void removeSubviewsFromContainerWithID(int containerTag) { mUIImplementation.removeSubviewsFromContainerWithID(containerTag); } }
UIManagerModule extends ReactContextBaseJavaModule implements OnBatchCompleteListener, LifecycleEventListener, PerformanceCounter { @ReactMethod public void removeSubviewsFromContainerWithID(int containerTag) { mUIImplementation.removeSubviewsFromContainerWithID(containerTag); } UIManagerModule( ReactApplicat...
UIManagerModule extends ReactContextBaseJavaModule implements OnBatchCompleteListener, LifecycleEventListener, PerformanceCounter { @ReactMethod public void removeSubviewsFromContainerWithID(int containerTag) { mUIImplementation.removeSubviewsFromContainerWithID(containerTag); } UIManagerModule( ReactApplicat...
UIManagerModule extends ReactContextBaseJavaModule implements OnBatchCompleteListener, LifecycleEventListener, PerformanceCounter { @ReactMethod public void removeSubviewsFromContainerWithID(int containerTag) { mUIImplementation.removeSubviewsFromContainerWithID(containerTag); } UIManagerModule( ReactApplicat...
@Test public void testThatCreateNativeModulesIsCalledOnAllPackages() { CompositeReactPackage composite = new CompositeReactPackage(packageNo1, packageNo2, packageNo3); composite.createNativeModules(reactContext); verify(packageNo1).createNativeModules(reactContext); verify(packageNo2).createNativeModules(reactContext);...
@Override public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { final Map<String, NativeModule> moduleMap = new HashMap<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (NativeModule nativeModule: reactPackage.createNativeModules(reactContext)) { moduleMap.put(nativeModule...
CompositeReactPackage extends ReactInstancePackage { @Override public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { final Map<String, NativeModule> moduleMap = new HashMap<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (NativeModule nativeModule: reactPackage.createNati...
CompositeReactPackage extends ReactInstancePackage { @Override public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { final Map<String, NativeModule> moduleMap = new HashMap<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (NativeModule nativeModule: reactPackage.createNati...
CompositeReactPackage extends ReactInstancePackage { @Override public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { final Map<String, NativeModule> moduleMap = new HashMap<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (NativeModule nativeModule: reactPackage.createNati...
CompositeReactPackage extends ReactInstancePackage { @Override public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { final Map<String, NativeModule> moduleMap = new HashMap<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (NativeModule nativeModule: reactPackage.createNati...
@Test public void testThatCreateJSModulesIsCalledOnAllPackages() { CompositeReactPackage composite = new CompositeReactPackage(packageNo1, packageNo2, packageNo3); composite.createJSModules(); verify(packageNo1).createJSModules(); verify(packageNo2).createJSModules(); verify(packageNo3).createJSModules(); }
@Override public List<Class<? extends JavaScriptModule>> createJSModules() { final Set<Class<? extends JavaScriptModule>> moduleSet = new HashSet<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (Class<? extends JavaScriptModule> jsModule: reactPackage.createJSModules()) { moduleSet.add(jsModule); } } re...
CompositeReactPackage extends ReactInstancePackage { @Override public List<Class<? extends JavaScriptModule>> createJSModules() { final Set<Class<? extends JavaScriptModule>> moduleSet = new HashSet<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (Class<? extends JavaScriptModule> jsModule: reactPackage...
CompositeReactPackage extends ReactInstancePackage { @Override public List<Class<? extends JavaScriptModule>> createJSModules() { final Set<Class<? extends JavaScriptModule>> moduleSet = new HashSet<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (Class<? extends JavaScriptModule> jsModule: reactPackage...
CompositeReactPackage extends ReactInstancePackage { @Override public List<Class<? extends JavaScriptModule>> createJSModules() { final Set<Class<? extends JavaScriptModule>> moduleSet = new HashSet<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (Class<? extends JavaScriptModule> jsModule: reactPackage...
CompositeReactPackage extends ReactInstancePackage { @Override public List<Class<? extends JavaScriptModule>> createJSModules() { final Set<Class<? extends JavaScriptModule>> moduleSet = new HashSet<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (Class<? extends JavaScriptModule> jsModule: reactPackage...
@Test public void testThatCreateViewManagersIsCalledOnAllPackages() { CompositeReactPackage composite = new CompositeReactPackage(packageNo1, packageNo2, packageNo3); composite.createViewManagers(reactContext); verify(packageNo1).createViewManagers(reactContext); verify(packageNo2).createViewManagers(reactContext); ver...
@Override public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) { final Map<String, ViewManager> viewManagerMap = new HashMap<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (ViewManager viewManager: reactPackage.createViewManagers(reactContext)) { viewManagerMap.put(viewMana...
CompositeReactPackage extends ReactInstancePackage { @Override public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) { final Map<String, ViewManager> viewManagerMap = new HashMap<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (ViewManager viewManager: reactPackage.createView...
CompositeReactPackage extends ReactInstancePackage { @Override public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) { final Map<String, ViewManager> viewManagerMap = new HashMap<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (ViewManager viewManager: reactPackage.createView...
CompositeReactPackage extends ReactInstancePackage { @Override public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) { final Map<String, ViewManager> viewManagerMap = new HashMap<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (ViewManager viewManager: reactPackage.createView...
CompositeReactPackage extends ReactInstancePackage { @Override public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) { final Map<String, ViewManager> viewManagerMap = new HashMap<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (ViewManager viewManager: reactPackage.createView...
@Test public void testThatCompositeReturnsASumOfNativeModules() { CompositeReactPackage composite = new CompositeReactPackage(packageNo1, packageNo2); NativeModule moduleNo1 = mock(NativeModule.class); when(moduleNo1.getName()).thenReturn("ModuleNo1"); final String sameModuleName = "SameModuleName"; NativeModule module...
@Override public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { final Map<String, NativeModule> moduleMap = new HashMap<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (NativeModule nativeModule: reactPackage.createNativeModules(reactContext)) { moduleMap.put(nativeModule...
CompositeReactPackage extends ReactInstancePackage { @Override public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { final Map<String, NativeModule> moduleMap = new HashMap<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (NativeModule nativeModule: reactPackage.createNati...
CompositeReactPackage extends ReactInstancePackage { @Override public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { final Map<String, NativeModule> moduleMap = new HashMap<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (NativeModule nativeModule: reactPackage.createNati...
CompositeReactPackage extends ReactInstancePackage { @Override public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { final Map<String, NativeModule> moduleMap = new HashMap<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (NativeModule nativeModule: reactPackage.createNati...
CompositeReactPackage extends ReactInstancePackage { @Override public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { final Map<String, NativeModule> moduleMap = new HashMap<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (NativeModule nativeModule: reactPackage.createNati...
@Test public void testThatCompositeReturnsASumOfViewManagers() { CompositeReactPackage composite = new CompositeReactPackage(packageNo1, packageNo2); ViewManager managerNo1 = mock(ViewManager.class); when(managerNo1.getName()).thenReturn("ManagerNo1"); final String sameModuleName = "SameModuleName"; ViewManager manager...
@Override public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) { final Map<String, ViewManager> viewManagerMap = new HashMap<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (ViewManager viewManager: reactPackage.createViewManagers(reactContext)) { viewManagerMap.put(viewMana...
CompositeReactPackage extends ReactInstancePackage { @Override public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) { final Map<String, ViewManager> viewManagerMap = new HashMap<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (ViewManager viewManager: reactPackage.createView...
CompositeReactPackage extends ReactInstancePackage { @Override public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) { final Map<String, ViewManager> viewManagerMap = new HashMap<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (ViewManager viewManager: reactPackage.createView...
CompositeReactPackage extends ReactInstancePackage { @Override public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) { final Map<String, ViewManager> viewManagerMap = new HashMap<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (ViewManager viewManager: reactPackage.createView...
CompositeReactPackage extends ReactInstancePackage { @Override public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) { final Map<String, ViewManager> viewManagerMap = new HashMap<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (ViewManager viewManager: reactPackage.createView...
@Test public void testThatCompositeReturnsASumOfJSModules() { CompositeReactPackage composite = new CompositeReactPackage(packageNo1, packageNo2); Class<? extends JavaScriptModule> moduleNo1 = mock(JavaScriptModuleNo1.class).getClass(); Class<? extends JavaScriptModule> moduleNo2 = mock(JavaScriptModuleNo2.class).getCl...
@Override public List<Class<? extends JavaScriptModule>> createJSModules() { final Set<Class<? extends JavaScriptModule>> moduleSet = new HashSet<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (Class<? extends JavaScriptModule> jsModule: reactPackage.createJSModules()) { moduleSet.add(jsModule); } } re...
CompositeReactPackage extends ReactInstancePackage { @Override public List<Class<? extends JavaScriptModule>> createJSModules() { final Set<Class<? extends JavaScriptModule>> moduleSet = new HashSet<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (Class<? extends JavaScriptModule> jsModule: reactPackage...
CompositeReactPackage extends ReactInstancePackage { @Override public List<Class<? extends JavaScriptModule>> createJSModules() { final Set<Class<? extends JavaScriptModule>> moduleSet = new HashSet<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (Class<? extends JavaScriptModule> jsModule: reactPackage...
CompositeReactPackage extends ReactInstancePackage { @Override public List<Class<? extends JavaScriptModule>> createJSModules() { final Set<Class<? extends JavaScriptModule>> moduleSet = new HashSet<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (Class<? extends JavaScriptModule> jsModule: reactPackage...
CompositeReactPackage extends ReactInstancePackage { @Override public List<Class<? extends JavaScriptModule>> createJSModules() { final Set<Class<? extends JavaScriptModule>> moduleSet = new HashSet<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (Class<? extends JavaScriptModule> jsModule: reactPackage...
@Test public void test_onMessage_ShouldTriggerNotification() throws IOException { RequestHandler handler = mock(RequestHandler.class); final JSPackagerClient client = new JSPackagerClient("test_client", mSettings, createRH("methodValue", handler)); client.onMessage( ResponseBody.create( WebSocket.TEXT, "{\"version\": 2...
@Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSONObject(response.string()); int version = message.optInt("version"); ...
JSPackagerClient implements ReconnectingWebSocket.MessageCallback { @Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSON...
JSPackagerClient implements ReconnectingWebSocket.MessageCallback { @Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSON...
JSPackagerClient implements ReconnectingWebSocket.MessageCallback { @Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSON...
JSPackagerClient implements ReconnectingWebSocket.MessageCallback { @Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSON...
@Test public void test_onMessage_ShouldTriggerRequest() throws IOException { RequestHandler handler = mock(RequestHandler.class); final JSPackagerClient client = new JSPackagerClient("test_client", mSettings, createRH("methodValue", handler)); client.onMessage( ResponseBody.create( WebSocket.TEXT, "{\"version\": 2, \"i...
@Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSONObject(response.string()); int version = message.optInt("version"); ...
JSPackagerClient implements ReconnectingWebSocket.MessageCallback { @Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSON...
JSPackagerClient implements ReconnectingWebSocket.MessageCallback { @Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSON...
JSPackagerClient implements ReconnectingWebSocket.MessageCallback { @Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSON...
JSPackagerClient implements ReconnectingWebSocket.MessageCallback { @Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSON...
@Test public void test_onMessage_WithoutParams_ShouldTriggerNotification() throws IOException { RequestHandler handler = mock(RequestHandler.class); final JSPackagerClient client = new JSPackagerClient("test_client", mSettings, createRH("methodValue", handler)); client.onMessage( ResponseBody.create( WebSocket.TEXT, "{...
@Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSONObject(response.string()); int version = message.optInt("version"); ...
JSPackagerClient implements ReconnectingWebSocket.MessageCallback { @Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSON...
JSPackagerClient implements ReconnectingWebSocket.MessageCallback { @Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSON...
JSPackagerClient implements ReconnectingWebSocket.MessageCallback { @Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSON...
JSPackagerClient implements ReconnectingWebSocket.MessageCallback { @Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSON...
@Test public void test_onMessage_WithInvalidContentType_ShouldNotTriggerCallback() throws IOException { RequestHandler handler = mock(RequestHandler.class); final JSPackagerClient client = new JSPackagerClient("test_client", mSettings, createRH("methodValue", handler)); client.onMessage( ResponseBody.create( WebSocket....
@Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSONObject(response.string()); int version = message.optInt("version"); ...
JSPackagerClient implements ReconnectingWebSocket.MessageCallback { @Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSON...
JSPackagerClient implements ReconnectingWebSocket.MessageCallback { @Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSON...
JSPackagerClient implements ReconnectingWebSocket.MessageCallback { @Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSON...
JSPackagerClient implements ReconnectingWebSocket.MessageCallback { @Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSON...
@Test public void test_onMessage_WithoutMethod_ShouldNotTriggerCallback() throws IOException { RequestHandler handler = mock(RequestHandler.class); final JSPackagerClient client = new JSPackagerClient("test_client", mSettings, createRH("methodValue", handler)); client.onMessage( ResponseBody.create( WebSocket.TEXT, "{\...
@Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSONObject(response.string()); int version = message.optInt("version"); ...
JSPackagerClient implements ReconnectingWebSocket.MessageCallback { @Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSON...
JSPackagerClient implements ReconnectingWebSocket.MessageCallback { @Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSON...
JSPackagerClient implements ReconnectingWebSocket.MessageCallback { @Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSON...
JSPackagerClient implements ReconnectingWebSocket.MessageCallback { @Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSON...
@Test public void test_onMessage_With_Null_Action_ShouldNotTriggerCallback() throws IOException { RequestHandler handler = mock(RequestHandler.class); final JSPackagerClient client = new JSPackagerClient("test_client", mSettings, createRH("methodValue", handler)); client.onMessage( ResponseBody.create( WebSocket.TEXT, ...
@Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSONObject(response.string()); int version = message.optInt("version"); ...
JSPackagerClient implements ReconnectingWebSocket.MessageCallback { @Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSON...
JSPackagerClient implements ReconnectingWebSocket.MessageCallback { @Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSON...
JSPackagerClient implements ReconnectingWebSocket.MessageCallback { @Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSON...
JSPackagerClient implements ReconnectingWebSocket.MessageCallback { @Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSON...
@Test public void test_onMessage_WithInvalidMethod_ShouldNotTriggerCallback() throws IOException { RequestHandler handler = mock(RequestHandler.class); final JSPackagerClient client = new JSPackagerClient("test_client", mSettings, createRH("methodValue", handler)); client.onMessage( ResponseBody.create( WebSocket.BINAR...
@Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSONObject(response.string()); int version = message.optInt("version"); ...
JSPackagerClient implements ReconnectingWebSocket.MessageCallback { @Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSON...
JSPackagerClient implements ReconnectingWebSocket.MessageCallback { @Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSON...
JSPackagerClient implements ReconnectingWebSocket.MessageCallback { @Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSON...
JSPackagerClient implements ReconnectingWebSocket.MessageCallback { @Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSON...
@Test public void test_onMessage_WrongVersion_ShouldNotTriggerCallback() throws IOException { RequestHandler handler = mock(RequestHandler.class); final JSPackagerClient client = new JSPackagerClient("test_client", mSettings, createRH("methodValue", handler)); client.onMessage( ResponseBody.create( WebSocket.TEXT, "{\"...
@Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSONObject(response.string()); int version = message.optInt("version"); ...
JSPackagerClient implements ReconnectingWebSocket.MessageCallback { @Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSON...
JSPackagerClient implements ReconnectingWebSocket.MessageCallback { @Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSON...
JSPackagerClient implements ReconnectingWebSocket.MessageCallback { @Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSON...
JSPackagerClient implements ReconnectingWebSocket.MessageCallback { @Override public void onMessage(ResponseBody response) { if (response.contentType() != WebSocket.TEXT) { FLog.w( TAG, "Websocket received message with payload of unexpected type " + response.contentType()); return; } try { JSONObject message = new JSON...
@Test public void extractTextLinesFromPdf_ffsClaims() throws IOException { try (InputStream codebookPdfStream = SupportedCodebook.FFS_CLAIMS.getCodebookPdfInputStream();) { List<String> codebookTextLines = PdfParser.extractTextLinesFromPdf(codebookPdfStream); Assert.assertNotNull(codebookTextLines); Assert.assertTrue(c...
static List<String> extractTextLinesFromPdf(InputStream pdfStream) { PdfReader pdfReader = null; try { pdfReader = new PdfReader(pdfStream); List<String> textLines = new ArrayList<>(); for (int page = 1; page <= pdfReader.getNumberOfPages(); page++) { String textFromPage = PdfTextExtractor.getTextFromPage(pdfReader, pa...
PdfParser { static List<String> extractTextLinesFromPdf(InputStream pdfStream) { PdfReader pdfReader = null; try { pdfReader = new PdfReader(pdfStream); List<String> textLines = new ArrayList<>(); for (int page = 1; page <= pdfReader.getNumberOfPages(); page++) { String textFromPage = PdfTextExtractor.getTextFromPage(p...
PdfParser { static List<String> extractTextLinesFromPdf(InputStream pdfStream) { PdfReader pdfReader = null; try { pdfReader = new PdfReader(pdfStream); List<String> textLines = new ArrayList<>(); for (int page = 1; page <= pdfReader.getNumberOfPages(); page++) { String textFromPage = PdfTextExtractor.getTextFromPage(p...
PdfParser { static List<String> extractTextLinesFromPdf(InputStream pdfStream) { PdfReader pdfReader = null; try { pdfReader = new PdfReader(pdfStream); List<String> textLines = new ArrayList<>(); for (int page = 1; page <= pdfReader.getNumberOfPages(); page++) { String textFromPage = PdfTextExtractor.getTextFromPage(p...
PdfParser { static List<String> extractTextLinesFromPdf(InputStream pdfStream) { PdfReader pdfReader = null; try { pdfReader = new PdfReader(pdfStream); List<String> textLines = new ArrayList<>(); for (int page = 1; page <= pdfReader.getNumberOfPages(); page++) { String textFromPage = PdfTextExtractor.getTextFromPage(p...
@Test public void findVariableSections() throws IOException { for (SupportedCodebook supportedCodebook : SupportedCodebook.values()) { try (InputStream codebookPdfStream = supportedCodebook.getCodebookPdfInputStream();) { LOGGER.info("Looking for sections in codebook: {}", supportedCodebook.name()); List<String> codebo...
static List<List<String>> findVariableSections(List<String> codebookTextLines) { int firstVariableLine = findFirstVariableLine(codebookTextLines); int lastVariableLine = findLastVariableLine(codebookTextLines); List<List<String>> variableSectionLineGroups = new ArrayList<>(); List<String> sectionBuilder = new ArrayList...
PdfParser { static List<List<String>> findVariableSections(List<String> codebookTextLines) { int firstVariableLine = findFirstVariableLine(codebookTextLines); int lastVariableLine = findLastVariableLine(codebookTextLines); List<List<String>> variableSectionLineGroups = new ArrayList<>(); List<String> sectionBuilder = n...
PdfParser { static List<List<String>> findVariableSections(List<String> codebookTextLines) { int firstVariableLine = findFirstVariableLine(codebookTextLines); int lastVariableLine = findLastVariableLine(codebookTextLines); List<List<String>> variableSectionLineGroups = new ArrayList<>(); List<String> sectionBuilder = n...
PdfParser { static List<List<String>> findVariableSections(List<String> codebookTextLines) { int firstVariableLine = findFirstVariableLine(codebookTextLines); int lastVariableLine = findLastVariableLine(codebookTextLines); List<List<String>> variableSectionLineGroups = new ArrayList<>(); List<String> sectionBuilder = n...
PdfParser { static List<List<String>> findVariableSections(List<String> codebookTextLines) { int firstVariableLine = findFirstVariableLine(codebookTextLines); int lastVariableLine = findLastVariableLine(codebookTextLines); List<List<String>> variableSectionLineGroups = new ArrayList<>(); List<String> sectionBuilder = n...
@Test public void parseCodebookPdf() throws IOException { for (SupportedCodebook supportedCodebook : SupportedCodebook.values()) { LOGGER.info("Looking for sections in codebook: {}", supportedCodebook.name()); Codebook codebook = PdfParser.parseCodebookPdf(supportedCodebook); Assert.assertNotNull(codebook); Assert.asse...
public static Codebook parseCodebookPdf(SupportedCodebook codebookSource) { try (InputStream codebookPdfStream = codebookSource.getCodebookPdfInputStream();) { List<String> codebookTextLines = extractTextLinesFromPdf(codebookPdfStream); Codebook codebook = new Codebook(codebookSource); List<List<String>> variableSectio...
PdfParser { public static Codebook parseCodebookPdf(SupportedCodebook codebookSource) { try (InputStream codebookPdfStream = codebookSource.getCodebookPdfInputStream();) { List<String> codebookTextLines = extractTextLinesFromPdf(codebookPdfStream); Codebook codebook = new Codebook(codebookSource); List<List<String>> va...
PdfParser { public static Codebook parseCodebookPdf(SupportedCodebook codebookSource) { try (InputStream codebookPdfStream = codebookSource.getCodebookPdfInputStream();) { List<String> codebookTextLines = extractTextLinesFromPdf(codebookPdfStream); Codebook codebook = new Codebook(codebookSource); List<List<String>> va...
PdfParser { public static Codebook parseCodebookPdf(SupportedCodebook codebookSource) { try (InputStream codebookPdfStream = codebookSource.getCodebookPdfInputStream();) { List<String> codebookTextLines = extractTextLinesFromPdf(codebookPdfStream); Codebook codebook = new Codebook(codebookSource); List<List<String>> va...
PdfParser { public static Codebook parseCodebookPdf(SupportedCodebook codebookSource) { try (InputStream codebookPdfStream = codebookSource.getCodebookPdfInputStream();) { List<String> codebookTextLines = extractTextLinesFromPdf(codebookPdfStream); Codebook codebook = new Codebook(codebookSource); List<List<String>> va...
@Test public void parseCodebookPdf_DUAL_MO() throws IOException { Codebook codebook = PdfParser.parseCodebookPdf(SupportedCodebook.BENEFICIARY_SUMMARY); Variable variable = codebook.getVariables().stream().filter(v -> v.getId().equals("DUAL_MO")).findAny().get(); String expectedDescription1 = "This variable is the numb...
public static Codebook parseCodebookPdf(SupportedCodebook codebookSource) { try (InputStream codebookPdfStream = codebookSource.getCodebookPdfInputStream();) { List<String> codebookTextLines = extractTextLinesFromPdf(codebookPdfStream); Codebook codebook = new Codebook(codebookSource); List<List<String>> variableSectio...
PdfParser { public static Codebook parseCodebookPdf(SupportedCodebook codebookSource) { try (InputStream codebookPdfStream = codebookSource.getCodebookPdfInputStream();) { List<String> codebookTextLines = extractTextLinesFromPdf(codebookPdfStream); Codebook codebook = new Codebook(codebookSource); List<List<String>> va...
PdfParser { public static Codebook parseCodebookPdf(SupportedCodebook codebookSource) { try (InputStream codebookPdfStream = codebookSource.getCodebookPdfInputStream();) { List<String> codebookTextLines = extractTextLinesFromPdf(codebookPdfStream); Codebook codebook = new Codebook(codebookSource); List<List<String>> va...
PdfParser { public static Codebook parseCodebookPdf(SupportedCodebook codebookSource) { try (InputStream codebookPdfStream = codebookSource.getCodebookPdfInputStream();) { List<String> codebookTextLines = extractTextLinesFromPdf(codebookPdfStream); Codebook codebook = new Codebook(codebookSource); List<List<String>> va...
PdfParser { public static Codebook parseCodebookPdf(SupportedCodebook codebookSource) { try (InputStream codebookPdfStream = codebookSource.getCodebookPdfInputStream();) { List<String> codebookTextLines = extractTextLinesFromPdf(codebookPdfStream); Codebook codebook = new Codebook(codebookSource); List<List<String>> va...
@Test public void parseCodebookPdf_DSH_OP_CLM_VAL_AMT() throws IOException { Codebook codebook = PdfParser.parseCodebookPdf(SupportedCodebook.FFS_CLAIMS); Variable variable = codebook.getVariables().stream().filter(v -> v.getId().equals("DSH_OP_CLM_VAL_AMT")) .findAny().get(); String expectedDescription1 = "This is one...
public static Codebook parseCodebookPdf(SupportedCodebook codebookSource) { try (InputStream codebookPdfStream = codebookSource.getCodebookPdfInputStream();) { List<String> codebookTextLines = extractTextLinesFromPdf(codebookPdfStream); Codebook codebook = new Codebook(codebookSource); List<List<String>> variableSectio...
PdfParser { public static Codebook parseCodebookPdf(SupportedCodebook codebookSource) { try (InputStream codebookPdfStream = codebookSource.getCodebookPdfInputStream();) { List<String> codebookTextLines = extractTextLinesFromPdf(codebookPdfStream); Codebook codebook = new Codebook(codebookSource); List<List<String>> va...
PdfParser { public static Codebook parseCodebookPdf(SupportedCodebook codebookSource) { try (InputStream codebookPdfStream = codebookSource.getCodebookPdfInputStream();) { List<String> codebookTextLines = extractTextLinesFromPdf(codebookPdfStream); Codebook codebook = new Codebook(codebookSource); List<List<String>> va...
PdfParser { public static Codebook parseCodebookPdf(SupportedCodebook codebookSource) { try (InputStream codebookPdfStream = codebookSource.getCodebookPdfInputStream();) { List<String> codebookTextLines = extractTextLinesFromPdf(codebookPdfStream); Codebook codebook = new Codebook(codebookSource); List<List<String>> va...
PdfParser { public static Codebook parseCodebookPdf(SupportedCodebook codebookSource) { try (InputStream codebookPdfStream = codebookSource.getCodebookPdfInputStream();) { List<String> codebookTextLines = extractTextLinesFromPdf(codebookPdfStream); Codebook codebook = new Codebook(codebookSource); List<List<String>> va...
@Test public void parseCodebookPdf_CARR_LINE_PRVDR_TYPE_CD() throws IOException { Codebook codebook = PdfParser.parseCodebookPdf(SupportedCodebook.FFS_CLAIMS); Variable variable = codebook.getVariables().stream().filter(v -> v.getId().equals("CARR_LINE_PRVDR_TYPE_CD")) .findAny().get(); String expectedDescription1 = "C...
public static Codebook parseCodebookPdf(SupportedCodebook codebookSource) { try (InputStream codebookPdfStream = codebookSource.getCodebookPdfInputStream();) { List<String> codebookTextLines = extractTextLinesFromPdf(codebookPdfStream); Codebook codebook = new Codebook(codebookSource); List<List<String>> variableSectio...
PdfParser { public static Codebook parseCodebookPdf(SupportedCodebook codebookSource) { try (InputStream codebookPdfStream = codebookSource.getCodebookPdfInputStream();) { List<String> codebookTextLines = extractTextLinesFromPdf(codebookPdfStream); Codebook codebook = new Codebook(codebookSource); List<List<String>> va...
PdfParser { public static Codebook parseCodebookPdf(SupportedCodebook codebookSource) { try (InputStream codebookPdfStream = codebookSource.getCodebookPdfInputStream();) { List<String> codebookTextLines = extractTextLinesFromPdf(codebookPdfStream); Codebook codebook = new Codebook(codebookSource); List<List<String>> va...
PdfParser { public static Codebook parseCodebookPdf(SupportedCodebook codebookSource) { try (InputStream codebookPdfStream = codebookSource.getCodebookPdfInputStream();) { List<String> codebookTextLines = extractTextLinesFromPdf(codebookPdfStream); Codebook codebook = new Codebook(codebookSource); List<List<String>> va...
PdfParser { public static Codebook parseCodebookPdf(SupportedCodebook codebookSource) { try (InputStream codebookPdfStream = codebookSource.getCodebookPdfInputStream();) { List<String> codebookTextLines = extractTextLinesFromPdf(codebookPdfStream); Codebook codebook = new Codebook(codebookSource); List<List<String>> va...
@Test public void parseLabel_multiline() { String[] variableSection = new String[] { "CLM_NEXT_GNRTN_ACO_IND_CD1", "LABEL: Claim Next Generation (NG) Accountable Care Organization (ACO) Indicator Code –", "Population-Based Payment (PBP)", "DESCRIPTION: The field identifies the claims that qualify for specific claims pr...
static String parseLabel(List<String> variableSection) { List<String> fieldText = extractFieldContent(variableSection, FIELD_NAME_LABEL, FIELD_NAME_LABEL_ALT1); List<String> fieldParagraphs = extractParagraphs(fieldText); if (fieldParagraphs.size() != 1) throw new IllegalStateException( String.format("Invalid '%s' fiel...
PdfParser { static String parseLabel(List<String> variableSection) { List<String> fieldText = extractFieldContent(variableSection, FIELD_NAME_LABEL, FIELD_NAME_LABEL_ALT1); List<String> fieldParagraphs = extractParagraphs(fieldText); if (fieldParagraphs.size() != 1) throw new IllegalStateException( String.format("Inval...
PdfParser { static String parseLabel(List<String> variableSection) { List<String> fieldText = extractFieldContent(variableSection, FIELD_NAME_LABEL, FIELD_NAME_LABEL_ALT1); List<String> fieldParagraphs = extractParagraphs(fieldText); if (fieldParagraphs.size() != 1) throw new IllegalStateException( String.format("Inval...
PdfParser { static String parseLabel(List<String> variableSection) { List<String> fieldText = extractFieldContent(variableSection, FIELD_NAME_LABEL, FIELD_NAME_LABEL_ALT1); List<String> fieldParagraphs = extractParagraphs(fieldText); if (fieldParagraphs.size() != 1) throw new IllegalStateException( String.format("Inval...
PdfParser { static String parseLabel(List<String> variableSection) { List<String> fieldText = extractFieldContent(variableSection, FIELD_NAME_LABEL, FIELD_NAME_LABEL_ALT1); List<String> fieldParagraphs = extractParagraphs(fieldText); if (fieldParagraphs.size() != 1) throw new IllegalStateException( String.format("Inval...
@Test public void createOrUpdateSchemaOnHsql() { JDBCDataSource hsqlDataSource = new JDBCDataSource(); hsqlDataSource.setUrl("jdbc:hsqldb:mem:test"); DatabaseSchemaManager.createOrUpdateSchema(hsqlDataSource); }
public static void createOrUpdateSchema(DataSource dataSource) { LOGGER.info("Schema create/upgrade: running..."); Flyway flyway = new Flyway(); flyway.setCleanDisabled(true); flyway.setDataSource(dataSource); flyway.setPlaceholders(createScriptPlaceholdersMap(dataSource)); flyway.migrate(); LOGGER.info("Schema create/...
DatabaseSchemaManager { public static void createOrUpdateSchema(DataSource dataSource) { LOGGER.info("Schema create/upgrade: running..."); Flyway flyway = new Flyway(); flyway.setCleanDisabled(true); flyway.setDataSource(dataSource); flyway.setPlaceholders(createScriptPlaceholdersMap(dataSource)); flyway.migrate(); LOG...
DatabaseSchemaManager { public static void createOrUpdateSchema(DataSource dataSource) { LOGGER.info("Schema create/upgrade: running..."); Flyway flyway = new Flyway(); flyway.setCleanDisabled(true); flyway.setDataSource(dataSource); flyway.setPlaceholders(createScriptPlaceholdersMap(dataSource)); flyway.migrate(); LOG...
DatabaseSchemaManager { public static void createOrUpdateSchema(DataSource dataSource) { LOGGER.info("Schema create/upgrade: running..."); Flyway flyway = new Flyway(); flyway.setCleanDisabled(true); flyway.setDataSource(dataSource); flyway.setPlaceholders(createScriptPlaceholdersMap(dataSource)); flyway.migrate(); LOG...
DatabaseSchemaManager { public static void createOrUpdateSchema(DataSource dataSource) { LOGGER.info("Schema create/upgrade: running..."); Flyway flyway = new Flyway(); flyway.setCleanDisabled(true); flyway.setDataSource(dataSource); flyway.setPlaceholders(createScriptPlaceholdersMap(dataSource)); flyway.migrate(); LOG...
@Test public void testFlagsAnywhere() { try { CommandContext context = new CommandContext("r hello -f"); assertTrue(context.hasFlag('f')); CommandContext context2 = new CommandContext("r hello -f world"); assertTrue(context2.hasFlag('f')); } catch (CommandException e) { log.warn("Error", e); fail("Error creating Comman...
public boolean hasFlag(char ch) { return booleanFlags.contains(ch) || valueFlags.containsKey(ch); }
CommandContext { public boolean hasFlag(char ch) { return booleanFlags.contains(ch) || valueFlags.containsKey(ch); } }
CommandContext { public boolean hasFlag(char ch) { return booleanFlags.contains(ch) || valueFlags.containsKey(ch); } CommandContext(String args); CommandContext(String[] args); CommandContext(String args, Set<Character> valueFlags); CommandContext(String args, Set<Character> valueFlags, boolean allowHangingFlag); C...
CommandContext { public boolean hasFlag(char ch) { return booleanFlags.contains(ch) || valueFlags.containsKey(ch); } CommandContext(String args); CommandContext(String[] args); CommandContext(String args, Set<Character> valueFlags); CommandContext(String args, Set<Character> valueFlags, boolean allowHangingFlag); C...
CommandContext { public boolean hasFlag(char ch) { return booleanFlags.contains(ch) || valueFlags.containsKey(ch); } CommandContext(String args); CommandContext(String[] args); CommandContext(String args, Set<Character> valueFlags); CommandContext(String args, Set<Character> valueFlags, boolean allowHangingFlag); C...
@Test public void testSetY() throws Exception { World world = mock(World.class); Location location1 = new Location(world, Vector3.ZERO); Location location2 = location1.setY(TEST_VALUE); assertEquals(0, location1.getY(), EPSILON); assertEquals(0, location2.getX(), EPSILON); assertEquals(TEST_VALUE, location2.getY(), EPS...
public Location setY(double y) { return new Location(extent, position.withY(y), yaw, pitch); }
Location { public Location setY(double y) { return new Location(extent, position.withY(y), yaw, pitch); } }
Location { public Location setY(double y) { return new Location(extent, position.withY(y), yaw, pitch); } Location(Extent extent); Location(Extent extent, double x, double y, double z); Location(Extent extent, Vector3 position); Location(Extent extent, double x, double y, double z, Vector3 direction); Location(Exte...
Location { public Location setY(double y) { return new Location(extent, position.withY(y), yaw, pitch); } Location(Extent extent); Location(Extent extent, double x, double y, double z); Location(Extent extent, Vector3 position); Location(Extent extent, double x, double y, double z, Vector3 direction); Location(Exte...
Location { public Location setY(double y) { return new Location(extent, position.withY(y), yaw, pitch); } Location(Extent extent); Location(Extent extent, double x, double y, double z); Location(Extent extent, Vector3 position); Location(Extent extent, double x, double y, double z, Vector3 direction); Location(Exte...
@Test public void testGetZ() throws Exception { World world = mock(World.class); Location location = new Location(world, Vector3.at(0, 0, TEST_VALUE)); assertEquals(TEST_VALUE, location.getZ(), EPSILON); }
public double getZ() { return position.getZ(); }
Location { public double getZ() { return position.getZ(); } }
Location { public double getZ() { return position.getZ(); } Location(Extent extent); Location(Extent extent, double x, double y, double z); Location(Extent extent, Vector3 position); Location(Extent extent, double x, double y, double z, Vector3 direction); Location(Extent extent, double x, double y, double z, float...
Location { public double getZ() { return position.getZ(); } Location(Extent extent); Location(Extent extent, double x, double y, double z); Location(Extent extent, Vector3 position); Location(Extent extent, double x, double y, double z, Vector3 direction); Location(Extent extent, double x, double y, double z, float...
Location { public double getZ() { return position.getZ(); } Location(Extent extent); Location(Extent extent, double x, double y, double z); Location(Extent extent, Vector3 position); Location(Extent extent, double x, double y, double z, Vector3 direction); Location(Extent extent, double x, double y, double z, float...
@Test public void testGetBlockZ() throws Exception { World world = mock(World.class); Location location = new Location(world, Vector3.at(0, 0, TEST_VALUE)); assertEquals(TEST_VALUE, location.getBlockZ()); }
public int getBlockZ() { return (int) Math.floor(position.getZ()); }
Location { public int getBlockZ() { return (int) Math.floor(position.getZ()); } }
Location { public int getBlockZ() { return (int) Math.floor(position.getZ()); } Location(Extent extent); Location(Extent extent, double x, double y, double z); Location(Extent extent, Vector3 position); Location(Extent extent, double x, double y, double z, Vector3 direction); Location(Extent extent, double x, doubl...
Location { public int getBlockZ() { return (int) Math.floor(position.getZ()); } Location(Extent extent); Location(Extent extent, double x, double y, double z); Location(Extent extent, Vector3 position); Location(Extent extent, double x, double y, double z, Vector3 direction); Location(Extent extent, double x, doubl...
Location { public int getBlockZ() { return (int) Math.floor(position.getZ()); } Location(Extent extent); Location(Extent extent, double x, double y, double z); Location(Extent extent, Vector3 position); Location(Extent extent, double x, double y, double z, Vector3 direction); Location(Extent extent, double x, doubl...
@Test public void testSetZ() throws Exception { World world = mock(World.class); Location location1 = new Location(world, Vector3.ZERO); Location location2 = location1.setZ(TEST_VALUE); assertEquals(0, location1.getZ(), EPSILON); assertEquals(0, location2.getX(), EPSILON); assertEquals(0, location2.getY(), EPSILON); as...
public Location setZ(double z) { return new Location(extent, position.withZ(z), yaw, pitch); }
Location { public Location setZ(double z) { return new Location(extent, position.withZ(z), yaw, pitch); } }
Location { public Location setZ(double z) { return new Location(extent, position.withZ(z), yaw, pitch); } Location(Extent extent); Location(Extent extent, double x, double y, double z); Location(Extent extent, Vector3 position); Location(Extent extent, double x, double y, double z, Vector3 direction); Location(Exte...
Location { public Location setZ(double z) { return new Location(extent, position.withZ(z), yaw, pitch); } Location(Extent extent); Location(Extent extent, double x, double y, double z); Location(Extent extent, Vector3 position); Location(Extent extent, double x, double y, double z, Vector3 direction); Location(Exte...
Location { public Location setZ(double z) { return new Location(extent, position.withZ(z), yaw, pitch); } Location(Extent extent); Location(Extent extent, double x, double y, double z); Location(Extent extent, Vector3 position); Location(Extent extent, double x, double y, double z, Vector3 direction); Location(Exte...
@Test void testRelative() { assertEquals( paths("a", "a/b", "a/b/c"), MorePaths.iterPaths(Paths.get("a/b/c")).collect(toList()) ); }
public static Stream<Path> iterPaths(Path path) { Deque<Path> parents = new ArrayDeque<>(path.getNameCount()); Path next = path; while (next != null) { parents.addFirst(next); next = next.getParent(); } return ImmutableList.copyOf(parents).stream(); }
MorePaths { public static Stream<Path> iterPaths(Path path) { Deque<Path> parents = new ArrayDeque<>(path.getNameCount()); Path next = path; while (next != null) { parents.addFirst(next); next = next.getParent(); } return ImmutableList.copyOf(parents).stream(); } }
MorePaths { public static Stream<Path> iterPaths(Path path) { Deque<Path> parents = new ArrayDeque<>(path.getNameCount()); Path next = path; while (next != null) { parents.addFirst(next); next = next.getParent(); } return ImmutableList.copyOf(parents).stream(); } private MorePaths(); }
MorePaths { public static Stream<Path> iterPaths(Path path) { Deque<Path> parents = new ArrayDeque<>(path.getNameCount()); Path next = path; while (next != null) { parents.addFirst(next); next = next.getParent(); } return ImmutableList.copyOf(parents).stream(); } private MorePaths(); static Comparator<Path> oldestFirs...
MorePaths { public static Stream<Path> iterPaths(Path path) { Deque<Path> parents = new ArrayDeque<>(path.getNameCount()); Path next = path; while (next != null) { parents.addFirst(next); next = next.getParent(); } return ImmutableList.copyOf(parents).stream(); } private MorePaths(); static Comparator<Path> oldestFirs...
@Test void testAbsolute() { assertEquals( paths("/", "/a", "/a/b", "/a/b/c"), MorePaths.iterPaths(Paths.get("/a/b/c")).collect(toList()) ); }
public static Stream<Path> iterPaths(Path path) { Deque<Path> parents = new ArrayDeque<>(path.getNameCount()); Path next = path; while (next != null) { parents.addFirst(next); next = next.getParent(); } return ImmutableList.copyOf(parents).stream(); }
MorePaths { public static Stream<Path> iterPaths(Path path) { Deque<Path> parents = new ArrayDeque<>(path.getNameCount()); Path next = path; while (next != null) { parents.addFirst(next); next = next.getParent(); } return ImmutableList.copyOf(parents).stream(); } }
MorePaths { public static Stream<Path> iterPaths(Path path) { Deque<Path> parents = new ArrayDeque<>(path.getNameCount()); Path next = path; while (next != null) { parents.addFirst(next); next = next.getParent(); } return ImmutableList.copyOf(parents).stream(); } private MorePaths(); }
MorePaths { public static Stream<Path> iterPaths(Path path) { Deque<Path> parents = new ArrayDeque<>(path.getNameCount()); Path next = path; while (next != null) { parents.addFirst(next); next = next.getParent(); } return ImmutableList.copyOf(parents).stream(); } private MorePaths(); static Comparator<Path> oldestFirs...
MorePaths { public static Stream<Path> iterPaths(Path path) { Deque<Path> parents = new ArrayDeque<>(path.getNameCount()); Path next = path; while (next != null) { parents.addFirst(next); next = next.getParent(); } return ImmutableList.copyOf(parents).stream(); } private MorePaths(); static Comparator<Path> oldestFirs...
@Test void testEmpty() { assertEquals( paths(""), MorePaths.iterPaths(Paths.get("")).collect(toList()) ); }
public static Stream<Path> iterPaths(Path path) { Deque<Path> parents = new ArrayDeque<>(path.getNameCount()); Path next = path; while (next != null) { parents.addFirst(next); next = next.getParent(); } return ImmutableList.copyOf(parents).stream(); }
MorePaths { public static Stream<Path> iterPaths(Path path) { Deque<Path> parents = new ArrayDeque<>(path.getNameCount()); Path next = path; while (next != null) { parents.addFirst(next); next = next.getParent(); } return ImmutableList.copyOf(parents).stream(); } }
MorePaths { public static Stream<Path> iterPaths(Path path) { Deque<Path> parents = new ArrayDeque<>(path.getNameCount()); Path next = path; while (next != null) { parents.addFirst(next); next = next.getParent(); } return ImmutableList.copyOf(parents).stream(); } private MorePaths(); }
MorePaths { public static Stream<Path> iterPaths(Path path) { Deque<Path> parents = new ArrayDeque<>(path.getNameCount()); Path next = path; while (next != null) { parents.addFirst(next); next = next.getParent(); } return ImmutableList.copyOf(parents).stream(); } private MorePaths(); static Comparator<Path> oldestFirs...
MorePaths { public static Stream<Path> iterPaths(Path path) { Deque<Path> parents = new ArrayDeque<>(path.getNameCount()); Path next = path; while (next != null) { parents.addFirst(next); next = next.getParent(); } return ImmutableList.copyOf(parents).stream(); } private MorePaths(); static Comparator<Path> oldestFirs...
@Test void testJustFile() { assertEquals( paths("a"), MorePaths.iterPaths(Paths.get("a")).collect(toList()) ); }
public static Stream<Path> iterPaths(Path path) { Deque<Path> parents = new ArrayDeque<>(path.getNameCount()); Path next = path; while (next != null) { parents.addFirst(next); next = next.getParent(); } return ImmutableList.copyOf(parents).stream(); }
MorePaths { public static Stream<Path> iterPaths(Path path) { Deque<Path> parents = new ArrayDeque<>(path.getNameCount()); Path next = path; while (next != null) { parents.addFirst(next); next = next.getParent(); } return ImmutableList.copyOf(parents).stream(); } }
MorePaths { public static Stream<Path> iterPaths(Path path) { Deque<Path> parents = new ArrayDeque<>(path.getNameCount()); Path next = path; while (next != null) { parents.addFirst(next); next = next.getParent(); } return ImmutableList.copyOf(parents).stream(); } private MorePaths(); }
MorePaths { public static Stream<Path> iterPaths(Path path) { Deque<Path> parents = new ArrayDeque<>(path.getNameCount()); Path next = path; while (next != null) { parents.addFirst(next); next = next.getParent(); } return ImmutableList.copyOf(parents).stream(); } private MorePaths(); static Comparator<Path> oldestFirs...
MorePaths { public static Stream<Path> iterPaths(Path path) { Deque<Path> parents = new ArrayDeque<>(path.getNameCount()); Path next = path; while (next != null) { parents.addFirst(next); next = next.getParent(); } return ImmutableList.copyOf(parents).stream(); } private MorePaths(); static Comparator<Path> oldestFirs...
@Test public void testRegister() { Subscriber subscriber = new Subscriber(); eventBus.register(subscriber); Event e1 = new Event(); eventBus.post(e1); Event e2 = new Event(); eventBus.post(e2); assertEquals(asList(e1, e2), subscriber.events); }
public void register(Object object) { subscribeAll(finder.findAllSubscribers(object)); }
EventBus { public void register(Object object) { subscribeAll(finder.findAllSubscribers(object)); } }
EventBus { public void register(Object object) { subscribeAll(finder.findAllSubscribers(object)); } }
EventBus { public void register(Object object) { subscribeAll(finder.findAllSubscribers(object)); } void subscribe(Class<?> clazz, EventHandler handler); void subscribeAll(Multimap<Class<?>, EventHandler> handlers); void unsubscribe(Class<?> clazz, EventHandler handler); void unsubscribeAll(Multimap<Class<?>, EventHan...
EventBus { public void register(Object object) { subscribeAll(finder.findAllSubscribers(object)); } void subscribe(Class<?> clazz, EventHandler handler); void subscribeAll(Multimap<Class<?>, EventHandler> handlers); void unsubscribe(Class<?> clazz, EventHandler handler); void unsubscribeAll(Multimap<Class<?>, EventHan...
@Test public void testUnregister() { Subscriber subscriber = new Subscriber(); eventBus.register(subscriber); Event e1 = new Event(); eventBus.post(e1); eventBus.unregister(subscriber); Event e2 = new Event(); eventBus.post(e2); assertEquals(singletonList(e1), subscriber.events); }
public void unregister(Object object) { unsubscribeAll(finder.findAllSubscribers(object)); }
EventBus { public void unregister(Object object) { unsubscribeAll(finder.findAllSubscribers(object)); } }
EventBus { public void unregister(Object object) { unsubscribeAll(finder.findAllSubscribers(object)); } }
EventBus { public void unregister(Object object) { unsubscribeAll(finder.findAllSubscribers(object)); } void subscribe(Class<?> clazz, EventHandler handler); void subscribeAll(Multimap<Class<?>, EventHandler> handlers); void unsubscribe(Class<?> clazz, EventHandler handler); void unsubscribeAll(Multimap<Class<?>, Even...
EventBus { public void unregister(Object object) { unsubscribeAll(finder.findAllSubscribers(object)); } void subscribe(Class<?> clazz, EventHandler handler); void subscribeAll(Multimap<Class<?>, EventHandler> handlers); void unsubscribe(Class<?> clazz, EventHandler handler); void unsubscribeAll(Multimap<Class<?>, Even...
@Test public void testSlice() { try { CommandContext context = new CommandContext("foo bar baz"); assertArrayEquals(new String[] { "foo", "bar", "baz" }, context.getSlice(0)); } catch (CommandException e) { log.warn("Error", e); fail("Error creating CommandContext"); } }
public String[] getSlice(int index) { String[] slice = new String[originalArgs.length - index]; System.arraycopy(originalArgs, index, slice, 0, originalArgs.length - index); return slice; }
CommandContext { public String[] getSlice(int index) { String[] slice = new String[originalArgs.length - index]; System.arraycopy(originalArgs, index, slice, 0, originalArgs.length - index); return slice; } }
CommandContext { public String[] getSlice(int index) { String[] slice = new String[originalArgs.length - index]; System.arraycopy(originalArgs, index, slice, 0, originalArgs.length - index); return slice; } CommandContext(String args); CommandContext(String[] args); CommandContext(String args, Set<Character> valueFla...
CommandContext { public String[] getSlice(int index) { String[] slice = new String[originalArgs.length - index]; System.arraycopy(originalArgs, index, slice, 0, originalArgs.length - index); return slice; } CommandContext(String args); CommandContext(String[] args); CommandContext(String args, Set<Character> valueFla...
CommandContext { public String[] getSlice(int index) { String[] slice = new String[originalArgs.length - index]; System.arraycopy(originalArgs, index, slice, 0, originalArgs.length - index); return slice; } CommandContext(String args); CommandContext(String[] args); CommandContext(String args, Set<Character> valueFla...
@Test @DisplayName("throws ClassCastException if invalid argument to get") void throwsFromGetOnInvalidArgument() { assertThrows(ClassCastException.class, () -> map.get("")); }
@Override public V get(Object key) { BlockVector3 vec = (BlockVector3) key; Int2ObjectMap<V> activeMap = maps.get(toGroupKey(vec)); if (activeMap == null) { return null; } return activeMap.get(toInnerKey(vec)); }
BlockMap extends AbstractMap<BlockVector3, V> { @Override public V get(Object key) { BlockVector3 vec = (BlockVector3) key; Int2ObjectMap<V> activeMap = maps.get(toGroupKey(vec)); if (activeMap == null) { return null; } return activeMap.get(toInnerKey(vec)); } }
BlockMap extends AbstractMap<BlockVector3, V> { @Override public V get(Object key) { BlockVector3 vec = (BlockVector3) key; Int2ObjectMap<V> activeMap = maps.get(toGroupKey(vec)); if (activeMap == null) { return null; } return activeMap.get(toInnerKey(vec)); } private BlockMap(Supplier<Int2ObjectMap<V>> subMapSupplier...
BlockMap extends AbstractMap<BlockVector3, V> { @Override public V get(Object key) { BlockVector3 vec = (BlockVector3) key; Int2ObjectMap<V> activeMap = maps.get(toGroupKey(vec)); if (activeMap == null) { return null; } return activeMap.get(toInnerKey(vec)); } private BlockMap(Supplier<Int2ObjectMap<V>> subMapSupplier...
BlockMap extends AbstractMap<BlockVector3, V> { @Override public V get(Object key) { BlockVector3 vec = (BlockVector3) key; Int2ObjectMap<V> activeMap = maps.get(toGroupKey(vec)); if (activeMap == null) { return null; } return activeMap.get(toInnerKey(vec)); } private BlockMap(Supplier<Int2ObjectMap<V>> subMapSupplier...
@TestFactory public Stream<DynamicNode> testEvaluate() throws ExpressionException { List<ExpressionTestCase> testCases = ImmutableList.of( testCase("1 - 2 + 3", 2), testCase("2 + +4", 6), testCase("2 - -4", 6), testCase("2 * -4", -8), testCase("sin(5)", sin(5)), testCase("atan2(3, 4)", atan2(3, 4)), testCase("min(1, 2)...
public double evaluate(double... values) throws EvaluationException { return evaluate(values, WorldEdit.getInstance().getConfiguration().calculationTimeout); }
Expression { public double evaluate(double... values) throws EvaluationException { return evaluate(values, WorldEdit.getInstance().getConfiguration().calculationTimeout); } }
Expression { public double evaluate(double... values) throws EvaluationException { return evaluate(values, WorldEdit.getInstance().getConfiguration().calculationTimeout); } private Expression(String expression, String... variableNames); }
Expression { public double evaluate(double... values) throws EvaluationException { return evaluate(values, WorldEdit.getInstance().getConfiguration().calculationTimeout); } private Expression(String expression, String... variableNames); static Expression compile(String expression, String... variableNames); double eval...
Expression { public double evaluate(double... values) throws EvaluationException { return evaluate(values, WorldEdit.getInstance().getConfiguration().calculationTimeout); } private Expression(String expression, String... variableNames); static Expression compile(String expression, String... variableNames); double eval...
@Test public void testErrors() { { ExpressionException e = assertThrows(ExpressionException.class, () -> compile("#")); assertEquals(0, e.getPosition(), "Error position"); } { ExpressionException e = assertThrows(ExpressionException.class, () -> compile("x")); assertEquals(0, e.getPosition(), "Error position"); } { Exp...
public static Expression compile(String expression, String... variableNames) throws ExpressionException { return new Expression(expression, variableNames); }
Expression { public static Expression compile(String expression, String... variableNames) throws ExpressionException { return new Expression(expression, variableNames); } }
Expression { public static Expression compile(String expression, String... variableNames) throws ExpressionException { return new Expression(expression, variableNames); } private Expression(String expression, String... variableNames); }
Expression { public static Expression compile(String expression, String... variableNames) throws ExpressionException { return new Expression(expression, variableNames); } private Expression(String expression, String... variableNames); static Expression compile(String expression, String... variableNames); double evalua...
Expression { public static Expression compile(String expression, String... variableNames) throws ExpressionException { return new Expression(expression, variableNames); } private Expression(String expression, String... variableNames); static Expression compile(String expression, String... variableNames); double evalua...
@Test public void testTransform() { for (BlockType type : BlockType.REGISTRY.values()) { if (ignored.contains(type)) { continue; } BlockState base = type.getDefaultState(); BlockState rotated = base; for (int i = 1; i < 4; i++) { rotated = BlockTransformExtent.transform(base, ROTATE_90); } assertEquals(base, rotated); ...
public static <B extends BlockStateHolder<B>> B transform(B block, Transform transform) { checkNotNull(block); checkNotNull(transform); B result = block; List<? extends Property<?>> properties = block.getBlockType().getProperties(); for (Property<?> property : properties) { if (property instanceof DirectionalProperty) ...
BlockTransformExtent extends AbstractDelegateExtent { public static <B extends BlockStateHolder<B>> B transform(B block, Transform transform) { checkNotNull(block); checkNotNull(transform); B result = block; List<? extends Property<?>> properties = block.getBlockType().getProperties(); for (Property<?> property : prope...
BlockTransformExtent extends AbstractDelegateExtent { public static <B extends BlockStateHolder<B>> B transform(B block, Transform transform) { checkNotNull(block); checkNotNull(transform); B result = block; List<? extends Property<?>> properties = block.getBlockType().getProperties(); for (Property<?> property : prope...
BlockTransformExtent extends AbstractDelegateExtent { public static <B extends BlockStateHolder<B>> B transform(B block, Transform transform) { checkNotNull(block); checkNotNull(transform); B result = block; List<? extends Property<?>> properties = block.getBlockType().getProperties(); for (Property<?> property : prope...
BlockTransformExtent extends AbstractDelegateExtent { public static <B extends BlockStateHolder<B>> B transform(B block, Transform transform) { checkNotNull(block); checkNotNull(transform); B result = block; List<? extends Property<?>> properties = block.getBlockType().getProperties(); for (Property<?> property : prope...
@DisplayName("makes the root directory absolute if needed") @Test void rootIsAbsoluteDir() throws IOException { Path root = newTempDb(); try { Path relative = root.getFileSystem().getPath("relative"); Files.createDirectories(relative); FileSystemSnapshotDatabase db2 = new FileSystemSnapshotDatabase(relative, ArchiveNio...
public Path getRoot() { return root; }
FileSystemSnapshotDatabase implements SnapshotDatabase { public Path getRoot() { return root; } }
FileSystemSnapshotDatabase implements SnapshotDatabase { public Path getRoot() { return root; } FileSystemSnapshotDatabase(Path root, ArchiveNioSupport archiveNioSupport); }
FileSystemSnapshotDatabase implements SnapshotDatabase { public Path getRoot() { return root; } FileSystemSnapshotDatabase(Path root, ArchiveNioSupport archiveNioSupport); static ZonedDateTime tryParseDate(Path path); static URI createUri(String name); static FileSystemSnapshotDatabase maybeCreate( Path root, ...
FileSystemSnapshotDatabase implements SnapshotDatabase { public Path getRoot() { return root; } FileSystemSnapshotDatabase(Path root, ArchiveNioSupport archiveNioSupport); static ZonedDateTime tryParseDate(Path path); static URI createUri(String name); static FileSystemSnapshotDatabase maybeCreate( Path root, ...