repo_name stringlengths 7 104 | file_path stringlengths 13 198 | context stringlengths 67 7.15k | import_statement stringlengths 16 4.43k | code stringlengths 40 6.98k | prompt stringlengths 227 8.27k | next_line stringlengths 8 795 |
|---|---|---|---|---|---|---|
nebhale/JsonPath | src/main/java/com/nebhale/jsonpath/internal/component/IndexPathComponent.java | // Path: src/main/java/com/nebhale/jsonpath/internal/util/ArrayUtils.java
// public final class ArrayUtils {
//
// private static final String DELIMITERS = ", ";
//
// private ArrayUtils() {
// }
//
// public static int[] parseAsIntArray(String value) {
// StringTokenizer tokenizer = new Stri... | import java.util.Arrays;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
import com.nebhale.jsonpath.internal.util.ArrayUtils; | /*
* Copyright 2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | // Path: src/main/java/com/nebhale/jsonpath/internal/util/ArrayUtils.java
// public final class ArrayUtils {
//
// private static final String DELIMITERS = ", ";
//
// private ArrayUtils() {
// }
//
// public static int[] parseAsIntArray(String value) {
// StringTokenizer tokenizer = new Stri... | this.indexes = ArrayUtils.parseAsIntArray(indexes); |
nebhale/JsonPath | src/test/java/com/nebhale/jsonpath/internal/component/AbstractChainedPathComponentTest.java | // Path: src/test/java/com/nebhale/jsonpath/testutils/JsonUtils.java
// public static final JsonNode NODE;
| import static com.nebhale.jsonpath.testutils.JsonUtils.NODE;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import org.junit.Test;
import com.fasterxml.jackson.databind.JsonNode; | /*
* Copyright 2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | // Path: src/test/java/com/nebhale/jsonpath/testutils/JsonUtils.java
// public static final JsonNode NODE;
// Path: src/test/java/com/nebhale/jsonpath/internal/component/AbstractChainedPathComponentTest.java
import static com.nebhale.jsonpath.testutils.JsonUtils.NODE;
import static org.junit.Assert.assertTrue;
import... | chainedPathComponent.get(NODE); |
googleapis/java-errorreporting | google-cloud-errorreporting/src/test/java/com/google/devtools/clouderrorreporting/v1beta1/ErrorStatsServiceClientTest.java | // Path: google-cloud-errorreporting/src/main/java/com/google/devtools/clouderrorreporting/v1beta1/ErrorStatsServiceClient.java
// public static class ListEventsPagedResponse
// extends AbstractPagedListResponse<
// ListEventsRequest,
// ListEventsResponse,
// ErrorEvent,
// ListEven... | import static com.google.devtools.clouderrorreporting.v1beta1.ErrorStatsServiceClient.ListEventsPagedResponse;
import static com.google.devtools.clouderrorreporting.v1beta1.ErrorStatsServiceClient.ListGroupStatsPagedResponse;
import com.google.api.gax.core.NoCredentialsProvider;
import com.google.api.gax.grpc.GaxGrpcPr... | @Before
public void setUp() throws IOException {
mockServiceHelper.reset();
channelProvider = mockServiceHelper.createChannelProvider();
ErrorStatsServiceSettings settings =
ErrorStatsServiceSettings.newBuilder()
.setTransportChannelProvider(channelProvider)
.setCredentia... | // Path: google-cloud-errorreporting/src/main/java/com/google/devtools/clouderrorreporting/v1beta1/ErrorStatsServiceClient.java
// public static class ListEventsPagedResponse
// extends AbstractPagedListResponse<
// ListEventsRequest,
// ListEventsResponse,
// ErrorEvent,
// ListEven... | ListGroupStatsPagedResponse pagedListResponse = client.listGroupStats(projectName, timeRange); |
googleapis/java-errorreporting | google-cloud-errorreporting/src/test/java/com/google/devtools/clouderrorreporting/v1beta1/ErrorStatsServiceClientTest.java | // Path: google-cloud-errorreporting/src/main/java/com/google/devtools/clouderrorreporting/v1beta1/ErrorStatsServiceClient.java
// public static class ListEventsPagedResponse
// extends AbstractPagedListResponse<
// ListEventsRequest,
// ListEventsResponse,
// ErrorEvent,
// ListEven... | import static com.google.devtools.clouderrorreporting.v1beta1.ErrorStatsServiceClient.ListEventsPagedResponse;
import static com.google.devtools.clouderrorreporting.v1beta1.ErrorStatsServiceClient.ListGroupStatsPagedResponse;
import com.google.api.gax.core.NoCredentialsProvider;
import com.google.api.gax.grpc.GaxGrpcPr... | }
@Test
public void listGroupStatsExceptionTest2() throws Exception {
StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT);
mockErrorStatsService.addException(exception);
try {
String projectName = "projectName-940047036";
QueryTimeRange timeRang... | // Path: google-cloud-errorreporting/src/main/java/com/google/devtools/clouderrorreporting/v1beta1/ErrorStatsServiceClient.java
// public static class ListEventsPagedResponse
// extends AbstractPagedListResponse<
// ListEventsRequest,
// ListEventsResponse,
// ErrorEvent,
// ListEven... | ListEventsPagedResponse pagedListResponse = client.listEvents(projectName, groupId); |
googleapis/java-errorreporting | google-cloud-errorreporting/src/test/java/com/google/devtools/clouderrorreporting/v1beta1/MockErrorGroupServiceImpl.java | // Path: grpc-google-cloud-error-reporting-v1beta1/src/main/java/com/google/devtools/clouderrorreporting/v1beta1/ErrorGroupServiceGrpc.java
// public abstract static class ErrorGroupServiceImplBase implements io.grpc.BindableService {
//
// /**
// *
// *
// * <pre>
// * Get the specified group.
// * <... | import com.google.api.core.BetaApi;
import com.google.devtools.clouderrorreporting.v1beta1.ErrorGroupServiceGrpc.ErrorGroupServiceImplBase;
import com.google.protobuf.AbstractMessage;
import io.grpc.stub.StreamObserver;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Que... | /*
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | // Path: grpc-google-cloud-error-reporting-v1beta1/src/main/java/com/google/devtools/clouderrorreporting/v1beta1/ErrorGroupServiceGrpc.java
// public abstract static class ErrorGroupServiceImplBase implements io.grpc.BindableService {
//
// /**
// *
// *
// * <pre>
// * Get the specified group.
// * <... | public class MockErrorGroupServiceImpl extends ErrorGroupServiceImplBase { |
googleapis/java-errorreporting | google-cloud-errorreporting/src/test/java/com/google/devtools/clouderrorreporting/v1beta1/MockErrorStatsServiceImpl.java | // Path: grpc-google-cloud-error-reporting-v1beta1/src/main/java/com/google/devtools/clouderrorreporting/v1beta1/ErrorStatsServiceGrpc.java
// public abstract static class ErrorStatsServiceImplBase implements io.grpc.BindableService {
//
// /**
// *
// *
// * <pre>
// * Lists the specified groups.
// ... | import com.google.api.core.BetaApi;
import com.google.devtools.clouderrorreporting.v1beta1.ErrorStatsServiceGrpc.ErrorStatsServiceImplBase;
import com.google.protobuf.AbstractMessage;
import io.grpc.stub.StreamObserver;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Que... | /*
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | // Path: grpc-google-cloud-error-reporting-v1beta1/src/main/java/com/google/devtools/clouderrorreporting/v1beta1/ErrorStatsServiceGrpc.java
// public abstract static class ErrorStatsServiceImplBase implements io.grpc.BindableService {
//
// /**
// *
// *
// * <pre>
// * Lists the specified groups.
// ... | public class MockErrorStatsServiceImpl extends ErrorStatsServiceImplBase { |
googleapis/java-errorreporting | google-cloud-errorreporting/src/test/java/com/google/devtools/clouderrorreporting/v1beta1/MockReportErrorsServiceImpl.java | // Path: grpc-google-cloud-error-reporting-v1beta1/src/main/java/com/google/devtools/clouderrorreporting/v1beta1/ReportErrorsServiceGrpc.java
// public abstract static class ReportErrorsServiceImplBase implements io.grpc.BindableService {
//
// /**
// *
// *
// * <pre>
// * Report an individual error eve... | import com.google.api.core.BetaApi;
import com.google.devtools.clouderrorreporting.v1beta1.ReportErrorsServiceGrpc.ReportErrorsServiceImplBase;
import com.google.protobuf.AbstractMessage;
import io.grpc.stub.StreamObserver;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util... | /*
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | // Path: grpc-google-cloud-error-reporting-v1beta1/src/main/java/com/google/devtools/clouderrorreporting/v1beta1/ReportErrorsServiceGrpc.java
// public abstract static class ReportErrorsServiceImplBase implements io.grpc.BindableService {
//
// /**
// *
// *
// * <pre>
// * Report an individual error eve... | public class MockReportErrorsServiceImpl extends ReportErrorsServiceImplBase { |
carlanton/mpd-tools | parser/src/main/java/io/lindstrom/mpd/data/SegmentTemplate.java | // Path: parser/src/main/java/io/lindstrom/mpd/support/Utils.java
// public class Utils {
// public static <T> List<T> unmodifiableList(List<T> list) {
// if (list == null) {
// return List.of();
// } else {
// return List.copyOf(list);
// }
// }
//
// @SafeV... | import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.lindstrom.mpd.support.Utils;
import java.u... | this.startNumber = startNumber;
this.timescale = timescale;
this.presentationTimeOffset = presentationTimeOffset;
this.indexRange = indexRange;
this.indexRangeExact = indexRangeExact;
this.availabilityTimeOffset = availabilityTimeOffset;
this.availabilityTimeCompl... | // Path: parser/src/main/java/io/lindstrom/mpd/support/Utils.java
// public class Utils {
// public static <T> List<T> unmodifiableList(List<T> list) {
// if (list == null) {
// return List.of();
// } else {
// return List.copyOf(list);
// }
// }
//
// @SafeV... | return Utils.unmodifiableList(segmentTimeline); |
carlanton/mpd-tools | parser/src/main/java/io/lindstrom/mpd/data/EventStream.java | // Path: parser/src/main/java/io/lindstrom/mpd/support/Utils.java
// public class Utils {
// public static <T> List<T> unmodifiableList(List<T> list) {
// if (list == null) {
// return List.of();
// } else {
// return List.copyOf(list);
// }
// }
//
// @SafeV... | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.lindstrom.mpd.support.Utils;
import java.util.List;
import java.util.Objects; | private final String value;
@JacksonXmlProperty(isAttribute = true)
private final Long timescale;
@JacksonXmlProperty(isAttribute = true)
private final String messageData;
private EventStream(List<Event> events, String href, ActuateType actuate, String schemeIdUri, String value, Long timescal... | // Path: parser/src/main/java/io/lindstrom/mpd/support/Utils.java
// public class Utils {
// public static <T> List<T> unmodifiableList(List<T> list) {
// if (list == null) {
// return List.of();
// } else {
// return List.copyOf(list);
// }
// }
//
// @SafeV... | return Utils.unmodifiableList(events); |
carlanton/mpd-tools | parser/src/main/java/io/lindstrom/mpd/data/RepresentationBase.java | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.lindstrom.mpd.data.descriptor.Descriptor;
import io.lindstrom.mpd.support.Utils;
import java.util.List;
import java.util.Objects; | package io.lindstrom.mpd.data;
@JsonPropertyOrder({
"framePackings",
"audioChannelConfigurations",
"contentProtections",
"essentialProperties",
"supplementalProperties",
"inbandEventStreams"
})
public abstract class RepresentationBase {
@JacksonXmlProperty(localName = "FramePacking", nam... | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | private final List<Descriptor> framePackings; |
carlanton/mpd-tools | parser/src/main/java/io/lindstrom/mpd/data/RepresentationBase.java | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.lindstrom.mpd.data.descriptor.Descriptor;
import io.lindstrom.mpd.support.Utils;
import java.util.List;
import java.util.Objects; | this.startWithSAP = startWithSAP;
this.maxPlayoutRate = maxPlayoutRate;
this.codingDependency = codingDependency;
this.scanType = scanType;
}
RepresentationBase() {
this.framePackings = null;
this.audioChannelConfigurations = null;
this.contentProtections... | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | return Utils.unmodifiableList(framePackings); |
carlanton/mpd-tools | parser/src/test/java/io/lindstrom/mpd/support/ProfilesSerializerTest.java | // Path: parser/src/main/java/io/lindstrom/mpd/data/Profile.java
// public enum Profile {
// /**
// * MPEG-DASH Full profile.
// */
// MPEG_DASH_FULL("urn:mpeg:dash:profile:full:2011"),
//
// /**
// * MPEG-DASH ISO Base media file format On Demand profile.
// */
// MPEG_DASH_ON_DEMA... | import io.lindstrom.mpd.data.Profile;
import io.lindstrom.mpd.data.Profiles;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.util.Arrays;
import java.util.Collections;
import static org.junit.jupiter.api.Assertions.assertEquals; | package io.lindstrom.mpd.support;
public class ProfilesSerializerTest extends ObjectMapperTestBase<Profiles> {
@BeforeEach
public void ProfilesSerializerTest() {
initObjectMapperTestBase(Profiles.class, new ProfilesSerializer(), new ProfilesDeserializer());
}
@Test
public void serializ... | // Path: parser/src/main/java/io/lindstrom/mpd/data/Profile.java
// public enum Profile {
// /**
// * MPEG-DASH Full profile.
// */
// MPEG_DASH_FULL("urn:mpeg:dash:profile:full:2011"),
//
// /**
// * MPEG-DASH ISO Base media file format On Demand profile.
// */
// MPEG_DASH_ON_DEMA... | Profiles profiles = new Profiles(Arrays.asList(Profile.MPEG_DASH_LIVE, Profile.HBBTV15), |
carlanton/mpd-tools | validator/src/main/java/io/lindstrom/mpd/validator/rules/RoleValidator.java | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | import io.lindstrom.mpd.data.descriptor.Descriptor;
import java.util.Arrays;
import java.util.List; | package io.lindstrom.mpd.validator.rules;
public class RoleValidator {
/*
*
* R13.*: Check the conformance of Role
*
*/
private static final List<String> VALID_ROLES = Arrays.asList(
"caption",
"subtitle",
"main",
"alternate",
... | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | private static Violation ruleR130(Descriptor role) { |
carlanton/mpd-tools | parser/src/main/java/io/lindstrom/mpd/data/Representation.java | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.lindstrom.mpd.data.descriptor.Descriptor;
import io.lindstrom.mpd.support.Utils;
import java.util.List;
import java.util.Objects; | @JacksonXmlProperty(localName = "BaseURL", namespace = MPD.NAMESPACE)
private final List<BaseURL> baseURLs;
@JacksonXmlProperty(localName = "SubRepresentation", namespace = MPD.NAMESPACE)
private final List<SubRepresentation> subRepresentations;
@JacksonXmlProperty(localName = "SegmentBase", names... | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | private Representation(List<Descriptor> framePackings, List<Descriptor> audioChannelConfigurations, List<Descriptor> contentProtections, List<Descriptor> essentialProperties, List<Descriptor> supplementalProperties, List<EventStream> inbandEventStreams, String profiles, Long width, Long height, Ratio sar, FrameRate... |
carlanton/mpd-tools | parser/src/main/java/io/lindstrom/mpd/data/Representation.java | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.lindstrom.mpd.data.descriptor.Descriptor;
import io.lindstrom.mpd.support.Utils;
import java.util.List;
import java.util.Objects; |
private Representation(List<Descriptor> framePackings, List<Descriptor> audioChannelConfigurations, List<Descriptor> contentProtections, List<Descriptor> essentialProperties, List<Descriptor> supplementalProperties, List<EventStream> inbandEventStreams, String profiles, Long width, Long height, Ratio sar, FrameRat... | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | return Utils.unmodifiableList(baseURLs); |
carlanton/mpd-tools | parser/src/main/java/io/lindstrom/mpd/data/SubRepresentation.java | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.lindstrom.mpd.data.descriptor.Descriptor;
import java.util.List;
import java.util.Objects; | package io.lindstrom.mpd.data;
public class SubRepresentation extends RepresentationBase {
@JacksonXmlProperty(isAttribute = true)
private final Long level;
@JacksonXmlProperty(isAttribute = true)
private final String dependencyLevel;
@JacksonXmlProperty(isAttribute = true)
private final Lo... | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | private SubRepresentation(List<Descriptor> framePackings, List<Descriptor> audioChannelConfigurations, List<Descriptor> contentProtections, List<Descriptor> essentialProperties, List<Descriptor> supplementalProperties, List<EventStream> inbandEventStreams, String profiles, Long width, Long height, Ratio sar, FrameR... |
carlanton/mpd-tools | validator/src/main/java/io/lindstrom/mpd/validator/rules/RepresentationValidator.java | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | import io.lindstrom.mpd.data.*;
import io.lindstrom.mpd.data.descriptor.Descriptor;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; | return Violation.empty();
}
public static List<Violation> validate(MPD mpd, Period period, AdaptationSet adaptationSet, Representation representation) {
List<Violation> violations = new ArrayList<>();
violations.addAll(Arrays.asList(
ruleR501(adaptationSet, representation),... | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | for (Descriptor framePacking : representation.getFramePackings()) { |
carlanton/mpd-tools | validator/src/main/java/io/lindstrom/mpd/validator/rules/AdaptationSetValidator.java | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | import io.lindstrom.mpd.data.*;
import io.lindstrom.mpd.data.descriptor.Descriptor;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.stream.Collectors; | ruleR33(adaptationSet),
ruleR34(adaptationSet),
ruleR35(adaptationSet),
ruleR36(adaptationSet),
ruleR37(adaptationSet),
ruleR38(adaptationSet),
ruleR39(adaptationSet),
ruleRD30(adaptationSet, mpd),
ruleRD31(adapt... | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | for (Descriptor framePacking : adaptationSet.getFramePackings()) { |
carlanton/mpd-tools | parser/src/main/java/io/lindstrom/mpd/support/ProfilesDeserializer.java | // Path: parser/src/main/java/io/lindstrom/mpd/data/Profile.java
// public enum Profile {
// /**
// * MPEG-DASH Full profile.
// */
// MPEG_DASH_FULL("urn:mpeg:dash:profile:full:2011"),
//
// /**
// * MPEG-DASH ISO Base media file format On Demand profile.
// */
// MPEG_DASH_ON_DEMA... | import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import io.lindstrom.mpd.data.Profile;
import io.lindstrom.mpd.data.Profiles;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List; | package io.lindstrom.mpd.support;
public class ProfilesDeserializer extends JsonDeserializer<Profiles> {
@Override
public Profiles deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
String text = p.getText();
| // Path: parser/src/main/java/io/lindstrom/mpd/data/Profile.java
// public enum Profile {
// /**
// * MPEG-DASH Full profile.
// */
// MPEG_DASH_FULL("urn:mpeg:dash:profile:full:2011"),
//
// /**
// * MPEG-DASH ISO Base media file format On Demand profile.
// */
// MPEG_DASH_ON_DEMA... | List<Profile> profiles = new ArrayList<>(); |
carlanton/mpd-tools | validator/src/main/java/io/lindstrom/mpd/validator/rules/EventStreamValidator.java | // Path: parser/src/main/java/io/lindstrom/mpd/data/EventStream.java
// public class EventStream {
// @JacksonXmlProperty(localName = "Event", namespace = MPD.NAMESPACE)
// private final List<Event> events;
//
// @JacksonXmlProperty(isAttribute = true, namespace = "http://www.w3.org/1999/xlink")
// pri... | import io.lindstrom.mpd.data.EventStream;
import java.util.Arrays;
import java.util.List; | package io.lindstrom.mpd.validator.rules;
public class EventStreamValidator {
/*
*
* R16.*: Check the conformance of SegmentList
*
*/
@ValidationRule("if (@actuate and not(@href)) then false() else true()") | // Path: parser/src/main/java/io/lindstrom/mpd/data/EventStream.java
// public class EventStream {
// @JacksonXmlProperty(localName = "Event", namespace = MPD.NAMESPACE)
// private final List<Event> events;
//
// @JacksonXmlProperty(isAttribute = true, namespace = "http://www.w3.org/1999/xlink")
// pri... | private static Violation ruleR160(EventStream eventStream) { |
carlanton/mpd-tools | parser/src/main/java/io/lindstrom/mpd/data/Profiles.java | // Path: parser/src/main/java/io/lindstrom/mpd/support/ProfilesDeserializer.java
// public class ProfilesDeserializer extends JsonDeserializer<Profiles> {
// @Override
// public Profiles deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
// String text = p.getText();
//
// ... | import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.lindstrom.mpd.support.ProfilesDeserializer;
import io.lindstrom.mpd.support.ProfilesSerializer;
import io.lindstrom.mpd.support.Utils;
import java.util.List;
import java.util.Objec... | package io.lindstrom.mpd.data;
@JsonSerialize(using = ProfilesSerializer.class)
@JsonDeserialize(using = ProfilesDeserializer.class)
public class Profiles {
private final List<Profile> profiles;
private final List<String> interoperabilityPointsAndExtensions;
public Profiles(List<Profile> profiles, List<... | // Path: parser/src/main/java/io/lindstrom/mpd/support/ProfilesDeserializer.java
// public class ProfilesDeserializer extends JsonDeserializer<Profiles> {
// @Override
// public Profiles deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
// String text = p.getText();
//
// ... | return Utils.unmodifiableList(profiles); |
carlanton/mpd-tools | parser/src/main/java/io/lindstrom/mpd/data/Metrics.java | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.lindstrom.mpd.data.descriptor.Descriptor;
import io.lindstrom.mpd.support.Utils;
import java.util.List;
import java.util.Objects; | package io.lindstrom.mpd.data;
public class Metrics {
@JacksonXmlProperty(localName = "Reporting", namespace = MPD.NAMESPACE) | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | private final List<Descriptor> reportings; |
carlanton/mpd-tools | parser/src/main/java/io/lindstrom/mpd/data/Metrics.java | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.lindstrom.mpd.data.descriptor.Descriptor;
import io.lindstrom.mpd.support.Utils;
import java.util.List;
import java.util.Objects; | package io.lindstrom.mpd.data;
public class Metrics {
@JacksonXmlProperty(localName = "Reporting", namespace = MPD.NAMESPACE)
private final List<Descriptor> reportings;
@JacksonXmlProperty(localName = "Range", namespace = MPD.NAMESPACE)
private final List<Range> ranges;
@JacksonXmlProperty(isAt... | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | return Utils.unmodifiableList(reportings); |
carlanton/mpd-tools | parser/src/test/java/io/lindstrom/mpd/data/DataTypeTest.java | // Path: parser/src/main/java/io/lindstrom/mpd/MPDParser.java
// public class MPDParser {
//
// private final ObjectMapper objectMapper;
//
// public MPDParser() {
// this(defaultObjectMapper());
// }
//
// public MPDParser(ObjectMapper objectMapper) {
// this.objectMapper = objectMap... | import io.lindstrom.mpd.MPDParser;
import org.apache.commons.lang3.reflect.FieldUtils;
import org.junit.jupiter.api.Test;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.ut... | package io.lindstrom.mpd.data;
public class DataTypeTest {
private static final String PACKAGE = DataTypeTest.class.getPackage().getName();
@Test
public void rebuildMPD() throws Exception { | // Path: parser/src/main/java/io/lindstrom/mpd/MPDParser.java
// public class MPDParser {
//
// private final ObjectMapper objectMapper;
//
// public MPDParser() {
// this(defaultObjectMapper());
// }
//
// public MPDParser(ObjectMapper objectMapper) {
// this.objectMapper = objectMap... | MPD mpd = new MPDParser().parse(Files.newInputStream(Paths.get("src/test/resources/random.mpd"))); |
carlanton/mpd-tools | parser/src/main/java/io/lindstrom/mpd/data/ContentComponent.java | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.lindstrom.mpd.data.descriptor.Descriptor;
import io.lindstrom.mpd.support.Utils;
import java.util.List;
import java.util.Objects; | package io.lindstrom.mpd.data;
@JsonPropertyOrder({
"accessibility",
"role",
"rating",
"viewpoint",
"any"
})
public class ContentComponent {
@JacksonXmlProperty(localName = "Accessibility", namespace = MPD.NAMESPACE) | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | private final List<Descriptor> accessibilities; |
carlanton/mpd-tools | parser/src/main/java/io/lindstrom/mpd/data/ContentComponent.java | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.lindstrom.mpd.data.descriptor.Descriptor;
import io.lindstrom.mpd.support.Utils;
import java.util.List;
import java.util.Objects; | @JacksonXmlProperty(isAttribute = true)
private final String contentType;
@JacksonXmlProperty(isAttribute = true)
private final Ratio par;
private ContentComponent(List<Descriptor> accessibilities, List<Descriptor> roles, List<Descriptor> ratings, List<Descriptor> viewpoints, Long id, String lang,... | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | return Utils.unmodifiableList(accessibilities); |
carlanton/mpd-tools | parser/src/main/java/io/lindstrom/mpd/data/SegmentList.java | // Path: parser/src/main/java/io/lindstrom/mpd/support/Utils.java
// public class Utils {
// public static <T> List<T> unmodifiableList(List<T> list) {
// if (list == null) {
// return List.of();
// } else {
// return List.copyOf(list);
// }
// }
//
// @SafeV... | import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.lindstrom.mpd.support.Utils;
import java.util.List;
import java.util.Objects; | }
@SuppressWarnings("unused")
private SegmentList() {
this.initialization = null;
this.representationIndex = null;
this.segmentTimeline = null;
this.bitstreamswitchingElement = null;
this.segmentURLs = null;
this.duration = null;
this.startNumber = nu... | // Path: parser/src/main/java/io/lindstrom/mpd/support/Utils.java
// public class Utils {
// public static <T> List<T> unmodifiableList(List<T> list) {
// if (list == null) {
// return List.of();
// } else {
// return List.copyOf(list);
// }
// }
//
// @SafeV... | return Utils.unmodifiableList(segmentTimeline); |
carlanton/mpd-tools | parser/src/main/java/io/lindstrom/mpd/data/Period.java | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.lindstrom.mpd.data.descriptor.Descriptor;
import io.lindstrom.mpd.support.Utils;
import java.time.Duration;
import java.util.List;
import java.util.Objects; | package io.lindstrom.mpd.data;
@JsonPropertyOrder({
"id",
"baseURLs",
"segmentBase",
"segmentList",
"segmentTemplate",
"assetIdentifier",
"eventStreams",
"adaptationSets",
"subsets",
"supplementalProperties"
})
public class Period {
... | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | private final Descriptor assetIdentifier; |
carlanton/mpd-tools | parser/src/main/java/io/lindstrom/mpd/data/Period.java | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.lindstrom.mpd.data.descriptor.Descriptor;
import io.lindstrom.mpd.support.Utils;
import java.time.Duration;
import java.util.List;
import java.util.Objects; | this.subsets = subsets;
this.supplementalProperties = supplementalProperties;
this.href = href;
this.actuate = actuate;
this.id = id;
this.start = start;
this.duration = duration;
this.bitstreamSwitching = bitstreamSwitching;
}
@SuppressWarnings("... | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | return Utils.unmodifiableList(baseURLs); |
carlanton/mpd-tools | validator/src/main/java/io/lindstrom/mpd/validator/rules/MPDValidator.java | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | import io.lindstrom.mpd.data.*;
import io.lindstrom.mpd.data.descriptor.Descriptor;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors; | "(@schemeIdUri = 'urn:mpeg:dash:utc:http-iso:2014') or (@schemeIdUri = 'urn:mpeg:dash:utc:http-ntp:2014') or " +
"(@schemeIdUri = 'urn:mpeg:dash:utc:direct:2014')) then true() else false()")
private static Violation ruleR181(UTCTiming utcTiming) {
// We are using an enum here, so thi... | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | for (Descriptor descriptor : mpd.getSupplementalProperties()) { |
carlanton/mpd-tools | parser/src/main/java/io/lindstrom/mpd/data/MPD.java | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import io.lindstrom.mpd.data.descriptor.Descriptor;
import io.lindstrom.mpd.support.Utils;
import java.time.... | package io.lindstrom.mpd.data;
@JsonPropertyOrder({
"programInformations",
"baseURLs",
"locations",
"periods",
"metrics",
"essentialProperties",
"supplementalProperties",
"utcTimings"
})
@JacksonXmlRootElement(localName = "MPD", namespace = io.lindstrom.mpd.data.MPD.NAMESPACE)
public ... | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | private final List<Descriptor> essentialProperties; |
carlanton/mpd-tools | parser/src/main/java/io/lindstrom/mpd/data/MPD.java | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import io.lindstrom.mpd.data.descriptor.Descriptor;
import io.lindstrom.mpd.support.Utils;
import java.time.... | this.maxSubsegmentDuration = maxSubsegmentDuration;
}
@SuppressWarnings("unused")
private MPD() {
this.programInformations = null;
this.baseURLs = null;
this.locations = null;
this.periods = null;
this.metrics = null;
this.essentialProperties = null;
... | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | return Utils.unmodifiableList(programInformations); |
carlanton/mpd-tools | validator/src/main/java/io/lindstrom/mpd/validator/rules/PeriodValidator.java | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | import io.lindstrom.mpd.data.*;
import io.lindstrom.mpd.data.descriptor.Descriptor;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.stream.Collectors; | ruleR20(period),
ruleR21(mpd),
ruleR23(period),
ruleR24(period, mpd),
ruleR251(period),
ruleR252(period),
ruleRD20(period, mpd),
ruleRD21(period, mpd),
ruleR171(period)));
for (EventStream eventStream : ... | // Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
// use = JsonTypeInfo.Id.NAME,
// property = "schemeIdUri",
// include = JsonTypeInfo.As.EXISTING_PROPERTY,
// visible = true,
// defaultImpl = GenericDescriptor.class)
// @JsonSubTyp... | for (Descriptor supplementalProperty : mpd.getSupplementalProperties()) { |
Justice-love/tiger | tiger/src/main/java/org/eddy/tiger/context/AbstractContext.java | // Path: tiger/src/main/java/org/eddy/tiger/TigerBean.java
// public interface TigerBean<T> extends Bean<T> {
//
// boolean isRight(String name, Type type);
//
// boolean isConstructor();
//
// ConstructorInjectionPoint getConstructorInjectionPoint();
// }
| import java.lang.annotation.Annotation;
import javax.enterprise.context.spi.Context;
import javax.enterprise.context.spi.Contextual;
import javax.enterprise.context.spi.CreationalContext;
import org.eddy.tiger.TigerBean; | /**
*
* @creatTime 上午10:56:43
* @author Eddy
*/
package org.eddy.tiger.context;
/**
* @author Eddy
*
*/
public abstract class AbstractContext implements Context {
private Class<? extends Annotation> scop;
/**
* 构造函数
*
* @creatTime 上午11:07:09
* @author Eddy
*/
public AbstractContext() {
}
... | // Path: tiger/src/main/java/org/eddy/tiger/TigerBean.java
// public interface TigerBean<T> extends Bean<T> {
//
// boolean isRight(String name, Type type);
//
// boolean isConstructor();
//
// ConstructorInjectionPoint getConstructorInjectionPoint();
// }
// Path: tiger/src/main/java/org/eddy/tiger/context/A... | public abstract TigerBean<?> getByName(String name); |
Justice-love/tiger | tiger/src/main/java/org/eddy/tiger/TigerBean.java | // Path: tiger/src/main/java/org/eddy/tiger/point/ConstructorInjectionPoint.java
// public class ConstructorInjectionPoint extends AbstractInjectionPoint {
//
// /**
// * 构造函数
// * @param annotated
// * @creatTime 下午5:42:51
// * @author Eddy
// */
// public ConstructorInjectionPoint(Annotated annotated) {
... | import javax.enterprise.inject.spi.Bean;
import org.eddy.tiger.point.ConstructorInjectionPoint;
import java.lang.reflect.Type; | /**
*
* @creatTime 上午11:38:55
* @author Eddy
*/
package org.eddy.tiger;
/**
* @author Eddy
*
*/
public interface TigerBean<T> extends Bean<T> {
boolean isRight(String name, Type type);
boolean isConstructor();
| // Path: tiger/src/main/java/org/eddy/tiger/point/ConstructorInjectionPoint.java
// public class ConstructorInjectionPoint extends AbstractInjectionPoint {
//
// /**
// * 构造函数
// * @param annotated
// * @creatTime 下午5:42:51
// * @author Eddy
// */
// public ConstructorInjectionPoint(Annotated annotated) {
... | ConstructorInjectionPoint getConstructorInjectionPoint(); |
Justice-love/tiger | tiger/src/main/java/org/eddy/tiger/context/CreationalContextImpl.java | // Path: tiger/src/main/java/org/eddy/tiger/TigerBean.java
// public interface TigerBean<T> extends Bean<T> {
//
// boolean isRight(String name, Type type);
//
// boolean isConstructor();
//
// ConstructorInjectionPoint getConstructorInjectionPoint();
// }
| import java.util.HashSet;
import java.util.Set;
import org.eddy.tiger.TigerBean;
import java.lang.reflect.Type; | /**
*
* @creatTime 上午11:35:28
* @author Eddy
*/
package org.eddy.tiger.context;
/**
* @author Eddy
*
*/
public class CreationalContextImpl<T> implements TigerCreationalContext<T> {
private Set<T> incompleteInstances = new HashSet<>();
private AbstractContext context;
/**
* 构造函数
* @creatTime 上午9:1... | // Path: tiger/src/main/java/org/eddy/tiger/TigerBean.java
// public interface TigerBean<T> extends Bean<T> {
//
// boolean isRight(String name, Type type);
//
// boolean isConstructor();
//
// ConstructorInjectionPoint getConstructorInjectionPoint();
// }
// Path: tiger/src/main/java/org/eddy/tiger/context/C... | if (((TigerBean<?>) bean).isRight(name, null)) { |
Justice-love/tiger | tiger/src/main/java/org/eddy/tiger/annotated/impl/AnnotatedTypeImpl.java | // Path: tiger/src/main/java/org/eddy/tiger/util/Reflects.java
// public class Reflects {
//
// /**
// * 获取当前class及父class的属性列表
// *
// * @param glass
// * @return
// * @creatTime 下午2:31:34
// * @author Eddy
// */
// public static Set<Field> getFields(Class<?> glass) {
// if (null == glass)
// thr... | import java.lang.annotation.Annotation;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import javax.enterprise.inject.spi.AnnotatedConstructor;
import javax.ent... | * @creatTime 下午8:07:16
* @author Eddy
*/
@SuppressWarnings("unused")
@Deprecated
private boolean named(Annotation[][] annos) {
for (Annotation[] ann : annos) {
if (named(ann)) return true;
}
return false;
}
/**
* 构造函数
* @creatTime 下午3:44:05
* @author Eddy
*/
public AnnotatedTypeImpl(Class... | // Path: tiger/src/main/java/org/eddy/tiger/util/Reflects.java
// public class Reflects {
//
// /**
// * 获取当前class及父class的属性列表
// *
// * @param glass
// * @return
// * @creatTime 下午2:31:34
// * @author Eddy
// */
// public static Set<Field> getFields(Class<?> glass) {
// if (null == glass)
// thr... | Set<Method> set = Reflects.getMethods(this.beanClass); |
tatools/sunshine | sunshine-testng/src/main/java/org/tatools/sunshine/testng/PreparedTestNGSuite.java | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/FileSystemPath.java
// public interface FileSystemPath {
// Path path();
//
// boolean exist();
//
// final class Fake implements FileSystemPath {
//
// private final Path path;
// private final boolean exist;
//
// p... | import org.tatools.sunshine.core.FileSystemPath;
import org.tatools.sunshine.core.FileSystemPathBase; | package org.tatools.sunshine.testng;
/**
* @author Dmytro Serdiuk (dmytro.serdiuk@gmail.com)
* @version $Id$
* @since 0.1
*/
public class PreparedTestNGSuite implements TestNGSuite {
private final FileSystemPath fileSystemPath;
public PreparedTestNGSuite(String path) { | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/FileSystemPath.java
// public interface FileSystemPath {
// Path path();
//
// boolean exist();
//
// final class Fake implements FileSystemPath {
//
// private final Path path;
// private final boolean exist;
//
// p... | this(new FileSystemPathBase(path)); |
tatools/sunshine | sunshine-junit5/src/test/java/org/tatools/sunshine/junit5/Junit5KernelTest.java | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/KernelException.java
// public class KernelException extends SunshineException {
// public KernelException(String message) {
// super(message);
// }
//
// public KernelException(String message, Throwable cause) {
// super(messag... | import java.util.ArrayList;
import lombok.EqualsAndHashCode;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.Test;
import org.junit.platform.engine.TestExecutionResult;
import org.junit.platform.launcher.TestExecutionListener;
import org.junit.platform.launcher.TestIdentifi... | package org.tatools.sunshine.junit5;
/**
* @author Dmytro Serdiuk
* @version $Id$
*/
public class Junit5KernelTest {
@Test | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/KernelException.java
// public class KernelException extends SunshineException {
// public KernelException(String message) {
// super(message);
// }
//
// public KernelException(String message, Throwable cause) {
// super(messag... | public void run() throws KernelException { |
tatools/sunshine | sunshine-core/src/test/java/org/tatools/sunshine/core/SunTest.java | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/Status.java
// final class Fake implements Status {
// private final short c;
// private final int r;
// private final int f;
// private final int i;
//
// public Fake() {
// this((short) 0, 5, 0, 1);
// }
//
// public ... | import org.junit.Rule;
import org.junit.Test;
import org.junit.contrib.java.lang.system.ExpectedSystemExit;
import org.tatools.sunshine.core.Status.Fake; | package org.tatools.sunshine.core;
/**
* @author Dmytro Serdiuk (dmytro.serdiuk@gmail.com)
* @version $Id$
* @since 0.2
*/
public class SunTest {
@Rule public final ExpectedSystemExit exit = ExpectedSystemExit.none();
@Test
public void shine() {
exit.expectSystemExitWithStatus(0); | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/Status.java
// final class Fake implements Status {
// private final short c;
// private final int r;
// private final int f;
// private final int i;
//
// public Fake() {
// this((short) 0, 5, 0, 1);
// }
//
// public ... | new Sun(new Kernel.Fake(new Fake())).shine(); |
tatools/sunshine | sunshine-testng/src/main/java/org/tatools/sunshine/testng/TestNGSuite.java | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/FileSystemPath.java
// public interface FileSystemPath {
// Path path();
//
// boolean exist();
//
// final class Fake implements FileSystemPath {
//
// private final Path path;
// private final boolean exist;
//
// p... | import org.tatools.sunshine.core.FileSystemPath;
import org.tatools.sunshine.core.Suite;
import org.tatools.sunshine.core.SuiteException; | package org.tatools.sunshine.testng;
/**
* @author Dmytro Serdiuk (dmytro.serdiuk@gmail.com)
* @version $Id$
* @since 0.1
*/
public interface TestNGSuite extends Suite<FileSystemPath> {
/**
* Return a TestNG tests file.
*
* @return an instance of {@link FileSystemPath}.
* @throws SuiteExce... | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/FileSystemPath.java
// public interface FileSystemPath {
// Path path();
//
// boolean exist();
//
// final class Fake implements FileSystemPath {
//
// private final Path path;
// private final boolean exist;
//
// p... | FileSystemPath tests() throws SuiteException; |
tatools/sunshine | sunshine-junit4/src/main/java/org/tatools/sunshine/junit4/Sunshine.java | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/RegexCondition.java
// @EqualsAndHashCode
// public class RegexCondition implements Condition {
//
// final Pattern regex;
//
// /**
// * Use a value of "tests-regex" system property as a regex pattern. If the system property is
// * not... | import org.tatools.sunshine.core.RegexCondition;
import org.tatools.sunshine.core.Sun;
import org.tatools.sunshine.core.VerboseRegex; | package org.tatools.sunshine.junit4;
/**
* The {@link Sunshine} class is a main class to run Junit 4 tests.
*
* @author Dmytro Serdiuk (dmytro.serdiuk@gmail.com)
* @version $Id$
* @since 0.1
*/
public final class Sunshine {
public static void main(String[] args) { | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/RegexCondition.java
// @EqualsAndHashCode
// public class RegexCondition implements Condition {
//
// final Pattern regex;
//
// /**
// * Use a value of "tests-regex" system property as a regex pattern. If the system property is
// * not... | new Sun(new Junit4Kernel(new JunitSuite(new VerboseRegex(new RegexCondition())))).shine(); |
tatools/sunshine | sunshine-junit4/src/main/java/org/tatools/sunshine/junit4/Sunshine.java | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/RegexCondition.java
// @EqualsAndHashCode
// public class RegexCondition implements Condition {
//
// final Pattern regex;
//
// /**
// * Use a value of "tests-regex" system property as a regex pattern. If the system property is
// * not... | import org.tatools.sunshine.core.RegexCondition;
import org.tatools.sunshine.core.Sun;
import org.tatools.sunshine.core.VerboseRegex; | package org.tatools.sunshine.junit4;
/**
* The {@link Sunshine} class is a main class to run Junit 4 tests.
*
* @author Dmytro Serdiuk (dmytro.serdiuk@gmail.com)
* @version $Id$
* @since 0.1
*/
public final class Sunshine {
public static void main(String[] args) { | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/RegexCondition.java
// @EqualsAndHashCode
// public class RegexCondition implements Condition {
//
// final Pattern regex;
//
// /**
// * Use a value of "tests-regex" system property as a regex pattern. If the system property is
// * not... | new Sun(new Junit4Kernel(new JunitSuite(new VerboseRegex(new RegexCondition())))).shine(); |
tatools/sunshine | sunshine-junit4/src/main/java/org/tatools/sunshine/junit4/Sunshine.java | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/RegexCondition.java
// @EqualsAndHashCode
// public class RegexCondition implements Condition {
//
// final Pattern regex;
//
// /**
// * Use a value of "tests-regex" system property as a regex pattern. If the system property is
// * not... | import org.tatools.sunshine.core.RegexCondition;
import org.tatools.sunshine.core.Sun;
import org.tatools.sunshine.core.VerboseRegex; | package org.tatools.sunshine.junit4;
/**
* The {@link Sunshine} class is a main class to run Junit 4 tests.
*
* @author Dmytro Serdiuk (dmytro.serdiuk@gmail.com)
* @version $Id$
* @since 0.1
*/
public final class Sunshine {
public static void main(String[] args) { | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/RegexCondition.java
// @EqualsAndHashCode
// public class RegexCondition implements Condition {
//
// final Pattern regex;
//
// /**
// * Use a value of "tests-regex" system property as a regex pattern. If the system property is
// * not... | new Sun(new Junit4Kernel(new JunitSuite(new VerboseRegex(new RegexCondition())))).shine(); |
tatools/sunshine | sunshine-junit4/src/test/java/org/tatools/sunshine/junit4/JunitSuiteTest.java | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/Condition.java
// @FunctionalInterface
// public interface Condition {
// /**
// * Allows verifying this condition on an identity. The identity is the full name of a class like
// * "io.github.my.FirstTest".
// *
// * @param identity... | import java.util.Collections;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.Test;
import org.tatools.sunshine.core.Condition;
import org.tatools.sunshine.core.FileSystem;
import org.tatools.sunshine.core.SuiteException; | package org.tatools.sunshine.junit4;
/**
* @author Dmytro Serdiuk (dmytro.serdiuk@gmail.com)
* @version $Id$
* @since 0.2
*/
public class JunitSuiteTest {
@Test | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/Condition.java
// @FunctionalInterface
// public interface Condition {
// /**
// * Allows verifying this condition on an identity. The identity is the full name of a class like
// * "io.github.my.FirstTest".
// *
// * @param identity... | public void testDefaultSuite() throws SuiteException { |
tatools/sunshine | sunshine-junit4/src/test/java/org/tatools/sunshine/junit4/JunitSuiteTest.java | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/Condition.java
// @FunctionalInterface
// public interface Condition {
// /**
// * Allows verifying this condition on an identity. The identity is the full name of a class like
// * "io.github.my.FirstTest".
// *
// * @param identity... | import java.util.Collections;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.Test;
import org.tatools.sunshine.core.Condition;
import org.tatools.sunshine.core.FileSystem;
import org.tatools.sunshine.core.SuiteException; | package org.tatools.sunshine.junit4;
/**
* @author Dmytro Serdiuk (dmytro.serdiuk@gmail.com)
* @version $Id$
* @since 0.2
*/
public class JunitSuiteTest {
@Test
public void testDefaultSuite() throws SuiteException {
MatcherAssert.assertThat(
new JunitSuite(() -> Collections.emptyLi... | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/Condition.java
// @FunctionalInterface
// public interface Condition {
// /**
// * Allows verifying this condition on an identity. The identity is the full name of a class like
// * "io.github.my.FirstTest".
// *
// * @param identity... | new JunitSuite(new FileSystem.Fake(), new Condition.Fake(false)).tests(), |
tatools/sunshine | sunshine-junit4/src/test/java/org/tatools/sunshine/junit4/JunitSuiteTest.java | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/Condition.java
// @FunctionalInterface
// public interface Condition {
// /**
// * Allows verifying this condition on an identity. The identity is the full name of a class like
// * "io.github.my.FirstTest".
// *
// * @param identity... | import java.util.Collections;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.Test;
import org.tatools.sunshine.core.Condition;
import org.tatools.sunshine.core.FileSystem;
import org.tatools.sunshine.core.SuiteException; | package org.tatools.sunshine.junit4;
/**
* @author Dmytro Serdiuk (dmytro.serdiuk@gmail.com)
* @version $Id$
* @since 0.2
*/
public class JunitSuiteTest {
@Test
public void testDefaultSuite() throws SuiteException {
MatcherAssert.assertThat(
new JunitSuite(() -> Collections.emptyLi... | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/Condition.java
// @FunctionalInterface
// public interface Condition {
// /**
// * Allows verifying this condition on an identity. The identity is the full name of a class like
// * "io.github.my.FirstTest".
// *
// * @param identity... | new JunitSuite(new FileSystem.Fake(), new Condition.Fake(false)).tests(), |
tatools/sunshine | sunshine-junit4/src/test/java/org/tatools/sunshine/junit4/Junit4KernelTest.java | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/KernelException.java
// public class KernelException extends SunshineException {
// public KernelException(String message) {
// super(message);
// }
//
// public KernelException(String message, Throwable cause) {
// super(messag... | import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.Test;
import org.junit.runner.Description;
import org.junit.runner.notification.RunListener;
import org.tatools.sunshine.core.KernelException;
import org.tatools.sunshine.core.SuiteException; | package org.tatools.sunshine.junit4;
/**
* @author Dmytro Serdiuk (dmytro.serdiuk@gmail.com)
* @version $Id$
* @since 0.2
*/
public class Junit4KernelTest {
@Test | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/KernelException.java
// public class KernelException extends SunshineException {
// public KernelException(String message) {
// super(message);
// }
//
// public KernelException(String message, Throwable cause) {
// super(messag... | public void run() throws KernelException { |
tatools/sunshine | sunshine-junit4/src/test/java/org/tatools/sunshine/junit4/Junit4KernelTest.java | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/KernelException.java
// public class KernelException extends SunshineException {
// public KernelException(String message) {
// super(message);
// }
//
// public KernelException(String message, Throwable cause) {
// super(messag... | import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.Test;
import org.junit.runner.Description;
import org.junit.runner.notification.RunListener;
import org.tatools.sunshine.core.KernelException;
import org.tatools.sunshine.core.SuiteException; | package org.tatools.sunshine.junit4;
/**
* @author Dmytro Serdiuk (dmytro.serdiuk@gmail.com)
* @version $Id$
* @since 0.2
*/
public class Junit4KernelTest {
@Test
public void run() throws KernelException {
MatcherAssert.assertThat(
new Junit4Kernel(() -> new Class[] {}).status().c... | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/KernelException.java
// public class KernelException extends SunshineException {
// public KernelException(String message) {
// super(message);
// }
//
// public KernelException(String message, Throwable cause) {
// super(messag... | throw new SuiteException("Fail"); |
tatools/sunshine | sunshine-testng/src/main/java/org/tatools/sunshine/testng/Sunshine.java | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/RegexCondition.java
// @EqualsAndHashCode
// public class RegexCondition implements Condition {
//
// final Pattern regex;
//
// /**
// * Use a value of "tests-regex" system property as a regex pattern. If the system property is
// * not... | import org.tatools.sunshine.core.RegexCondition;
import org.tatools.sunshine.core.Sun;
import org.tatools.sunshine.core.VerboseRegex; | package org.tatools.sunshine.testng;
/**
* The {@link Sunshine} class is a main class to run TestNG tests.
*
* <p>If no arguments will be provided, then Sunshine will try to find TestNG tests in the
* CLASSPATH.
*
* <p>If an argument will be provided, then Sunshine will run TestNG with given argument. The
* ar... | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/RegexCondition.java
// @EqualsAndHashCode
// public class RegexCondition implements Condition {
//
// final Pattern regex;
//
// /**
// * Use a value of "tests-regex" system property as a regex pattern. If the system property is
// * not... | new Sun(new TestNGKernel(new PreparedTestNGSuite(args[0]))).shine(); |
tatools/sunshine | sunshine-testng/src/main/java/org/tatools/sunshine/testng/Sunshine.java | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/RegexCondition.java
// @EqualsAndHashCode
// public class RegexCondition implements Condition {
//
// final Pattern regex;
//
// /**
// * Use a value of "tests-regex" system property as a regex pattern. If the system property is
// * not... | import org.tatools.sunshine.core.RegexCondition;
import org.tatools.sunshine.core.Sun;
import org.tatools.sunshine.core.VerboseRegex; | package org.tatools.sunshine.testng;
/**
* The {@link Sunshine} class is a main class to run TestNG tests.
*
* <p>If no arguments will be provided, then Sunshine will try to find TestNG tests in the
* CLASSPATH.
*
* <p>If an argument will be provided, then Sunshine will run TestNG with given argument. The
* ar... | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/RegexCondition.java
// @EqualsAndHashCode
// public class RegexCondition implements Condition {
//
// final Pattern regex;
//
// /**
// * Use a value of "tests-regex" system property as a regex pattern. If the system property is
// * not... | new VerboseRegex(new RegexCondition())))) |
tatools/sunshine | sunshine-testng/src/main/java/org/tatools/sunshine/testng/Sunshine.java | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/RegexCondition.java
// @EqualsAndHashCode
// public class RegexCondition implements Condition {
//
// final Pattern regex;
//
// /**
// * Use a value of "tests-regex" system property as a regex pattern. If the system property is
// * not... | import org.tatools.sunshine.core.RegexCondition;
import org.tatools.sunshine.core.Sun;
import org.tatools.sunshine.core.VerboseRegex; | package org.tatools.sunshine.testng;
/**
* The {@link Sunshine} class is a main class to run TestNG tests.
*
* <p>If no arguments will be provided, then Sunshine will try to find TestNG tests in the
* CLASSPATH.
*
* <p>If an argument will be provided, then Sunshine will run TestNG with given argument. The
* ar... | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/RegexCondition.java
// @EqualsAndHashCode
// public class RegexCondition implements Condition {
//
// final Pattern regex;
//
// /**
// * Use a value of "tests-regex" system property as a regex pattern. If the system property is
// * not... | new VerboseRegex(new RegexCondition())))) |
tatools/sunshine | sunshine-testng/src/test/java/org/tatools/sunshine/testng/TestNGKernelTest.java | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/FileSystemPath.java
// public interface FileSystemPath {
// Path path();
//
// boolean exist();
//
// final class Fake implements FileSystemPath {
//
// private final Path path;
// private final boolean exist;
//
// p... | import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.Test;
import org.tatools.sunshine.core.FileSystemPath;
import org.tatools.sunshine.core.KernelException;
import org.tatools.sunshine.core.SuiteException;
import org.testng.ISuite;
import org.testng.ISuiteListener; | package org.tatools.sunshine.testng;
/**
* @author Dmytro Serdiuk (dmytro.serdiuk@gmail.com)
* @version $Id$
* @since 0.2
*/
public class TestNGKernelTest {
@Test | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/FileSystemPath.java
// public interface FileSystemPath {
// Path path();
//
// boolean exist();
//
// final class Fake implements FileSystemPath {
//
// private final Path path;
// private final boolean exist;
//
// p... | public void status() throws KernelException { |
tatools/sunshine | sunshine-testng/src/test/java/org/tatools/sunshine/testng/TestNGKernelTest.java | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/FileSystemPath.java
// public interface FileSystemPath {
// Path path();
//
// boolean exist();
//
// final class Fake implements FileSystemPath {
//
// private final Path path;
// private final boolean exist;
//
// p... | import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.Test;
import org.tatools.sunshine.core.FileSystemPath;
import org.tatools.sunshine.core.KernelException;
import org.tatools.sunshine.core.SuiteException;
import org.testng.ISuite;
import org.testng.ISuiteListener; | package org.tatools.sunshine.testng;
/**
* @author Dmytro Serdiuk (dmytro.serdiuk@gmail.com)
* @version $Id$
* @since 0.2
*/
public class TestNGKernelTest {
@Test
public void status() throws KernelException {
MatcherAssert.assertThat( | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/FileSystemPath.java
// public interface FileSystemPath {
// Path path();
//
// boolean exist();
//
// final class Fake implements FileSystemPath {
//
// private final Path path;
// private final boolean exist;
//
// p... | new TestNGKernel(() -> new FileSystemPath.Fake("src/test/resources/testng.xml")) |
tatools/sunshine | sunshine-testng/src/test/java/org/tatools/sunshine/testng/TestNGKernelTest.java | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/FileSystemPath.java
// public interface FileSystemPath {
// Path path();
//
// boolean exist();
//
// final class Fake implements FileSystemPath {
//
// private final Path path;
// private final boolean exist;
//
// p... | import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.Test;
import org.tatools.sunshine.core.FileSystemPath;
import org.tatools.sunshine.core.KernelException;
import org.tatools.sunshine.core.SuiteException;
import org.testng.ISuite;
import org.testng.ISuiteListener; | package org.tatools.sunshine.testng;
/**
* @author Dmytro Serdiuk (dmytro.serdiuk@gmail.com)
* @version $Id$
* @since 0.2
*/
public class TestNGKernelTest {
@Test
public void status() throws KernelException {
MatcherAssert.assertThat(
new TestNGKernel(() -> new FileSystemPath.Fake... | // Path: sunshine-core/src/main/java/org/tatools/sunshine/core/FileSystemPath.java
// public interface FileSystemPath {
// Path path();
//
// boolean exist();
//
// final class Fake implements FileSystemPath {
//
// private final Path path;
// private final boolean exist;
//
// p... | throw new SuiteException("Fail"); |
Alienturnedhuman/PearPlanner | src/Controller/StudyProfileController.java | // Path: src/Model/StudyProfile.java
// public class StudyProfile extends VersionControlEntity
// {
// // private data
// private ArrayList<Module> modules;
// private ArrayList<Milestone> milestones;
// private ArrayList<ExtensionApplication> extensions;
// private ArrayList<Event> calendar = new A... | import Model.StudyProfile;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.stage.Stage;
import java.net.URL;
import java.util.ResourceBundle; | package Controller;
/**
* Created by Žilvinas on 10/05/2017.
*/
public class StudyProfileController implements Initializable
{ | // Path: src/Model/StudyProfile.java
// public class StudyProfile extends VersionControlEntity
// {
// // private data
// private ArrayList<Module> modules;
// private ArrayList<Milestone> milestones;
// private ArrayList<ExtensionApplication> extensions;
// private ArrayList<Event> calendar = new A... | private StudyProfile profile; |
Alienturnedhuman/PearPlanner | Test/Controller/StudyPlannerControllerTest.java | // Path: src/Model/Account.java
// public class Account implements Serializable
// {
// // private data
// private Person studentDetails;
// private String studentNumber;
//
// // public methods
//
// // getters
// public Person getStudentDetails()
// {
// return studentDetails;
//... | import Model.Account;
import Model.Person;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*; | package Controller;
/**
* Created by bijan on 08/05/2017.
*/
public class StudyPlannerControllerTest {
@Before
public void setUp() throws Exception
{ | // Path: src/Model/Account.java
// public class Account implements Serializable
// {
// // private data
// private Person studentDetails;
// private String studentNumber;
//
// // public methods
//
// // getters
// public Person getStudentDetails()
// {
// return studentDetails;
//... | Account a = new Account(new Person("Mr","Adrew",true),"100125464"); |
Alienturnedhuman/PearPlanner | Test/View/FXBase.java | // Path: src/Controller/AccountController.java
// public class AccountController implements Initializable
// {
// @FXML private TextField account_no;
// @FXML private TextField salutation;
// @FXML private TextField full_name;
// @FXML private TextField email;
// @FXML private CheckBox fam_last;
// ... | import Controller.AccountController;
import javafx.application.Platform;
import javafx.fxml.FXMLLoader;
import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.input.KeyCode;
import javafx.scene.input.MouseButton;
import javafx.stage.Stage;
import org.junit.After;
import org... | package View;
/**
* PearPlanner
* Created by Team BRONZE on 08/05/2017
*/
public abstract class FXBase extends ApplicationTest {
@Override
public void start(Stage stage) throws Exception
{
| // Path: src/Controller/AccountController.java
// public class AccountController implements Initializable
// {
// @FXML private TextField account_no;
// @FXML private TextField salutation;
// @FXML private TextField full_name;
// @FXML private TextField email;
// @FXML private CheckBox fam_last;
// ... | AccountController accountControl = new AccountController(); |
Alienturnedhuman/PearPlanner | src/Controller/XMLcontroller.java | // Path: src/Model/MultilineString.java
// public class MultilineString implements Serializable
// {
// // private Data;
// private ArrayList<String> lines;
//
// // public methods
// public MultilineString clone()
// {
// return new MultilineString(this.getAsArray());
// }
//
// /... | import Model.MultilineString;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import java.util.HashMap;
import java.util.HashSet;
import static Controller.MainController.isNumeric; | package Controller;
/**
* Created by bendickson on 5/6/17.
*/
public class XMLcontroller
{
public enum ImportAs
{
BOOLEAN, STRING, INTEGER, DOUBLE, MULTILINESTRING, NODELIST
}
public class NodeReturn
{
private ImportAs importedAs;
private String stringValue;
pr... | // Path: src/Model/MultilineString.java
// public class MultilineString implements Serializable
// {
// // private Data;
// private ArrayList<String> lines;
//
// // public methods
// public MultilineString clone()
// {
// return new MultilineString(this.getAsArray());
// }
//
// /... | private MultilineString multilineStringValue; |
Alienturnedhuman/PearPlanner | src/Controller/XMLcontroller.java | // Path: src/Model/MultilineString.java
// public class MultilineString implements Serializable
// {
// // private Data;
// private ArrayList<String> lines;
//
// // public methods
// public MultilineString clone()
// {
// return new MultilineString(this.getAsArray());
// }
//
// /... | import Model.MultilineString;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import java.util.HashMap;
import java.util.HashSet;
import static Controller.MainController.isNumeric; | }
}
public HashMap<String, NodeReturn> getSchemaValues(NodeList nodes, HashMap<String, ImportAs> schema)
{
HashMap<String, NodeReturn> r = new HashMap<>();
int i = -1;
int ii = nodes.getLength();
String nodeName;
String temp;
while (++i < ii)
... | // Path: src/Model/MultilineString.java
// public class MultilineString implements Serializable
// {
// // private Data;
// private ArrayList<String> lines;
//
// // public methods
// public MultilineString clone()
// {
// return new MultilineString(this.getAsArray());
// }
//
// /... | if (isNumeric(temp)) |
Alienturnedhuman/PearPlanner | src/Controller/AccountController.java | // Path: src/Model/Account.java
// public class Account implements Serializable
// {
// // private data
// private Person studentDetails;
// private String studentNumber;
//
// // public methods
//
// // getters
// public Person getStudentDetails()
// {
// return studentDetails;
//... | import Model.Account;
import Model.Person;
import javafx.application.Platform;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.CheckBox;
import javafx.scene.control.TextField;
import javafx.scene.layout.GridPane;
import javafx.stage.Stage;
impor... | package Controller;
/**
* Created by Zilvinas on 04/05/2017.
*/
public class AccountController implements Initializable
{
@FXML private TextField account_no;
@FXML private TextField salutation;
@FXML private TextField full_name;
@FXML private TextField email;
@FXML private CheckBox fam_last;
... | // Path: src/Model/Account.java
// public class Account implements Serializable
// {
// // private data
// private Person studentDetails;
// private String studentNumber;
//
// // public methods
//
// // getters
// public Person getStudentDetails()
// {
// return studentDetails;
//... | private Account account; |
ralscha/extclassgenerator | src/test/java/ch/rasc/extclassgenerator/ModelGeneratorBeanWithAnnotationsDisablePagingTest.java | // Path: src/test/java/ch/rasc/extclassgenerator/bean/BeanWithAnnotationsDisablePaging.java
// @Model(value = "Sch.Bean2", idProperty = "id", paging = false, readMethod = "read",
// messageProperty = "theMessageProperty", disablePagingParameters = true)
// public class BeanWithAnnotationsDisablePaging extends Base {
... | import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Before;
import org.junit.Test;
import ch.rasc.extclassgenerator.bean.BeanWithAnnotationsDisablePaging; | /**
* Copyright 2013-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appl... | // Path: src/test/java/ch/rasc/extclassgenerator/bean/BeanWithAnnotationsDisablePaging.java
// @Model(value = "Sch.Bean2", idProperty = "id", paging = false, readMethod = "read",
// messageProperty = "theMessageProperty", disablePagingParameters = true)
// public class BeanWithAnnotationsDisablePaging extends Base {
... | GeneratorTestUtil.testGenerateJavascript(BeanWithAnnotationsDisablePaging.class, |
ralscha/extclassgenerator | src/test/java/ch/rasc/extclassgenerator/ModelGeneratorBeanWithAnnotations3Test.java | // Path: src/test/java/ch/rasc/extclassgenerator/bean/BeanWithAnnotations3.java
// @Model(value = "Sch.Bean3", idProperty = "id", readMethod = "read",
// messageProperty = "theMessageProperty", rootProperty = "theRootProperty",
// successProperty = "theSuccessProperty", totalProperty = "theTotalProperty")
// public... | import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Before;
import org.junit.Test;
import ch.rasc.extclassgenerator.bean.BeanWithAnnotations3; | /**
* Copyright 2013-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appl... | // Path: src/test/java/ch/rasc/extclassgenerator/bean/BeanWithAnnotations3.java
// @Model(value = "Sch.Bean3", idProperty = "id", readMethod = "read",
// messageProperty = "theMessageProperty", rootProperty = "theRootProperty",
// successProperty = "theSuccessProperty", totalProperty = "theTotalProperty")
// public... | GeneratorTestUtil.testGenerateJavascript(BeanWithAnnotations3.class, |
ralscha/extclassgenerator | src/test/java/ch/rasc/extclassgenerator/ModelGeneratorBeanWithAnnotations2Test.java | // Path: src/test/java/ch/rasc/extclassgenerator/bean/BeanWithAnnotations2.java
// @Model(value = "Sch.Bean2", idProperty = "id", paging = false, readMethod = "read",
// messageProperty = "theMessageProperty")
// public class BeanWithAnnotations2 extends Base {
//
// @Pattern(regexp = "[a-zA-Z]*")
// private Strin... | import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Before;
import org.junit.Test;
import ch.rasc.extclassgenerator.bean.BeanWithAnnotations2; | /**
* Copyright 2013-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appl... | // Path: src/test/java/ch/rasc/extclassgenerator/bean/BeanWithAnnotations2.java
// @Model(value = "Sch.Bean2", idProperty = "id", paging = false, readMethod = "read",
// messageProperty = "theMessageProperty")
// public class BeanWithAnnotations2 extends Base {
//
// @Pattern(regexp = "[a-zA-Z]*")
// private Strin... | GeneratorTestUtil.testGenerateJavascript(BeanWithAnnotations2.class, |
ralscha/extclassgenerator | src/test/java/ch/rasc/extclassgenerator/ModelGeneratorBeanWithCustomTypeTest.java | // Path: src/test/java/ch/rasc/extclassgenerator/bean/BeanWithCustomType.java
// @Model(value = "Sch.BeanWithCustomType")
// public class BeanWithCustomType {
//
// private String id;
//
// @ModelField(type = ModelType.INTEGER)
// private int age;
//
// @ModelField(type = ModelType.STRING, customType = "city")
/... | import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Before;
import org.junit.Test;
import ch.rasc.extclassgenerator.bean.BeanWithCustomType; | /**
* Copyright 2013-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appl... | // Path: src/test/java/ch/rasc/extclassgenerator/bean/BeanWithCustomType.java
// @Model(value = "Sch.BeanWithCustomType")
// public class BeanWithCustomType {
//
// private String id;
//
// @ModelField(type = ModelType.INTEGER)
// private int age;
//
// @ModelField(type = ModelType.STRING, customType = "city")
/... | GeneratorTestUtil.testGenerateJavascript(BeanWithCustomType.class, |
ralscha/extclassgenerator | src/test/java/ch/rasc/extclassgenerator/ModelGeneratorPartialApiTest.java | // Path: src/test/java/ch/rasc/extclassgenerator/bean/PartialApi.java
// @Model(value = "App.PartialApi", readMethod = "read", destroyMethod = "destroy")
// public class PartialApi {
// private int id;
//
// private String name;
//
// public int getId() {
// return this.id;
// }
//
// public void setId(int id... | import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Before;
import org.junit.Test;
import ch.rasc.extclassgenerator.bean.PartialApi; | /**
* Copyright 2013-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appl... | // Path: src/test/java/ch/rasc/extclassgenerator/bean/PartialApi.java
// @Model(value = "App.PartialApi", readMethod = "read", destroyMethod = "destroy")
// public class PartialApi {
// private int id;
//
// private String name;
//
// public int getId() {
// return this.id;
// }
//
// public void setId(int id... | GeneratorTestUtil.testGenerateJavascript(PartialApi.class, "PartialApi", true, |
ralscha/extclassgenerator | src/test/java/ch/rasc/extclassgenerator/ModelGeneratorInterfaceTest.java | // Path: src/test/java/ch/rasc/extclassgenerator/bean/User.java
// @Model
// public interface User {
//
// @ModelField
// UUID getId();
//
// @NotEmpty
// @Email
// @Size(max = 128)
// String getEmail();
//
// }
| import org.junit.Before;
import org.junit.Test;
import ch.rasc.extclassgenerator.bean.User; | /**
* Copyright 2013-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appl... | // Path: src/test/java/ch/rasc/extclassgenerator/bean/User.java
// @Model
// public interface User {
//
// @ModelField
// UUID getId();
//
// @NotEmpty
// @Email
// @Size(max = 128)
// String getEmail();
//
// }
// Path: src/test/java/ch/rasc/extclassgenerator/ModelGeneratorInterfaceTest.java
import org.juni... | ModelBean modelBean = ModelGenerator.createModel(User.class, |
ralscha/extclassgenerator | src/test/java/ch/rasc/extclassgenerator/ModelGeneratorDataOptionsTest.java | // Path: src/test/java/ch/rasc/extclassgenerator/bean/UserDataOptionsAll.java
// @Model(value = "User", allDataOptions = @AllDataOptions(associated = true))
// public class UserDataOptionsAll {
//
// @ModelField
// public UUID id;
//
// @NotEmpty
// @Email
// @Size(max = 128)
// public String email;
//
// }
//... | import org.junit.Before;
import org.junit.Test;
import ch.rasc.extclassgenerator.bean.UserDataOptionsAll;
import ch.rasc.extclassgenerator.bean.UserDataOptionsAllAndPartial;
import ch.rasc.extclassgenerator.bean.UserDataOptionsPartial; | /**
* Copyright 2013-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appl... | // Path: src/test/java/ch/rasc/extclassgenerator/bean/UserDataOptionsAll.java
// @Model(value = "User", allDataOptions = @AllDataOptions(associated = true))
// public class UserDataOptionsAll {
//
// @ModelField
// public UUID id;
//
// @NotEmpty
// @Email
// @Size(max = 128)
// public String email;
//
// }
//... | ModelBean modelBean = ModelGenerator.createModel(UserDataOptionsAll.class, |
ralscha/extclassgenerator | src/test/java/ch/rasc/extclassgenerator/ModelGeneratorDataOptionsTest.java | // Path: src/test/java/ch/rasc/extclassgenerator/bean/UserDataOptionsAll.java
// @Model(value = "User", allDataOptions = @AllDataOptions(associated = true))
// public class UserDataOptionsAll {
//
// @ModelField
// public UUID id;
//
// @NotEmpty
// @Email
// @Size(max = 128)
// public String email;
//
// }
//... | import org.junit.Before;
import org.junit.Test;
import ch.rasc.extclassgenerator.bean.UserDataOptionsAll;
import ch.rasc.extclassgenerator.bean.UserDataOptionsAllAndPartial;
import ch.rasc.extclassgenerator.bean.UserDataOptionsPartial; |
GeneratorTestUtil.compareExtJs4Code("UserDataOptionsAll", code, false, false);
}
@Test
public void testAllDataOptionsExtJs5() {
ModelBean modelBean = ModelGenerator.createModel(UserDataOptionsAll.class,
IncludeValidation.ALL);
OutputConfig outputConfig = new OutputConfig();
outputConfig.setOutputFormat... | // Path: src/test/java/ch/rasc/extclassgenerator/bean/UserDataOptionsAll.java
// @Model(value = "User", allDataOptions = @AllDataOptions(associated = true))
// public class UserDataOptionsAll {
//
// @ModelField
// public UUID id;
//
// @NotEmpty
// @Email
// @Size(max = 128)
// public String email;
//
// }
//... | ModelBean modelBean = ModelGenerator.createModel(UserDataOptionsPartial.class, |
ralscha/extclassgenerator | src/test/java/ch/rasc/extclassgenerator/ModelGeneratorDataOptionsTest.java | // Path: src/test/java/ch/rasc/extclassgenerator/bean/UserDataOptionsAll.java
// @Model(value = "User", allDataOptions = @AllDataOptions(associated = true))
// public class UserDataOptionsAll {
//
// @ModelField
// public UUID id;
//
// @NotEmpty
// @Email
// @Size(max = 128)
// public String email;
//
// }
//... | import org.junit.Before;
import org.junit.Test;
import ch.rasc.extclassgenerator.bean.UserDataOptionsAll;
import ch.rasc.extclassgenerator.bean.UserDataOptionsAllAndPartial;
import ch.rasc.extclassgenerator.bean.UserDataOptionsPartial; | GeneratorTestUtil.compareExtJs4Code("UserDataOptionsPartial", code, false, false);
}
@Test
public void testPartialDataOptionsExtJs5() {
ModelBean modelBean = ModelGenerator.createModel(UserDataOptionsPartial.class,
IncludeValidation.ALL);
OutputConfig outputConfig = new OutputConfig();
outputConfig.setO... | // Path: src/test/java/ch/rasc/extclassgenerator/bean/UserDataOptionsAll.java
// @Model(value = "User", allDataOptions = @AllDataOptions(associated = true))
// public class UserDataOptionsAll {
//
// @ModelField
// public UUID id;
//
// @NotEmpty
// @Email
// @Size(max = 128)
// public String email;
//
// }
//... | .createModel(UserDataOptionsAllAndPartial.class, IncludeValidation.ALL); |
ralscha/extclassgenerator | src/test/java/ch/rasc/extclassgenerator/ModelGeneratorMethodTest.java | // Path: src/test/java/ch/rasc/extclassgenerator/bean/UserClass.java
// @Model
// public class UserClass {
//
// private UUID id;
//
// private String email;
//
// @ModelField
// public UUID getId() {
// return this.id;
// }
//
// public void setId(UUID id) {
// this.id = id;
// }
//
// public String g... | import org.junit.Before;
import org.junit.Test;
import ch.rasc.extclassgenerator.bean.UserClass; | /**
* Copyright 2013-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appl... | // Path: src/test/java/ch/rasc/extclassgenerator/bean/UserClass.java
// @Model
// public class UserClass {
//
// private UUID id;
//
// private String email;
//
// @ModelField
// public UUID getId() {
// return this.id;
// }
//
// public void setId(UUID id) {
// this.id = id;
// }
//
// public String g... | ModelBean modelBean = ModelGenerator.createModel(UserClass.class, |
spotify/trickle | src/test/java/com/spotify/trickle/NodeExecutionFallbackTest.java | // Path: src/test/java/com/spotify/trickle/Util.java
// static Matcher<Throwable> hasAncestor(final Throwable expected) {
// return new TypeSafeMatcher<Throwable>() {
// @Override
// protected boolean matchesSafely(Throwable item) {
// for (Throwable cause = item ; cause != null ; cause = cause.getCause... | import com.google.common.base.Optional;
import com.google.common.collect.ImmutableList;
import com.google.common.util.concurrent.AsyncFunction;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
import org.junit.Before;
import org.junit.Test;
import java.u... | currentCallInfo = new CallInfo(currentNodeInfo, NO_PARAMS);
fallback = new NodeExecutionFallback<String>(graphBuilder, currentCall, traverseState);
}
@Test
public void shouldNotWrapGraphExecutionException() throws Exception {
Throwable expected = new GraphExecutionException(null, currentCallInfo, NO... | // Path: src/test/java/com/spotify/trickle/Util.java
// static Matcher<Throwable> hasAncestor(final Throwable expected) {
// return new TypeSafeMatcher<Throwable>() {
// @Override
// protected boolean matchesSafely(Throwable item) {
// for (Throwable cause = item ; cause != null ; cause = cause.getCause... | assertThat(e, hasAncestor(expected)); |
spotify/trickle | src/test/java/com/spotify/trickle/TrickleTest.java | // Path: src/main/java/com/spotify/trickle/Fallbacks.java
// public static <T> AsyncFunction<Throwable, T> always(@Nullable final T value) {
// return new AsyncFunction<Throwable, T>() {
// @Nullable
// @Override
// public ListenableFuture<T> apply(@Nullable Throwable input) {
// return immediateFut... | import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList;
import com.google.common.util.concurrent.AsyncFunction;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.common.util.concurrent.MoreExecuto... | /*
* Copyright 2013-2014 Spotify AB. All rights reserved.
*
* The contents of this file are licensed under the Apache License, Version
* 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2... | // Path: src/main/java/com/spotify/trickle/Fallbacks.java
// public static <T> AsyncFunction<Throwable, T> always(@Nullable final T value) {
// return new AsyncFunction<Throwable, T>() {
// @Nullable
// @Override
// public ListenableFuture<T> apply(@Nullable Throwable input) {
// return immediateFut... | Graph<String> graph = call(node1); |
spotify/trickle | src/test/java/com/spotify/trickle/TrickleTest.java | // Path: src/main/java/com/spotify/trickle/Fallbacks.java
// public static <T> AsyncFunction<Throwable, T> always(@Nullable final T value) {
// return new AsyncFunction<Throwable, T>() {
// @Nullable
// @Override
// public ListenableFuture<T> apply(@Nullable Throwable input) {
// return immediateFut... | import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList;
import com.google.common.util.concurrent.AsyncFunction;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.common.util.concurrent.MoreExecuto... | @Test
public void shouldForwardValues() throws Exception {
Func0<String> first = new Func0<String>() {
@Override
public ListenableFuture<String> run() {
return immediateFuture("hi there!");
}
};
Func1<String, Integer> second = new Func1<String, Integer>() {
@Override
... | // Path: src/main/java/com/spotify/trickle/Fallbacks.java
// public static <T> AsyncFunction<Throwable, T> always(@Nullable final T value) {
// return new AsyncFunction<Throwable, T>() {
// @Nullable
// @Override
// public ListenableFuture<T> apply(@Nullable Throwable input) {
// return immediateFut... | Graph<String> graph = call(node).fallback(always("fallback response")); |
spotify/trickle | src/test/java/com/spotify/trickle/TrickleTest.java | // Path: src/main/java/com/spotify/trickle/Fallbacks.java
// public static <T> AsyncFunction<Throwable, T> always(@Nullable final T value) {
// return new AsyncFunction<Throwable, T>() {
// @Nullable
// @Override
// public ListenableFuture<T> apply(@Nullable Throwable input) {
// return immediateFut... | import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList;
import com.google.common.util.concurrent.AsyncFunction;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.common.util.concurrent.MoreExecuto... | .bind(input2, "hum")
.bind(input3, "häpp")
.bind(input4, "Luis")
.run().get();
assertThat(result, equalTo("hey, 1, hey, ho, hum, häpp, Luis, 2"));
}
@Test
public void shouldPropagateExceptionsToResultFuture() throws Exception {
final RuntimeException expected = new Runtim... | // Path: src/main/java/com/spotify/trickle/Fallbacks.java
// public static <T> AsyncFunction<Throwable, T> always(@Nullable final T value) {
// return new AsyncFunction<Throwable, T>() {
// @Nullable
// @Override
// public ListenableFuture<T> apply(@Nullable Throwable input) {
// return immediateFut... | thrown.expectCause(hasAncestor(expected)); |
spotify/trickle | src/test/java/com/spotify/trickle/TrickleErrorHandlingTest.java | // Path: src/main/java/com/spotify/trickle/Trickle.java
// public static <R> ConfigurableGraph<R> call(Func0<R> func) {
// return new GraphBuilder<R>(func);
// }
//
// Path: src/test/java/com/spotify/trickle/Util.java
// static Matcher<Throwable> hasAncestor(final Throwable expected) {
// return new TypeSafeMatche... | import com.google.common.base.Function;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import... | /*
* Copyright 2013-2014 Spotify AB. All rights reserved.
*
* The contents of this file are licensed under the Apache License, Version
* 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2... | // Path: src/main/java/com/spotify/trickle/Trickle.java
// public static <R> ConfigurableGraph<R> call(Func0<R> func) {
// return new GraphBuilder<R>(func);
// }
//
// Path: src/test/java/com/spotify/trickle/Util.java
// static Matcher<Throwable> hasAncestor(final Throwable expected) {
// return new TypeSafeMatche... | call(failingFunction(expected)).with(setupDebugInfoGraph()).named("the node that fails") |
spotify/trickle | src/test/java/com/spotify/trickle/TrickleErrorHandlingTest.java | // Path: src/main/java/com/spotify/trickle/Trickle.java
// public static <R> ConfigurableGraph<R> call(Func0<R> func) {
// return new GraphBuilder<R>(func);
// }
//
// Path: src/test/java/com/spotify/trickle/Util.java
// static Matcher<Throwable> hasAncestor(final Throwable expected) {
// return new TypeSafeMatche... | import com.google.common.base.Function;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import... | RuntimeException expected = new RuntimeException("expected");
Graph<String> g =
call(failingFunction(expected)).with(setupDebugInfoGraph()).named("the node that fails")
.bind(debugInfoInput, "fail me").debug(false);
thrown.expectMessage("the node that fails");
thrown.expectMessage(I... | // Path: src/main/java/com/spotify/trickle/Trickle.java
// public static <R> ConfigurableGraph<R> call(Func0<R> func) {
// return new GraphBuilder<R>(func);
// }
//
// Path: src/test/java/com/spotify/trickle/Util.java
// static Matcher<Throwable> hasAncestor(final Throwable expected) {
// return new TypeSafeMatche... | thrown.expect(hasAncestor(expected)); |
spotify/trickle | src/main/java/com/spotify/trickle/NodeExecutionFallback.java | // Path: src/main/java/com/spotify/trickle/GraphExceptionWrapper.java
// public static Throwable wrapException(Throwable t,
// TraverseState.FutureCallInformation currentCall,
// TraverseState traverseState) {
// return new GraphExecutionExce... | import com.google.common.util.concurrent.FutureFallback;
import com.google.common.util.concurrent.ListenableFuture;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.util.concurrent.Futures.immediateFailedFuture;
import static com.spotify.trickle.GraphExceptionWrapper.wrap... | /*
* Copyright 2013-2014 Spotify AB. All rights reserved.
*
* The contents of this file are licensed under the Apache License, Version
* 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2... | // Path: src/main/java/com/spotify/trickle/GraphExceptionWrapper.java
// public static Throwable wrapException(Throwable t,
// TraverseState.FutureCallInformation currentCall,
// TraverseState traverseState) {
// return new GraphExecutionExce... | return wrapException(t, currentCall, state); |
spotify/trickle | src/test/java/com/spotify/trickle/TrickleApiTest.java | // Path: src/main/java/com/spotify/trickle/Trickle.java
// public static <R> ConfigurableGraph<R> call(Func0<R> func) {
// return new GraphBuilder<R>(func);
// }
| import com.google.common.util.concurrent.ListenableFuture;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import static com.google.common.util.concurrent.Futures.immediateFuture;
import static com.spotify.trickle.Trickle.call; | /*
* Copyright 2013-2014 Spotify AB. All rights reserved.
*
* The contents of this file are licensed under the Apache License, Version
* 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2... | // Path: src/main/java/com/spotify/trickle/Trickle.java
// public static <R> ConfigurableGraph<R> call(Func0<R> func) {
// return new GraphBuilder<R>(func);
// }
// Path: src/test/java/com/spotify/trickle/TrickleApiTest.java
import com.google.common.util.concurrent.ListenableFuture;
import org.junit.Rule;
import or... | Graph<String> g = call(node1).with(input); |
spotify/trickle | src/test/java/com/spotify/trickle/GraphExceptionWrapperTest.java | // Path: src/main/java/com/spotify/trickle/GraphExceptionWrapper.java
// public static Throwable wrapException(Throwable t,
// TraverseState.FutureCallInformation currentCall,
// TraverseState traverseState) {
// return new GraphExecutionExce... | import com.google.common.base.Function;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.common.util.concurrent.SettableFuture;
import org.junit.Bef... | /*
* Copyright 2013-2014 Spotify AB. All rights reserved.
*
* The contents of this file are licensed under the Apache License, Version
* 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2... | // Path: src/main/java/com/spotify/trickle/GraphExceptionWrapper.java
// public static Throwable wrapException(Throwable t,
// TraverseState.FutureCallInformation currentCall,
// TraverseState traverseState) {
// return new GraphExecutionExce... | assertThat(wrapException(t, currentCall, traverseState).getCause(), equalTo(t)); |
spotify/trickle | src/test/java/com/spotify/trickle/GraphExceptionWrapperTest.java | // Path: src/main/java/com/spotify/trickle/GraphExceptionWrapper.java
// public static Throwable wrapException(Throwable t,
// TraverseState.FutureCallInformation currentCall,
// TraverseState traverseState) {
// return new GraphExecutionExce... | import com.google.common.base.Function;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.common.util.concurrent.SettableFuture;
import org.junit.Bef... |
assertThat(found1, is(true));
assertThat(found2, is(false));
}
@Test
public void shouldReportIncompleteInputs() throws Exception {
ListenableFuture<Object> element = SettableFuture.create();
List<ListenableFuture<?>> parameterValues = ImmutableList.of(
immediateFuture("hi"),
elem... | // Path: src/main/java/com/spotify/trickle/GraphExceptionWrapper.java
// public static Throwable wrapException(Throwable t,
// TraverseState.FutureCallInformation currentCall,
// TraverseState traverseState) {
// return new GraphExecutionExce... | thrown.expect(hasAncestor(inputException)); |
spotify/trickle | src/test/java/com/spotify/trickle/TrickleIntrospectionTest.java | // Path: src/main/java/com/spotify/trickle/Trickle.java
// public static <R> ConfigurableGraph<R> call(Func0<R> func) {
// return new GraphBuilder<R>(func);
// }
| import com.google.common.util.concurrent.ListenableFuture;
import org.junit.Before;
import org.junit.Test;
import static com.google.common.util.concurrent.Futures.immediateFuture;
import static com.spotify.trickle.Trickle.call;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat; | /*
* Copyright 2013-2014 Spotify AB. All rights reserved.
*
* The contents of this file are licensed under the Apache License, Version
* 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2... | // Path: src/main/java/com/spotify/trickle/Trickle.java
// public static <R> ConfigurableGraph<R> call(Func0<R> func) {
// return new GraphBuilder<R>(func);
// }
// Path: src/test/java/com/spotify/trickle/TrickleIntrospectionTest.java
import com.google.common.util.concurrent.ListenableFuture;
import org.junit.Befor... | Graph<String> root = call(func1).with(input); |
GhostFlying/PortalWaitingList | app/src/main/java/com/ghostflying/portalwaitinglist/dao/DataProvider.java | // Path: app/src/main/java/com/ghostflying/portalwaitinglist/dao/dbinfo/PortalEventDbInfo.java
// public class PortalEventDbInfo implements BaseColumns {
// public static final int ID = 0;
// public static final String TABLE_NAME = "event";
// public static final String COLUMN_NAME_PORTAL_NAME = "portalname... | import android.content.ContentProvider;
import android.content.ContentUris;
import android.content.ContentValues;
import android.content.UriMatcher;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteQueryBuilder;
imp... | package com.ghostflying.portalwaitinglist.dao;
public class DataProvider extends ContentProvider {
public static final String AUTHORITY = BuildConfig.APPLICATION_ID;
private DbHelper mDbHelper;
private SQLiteDatabase mDatabase;
public DataProvider() {
}
private static final UriMatcher mU... | // Path: app/src/main/java/com/ghostflying/portalwaitinglist/dao/dbinfo/PortalEventDbInfo.java
// public class PortalEventDbInfo implements BaseColumns {
// public static final int ID = 0;
// public static final String TABLE_NAME = "event";
// public static final String COLUMN_NAME_PORTAL_NAME = "portalname... | addURI(AUTHORITY, PortalEventDbInfo.TABLE_NAME, PortalEventDbInfo.ID); |
GhostFlying/PortalWaitingList | app/src/main/java/com/ghostflying/portalwaitinglist/dao/DbHelper.java | // Path: app/src/main/java/com/ghostflying/portalwaitinglist/dao/dbinfo/PortalEventDbInfo.java
// public class PortalEventDbInfo implements BaseColumns {
// public static final int ID = 0;
// public static final String TABLE_NAME = "event";
// public static final String COLUMN_NAME_PORTAL_NAME = "portalname... | import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import com.ghostflying.portalwaitinglist.dao.dbinfo.PortalEventDbInfo; | package com.ghostflying.portalwaitinglist.dao;
/**
* Created by ghostflying on 1/14/15.
*/
public class DbHelper extends SQLiteOpenHelper{
static final int DATABASE_VERSION = 3;
static final String DATABASE_NAME = "PortalEvent.db";
private static final String TEXT_TYPE = " TEXT";
private static fi... | // Path: app/src/main/java/com/ghostflying/portalwaitinglist/dao/dbinfo/PortalEventDbInfo.java
// public class PortalEventDbInfo implements BaseColumns {
// public static final int ID = 0;
// public static final String TABLE_NAME = "event";
// public static final String COLUMN_NAME_PORTAL_NAME = "portalname... | private static final String SQL_CREATE_EVENTS = "CREATE TABLE " + PortalEventDbInfo.TABLE_NAME |
GhostFlying/PortalWaitingList | app/src/main/java/com/ghostflying/portalwaitinglist/dao/datahelper/BaseHelper.java | // Path: app/src/main/java/com/ghostflying/portalwaitinglist/dao/DataProvider.java
// public class DataProvider extends ContentProvider {
// public static final String AUTHORITY = BuildConfig.APPLICATION_ID;
//
// private DbHelper mDbHelper;
// private SQLiteDatabase mDatabase;
//
// public DataProvid... | import android.content.ContentValues;
import android.content.Context;
import android.database.ContentObserver;
import android.database.Cursor;
import android.net.Uri;
import com.ghostflying.portalwaitinglist.dao.DataProvider; | package com.ghostflying.portalwaitinglist.dao.datahelper;
/**
* Created by ghostflying on 1/19/15.
*/
public abstract class BaseHelper {
Context mContext;
Uri mUri;
public BaseHelper(Context context){
mContext = context; | // Path: app/src/main/java/com/ghostflying/portalwaitinglist/dao/DataProvider.java
// public class DataProvider extends ContentProvider {
// public static final String AUTHORITY = BuildConfig.APPLICATION_ID;
//
// private DbHelper mDbHelper;
// private SQLiteDatabase mDatabase;
//
// public DataProvid... | mUri = Uri.parse("content://" + DataProvider.AUTHORITY + "/" + getTableName()); |
GhostFlying/PortalWaitingList | app/src/main/java/com/ghostflying/portalwaitinglist/util/GMailService.java | // Path: app/src/main/java/com/ghostflying/portalwaitinglist/model/Message.java
// public class Message {
// private static final String SUBJECT_NAME = "Subject";
// private static final String SUBJECT_DATE = "Date";
//
// Payload payload;
// String id;
//
// public String getId(){
// retu... | import com.ghostflying.portalwaitinglist.model.Message;
import com.ghostflying.portalwaitinglist.model.MessageList;
import retrofit.http.GET;
import retrofit.http.Path;
import retrofit.http.Query; | package com.ghostflying.portalwaitinglist.util;
/**
* Created by ghostflying on 11/19/14.
* <br>
* GMail API interface, used by retrofit to achieve.
*/
public interface GMailService {
@GET("/users/me/messages") | // Path: app/src/main/java/com/ghostflying/portalwaitinglist/model/Message.java
// public class Message {
// private static final String SUBJECT_NAME = "Subject";
// private static final String SUBJECT_DATE = "Date";
//
// Payload payload;
// String id;
//
// public String getId(){
// retu... | public MessageList getMessages(@Query("q") String query, @Query("pageToken") String pageToken); |
GhostFlying/PortalWaitingList | app/src/main/java/com/ghostflying/portalwaitinglist/util/GMailService.java | // Path: app/src/main/java/com/ghostflying/portalwaitinglist/model/Message.java
// public class Message {
// private static final String SUBJECT_NAME = "Subject";
// private static final String SUBJECT_DATE = "Date";
//
// Payload payload;
// String id;
//
// public String getId(){
// retu... | import com.ghostflying.portalwaitinglist.model.Message;
import com.ghostflying.portalwaitinglist.model.MessageList;
import retrofit.http.GET;
import retrofit.http.Path;
import retrofit.http.Query; | package com.ghostflying.portalwaitinglist.util;
/**
* Created by ghostflying on 11/19/14.
* <br>
* GMail API interface, used by retrofit to achieve.
*/
public interface GMailService {
@GET("/users/me/messages")
public MessageList getMessages(@Query("q") String query, @Query("pageToken") String pageToken)... | // Path: app/src/main/java/com/ghostflying/portalwaitinglist/model/Message.java
// public class Message {
// private static final String SUBJECT_NAME = "Subject";
// private static final String SUBJECT_DATE = "Date";
//
// Payload payload;
// String id;
//
// public String getId(){
// retu... | public Message getMessage(@Path("id") String id, @Query("format")String format, @Query("metadataHeaders") String[] metadataHeaders); |
sergueik/SWET | src/test/java/com/github/sergueik/swet/TestConfigurationParserTest.java | // Path: src/main/java/com/github/sergueik/swet/TestConfigurationParser.java
// public class TestConfigurationParser {
//
// private static boolean skipHeaders = true;
// private static String defaultConfig = "test.configuration";
// private static Scanner scanner;
//
// public static void main(String[] args) {
/... | import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import static org.junit.Assert.*;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.assertThat;
import static org.hamcrest.core.AnyOf.anyOf;
imp... | package com.github.sergueik.swet;
/**
* Copyright 2014 - 2019 Serguei Kouzmine
*/
// import static org.hamcrest.CoreMatchers.*;
// NOTE: a need to switch to hamcrest-all.jar and Matchers
// just for resolving method 'containsInAnyOrder'
public class TestConfigurationParserTest {
/**
* Testing of the Seleniu... | // Path: src/main/java/com/github/sergueik/swet/TestConfigurationParser.java
// public class TestConfigurationParser {
//
// private static boolean skipHeaders = true;
// private static String defaultConfig = "test.configuration";
// private static Scanner scanner;
//
// public static void main(String[] args) {
/... | result = flatten(TestConfigurationParser.getConfiguration(configuPath)); |
xiaoyu830411/abtesting_dsl | src/main/java/com/yanglinkui/ab/dsl/condition/Statements.java | // Path: src/main/java/com/yanglinkui/ab/dsl/Context.java
// public interface Context {
// public String getValue(Variable var);
//
// public String getValue(Function function);
//
// }
//
// Path: src/main/java/com/yanglinkui/ab/dsl/Expression.java
// public interface Expression {
//
// public boolean ... | import com.yanglinkui.ab.dsl.Context;
import com.yanglinkui.ab.dsl.Expression; | package com.yanglinkui.ab.dsl.condition;
/**
* Created by jonas on 2017/1/4.
*/
public class Statements implements Expression {
private Expression expression;
public Statements() {}
public Expression getExpression() {
return expression;
}
public void setExpression(Expression expressi... | // Path: src/main/java/com/yanglinkui/ab/dsl/Context.java
// public interface Context {
// public String getValue(Variable var);
//
// public String getValue(Function function);
//
// }
//
// Path: src/main/java/com/yanglinkui/ab/dsl/Expression.java
// public interface Expression {
//
// public boolean ... | public boolean interpret(Context context) { |
xiaoyu830411/abtesting_dsl | src/test/java/com/yanglinkui/ab/dsl/TestEqual.java | // Path: src/main/java/com/yanglinkui/ab/dsl/Number.java
// public class Number implements Value<BigDecimal> {
//
// private final BigDecimal value;
//
// public Number(BigDecimal value) {
// this.value = value;
// }
//
// public BigDecimal getValue() {
// return this.value;
// }
... | import com.yanglinkui.ab.dsl.*;
import com.yanglinkui.ab.dsl.Number;
import org.junit.Test;
import java.math.BigDecimal;
import java.util.HashSet;
import static org.mockito.Mockito.*;
import static junit.framework.Assert.*; | package com.yanglinkui.ab.dsl;
/**
* Created by jonas on 2017/1/8.
*/
public class TestEqual {
@Test
public void testInterpretByNumber() {
Variable s1Version = new Variable("s1.version");
Context s1VersionContext = mock(Context.class);
when(s1VersionContext.getValue(s1Version)).th... | // Path: src/main/java/com/yanglinkui/ab/dsl/Number.java
// public class Number implements Value<BigDecimal> {
//
// private final BigDecimal value;
//
// public Number(BigDecimal value) {
// this.value = value;
// }
//
// public BigDecimal getValue() {
// return this.value;
// }
... | equal.setValue(new com.yanglinkui.ab.dsl.Number(new BigDecimal("1"))); |
xiaoyu830411/abtesting_dsl | src/main/java/com/yanglinkui/ab/dsl/condition/ConditionParser.java | // Path: src/main/java/com/yanglinkui/ab/dsl/Number.java
// public class Number implements Value<BigDecimal> {
//
// private final BigDecimal value;
//
// public Number(BigDecimal value) {
// this.value = value;
// }
//
// public BigDecimal getValue() {
// return this.value;
// }
... | import com.yanglinkui.ab.dsl.*;
import com.yanglinkui.ab.dsl.Number;
import java.math.BigDecimal;
import java.util.HashSet; | return new LessEqual();
}
Value value() {
if (LA(1) == ConditionToken.TOKEN_NUMBER || LA(1) == ConditionToken.TOKEN_STRING) {
return element();
} else {
match(ConditionToken.TOKEN_LSBRACK);
Value value = elements();
match(ConditionToken.TO... | // Path: src/main/java/com/yanglinkui/ab/dsl/Number.java
// public class Number implements Value<BigDecimal> {
//
// private final BigDecimal value;
//
// public Number(BigDecimal value) {
// this.value = value;
// }
//
// public BigDecimal getValue() {
// return this.value;
// }
... | return new Number(new BigDecimal(t.getText())); |
xiaoyu830411/abtesting_dsl | src/test/java/com/yanglinkui/ab/dsl/TestGreater.java | // Path: src/main/java/com/yanglinkui/ab/dsl/Context.java
// public interface Context {
// public String getValue(Variable var);
//
// public String getValue(Function function);
//
// }
//
// Path: src/main/java/com/yanglinkui/ab/dsl/Greater.java
// public class Greater extends Operation {
//
// public ... | import com.yanglinkui.ab.dsl.Context;
import com.yanglinkui.ab.dsl.Greater;
import com.yanglinkui.ab.dsl.Number;
import com.yanglinkui.ab.dsl.Variable;
import org.junit.Test;
import java.math.BigDecimal;
import static org.mockito.Mockito.*;
import static junit.framework.Assert.*; | package com.yanglinkui.ab.dsl;
/**
* Created by jonas on 2017/1/8.
*/
public class TestGreater {
@Test
public void testInterpretByNumber() { | // Path: src/main/java/com/yanglinkui/ab/dsl/Context.java
// public interface Context {
// public String getValue(Variable var);
//
// public String getValue(Function function);
//
// }
//
// Path: src/main/java/com/yanglinkui/ab/dsl/Greater.java
// public class Greater extends Operation {
//
// public ... | Variable var = new Variable("s1.version"); |
xiaoyu830411/abtesting_dsl | src/test/java/com/yanglinkui/ab/dsl/TestGreater.java | // Path: src/main/java/com/yanglinkui/ab/dsl/Context.java
// public interface Context {
// public String getValue(Variable var);
//
// public String getValue(Function function);
//
// }
//
// Path: src/main/java/com/yanglinkui/ab/dsl/Greater.java
// public class Greater extends Operation {
//
// public ... | import com.yanglinkui.ab.dsl.Context;
import com.yanglinkui.ab.dsl.Greater;
import com.yanglinkui.ab.dsl.Number;
import com.yanglinkui.ab.dsl.Variable;
import org.junit.Test;
import java.math.BigDecimal;
import static org.mockito.Mockito.*;
import static junit.framework.Assert.*; | package com.yanglinkui.ab.dsl;
/**
* Created by jonas on 2017/1/8.
*/
public class TestGreater {
@Test
public void testInterpretByNumber() {
Variable var = new Variable("s1.version"); | // Path: src/main/java/com/yanglinkui/ab/dsl/Context.java
// public interface Context {
// public String getValue(Variable var);
//
// public String getValue(Function function);
//
// }
//
// Path: src/main/java/com/yanglinkui/ab/dsl/Greater.java
// public class Greater extends Operation {
//
// public ... | Context context = mock(Context.class); |
xiaoyu830411/abtesting_dsl | src/test/java/com/yanglinkui/ab/dsl/TestGreater.java | // Path: src/main/java/com/yanglinkui/ab/dsl/Context.java
// public interface Context {
// public String getValue(Variable var);
//
// public String getValue(Function function);
//
// }
//
// Path: src/main/java/com/yanglinkui/ab/dsl/Greater.java
// public class Greater extends Operation {
//
// public ... | import com.yanglinkui.ab.dsl.Context;
import com.yanglinkui.ab.dsl.Greater;
import com.yanglinkui.ab.dsl.Number;
import com.yanglinkui.ab.dsl.Variable;
import org.junit.Test;
import java.math.BigDecimal;
import static org.mockito.Mockito.*;
import static junit.framework.Assert.*; | package com.yanglinkui.ab.dsl;
/**
* Created by jonas on 2017/1/8.
*/
public class TestGreater {
@Test
public void testInterpretByNumber() {
Variable var = new Variable("s1.version");
Context context = mock(Context.class);
when(context.getValue(var)).thenReturn("1");
| // Path: src/main/java/com/yanglinkui/ab/dsl/Context.java
// public interface Context {
// public String getValue(Variable var);
//
// public String getValue(Function function);
//
// }
//
// Path: src/main/java/com/yanglinkui/ab/dsl/Greater.java
// public class Greater extends Operation {
//
// public ... | Greater g = new Greater(); |
xiaoyu830411/abtesting_dsl | src/test/java/com/yanglinkui/ab/dsl/TestGreater.java | // Path: src/main/java/com/yanglinkui/ab/dsl/Context.java
// public interface Context {
// public String getValue(Variable var);
//
// public String getValue(Function function);
//
// }
//
// Path: src/main/java/com/yanglinkui/ab/dsl/Greater.java
// public class Greater extends Operation {
//
// public ... | import com.yanglinkui.ab.dsl.Context;
import com.yanglinkui.ab.dsl.Greater;
import com.yanglinkui.ab.dsl.Number;
import com.yanglinkui.ab.dsl.Variable;
import org.junit.Test;
import java.math.BigDecimal;
import static org.mockito.Mockito.*;
import static junit.framework.Assert.*; | package com.yanglinkui.ab.dsl;
/**
* Created by jonas on 2017/1/8.
*/
public class TestGreater {
@Test
public void testInterpretByNumber() {
Variable var = new Variable("s1.version");
Context context = mock(Context.class);
when(context.getValue(var)).thenReturn("1");
Great... | // Path: src/main/java/com/yanglinkui/ab/dsl/Context.java
// public interface Context {
// public String getValue(Variable var);
//
// public String getValue(Function function);
//
// }
//
// Path: src/main/java/com/yanglinkui/ab/dsl/Greater.java
// public class Greater extends Operation {
//
// public ... | g.setValue(new Number(new BigDecimal("1"))); |
xiaoyu830411/abtesting_dsl | src/test/java/com/yanglinkui/ab/dsl/TestLessEqual.java | // Path: src/main/java/com/yanglinkui/ab/dsl/Context.java
// public interface Context {
// public String getValue(Variable var);
//
// public String getValue(Function function);
//
// }
//
// Path: src/main/java/com/yanglinkui/ab/dsl/LessEqual.java
// public class LessEqual extends Operation {
//
// pub... | import com.yanglinkui.ab.dsl.Context;
import com.yanglinkui.ab.dsl.LessEqual;
import com.yanglinkui.ab.dsl.Number;
import com.yanglinkui.ab.dsl.Variable;
import org.junit.Test;
import java.math.BigDecimal;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
import static o... | package com.yanglinkui.ab.dsl;
/**
* Created by jonas on 2017/1/8.
*/
public class TestLessEqual {
@Test
public void testInterpretByNumber() { | // Path: src/main/java/com/yanglinkui/ab/dsl/Context.java
// public interface Context {
// public String getValue(Variable var);
//
// public String getValue(Function function);
//
// }
//
// Path: src/main/java/com/yanglinkui/ab/dsl/LessEqual.java
// public class LessEqual extends Operation {
//
// pub... | Variable var = new Variable("s1.version"); |
xiaoyu830411/abtesting_dsl | src/test/java/com/yanglinkui/ab/dsl/TestLessEqual.java | // Path: src/main/java/com/yanglinkui/ab/dsl/Context.java
// public interface Context {
// public String getValue(Variable var);
//
// public String getValue(Function function);
//
// }
//
// Path: src/main/java/com/yanglinkui/ab/dsl/LessEqual.java
// public class LessEqual extends Operation {
//
// pub... | import com.yanglinkui.ab.dsl.Context;
import com.yanglinkui.ab.dsl.LessEqual;
import com.yanglinkui.ab.dsl.Number;
import com.yanglinkui.ab.dsl.Variable;
import org.junit.Test;
import java.math.BigDecimal;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
import static o... | package com.yanglinkui.ab.dsl;
/**
* Created by jonas on 2017/1/8.
*/
public class TestLessEqual {
@Test
public void testInterpretByNumber() {
Variable var = new Variable("s1.version"); | // Path: src/main/java/com/yanglinkui/ab/dsl/Context.java
// public interface Context {
// public String getValue(Variable var);
//
// public String getValue(Function function);
//
// }
//
// Path: src/main/java/com/yanglinkui/ab/dsl/LessEqual.java
// public class LessEqual extends Operation {
//
// pub... | Context context = mock(Context.class); |
xiaoyu830411/abtesting_dsl | src/test/java/com/yanglinkui/ab/dsl/TestLessEqual.java | // Path: src/main/java/com/yanglinkui/ab/dsl/Context.java
// public interface Context {
// public String getValue(Variable var);
//
// public String getValue(Function function);
//
// }
//
// Path: src/main/java/com/yanglinkui/ab/dsl/LessEqual.java
// public class LessEqual extends Operation {
//
// pub... | import com.yanglinkui.ab.dsl.Context;
import com.yanglinkui.ab.dsl.LessEqual;
import com.yanglinkui.ab.dsl.Number;
import com.yanglinkui.ab.dsl.Variable;
import org.junit.Test;
import java.math.BigDecimal;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
import static o... | package com.yanglinkui.ab.dsl;
/**
* Created by jonas on 2017/1/8.
*/
public class TestLessEqual {
@Test
public void testInterpretByNumber() {
Variable var = new Variable("s1.version");
Context context = mock(Context.class);
when(context.getValue(var)).thenReturn("1");
| // Path: src/main/java/com/yanglinkui/ab/dsl/Context.java
// public interface Context {
// public String getValue(Variable var);
//
// public String getValue(Function function);
//
// }
//
// Path: src/main/java/com/yanglinkui/ab/dsl/LessEqual.java
// public class LessEqual extends Operation {
//
// pub... | LessEqual g = new LessEqual(); |
xiaoyu830411/abtesting_dsl | src/test/java/com/yanglinkui/ab/dsl/TestLessEqual.java | // Path: src/main/java/com/yanglinkui/ab/dsl/Context.java
// public interface Context {
// public String getValue(Variable var);
//
// public String getValue(Function function);
//
// }
//
// Path: src/main/java/com/yanglinkui/ab/dsl/LessEqual.java
// public class LessEqual extends Operation {
//
// pub... | import com.yanglinkui.ab.dsl.Context;
import com.yanglinkui.ab.dsl.LessEqual;
import com.yanglinkui.ab.dsl.Number;
import com.yanglinkui.ab.dsl.Variable;
import org.junit.Test;
import java.math.BigDecimal;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
import static o... | package com.yanglinkui.ab.dsl;
/**
* Created by jonas on 2017/1/8.
*/
public class TestLessEqual {
@Test
public void testInterpretByNumber() {
Variable var = new Variable("s1.version");
Context context = mock(Context.class);
when(context.getValue(var)).thenReturn("1");
Les... | // Path: src/main/java/com/yanglinkui/ab/dsl/Context.java
// public interface Context {
// public String getValue(Variable var);
//
// public String getValue(Function function);
//
// }
//
// Path: src/main/java/com/yanglinkui/ab/dsl/LessEqual.java
// public class LessEqual extends Operation {
//
// pub... | g.setValue(new Number(new BigDecimal("1"))); |
xiaoyu830411/abtesting_dsl | src/main/java/com/yanglinkui/ab/dsl/action/ActionLexer.java | // Path: src/main/java/com/yanglinkui/ab/dsl/Lexer.java
// public abstract class Lexer {
//
// public static final char EOF = (char) -1;
//
// protected final String input;
// protected int p = 0;
// protected char c;
//
// public Lexer(String input) {
// this.input = input;
// c ... | import com.yanglinkui.ab.dsl.Lexer;
import com.yanglinkui.ab.dsl.Token; | package com.yanglinkui.ab.dsl.action;
/**
* Created by jonas on 2017/1/8.
*/
public class ActionLexer extends Lexer {
public ActionLexer(String input) {
super(input);
}
| // Path: src/main/java/com/yanglinkui/ab/dsl/Lexer.java
// public abstract class Lexer {
//
// public static final char EOF = (char) -1;
//
// protected final String input;
// protected int p = 0;
// protected char c;
//
// public Lexer(String input) {
// this.input = input;
// c ... | public Token nextToken() { |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.