method2testcases stringlengths 118 6.63k |
|---|
### Question:
JmsPoolSession implements Session, TopicSession, QueueSession, XASession, AutoCloseable { @Override public XAResource getXAResource() { final PooledSessionHolder session; try { session = safeGetSessionHolder(); } catch (JMSException e) { throw JMSExceptionSupport.createRuntimeException(e); } if (session.g... |
### Question:
JmsPoolJMSProducer implements JMSProducer { @Override public JMSProducer clearProperties() { messageProperties.clear(); return this; } JmsPoolJMSProducer(JmsPoolSession session, JmsPoolMessageProducer producer); @Override String toString(); @Override JMSProducer send(Destination destination, Message messa... |
### Question:
JmsPoolSession implements Session, TopicSession, QueueSession, XASession, AutoCloseable { @Override public Queue createQueue(String s) throws JMSException { return getInternalSession().createQueue(s); } JmsPoolSession(PooledSessionKey key, PooledSessionHolder sessionHolder, KeyedObjectPool<PooledSessionKe... |
### Question:
JmsPoolSession implements Session, TopicSession, QueueSession, XASession, AutoCloseable { @Override public Topic createTopic(String s) throws JMSException { return getInternalSession().createTopic(s); } JmsPoolSession(PooledSessionKey key, PooledSessionHolder sessionHolder, KeyedObjectPool<PooledSessionKe... |
### Question:
JmsPoolSession implements Session, TopicSession, QueueSession, XASession, AutoCloseable { @Override public TemporaryQueue createTemporaryQueue() throws JMSException { TemporaryQueue result; result = getInternalSession().createTemporaryQueue(); for (JmsPoolSessionEventListener listener : this.sessionEventL... |
### Question:
JmsPoolSession implements Session, TopicSession, QueueSession, XASession, AutoCloseable { @Override public TemporaryTopic createTemporaryTopic() throws JMSException { TemporaryTopic result; result = getInternalSession().createTemporaryTopic(); for (JmsPoolSessionEventListener listener : this.sessionEventL... |
### Question:
JmsPoolSession implements Session, TopicSession, QueueSession, XASession, AutoCloseable { public void addSessionEventListener(JmsPoolSessionEventListener listener) throws JMSException { checkClosed(); if (!sessionEventListeners.contains(listener)) { this.sessionEventListeners.add(listener); } } JmsPoolSes... |
### Question:
JmsPoolSession implements Session, TopicSession, QueueSession, XASession, AutoCloseable { @Override public TopicSubscriber createDurableSubscriber(Topic topic, String selector) throws JMSException { return addTopicSubscriber(getInternalSession().createDurableSubscriber(topic, selector)); } JmsPoolSession(... |
### Question:
JmsPoolJMSProducer implements JMSProducer { @Override public boolean propertyExists(String name) { return messageProperties.containsKey(name); } JmsPoolJMSProducer(JmsPoolSession session, JmsPoolMessageProducer producer); @Override String toString(); @Override JMSProducer send(Destination destination, Mes... |
### Question:
JmsPoolSession implements Session, TopicSession, QueueSession, XASession, AutoCloseable { @Override public TopicSubscriber createSubscriber(Topic topic) throws JMSException { return addTopicSubscriber(((TopicSession) getInternalSession()).createSubscriber(topic)); } JmsPoolSession(PooledSessionKey key, Po... |
### Question:
JmsPoolSession implements Session, TopicSession, QueueSession, XASession, AutoCloseable { @Override public QueueReceiver createReceiver(Queue queue) throws JMSException { return addQueueReceiver(((QueueSession) getInternalSession()).createReceiver(queue)); } JmsPoolSession(PooledSessionKey key, PooledSess... |
### Question:
JmsPoolSession implements Session, TopicSession, QueueSession, XASession, AutoCloseable { @Override public void setMessageListener(MessageListener messageListener) throws JMSException { getInternalSession().setMessageListener(messageListener); } JmsPoolSession(PooledSessionKey key, PooledSessionHolder ses... |
### Question:
JmsPoolJMSProducer implements JMSProducer { @Override public String getStringProperty(String name) { try { return convertPropertyTo(name, messageProperties.get(name), String.class); } catch (JMSException jmse) { throw JMSExceptionSupport.createRuntimeException(jmse); } } JmsPoolJMSProducer(JmsPoolSession ... |
### Question:
JmsPoolJMSProducer implements JMSProducer { @Override public byte getByteProperty(String name) { try { return convertPropertyTo(name, messageProperties.get(name), Byte.class); } catch (JMSException jmse) { throw JMSExceptionSupport.createRuntimeException(jmse); } } JmsPoolJMSProducer(JmsPoolSession sessio... |
### Question:
JmsPoolJMSProducer implements JMSProducer { @Override public boolean getBooleanProperty(String name) { try { return convertPropertyTo(name, messageProperties.get(name), Boolean.class); } catch (JMSException jmse) { throw JMSExceptionSupport.createRuntimeException(jmse); } } JmsPoolJMSProducer(JmsPoolSessi... |
### Question:
JmsPoolJMSProducer implements JMSProducer { @Override public short getShortProperty(String name) { try { return convertPropertyTo(name, messageProperties.get(name), Short.class); } catch (JMSException jmse) { throw JMSExceptionSupport.createRuntimeException(jmse); } } JmsPoolJMSProducer(JmsPoolSession ses... |
### Question:
JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cau... |
### Question:
JmsPoolJMSProducer implements JMSProducer { @Override public long getLongProperty(String name) { try { return convertPropertyTo(name, messageProperties.get(name), Long.class); } catch (JMSException jmse) { throw JMSExceptionSupport.createRuntimeException(jmse); } } JmsPoolJMSProducer(JmsPoolSession sessio... |
### Question:
DigestUtils { public static byte[] digest(MessageDigest digest, byte[] data) { return digest.digest(data); } static byte[] digest(MessageDigest digest, byte[] data); static MessageDigest updateDigest(MessageDigest messageDigest, byte[] valueToDigest); static byte[] digest(MessageDigest digest, InputStrea... |
### Question:
NumberUtils { public static boolean isPositiveNumber(Number number) { if (number == null) return false; return org.apache.commons.lang3.math.NumberUtils.isDigits(number.toString()) && number.byteValue() > 0; } static int toInt(String str); static long toLong(String str); static float toFloat(String str);... |
### Question:
BeanUtils { public static void copyProperties(Object source, Object target) throws BeansException { org.springframework.beans.BeanUtils.copyProperties(source, target); } static void copyProperties(Object source, Object target); static void copyProperties(Object source, String[] copyProperties, Object tar... |
### Question:
HashCodeBuilderUtils { public static int reflectionHashCode(Object object) { return reflectionHashCode(17, 37, object); } static int reflectionHashCode(Object object); static int reflectionHashCode(int initialNonZeroOddNumber, int multiplierNonZeroOddNumber, T object); }### Answer:
@Test public void tes... |
### Question:
ToStringBuilderUtils { public static String reflectionToString(Object object) { ToStringBuilder builder = new ToStringBuilder(object); Class<?> clazz = object.getClass(); reflectionAppend(object, clazz, builder); while (clazz.getSuperclass() != null) { clazz = clazz.getSuperclass(); reflectionAppend(objec... |
### Question:
Message { public T getContent() { return content; } Message(MessageType type, T content); MessageType getType(); T getContent(); }### Answer:
@Test public void test() { ApplicationContext applicationContext = BeanFactoryContext.currentApplicationContext(); LOGGER.info(ApplicationContextUtils.getMessage(a... |
### Question:
ReportExportRestApi { @NotNull public ExportExecutionDescriptor runExportExecution(@NotNull String executionId, @NotNull ExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(executionOptions, "E... |
### Question:
RepositoryRestApi { @NotNull public ResourceLookup requestResource(@NotNull String resourceUri, @NotNull String type) throws IOException, HttpException { Utils.checkNotNull(resourceUri, "Report uri should not be null"); Utils.checkNotNull(type, "Report type should not be null"); HttpUrl url = new PathReso... |
### Question:
RepositoryRestApi { @NotNull public OutputResource requestResourceOutput(@NotNull String resourceUri) throws IOException, HttpException { Utils.checkNotNull(resourceUri, "Resource uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("resources") .addPaths(resourc... |
### Question:
RepositoryRestApi { @NotNull public DashboardComponentCollection requestDashboardComponents(@NotNull String dashboardUri) throws IOException, HttpException { Utils.checkNotNull(dashboardUri, "Dashboard uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("resourc... |
### Question:
ReportExportRestApi { @NotNull public OutputResource requestExportAttachment(@NotNull String executionId, @NotNull String exportId, @NotNull String attachmentId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id ... |
### Question:
SpringAuthServiceFactory { public SpringAuthService create() { AuthRestApi restApi = new AuthRestApi(mClient); JSEncryptionAlgorithm encryptionAlgorithm = JSEncryptionAlgorithm.create(); return new SpringAuthService(restApi, encryptionAlgorithm); } SpringAuthServiceFactory(NetworkClient client); SpringAut... |
### Question:
Utils { public static String normalizeBaseUrl(String url) { if (url == null || url.length() == 0) { return url; } if (url.endsWith("/")) { return url; } return url + "/"; } private Utils(); static T checkNotNull(T object, String message); static void checkArgument(boolean condition, String message); stat... |
### Question:
JobData { @Override public final boolean equals(Object o) { if (this == o) return true; if (!(o instanceof JobData)) return false; JobData jobData = (JobData) o; if (mId != jobData.mId) return false; if (mVersion != jobData.mVersion) return false; if (!mCreationDate.equals(jobData.mCreationDate)) return f... |
### Question:
TimePattern { public void setRange(int start, int end) { if (start < mLowerBound) { throw new IllegalArgumentException("start cannot be less than lower bound."); } if (end > mHigherBound) { throw new IllegalArgumentException("end cannot be more than upper bound."); } if (start > end) { throw new IllegalAr... |
### Question:
TimePattern { public void setValue(int value) { validateWithinBounds(value, String.format("Value should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); mPattern.setLength(0); mPattern.append(String.valueOf(value)); } TimePattern(int lowerBound, int higherBound); void setRange(int start, int end... |
### Question:
TimePattern { public void setIncrement(int interval, int from) { validateWithinBounds(interval, String.format("Interval should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); validateWithinBounds(from, String.format("From should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); mPatter... |
### Question:
RepositoryDestination { @Nullable public Boolean getUseDefaultReportOutputFolderURI() { return useDefaultReportOutputFolderURI; } RepositoryDestination(Builder builder); @Nullable Boolean getSequentialFileNames(); @Nullable Boolean getOverwriteFiles(); @Nullable Boolean getSaveToRepository(); @Nullable Bo... |
### Question:
ReportMetadata { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ReportMetadata that = (ReportMetadata) o; if (totalPages != that.totalPages) return false; if (uri != null ? !uri.equals(that.uri) : that.uri != null) return ... |
### Question:
ReportOption { @Override public final boolean equals(Object o) { if (this == o) return true; if (!(o instanceof ReportOption)) return false; ReportOption that = (ReportOption) o; if (!id.equals(that.id)) return false; if (!label.equals(that.label)) return false; if (!uri.equals(that.uri)) return false; re... |
### Question:
PageRange { @NotNull public static PageRange parse(@NotNull String pages) { Preconditions.checkNotNull(pages, "Pages should not be null"); int lowerBound = parseLowerBound(pages); int upperBound = parseUpperBound(pages); return new PageRange(lowerBound, upperBound); } private PageRange(int lowerBound, in... |
### Question:
PageRange { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PageRange pageRange = (PageRange) o; if (mLowerBound != pageRange.mLowerBound) return false; if (mUpperBound != pageRange.mUpperBound) return false; return true; }... |
### Question:
VersionParser { public static double toDouble(String version) { if (version != null) { try { return Double.parseDouble(version); } catch (NumberFormatException ex) { if (version.contains(".")) { return parseAsVersionName(version); } else { return parseAsNumber(version); } } } return INVALID_VERSION; } pri... |
### Question:
ReportExportRestApi { @NotNull public ExecutionStatus checkExportExecutionStatus(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); Http... |
### Question:
RepositoryUseCase { public DashboardComponentCollection requestDashboardComponents(String dashboardUri) throws ServiceException { try { return mRestApi.requestDashboardComponents(dashboardUri); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMappe... |
### Question:
ReportOptionMapper { public Set<ReportOption> transform(Set<ReportOptionEntity> entities) { Set<ReportOption> options = new HashSet<>(entities.size()); for (ReportOptionEntity entity : entities) { if (entity != null) { ReportOption option = transform(entity); options.add(option); } } return options; } Se... |
### Question:
ReportOptionsUseCase { public Set<ReportOption> requestReportOptionsList(String reportUnitUri) throws ServiceException { try { Set<ReportOptionEntity> entities = mReportOptionRestApi.requestReportOptionsList(reportUnitUri); return mReportOptionMapper.transform(entities); } catch (HttpException e) { throw ... |
### Question:
ReportOptionsUseCase { public ReportOption createReportOption(String reportUri, String optionLabel, List<ReportParameter> parameters, boolean overwrite) throws ServiceException { try { ReportOptionEntity entity = mReportOptionRestApi.createReportOption(reportUri, optionLabel, parameters, overwrite); retur... |
### Question:
ReportOptionsUseCase { public void updateReportOption(String reportUri, String optionId, List<ReportParameter> parameters) throws ServiceException { try { mReportOptionRestApi.updateReportOption(reportUri, optionId, parameters); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOE... |
### Question:
ReportOptionsUseCase { public void deleteReportOption(String reportUri, String optionId) throws ServiceException { try { mReportOptionRestApi.deleteReportOption(reportUri, optionId); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform... |
### Question:
ReportControlsUseCase { public List<InputControl> requestControls(String reportUri, Set<String> ids, boolean excludeState) throws ServiceException { try { return mRestApi.requestInputControls(reportUri, ids, excludeState); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOExcepti... |
### Question:
ReportControlsUseCase { public List<InputControlState> requestResourceValues(String resourceUri, boolean freshData) throws ServiceException { try { return mRestApi.requestInputControlsInitialStates(resourceUri, freshData); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOExcepti... |
### Question:
ReportControlsUseCase { public List<InputControlState> requestControlsValues(String reportUri, List<ReportParameter> parameters, boolean fresh) throws ServiceException { try { return mRestApi.requestInputControlsStates(reportUri, parameters, fresh); } catch (HttpException e) { throw mExceptionMapper.trans... |
### Question:
ServerInfoTransformer { public ServerInfo transform(ServerInfoData response) { ServerInfo serverInfo = new ServerInfo(); serverInfo.setBuild(response.getBuild()); SimpleDateFormat dateDateFormat = new SimpleDateFormat(response.getDateFormatPattern()); serverInfo.setDateFormatPattern(dateDateFormat); Simpl... |
### Question:
FileResourceMapper extends AbstractResourceMapper<FileResource, FileLookup> { @Override public FileResource transform(FileLookup lookup) { FileResource.Builder builder = new FileResource.Builder(); AbstractResourceBuilder abstractResourceBuilder = builder.addResource(); buildLookup(abstractResourceBuilder... |
### Question:
RepositorySearchCriteria { @NotNull public static Builder builder() { return new Builder(); } private RepositorySearchCriteria(Builder builder); @NotNull static Builder builder(); @NotNull static RepositorySearchCriteria empty(); int getLimit(); int getOffset(); @Nullable String getQuery(); @Nullable Boo... |
### Question:
ReportResourceMapper extends AbstractResourceMapper<ReportResource, ReportLookup> { @Override public ReportResource transform(ReportLookup lookup) { ReportResource.Builder builder = new ReportResource.Builder(); AbstractResourceBuilder abstractResourceBuilder = builder.addResource(); buildLookup(abstractR... |
### Question:
ResourceMapper extends AbstractResourceMapper<Resource, ResourceLookup> { @Override public Resource transform(ResourceLookup lookup) { AbstractResourceBuilder<?> builder = new AbstractResourceBuilder<>(null); buildLookup(builder, lookup); return builder.getResourceBuilder().build(); } ResourceMapper(@NotN... |
### Question:
ReportExportRestApi { @NotNull public ExportOutputResource requestExportOutput(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUr... |
### Question:
RepositorySearchTaskV5_6Plus extends RepositorySearchTask { @NotNull @Override public List<Resource> nextLookup() throws ServiceException { if (mEndReached || mInitialCriteria.getLimit() == 0){ return EMPTY_RESPONSE; } if (mInternalOffset == UNDEFINED) { defineInternalOffset(); } return Collections.unmodi... |
### Question:
RepositorySearchTaskV5_5 extends RepositorySearchTask { @NotNull @Override public List<Resource> nextLookup() throws ServiceException { int limit = mInitialCriteria.getLimit(); int offset = mInitialCriteria.getOffset(); if (mEndReached || limit == 0) { return EMPTY_RESPONSE; } calculateDisposition(offset)... |
### Question:
SearchUseCase { @NotNull public SearchResult performSearch(@NotNull final InternalCriteria internalCriteria) throws ServiceException { final SimpleDateFormat dateTimeFormat = mInfoCacheManager.getInfo().getDatetimeFormatPattern(); Call<SearchResult> call = new Call<SearchResult>() { @Override public Searc... |
### Question:
RepositorySearchTaskProxy extends RepositorySearchTask { @NotNull @Override public List<Resource> nextLookup() throws ServiceException { if (mDelegate == null) { mDelegate = mSearchTaskFactory.create(); } return mDelegate.nextLookup(); } RepositorySearchTaskProxy(SearchTaskFactory searchTaskFactory); @Not... |
### Question:
RepositorySearchTaskProxy extends RepositorySearchTask { @Override public boolean hasNext() { return mDelegate != null && mDelegate.hasNext(); } RepositorySearchTaskProxy(SearchTaskFactory searchTaskFactory); @NotNull @Override List<Resource> nextLookup(); @Override boolean hasNext(); }### Answer:
@Test ... |
### Question:
ExportOptionsMapper { public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.... |
### Question:
JobTriggerMapper extends JobMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobSimpleTriggerEntity simpleTrigger = entity.getSimpleTrigger(); if (simpleTrigger == null) { mCalendarTriggerMapper.mapEntityOnForm(form, entity); } else { Integer recurrenceInterval ... |
### Question:
JobTriggerMapper extends JobMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); if (trigger == null) { mNoneTriggerMapper.mapFormOnEntity(form, entity); } else { Recurrence recurrence = trigger.getRecurrence(); if (recurrence instanceof... |
### Question:
PathResolver { public HttpUrl resolve(HttpUrl base) { HttpUrl.Builder builder = base.newBuilder(); for (String path : mPaths) { builder.addPathSegment(path); } return builder.build(); } PathResolver(List<String> paths); HttpUrl resolve(HttpUrl base); }### Answer:
@Test public void shouldAggregateSinglePa... |
### Question:
JobSourceMapper extends JobMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { JobSource source = form.getSource(); List<ReportParameter> params = source.getParameters(); Map<String, Set<String>> values = mapSourceParamValues(params); entity.setSourceUri(source.getUri()); ... |
### Question:
JobSourceMapper extends JobMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobSource.Builder builder = new JobSource.Builder(); builder.withUri(entity.getSourceUri()); Map<String, Set<String>> parameters = entity.getSourceParameters(); if (parameters != null) {... |
### Question:
ReportScheduleUseCase { public List<JobUnit> searchJob(JobSearchCriteria criteria) throws ServiceException { try { Map<String, Object> searchParams = mSearchCriteriaMapper.transform(criteria); List<JobUnitEntity> jobUnitEntities = mScheduleRestApi.searchJob(searchParams); return mJobUnitMapper.transform(j... |
### Question:
ReportScheduleUseCase { public JobData createJob(JobForm form) throws ServiceException { return alterJob(form, null); } ReportScheduleUseCase(ServiceExceptionMapper exceptionMapper,
ReportScheduleRestApi scheduleRestApi,
InfoCacheManager cacheManager,
... |
### Question:
ReportScheduleUseCase { public JobData updateJob(int id, JobForm form) throws ServiceException { return alterJob(form, id); } ReportScheduleUseCase(ServiceExceptionMapper exceptionMapper,
ReportScheduleRestApi scheduleRestApi,
InfoCacheManager cacheManag... |
### Question:
ReportScheduleUseCase { public Set<Integer> deleteJobs(Set<Integer> jobIds) throws ServiceException { try { return mScheduleRestApi.deleteJobs(jobIds); } catch (IOException e) { throw mExceptionMapper.transform(e); } catch (HttpException e) { throw mExceptionMapper.transform(e); } } ReportScheduleUseCase(... |
### Question:
ReportScheduleUseCase { public JobForm readJob(int jobId) throws ServiceException { try { JobFormEntity entity = mScheduleRestApi.requestJob(jobId); return mJobFormMapper.toDataForm(entity); } catch (IOException e) { throw mExceptionMapper.transform(e); } catch (HttpException e) { throw mExceptionMapper.t... |
### Question:
JobUnitMapper { public List<JobUnit> transform(List<JobUnitEntity> entities) { List<JobUnit> list = new ArrayList<>(entities.size()); for (JobUnitEntity entity : entities) { if (entity != null) { JobUnit unit = transform(entity); list.add(unit); } } return list; } JobUnitMapper(JobUnitDateParser jobUnitDa... |
### Question:
JobNoneTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { JobSimpleTriggerEntity triggerEntity = new JobSimpleTriggerEntity(); mapCommonTriggerFieldsOnEntity(form, triggerEntity); triggerEntity.setOccurrenceCount(1); triggerEntity.setRecur... |
### Question:
JobNoneTriggerMapper extends BaseTriggerMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { mapCommonEntityTriggerFieldsOnEntity(form, entity); } @Override void mapFormOnEntity(JobForm form, JobFormEntity entity); @Override void mapEntityOnForm(JobForm.Builder for... |
### Question:
JobDataMapper { public JobData transform(JobDescriptor jobDescriptor, SimpleDateFormat dateTimeFormat) { JobData.Builder builder = new JobData.Builder(); builder.withId(jobDescriptor.getId()); builder.withLabel(jobDescriptor.getLabel()); builder.withDescription(jobDescriptor.getDescription()); builder.wit... |
### Question:
JobSimpleTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); EndDate endDate = trigger.getEndDate(); JobSimpleTriggerEntity simpleTrigger = new JobSimpleTriggerEntity(); mapCommonTriggerFieldsOnEntity(fo... |
### Question:
JobSimpleTriggerMapper extends BaseTriggerMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { mapCommonEntityTriggerFieldsOnEntity(form, entity); JobSimpleTriggerEntity simpleTrigger = entity.getSimpleTrigger(); int occurrenceCount = simpleTrigger.getOccurrenceCoun... |
### Question:
JobUnitDateParser { @Nullable abstract Date parseDate(String rawDate); }### Answer:
@Test public void should_parse_without_milliseconds() throws Exception { parser.parseDate(PREVIOUS_FIRE_TIME); }
@Test public void should_parse_with_milliseconds() throws Exception { parser.parseDate(NEXT_FIRE_TIME); } |
### Question:
AttachmentsFactory { public List<ReportAttachment> create(ExportDescriptor export, String execId) { String exportId = export.getId(); Set<AttachmentDescriptor> rawAttachments = export.getAttachments(); List<ReportAttachment> attachments = new ArrayList<>(rawAttachments.size()); for (AttachmentDescriptor a... |
### Question:
ExportExecutionApi { public ExportExecutionDescriptor start(String execId, ReportExportOptions reportExportOptions) throws ServiceException { ExecutionRequestOptions options = mExportOptionsMapper.transform(reportExportOptions); try { return mReportExportRestApi.runExportExecution(execId, options); } catc... |
### Question:
ExportExecutionApi { public ReportExportOutput downloadExport(String execId, String exportId) throws ServiceException { try { ExportOutputResource result = mReportExportRestApi.requestExportOutput(execId, exportId); return mReportExportMapper.transform(result); } catch (HttpException e) { throw mException... |
### Question:
ExportExecutionApi { public ResourceOutput downloadAttachment(String execId, String exportId, String attachmentId) throws ServiceException { try { OutputResource result = mReportExportRestApi.requestExportAttachment(execId, exportId, attachmentId); return mAttachmentExportMapper.transform(result); } catch... |
### Question:
ExportFactory { @NotNull public ReportExport create(ReportExecutionDescriptor descriptor, String execId, ExportIdWrapper exportIdWrapper) throws ServiceException { ExportDescriptor export = findExportDescriptor(descriptor, exportIdWrapper.getServerId()); if (export == null) { throw new ServiceException("S... |
### Question:
AbstractReportExecution extends ReportExecution { @NotNull @Override public final ReportMetadata waitForReportCompletion() throws ServiceException { mReportExecutionApi.awaitStatus(mExecId, mReportUri, mDelay, Status.ready()); ReportExecutionDescriptor reportDescriptor = mReportExecutionApi.getDetails(mEx... |
### Question:
AbstractReportExecution extends ReportExecution { @NotNull @Override public final ReportExport export(@NotNull ReportExportOptions options) throws ServiceException { Preconditions.checkNotNull(options, "Export options should not be null"); return doExport(options); } protected AbstractReportExecution(Rep... |
### Question:
ExportOptionsMapper5_5 extends ExportOptionsMapper { @Override public ExecutionRequestOptions transform(ReportExportOptions criteria) { ExecutionRequestOptions options = super.transform(criteria); options.withIgnorePagination(null); options.withBaseUrl(null); options.withMarkupType(null); return options; ... |
### Question:
ProxyReportService extends ReportService { @NotNull @Override public ReportExecution run(@Nullable String reportUri, @Nullable ReportExecutionOptions execOptions) throws ServiceException { Preconditions.checkNotNull(reportUri, "Report uri should not be null"); if (execOptions == null) { execOptions = Repo... |
### Question:
ReportService { @NotNull public static ReportService newService(@NotNull AuthorizedClient client) { Preconditions.checkNotNull(client, "Client should not be null"); InfoCacheManager cacheManager = InfoCacheManager.create(client); ServiceExceptionMapper reportMapper = ReportExceptionMapper.getInstance(); R... |
### Question:
ReportExportMapper { public ReportExportOutput transform(final ExportOutputResource outputResource) { return new ReportExportOutput() { @Override public boolean isFinal() { return outputResource.isFinal(); } @Override public PageRange getPages() { return PageRange.parse(outputResource.getPages()); } @Over... |
### Question:
InputControlRestApi { @NotNull public List<InputControlState> requestInputControlsStates(@NotNull String reportUri, @NotNull List<ReportParameter> parameters, boolean freshData) throws HttpException, IOException { Utils.checkNotNull(reportUri, "Report URI should not be null"); Utils.checkNotNull(parameter... |
### Question:
ExportIdWrapper { public abstract String getExactId(); abstract String getServerId(); abstract String getExactId(); final void wrap(ExportExecutionDescriptor exportDetails, ReportExportOptions options); }### Answer:
@Test public void should_generate_specific_exact_id_for_5_5() throws Exception { giveExp... |
### Question:
ExportIdWrapper { public abstract String getServerId(); abstract String getServerId(); abstract String getExactId(); final void wrap(ExportExecutionDescriptor exportDetails, ReportExportOptions options); }### Answer:
@Test public void should_return_export_descriptor_id_for_5_5() throws Exception { giveE... |
### Question:
RetryReportExecution extends ReportExecution { @NotNull @Override public ReportExport export(@NotNull ReportExportOptions options) throws ServiceException { try { return mDelegate.export(options); } catch (ServiceException ex) { boolean isCancelled = (ex.code() == StatusCodes.EXPORT_EXECUTION_CANCELLED ||... |
### Question:
RetryReportExecution extends ReportExecution { @NotNull @Override public ReportMetadata waitForReportCompletion() throws ServiceException { return mDelegate.waitForReportCompletion(); } RetryReportExecution(ReportExecution delegate); @NotNull @Override ReportExport export(@NotNull ReportExportOptions opti... |
### Question:
RetryReportExecution extends ReportExecution { @NotNull @Override public ReportExecution updateExecution(@Nullable List<ReportParameter> newParameters) throws ServiceException { return mDelegate.updateExecution(newParameters); } RetryReportExecution(ReportExecution delegate); @NotNull @Override ReportExpo... |
### Question:
AbstractReportService extends ReportService { @NotNull @Override public final ReportExecution run(@NotNull String reportUri, @NotNull ReportExecutionOptions execOptions) throws ServiceException { ReportExecutionDescriptor descriptor = mReportExecutionApi.start(reportUri, execOptions); String executionId =... |
### Question:
AttachmentExportMapper { public ResourceOutput transform(final OutputResource resource) { return new ResourceOutput() { @Override public InputStream getStream() throws IOException { return resource.getStream(); } }; } ResourceOutput transform(final OutputResource resource); }### Answer:
@Test public voi... |
### Question:
InputControlRestApi { @NotNull public List<InputControlState> requestInputControlsInitialStates(@NotNull String reportUri, boolean freshData) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .ad... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.