mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-05 08:06:56 +07:00
[external system api][IJPL-158355] progress event api: API redesign. Replaced interfaces with their implementations.
GitOrigin-RevId: ac635b228b0e8a53c70dd7795ebfb5fd48648d42
This commit is contained in:
committed by
intellij-monorepo-bot
parent
01b39de56a
commit
cbb7d0cedc
@@ -893,65 +893,34 @@ f:com.intellij.openapi.externalSystem.model.task.TaskData
|
||||
- setJvmTest(Z):V
|
||||
- setTest(Z):V
|
||||
- setType(java.lang.String):V
|
||||
c:com.intellij.openapi.externalSystem.model.task.event.BaseExternalSystemProgressEvent
|
||||
*c:com.intellij.openapi.externalSystem.model.task.event.ExternalSystemBuildEvent
|
||||
- com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationEvent
|
||||
- <init>(com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId,com.intellij.build.events.BuildEvent):V
|
||||
- getBuildEvent():com.intellij.build.events.BuildEvent
|
||||
c:com.intellij.openapi.externalSystem.model.task.event.ExternalSystemFinishEvent
|
||||
- com.intellij.openapi.externalSystem.model.task.event.ExternalSystemProgressEvent
|
||||
- <init>(java.lang.String,java.lang.String,com.intellij.openapi.externalSystem.model.task.event.OperationDescriptor,com.intellij.openapi.externalSystem.model.task.event.OperationResult):V
|
||||
- getOperationResult():com.intellij.openapi.externalSystem.model.task.event.OperationResult
|
||||
c:com.intellij.openapi.externalSystem.model.task.event.ExternalSystemMessageEvent
|
||||
- com.intellij.openapi.externalSystem.model.task.event.ExternalSystemProgressEvent
|
||||
- <init>(java.lang.String,java.lang.String,com.intellij.openapi.externalSystem.model.task.event.OperationDescriptor,java.lang.String):V
|
||||
- <init>(java.lang.String,java.lang.String,com.intellij.openapi.externalSystem.model.task.event.OperationDescriptor,Z,java.lang.String,java.lang.String):V
|
||||
- getDescription():java.lang.String
|
||||
- getMessage():java.lang.String
|
||||
- isStdOut():Z
|
||||
c:com.intellij.openapi.externalSystem.model.task.event.ExternalSystemProgressEvent
|
||||
- java.io.Serializable
|
||||
- <init>(java.lang.String,java.lang.String,com.intellij.openapi.externalSystem.model.task.event.OperationDescriptor):V
|
||||
- getDescriptor():com.intellij.openapi.externalSystem.model.task.event.OperationDescriptor
|
||||
- getDisplayName():java.lang.String
|
||||
- getEventId():java.lang.String
|
||||
- getEventTime():J
|
||||
- getParentEventId():java.lang.String
|
||||
c:com.intellij.openapi.externalSystem.model.task.event.DefaultOperationResult
|
||||
- com.intellij.openapi.externalSystem.model.task.event.OperationResult
|
||||
- <init>(J,J):V
|
||||
- getEndTime():J
|
||||
- getStartTime():J
|
||||
*c:com.intellij.openapi.externalSystem.model.task.event.ExternalSystemBuildEvent
|
||||
- com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationEvent
|
||||
- <init>(com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId,com.intellij.build.events.BuildEvent):V
|
||||
- getBuildEvent():com.intellij.build.events.BuildEvent
|
||||
com.intellij.openapi.externalSystem.model.task.event.ExternalSystemFinishEvent
|
||||
c:com.intellij.openapi.externalSystem.model.task.event.ExternalSystemStartEvent
|
||||
- com.intellij.openapi.externalSystem.model.task.event.ExternalSystemProgressEvent
|
||||
- a:getOperationResult():com.intellij.openapi.externalSystem.model.task.event.OperationResult
|
||||
c:com.intellij.openapi.externalSystem.model.task.event.ExternalSystemFinishEventImpl
|
||||
- com.intellij.openapi.externalSystem.model.task.event.BaseExternalSystemProgressEvent
|
||||
- com.intellij.openapi.externalSystem.model.task.event.ExternalSystemFinishEvent
|
||||
- <init>(java.lang.String,java.lang.String,com.intellij.openapi.externalSystem.model.task.event.OperationDescriptor,com.intellij.openapi.externalSystem.model.task.event.OperationResult):V
|
||||
- getOperationResult():com.intellij.openapi.externalSystem.model.task.event.OperationResult
|
||||
com.intellij.openapi.externalSystem.model.task.event.ExternalSystemMessageEvent
|
||||
- com.intellij.openapi.externalSystem.model.task.event.ExternalSystemProgressEvent
|
||||
- getDescription():java.lang.String
|
||||
- getMessage():java.lang.String
|
||||
- isStdOut():Z
|
||||
c:com.intellij.openapi.externalSystem.model.task.event.ExternalSystemMessageEventImpl
|
||||
- com.intellij.openapi.externalSystem.model.task.event.BaseExternalSystemProgressEvent
|
||||
- com.intellij.openapi.externalSystem.model.task.event.ExternalSystemMessageEvent
|
||||
- <init>(java.lang.String,java.lang.String,com.intellij.openapi.externalSystem.model.task.event.OperationDescriptor,java.lang.String):V
|
||||
- <init>(java.lang.String,java.lang.String,com.intellij.openapi.externalSystem.model.task.event.OperationDescriptor,Z,java.lang.String,java.lang.String):V
|
||||
- getDescription():java.lang.String
|
||||
- getMessage():java.lang.String
|
||||
- isStdOut():Z
|
||||
com.intellij.openapi.externalSystem.model.task.event.ExternalSystemProgressEvent
|
||||
- java.io.Serializable
|
||||
- a:getDescriptor():com.intellij.openapi.externalSystem.model.task.event.OperationDescriptor
|
||||
- a:getDisplayName():java.lang.String
|
||||
- a:getEventId():java.lang.String
|
||||
- a:getEventTime():J
|
||||
- a:getParentEventId():java.lang.String
|
||||
com.intellij.openapi.externalSystem.model.task.event.ExternalSystemStartEvent
|
||||
- com.intellij.openapi.externalSystem.model.task.event.ExternalSystemProgressEvent
|
||||
c:com.intellij.openapi.externalSystem.model.task.event.ExternalSystemStartEventImpl
|
||||
- com.intellij.openapi.externalSystem.model.task.event.BaseExternalSystemProgressEvent
|
||||
- com.intellij.openapi.externalSystem.model.task.event.ExternalSystemStartEvent
|
||||
- <init>(java.lang.String,java.lang.String,com.intellij.openapi.externalSystem.model.task.event.OperationDescriptor):V
|
||||
com.intellij.openapi.externalSystem.model.task.event.ExternalSystemStatusEvent
|
||||
- com.intellij.openapi.externalSystem.model.task.event.ExternalSystemMessageEvent
|
||||
- a:getProgress():J
|
||||
- a:getTotal():J
|
||||
- a:getUnit():java.lang.String
|
||||
c:com.intellij.openapi.externalSystem.model.task.event.ExternalSystemStatusEventImpl
|
||||
- com.intellij.openapi.externalSystem.model.task.event.BaseExternalSystemProgressEvent
|
||||
- com.intellij.openapi.externalSystem.model.task.event.ExternalSystemStatusEvent
|
||||
c:com.intellij.openapi.externalSystem.model.task.event.ExternalSystemStatusEvent
|
||||
- com.intellij.openapi.externalSystem.model.task.event.ExternalSystemProgressEvent
|
||||
- <init>(java.lang.String,java.lang.String,com.intellij.openapi.externalSystem.model.task.event.OperationDescriptor,J,J,java.lang.String):V
|
||||
- <init>(java.lang.String,java.lang.String,com.intellij.openapi.externalSystem.model.task.event.OperationDescriptor,J,J,java.lang.String,java.lang.String):V
|
||||
- getDescription():java.lang.String
|
||||
@@ -962,60 +931,35 @@ c:com.intellij.openapi.externalSystem.model.task.event.ExternalSystemTaskExecuti
|
||||
- com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationEvent
|
||||
- <init>(com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId,com.intellij.openapi.externalSystem.model.task.event.ExternalSystemProgressEvent):V
|
||||
- getProgressEvent():com.intellij.openapi.externalSystem.model.task.event.ExternalSystemProgressEvent
|
||||
com.intellij.openapi.externalSystem.model.task.event.Failure
|
||||
- a:getCauses():java.util.List
|
||||
- a:getDescription():java.lang.String
|
||||
- a:getMessage():java.lang.String
|
||||
c:com.intellij.openapi.externalSystem.model.task.event.FailureImpl
|
||||
- com.intellij.openapi.externalSystem.model.task.event.Failure
|
||||
c:com.intellij.openapi.externalSystem.model.task.event.Failure
|
||||
- <init>(java.lang.String,java.lang.String,java.util.List):V
|
||||
- getCauses():java.util.List
|
||||
- getDescription():java.lang.String
|
||||
- getMessage():java.lang.String
|
||||
com.intellij.openapi.externalSystem.model.task.event.FailureResult
|
||||
c:com.intellij.openapi.externalSystem.model.task.event.FailureResult
|
||||
- com.intellij.openapi.externalSystem.model.task.event.OperationResult
|
||||
- a:getFailures():java.util.List
|
||||
c:com.intellij.openapi.externalSystem.model.task.event.FailureResultImpl
|
||||
- com.intellij.openapi.externalSystem.model.task.event.DefaultOperationResult
|
||||
- com.intellij.openapi.externalSystem.model.task.event.FailureResult
|
||||
- <init>(J,J,java.util.List):V
|
||||
- getFailures():java.util.List
|
||||
com.intellij.openapi.externalSystem.model.task.event.OperationDescriptor
|
||||
- java.io.Serializable
|
||||
- a:getDisplayName():java.lang.String
|
||||
- a:getEventTime():J
|
||||
- a:getHint():java.lang.String
|
||||
c:com.intellij.openapi.externalSystem.model.task.event.OperationDescriptorImpl
|
||||
- com.intellij.openapi.externalSystem.model.task.event.OperationDescriptor
|
||||
c:com.intellij.openapi.externalSystem.model.task.event.OperationDescriptor
|
||||
- <init>(java.lang.String,J):V
|
||||
- getDisplayName():java.lang.String
|
||||
- getEventTime():J
|
||||
- getHint():java.lang.String
|
||||
- setHint(java.lang.String):V
|
||||
com.intellij.openapi.externalSystem.model.task.event.OperationResult
|
||||
c:com.intellij.openapi.externalSystem.model.task.event.OperationResult
|
||||
- java.io.Serializable
|
||||
- a:getEndTime():J
|
||||
- a:getStartTime():J
|
||||
com.intellij.openapi.externalSystem.model.task.event.SkippedResult
|
||||
- com.intellij.openapi.externalSystem.model.task.event.OperationResult
|
||||
c:com.intellij.openapi.externalSystem.model.task.event.SkippedResultImpl
|
||||
- com.intellij.openapi.externalSystem.model.task.event.DefaultOperationResult
|
||||
- com.intellij.openapi.externalSystem.model.task.event.SkippedResult
|
||||
- <init>(J,J):V
|
||||
com.intellij.openapi.externalSystem.model.task.event.SuccessResult
|
||||
- getEndTime():J
|
||||
- getStartTime():J
|
||||
c:com.intellij.openapi.externalSystem.model.task.event.SkippedResult
|
||||
- com.intellij.openapi.externalSystem.model.task.event.OperationResult
|
||||
- <init>(J,J):V
|
||||
c:com.intellij.openapi.externalSystem.model.task.event.SuccessResult
|
||||
- com.intellij.openapi.externalSystem.model.task.event.OperationResult
|
||||
- a:isUpToDate():Z
|
||||
c:com.intellij.openapi.externalSystem.model.task.event.SuccessResultImpl
|
||||
- com.intellij.openapi.externalSystem.model.task.event.DefaultOperationResult
|
||||
- com.intellij.openapi.externalSystem.model.task.event.SuccessResult
|
||||
- <init>(J,J,Z):V
|
||||
- isUpToDate():Z
|
||||
com.intellij.openapi.externalSystem.model.task.event.TaskOperationDescriptor
|
||||
c:com.intellij.openapi.externalSystem.model.task.event.TaskOperationDescriptor
|
||||
- com.intellij.openapi.externalSystem.model.task.event.OperationDescriptor
|
||||
- a:getTaskName():java.lang.String
|
||||
c:com.intellij.openapi.externalSystem.model.task.event.TaskOperationDescriptorImpl
|
||||
- com.intellij.openapi.externalSystem.model.task.event.OperationDescriptorImpl
|
||||
- com.intellij.openapi.externalSystem.model.task.event.TaskOperationDescriptor
|
||||
- <init>(java.lang.String,J,java.lang.String):V
|
||||
- getTaskName():java.lang.String
|
||||
c:com.intellij.openapi.externalSystem.model.task.event.TestAssertionFailure
|
||||
@@ -1027,19 +971,13 @@ c:com.intellij.openapi.externalSystem.model.task.event.TestAssertionFailure
|
||||
- getExpectedFile():java.lang.String
|
||||
- getExpectedText():java.lang.String
|
||||
c:com.intellij.openapi.externalSystem.model.task.event.TestFailure
|
||||
- com.intellij.openapi.externalSystem.model.task.event.FailureImpl
|
||||
- com.intellij.openapi.externalSystem.model.task.event.Failure
|
||||
- <init>(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.util.List,Z):V
|
||||
- getExceptionName():java.lang.String
|
||||
- getStackTrace():java.lang.String
|
||||
- isTestError():Z
|
||||
com.intellij.openapi.externalSystem.model.task.event.TestOperationDescriptor
|
||||
c:com.intellij.openapi.externalSystem.model.task.event.TestOperationDescriptor
|
||||
- com.intellij.openapi.externalSystem.model.task.event.OperationDescriptor
|
||||
- a:getClassName():java.lang.String
|
||||
- a:getMethodName():java.lang.String
|
||||
- a:getSuiteName():java.lang.String
|
||||
c:com.intellij.openapi.externalSystem.model.task.event.TestOperationDescriptorImpl
|
||||
- com.intellij.openapi.externalSystem.model.task.event.OperationDescriptorImpl
|
||||
- com.intellij.openapi.externalSystem.model.task.event.TestOperationDescriptor
|
||||
- <init>(java.lang.String,J,java.lang.String,java.lang.String,java.lang.String):V
|
||||
- getClassName():java.lang.String
|
||||
- getMethodName():java.lang.String
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
*
|
||||
* 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 applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.openapi.externalSystem.model.task.event;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
*/
|
||||
public class BaseExternalSystemProgressEvent<T extends OperationDescriptor> implements ExternalSystemProgressEvent<T> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@NotNull private final String myEventId;
|
||||
@NotNull private final T myDescriptor;
|
||||
@Nullable private final String myParentEventId;
|
||||
|
||||
public BaseExternalSystemProgressEvent(@NotNull String eventId,
|
||||
@Nullable String parentEventId,
|
||||
@NotNull T descriptor) {
|
||||
myEventId = eventId;
|
||||
myDescriptor = descriptor;
|
||||
myParentEventId = parentEventId;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getEventId() {
|
||||
return myEventId;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public String getParentEventId() {
|
||||
return myParentEventId;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public T getDescriptor() {
|
||||
return myDescriptor;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return myDescriptor.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEventTime() {
|
||||
return myDescriptor.getEventTime();
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
*
|
||||
* 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 applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.openapi.externalSystem.model.task.event;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
*/
|
||||
public class DefaultOperationResult implements OperationResult {
|
||||
|
||||
private final long myStartTime;
|
||||
private final long myEndTime;
|
||||
|
||||
public DefaultOperationResult(long startTime, long endTime) {
|
||||
myStartTime = startTime;
|
||||
myEndTime = endTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getStartTime() {
|
||||
return myStartTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEndTime() {
|
||||
return myEndTime;
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
public class ExternalSystemBuildEvent extends ExternalSystemTaskNotificationEvent {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@NotNull private final BuildEvent myBuildEvent;
|
||||
|
||||
|
||||
@@ -15,9 +15,26 @@
|
||||
*/
|
||||
package com.intellij.openapi.externalSystem.model.task.event;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
*/
|
||||
public interface ExternalSystemFinishEvent<T extends OperationDescriptor> extends ExternalSystemProgressEvent<T> {
|
||||
OperationResult getOperationResult();
|
||||
public class ExternalSystemFinishEvent<T extends OperationDescriptor> extends ExternalSystemProgressEvent<T> {
|
||||
|
||||
@NotNull
|
||||
private final OperationResult myResult;
|
||||
|
||||
public ExternalSystemFinishEvent(@NotNull String eventId,
|
||||
@Nullable String parentEventId,
|
||||
@NotNull T descriptor,
|
||||
@NotNull OperationResult result) {
|
||||
super(eventId, parentEventId, descriptor);
|
||||
myResult = result;
|
||||
}
|
||||
|
||||
public OperationResult getOperationResult() {
|
||||
return myResult;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
*
|
||||
* 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 applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.openapi.externalSystem.model.task.event;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
*/
|
||||
public class ExternalSystemFinishEventImpl<T extends OperationDescriptor> extends BaseExternalSystemProgressEvent<T>
|
||||
implements ExternalSystemFinishEvent<T> {
|
||||
@NotNull
|
||||
private final OperationResult myResult;
|
||||
public ExternalSystemFinishEventImpl(@NotNull String eventId,
|
||||
@Nullable String parentEventId,
|
||||
@NotNull T descriptor,
|
||||
@NotNull OperationResult result) {
|
||||
super(eventId, parentEventId, descriptor);
|
||||
myResult = result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OperationResult getOperationResult() {
|
||||
return myResult;
|
||||
}
|
||||
}
|
||||
@@ -1,23 +1,56 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.externalSystem.model.task.event;
|
||||
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* An event with textual description.
|
||||
* @param <T>
|
||||
*/
|
||||
public interface ExternalSystemMessageEvent<T extends OperationDescriptor> extends ExternalSystemProgressEvent<T> {
|
||||
public class ExternalSystemMessageEvent<T extends OperationDescriptor> extends ExternalSystemProgressEvent<T> {
|
||||
|
||||
default boolean isStdOut() { return true; }
|
||||
private final boolean myStdOut;
|
||||
private final @Nullable @Nls String myMessage;
|
||||
private final @Nullable String myDescription;
|
||||
|
||||
default @Nullable @Nls String getMessage() { return null; }
|
||||
public ExternalSystemMessageEvent(
|
||||
@NotNull String eventId,
|
||||
@Nullable String parentEventId,
|
||||
@NotNull T descriptor,
|
||||
boolean isStdOut,
|
||||
@Nullable @Nls String message,
|
||||
@Nullable String description
|
||||
) {
|
||||
super(eventId, parentEventId, descriptor);
|
||||
myStdOut = isStdOut;
|
||||
myMessage = message;
|
||||
myDescription = description;
|
||||
}
|
||||
|
||||
public ExternalSystemMessageEvent(@NotNull String eventId,
|
||||
@Nullable String parentEventId,
|
||||
@NotNull T descriptor,
|
||||
@Nullable @NlsSafe String description) {
|
||||
this(eventId, parentEventId, descriptor, true, description, description);
|
||||
}
|
||||
|
||||
public boolean isStdOut() {
|
||||
return myStdOut;
|
||||
}
|
||||
|
||||
public @Nullable String getMessage() {
|
||||
return myMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Textual description of event.
|
||||
* Textual description of the event.
|
||||
*
|
||||
* @return arbitrary additional information about status update
|
||||
*/
|
||||
default @Nullable String getDescription() { return null; }
|
||||
public @Nullable String getDescription() {
|
||||
return myDescription;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.externalSystem.model.task.event;
|
||||
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class ExternalSystemMessageEventImpl<T extends OperationDescriptor>
|
||||
extends BaseExternalSystemProgressEvent<T>
|
||||
implements ExternalSystemMessageEvent<T> {
|
||||
|
||||
private final boolean myStdOut;
|
||||
private final @Nullable @Nls String myMessage;
|
||||
private final @Nullable String myDescription;
|
||||
|
||||
public ExternalSystemMessageEventImpl(
|
||||
@NotNull String eventId,
|
||||
@Nullable String parentEventId,
|
||||
@NotNull T descriptor,
|
||||
boolean isStdOut,
|
||||
@Nullable @Nls String message,
|
||||
@Nullable String description
|
||||
) {
|
||||
super(eventId, parentEventId, descriptor);
|
||||
myStdOut = isStdOut;
|
||||
myMessage = message;
|
||||
myDescription = description;
|
||||
}
|
||||
|
||||
public ExternalSystemMessageEventImpl(@NotNull String eventId,
|
||||
@Nullable String parentEventId,
|
||||
@NotNull T descriptor,
|
||||
@Nullable @NlsSafe String description) {
|
||||
this(eventId, parentEventId, descriptor, true, description, description);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStdOut() {
|
||||
return myStdOut;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable String getMessage() {
|
||||
return myMessage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable String getDescription() {
|
||||
return myDescription;
|
||||
}
|
||||
}
|
||||
@@ -23,17 +23,43 @@ import java.io.Serializable;
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
*/
|
||||
public interface ExternalSystemProgressEvent<T extends OperationDescriptor> extends Serializable {
|
||||
public class ExternalSystemProgressEvent<T extends OperationDescriptor> implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@NotNull private final String myEventId;
|
||||
@NotNull private final T myDescriptor;
|
||||
@Nullable private final String myParentEventId;
|
||||
|
||||
public ExternalSystemProgressEvent(@NotNull String eventId,
|
||||
@Nullable String parentEventId,
|
||||
@NotNull T descriptor) {
|
||||
myEventId = eventId;
|
||||
myDescriptor = descriptor;
|
||||
myParentEventId = parentEventId;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
String getEventId();
|
||||
public String getEventId() {
|
||||
return myEventId;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
String getParentEventId();
|
||||
public String getParentEventId() {
|
||||
return myParentEventId;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
String getDisplayName();
|
||||
|
||||
long getEventTime();
|
||||
public T getDescriptor() {
|
||||
return myDescriptor;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
T getDescriptor();
|
||||
public String getDisplayName() {
|
||||
return myDescriptor.getDisplayName();
|
||||
}
|
||||
|
||||
public long getEventTime() {
|
||||
return myDescriptor.getEventTime();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,8 +15,14 @@
|
||||
*/
|
||||
package com.intellij.openapi.externalSystem.model.task.event;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
*/
|
||||
public interface ExternalSystemStartEvent<T extends OperationDescriptor> extends ExternalSystemProgressEvent<T> {
|
||||
public class ExternalSystemStartEvent<T extends OperationDescriptor> extends ExternalSystemProgressEvent<T> {
|
||||
public ExternalSystemStartEvent(@NotNull String eventId, @Nullable String parentEventId, @NotNull T descriptor) {
|
||||
super(eventId, parentEventId, descriptor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
*
|
||||
* 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 applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.openapi.externalSystem.model.task.event;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
*/
|
||||
public class ExternalSystemStartEventImpl<T extends OperationDescriptor> extends BaseExternalSystemProgressEvent<T>
|
||||
implements ExternalSystemStartEvent<T> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ExternalSystemStartEventImpl(@NotNull String eventId, @Nullable String parentEventId, @NotNull T descriptor) {
|
||||
super(eventId, parentEventId, descriptor);
|
||||
}
|
||||
}
|
||||
@@ -15,30 +15,65 @@
|
||||
*/
|
||||
package com.intellij.openapi.externalSystem.model.task.event;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* An event that informs about an interim results of the operation.
|
||||
* An event that informs about an interim result of the operation.
|
||||
*
|
||||
* @author Vladislav.Soroka
|
||||
*/
|
||||
public interface ExternalSystemStatusEvent<T extends OperationDescriptor> extends ExternalSystemMessageEvent<T> {
|
||||
public class ExternalSystemStatusEvent<T extends OperationDescriptor> extends ExternalSystemProgressEvent<T> {
|
||||
|
||||
private final long myTotal;
|
||||
private final long myProgress;
|
||||
private final String myUnit;
|
||||
@Nullable
|
||||
private final String myDescription;
|
||||
|
||||
public ExternalSystemStatusEvent(@NotNull String eventId, @Nullable String parentEventId, @NotNull T descriptor,
|
||||
long total, long progress, String unit) {
|
||||
this(eventId, parentEventId, descriptor, total, progress, unit, null);
|
||||
}
|
||||
|
||||
public ExternalSystemStatusEvent(@NotNull String eventId, @Nullable String parentEventId, @NotNull T descriptor,
|
||||
long total, long progress, String unit, @Nullable String description) {
|
||||
super(eventId, parentEventId, descriptor);
|
||||
myTotal = total;
|
||||
myProgress = progress;
|
||||
myUnit = unit;
|
||||
myDescription = description;
|
||||
}
|
||||
|
||||
/**
|
||||
* The amount of work already performed by the build operation.
|
||||
*
|
||||
* @return The amount of performed work
|
||||
*/
|
||||
long getProgress();
|
||||
public long getProgress() {
|
||||
return myProgress;
|
||||
}
|
||||
|
||||
/**
|
||||
* The total amount of work that the build operation is in the progress of performing, or -1 if not known.
|
||||
*
|
||||
* @return The total amount of work, or -1 if not known.
|
||||
*/
|
||||
long getTotal();
|
||||
public long getTotal() {
|
||||
return myTotal;
|
||||
}
|
||||
|
||||
/**
|
||||
* The measure used to express the amount of work.
|
||||
*
|
||||
* @return The measure used to express the amount of work.
|
||||
*/
|
||||
String getUnit();
|
||||
public String getUnit() {
|
||||
return myUnit;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getDescription() {
|
||||
return myDescription;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o.
|
||||
*
|
||||
* 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 applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.openapi.externalSystem.model.task.event;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
*/
|
||||
public class ExternalSystemStatusEventImpl<T extends OperationDescriptor> extends BaseExternalSystemProgressEvent<T>
|
||||
implements ExternalSystemStatusEvent<T> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final long myTotal;
|
||||
private final long myProgress;
|
||||
private final String myUnit;
|
||||
private final String myDescription;
|
||||
|
||||
public ExternalSystemStatusEventImpl(@NotNull String eventId, @Nullable String parentEventId, @NotNull T descriptor,
|
||||
long total, long progress, String unit) {
|
||||
this(eventId, parentEventId, descriptor, total, progress, unit, null);
|
||||
}
|
||||
|
||||
public ExternalSystemStatusEventImpl(@NotNull String eventId, @Nullable String parentEventId, @NotNull T descriptor,
|
||||
long total, long progress, String unit, @Nullable String description) {
|
||||
super(eventId, parentEventId, descriptor);
|
||||
myTotal = total;
|
||||
myProgress = progress;
|
||||
myUnit = unit;
|
||||
myDescription = description;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getProgress() {
|
||||
return myProgress;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getTotal() {
|
||||
return myTotal;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnit() {
|
||||
return myUnit;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return myDescription;
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,6 @@ import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotifica
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class ExternalSystemTaskExecutionEvent extends ExternalSystemTaskNotificationEvent {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@NotNull private final ExternalSystemProgressEvent<?> myProgressEvent;
|
||||
|
||||
|
||||
@@ -19,16 +19,37 @@ import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
*/
|
||||
public interface Failure {
|
||||
public class Failure implements Serializable {
|
||||
|
||||
@Nullable @Nls String getMessage();
|
||||
private final @Nullable @Nls String myMessage;
|
||||
private final @Nullable @Nls String myDescription;
|
||||
private final @NotNull List<? extends Failure> myCauses;
|
||||
|
||||
@Nullable @Nls String getDescription();
|
||||
public Failure(
|
||||
@Nullable @Nls String message,
|
||||
@Nullable @Nls String description,
|
||||
@NotNull List<? extends Failure> causes
|
||||
) {
|
||||
myMessage = message;
|
||||
myDescription = description;
|
||||
myCauses = causes;
|
||||
}
|
||||
|
||||
@NotNull List<? extends Failure> getCauses();
|
||||
public @Nullable @Nls String getMessage() {
|
||||
return myMessage;
|
||||
}
|
||||
|
||||
public @Nullable @Nls String getDescription() {
|
||||
return myDescription;
|
||||
}
|
||||
|
||||
public @NotNull List<? extends Failure> getCauses() {
|
||||
return myCauses;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o.
|
||||
*
|
||||
* 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 applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.openapi.externalSystem.model.task.event;
|
||||
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
*/
|
||||
public class FailureImpl implements Failure {
|
||||
|
||||
private final @Nullable @Nls String myMessage;
|
||||
private final @Nullable @Nls String myDescription;
|
||||
private final @NotNull List<? extends Failure> myCauses;
|
||||
|
||||
public FailureImpl(
|
||||
@Nullable @Nls String message,
|
||||
@Nullable @Nls String description,
|
||||
@NotNull List<? extends Failure> causes
|
||||
) {
|
||||
myMessage = message;
|
||||
myDescription = description;
|
||||
myCauses = causes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable @Nls String getMessage() {
|
||||
return myMessage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable @Nls String getDescription() {
|
||||
return myDescription;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<? extends Failure> getCauses() {
|
||||
return myCauses;
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,16 @@ import java.util.List;
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
*/
|
||||
public interface FailureResult extends OperationResult {
|
||||
List<? extends Failure> getFailures();
|
||||
public class FailureResult extends OperationResult {
|
||||
|
||||
private final List<? extends Failure> myFailures;
|
||||
|
||||
public FailureResult(long startTime, long endTime, List<? extends Failure> failures) {
|
||||
super(startTime, endTime);
|
||||
myFailures = failures;
|
||||
}
|
||||
|
||||
public List<? extends Failure> getFailures() {
|
||||
return myFailures;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
*
|
||||
* 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 applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.openapi.externalSystem.model.task.event;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
*/
|
||||
public class FailureResultImpl extends DefaultOperationResult implements FailureResult {
|
||||
|
||||
private final List<? extends Failure> myFailures;
|
||||
|
||||
public FailureResultImpl(long startTime, long endTime, List<? extends Failure> failures) {
|
||||
super(startTime, endTime);
|
||||
myFailures = failures;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends Failure> getFailures() {
|
||||
return myFailures;
|
||||
}
|
||||
}
|
||||
@@ -16,16 +16,37 @@
|
||||
package com.intellij.openapi.externalSystem.model.task.event;
|
||||
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
*/
|
||||
public interface OperationDescriptor extends Serializable {
|
||||
long getEventTime();
|
||||
public class OperationDescriptor implements Serializable {
|
||||
|
||||
@Nls String getDisplayName();
|
||||
private final long myEventTime;
|
||||
private final @Nls String myDisplayName;
|
||||
private @Nullable @Nls String myHint;
|
||||
|
||||
@Nls String getHint();
|
||||
public OperationDescriptor(@Nls String displayName, long eventTime) {
|
||||
myDisplayName = displayName;
|
||||
myEventTime = eventTime;
|
||||
}
|
||||
|
||||
public long getEventTime() {
|
||||
return myEventTime;
|
||||
}
|
||||
|
||||
public @Nls String getDisplayName() {
|
||||
return myDisplayName;
|
||||
}
|
||||
|
||||
public @Nullable @Nls String getHint() {
|
||||
return myHint;
|
||||
}
|
||||
|
||||
public void setHint(@Nullable @Nls String hint) {
|
||||
myHint = hint;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
*
|
||||
* 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 applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.openapi.externalSystem.model.task.event;
|
||||
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
*/
|
||||
public class OperationDescriptorImpl implements OperationDescriptor {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final long myEventTime;
|
||||
private final @Nls String myDisplayName;
|
||||
@Nullable private @Nls String myHint;
|
||||
|
||||
public OperationDescriptorImpl(@Nls String displayName, long eventTime) {
|
||||
myDisplayName = displayName;
|
||||
myEventTime = eventTime;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public long getEventTime() {
|
||||
return myEventTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nls String getDisplayName() {
|
||||
return myDisplayName;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public String getHint() {
|
||||
return myHint;
|
||||
}
|
||||
|
||||
public void setHint(@Nullable @Nls String hint) {
|
||||
myHint = hint;
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
*
|
||||
* 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 applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.openapi.externalSystem.model.task.event;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -20,7 +6,21 @@ import java.io.Serializable;
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
*/
|
||||
public interface OperationResult extends Serializable {
|
||||
long getStartTime();
|
||||
long getEndTime();
|
||||
public class OperationResult implements Serializable {
|
||||
|
||||
private final long myStartTime;
|
||||
private final long myEndTime;
|
||||
|
||||
public OperationResult(long startTime, long endTime) {
|
||||
myStartTime = startTime;
|
||||
myEndTime = endTime;
|
||||
}
|
||||
|
||||
public long getStartTime() {
|
||||
return myStartTime;
|
||||
}
|
||||
|
||||
public long getEndTime() {
|
||||
return myEndTime;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,5 +18,9 @@ package com.intellij.openapi.externalSystem.model.task.event;
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
*/
|
||||
public interface SkippedResult extends OperationResult {
|
||||
public class SkippedResult extends OperationResult {
|
||||
|
||||
public SkippedResult(long startTime, long endTime) {
|
||||
super(startTime, endTime);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
*
|
||||
* 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 applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.openapi.externalSystem.model.task.event;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
*/
|
||||
public class SkippedResultImpl extends DefaultOperationResult implements SkippedResult {
|
||||
public SkippedResultImpl(long startTime, long endTime) {
|
||||
super(startTime, endTime);
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,16 @@ package com.intellij.openapi.externalSystem.model.task.event;
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
*/
|
||||
public interface SuccessResult extends OperationResult {
|
||||
boolean isUpToDate();
|
||||
}
|
||||
public class SuccessResult extends OperationResult {
|
||||
|
||||
private final boolean myUpToDate;
|
||||
|
||||
public SuccessResult(long startTime, long endTime, boolean isUpToDate) {
|
||||
super(startTime, endTime);
|
||||
myUpToDate = isUpToDate;
|
||||
}
|
||||
|
||||
public boolean isUpToDate() {
|
||||
return myUpToDate;
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
*
|
||||
* 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 applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.openapi.externalSystem.model.task.event;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
*/
|
||||
public class SuccessResultImpl extends DefaultOperationResult implements SuccessResult {
|
||||
|
||||
private final boolean myUpToDate;
|
||||
|
||||
public SuccessResultImpl(long startTime, long endTime, boolean isUpToDate) {
|
||||
super(startTime, endTime);
|
||||
myUpToDate = isUpToDate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUpToDate() {
|
||||
return myUpToDate;
|
||||
}
|
||||
}
|
||||
@@ -15,9 +15,23 @@
|
||||
*/
|
||||
package com.intellij.openapi.externalSystem.model.task.event;
|
||||
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
*/
|
||||
public interface TaskOperationDescriptor extends OperationDescriptor {
|
||||
String getTaskName();
|
||||
public class TaskOperationDescriptor extends OperationDescriptor {
|
||||
|
||||
private final String myTaskName;
|
||||
|
||||
public TaskOperationDescriptor(@Nls String displayName, long eventTime, String taskName) {
|
||||
super(displayName, eventTime);
|
||||
myTaskName = taskName;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getTaskName() {
|
||||
return myTaskName;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
*
|
||||
* 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 applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.openapi.externalSystem.model.task.event;
|
||||
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
*/
|
||||
public class TaskOperationDescriptorImpl extends OperationDescriptorImpl implements TaskOperationDescriptor {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final String myTaskName;
|
||||
|
||||
public TaskOperationDescriptorImpl(@Nls String displayName, long eventTime, String taskName) {
|
||||
super(displayName, eventTime);
|
||||
myTaskName = taskName;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getTaskName() {
|
||||
return myTaskName;
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class TestFailure extends FailureImpl {
|
||||
public class TestFailure extends Failure {
|
||||
|
||||
private final @Nullable String exceptionName;
|
||||
private final @Nullable String stackTrace;
|
||||
|
||||
@@ -15,19 +15,41 @@
|
||||
*/
|
||||
package com.intellij.openapi.externalSystem.model.task.event;
|
||||
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
*/
|
||||
public interface TestOperationDescriptor extends OperationDescriptor {
|
||||
public class TestOperationDescriptor extends OperationDescriptor {
|
||||
|
||||
private final String mySuiteName;
|
||||
private final String myClassName;
|
||||
private final String myMethodName;
|
||||
|
||||
public TestOperationDescriptor(@Nls String displayName,
|
||||
long eventTime,
|
||||
String suiteName,
|
||||
String className,
|
||||
String methodName) {
|
||||
super(displayName, eventTime);
|
||||
mySuiteName = suiteName;
|
||||
myClassName = className;
|
||||
myMethodName = methodName;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
String getSuiteName();
|
||||
public String getSuiteName() {
|
||||
return mySuiteName;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
String getClassName();
|
||||
public String getClassName() {
|
||||
return myClassName;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
String getMethodName();
|
||||
public String getMethodName() {
|
||||
return myMethodName;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
*
|
||||
* 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 applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.openapi.externalSystem.model.task.event;
|
||||
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
*/
|
||||
public class TestOperationDescriptorImpl extends OperationDescriptorImpl implements TestOperationDescriptor {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final String mySuiteName;
|
||||
private final String myClassName;
|
||||
private final String myMethodName;
|
||||
|
||||
public TestOperationDescriptorImpl(@Nls String displayName,
|
||||
long eventTime,
|
||||
String suiteName,
|
||||
String className,
|
||||
String methodName) {
|
||||
super(displayName, eventTime);
|
||||
mySuiteName = suiteName;
|
||||
myClassName = className;
|
||||
myMethodName = methodName;
|
||||
}
|
||||
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public String getSuiteName() {
|
||||
return mySuiteName;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public String getClassName() {
|
||||
return myClassName;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public String getMethodName() {
|
||||
return myMethodName;
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,7 @@ public class AfterTestEventProcessor extends AbstractTestEventProcessor {
|
||||
var eventTime = Long.parseLong(eventXml.getEventTestResultEndTime());
|
||||
var testDescriptor = GradleXmlTestEventConverter.convertTestDescriptor(eventTime, eventXml);
|
||||
var testResult = GradleXmlTestEventConverter.convertOperationResult(eventXml);
|
||||
var event = new ExternalSystemFinishEventImpl<>(testId, testParentId, testDescriptor, testResult);
|
||||
var event = new ExternalSystemFinishEvent<>(testId, testParentId, testDescriptor, testResult);
|
||||
process(event, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -126,12 +126,12 @@ internal class GradleFileComparisonEventPatcher {
|
||||
xmlFailure.expectedFile,
|
||||
xmlFailure.actualFile
|
||||
)
|
||||
val failureResult = FailureResultImpl(
|
||||
val failureResult = FailureResult(
|
||||
tapiOperationResult.startTime,
|
||||
tapiOperationResult.endTime,
|
||||
listOf(failure)
|
||||
)
|
||||
return ExternalSystemFinishEventImpl<TestOperationDescriptor>(
|
||||
return ExternalSystemFinishEvent<TestOperationDescriptor>(
|
||||
tapiEvent.eventId,
|
||||
tapiEvent.parentEventId,
|
||||
tapiEvent.descriptor,
|
||||
|
||||
@@ -18,7 +18,7 @@ object GradleXmlTestEventConverter {
|
||||
val className = eventXml.testClassName
|
||||
val methodName = eventXml.testName
|
||||
val displayName = eventXml.testDisplayName
|
||||
return TestOperationDescriptorImpl(displayName, eventTime, suiteName, className, methodName)
|
||||
return TestOperationDescriptor(displayName, eventTime, suiteName, className, methodName)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@@ -28,10 +28,10 @@ object GradleXmlTestEventConverter {
|
||||
val endTime = eventXml.eventTestResultEndTime.toLong()
|
||||
val resultType = TestEventResult.fromValue(eventXml.testEventResultType)
|
||||
if (resultType == TestEventResult.SUCCESS) {
|
||||
return SuccessResultImpl(startTime, endTime, false)
|
||||
return SuccessResult(startTime, endTime, false)
|
||||
}
|
||||
if (resultType == TestEventResult.SKIPPED) {
|
||||
return SkippedResultImpl(startTime, endTime)
|
||||
return SkippedResult(startTime, endTime)
|
||||
}
|
||||
if (resultType == TestEventResult.FAILURE) {
|
||||
val failureType = eventXml.eventTestResultFailureType
|
||||
@@ -54,22 +54,22 @@ object GradleXmlTestEventConverter {
|
||||
expectedFilePath, actualFilePath
|
||||
)
|
||||
}
|
||||
return FailureResultImpl(startTime, endTime, listOf(failure))
|
||||
return FailureResult(startTime, endTime, listOf(failure))
|
||||
}
|
||||
if ("assertionFailed" == failureType) {
|
||||
val failure = TestFailure(exceptionName, message, stackTrace, description, emptyList(), false)
|
||||
return FailureResultImpl(startTime, endTime, listOf(failure))
|
||||
return FailureResult(startTime, endTime, listOf(failure))
|
||||
}
|
||||
if ("error" == failureType) {
|
||||
val failure = TestFailure(exceptionName, message, stackTrace, description, emptyList(), true)
|
||||
return FailureResultImpl(startTime, endTime, listOf(failure))
|
||||
return FailureResult(startTime, endTime, listOf(failure))
|
||||
}
|
||||
LOG.error("Undefined test failure type: $failureType")
|
||||
val failure = FailureImpl(message, stackTrace, emptyList())
|
||||
return FailureResultImpl(startTime, endTime, listOf(failure))
|
||||
val failure = Failure(message, stackTrace, emptyList())
|
||||
return FailureResult(startTime, endTime, listOf(failure))
|
||||
}
|
||||
LOG.error("Undefined test result type: $resultType")
|
||||
return DefaultOperationResult(startTime, endTime)
|
||||
return OperationResult(startTime, endTime)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
|
||||
@@ -7,7 +7,6 @@ import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotifica
|
||||
import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationListener
|
||||
import com.intellij.openapi.externalSystem.model.task.event.ExternalSystemTaskExecutionEvent
|
||||
import com.intellij.openapi.externalSystem.model.task.event.TestOperationDescriptor
|
||||
import com.intellij.openapi.externalSystem.model.task.event.TestOperationDescriptorImpl
|
||||
import com.intellij.openapi.externalSystem.service.notification.ExternalSystemProgressNotificationManager
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.util.Disposer
|
||||
@@ -102,7 +101,7 @@ class GradleExecutionOutputFixture(
|
||||
val descriptor = executionEvent.progressEvent.descriptor as? TestOperationDescriptor ?: return null
|
||||
val className = descriptor.className ?: ""
|
||||
val methodName = descriptor.methodName?.removeSuffix("()") ?: ""
|
||||
return TestOperationDescriptorImpl("", -1, "", className, methodName)
|
||||
return TestOperationDescriptor("", -1, "", className, methodName)
|
||||
}
|
||||
|
||||
private fun extractTestOperationDescriptors(text: String): List<TestOperationDescriptor> {
|
||||
@@ -124,7 +123,7 @@ class GradleExecutionOutputFixture(
|
||||
?.let { StringUtil.substringBefore(it, "' displayName='") }
|
||||
?.removeSuffix("()")
|
||||
?: return null
|
||||
return TestOperationDescriptorImpl("", -1, "", className, methodName)
|
||||
return TestOperationDescriptor("", -1, "", className, methodName)
|
||||
}
|
||||
|
||||
private class Output {
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.intellij.build.events.EventResult;
|
||||
import com.intellij.build.events.impl.FinishEventImpl;
|
||||
import com.intellij.build.events.impl.ProgressBuildEventImpl;
|
||||
import com.intellij.build.events.impl.StartEventImpl;
|
||||
import com.intellij.gradle.toolingExtension.util.GradleVersionUtil;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId;
|
||||
import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationEvent;
|
||||
@@ -126,13 +127,13 @@ public final class GradleProgressEventConverter {
|
||||
var descriptor = convertTestDescriptor(event);
|
||||
|
||||
if (event instanceof TestStartEvent) {
|
||||
var esEvent = new ExternalSystemStartEventImpl<>(eventId, parentEventId, descriptor);
|
||||
var esEvent = new ExternalSystemStartEvent<>(eventId, parentEventId, descriptor);
|
||||
return new ExternalSystemTaskExecutionEvent(taskId, esEvent);
|
||||
}
|
||||
if (event instanceof TestFinishEvent finishEvent) {
|
||||
var result = finishEvent.getResult();
|
||||
var operationResult = convertTestProgressEventResult(result);
|
||||
var esEvent = new ExternalSystemFinishEventImpl<>(eventId, parentEventId, descriptor, operationResult);
|
||||
var esEvent = new ExternalSystemFinishEvent<>(eventId, parentEventId, descriptor, operationResult);
|
||||
return new ExternalSystemTaskExecutionEvent(taskId, esEvent);
|
||||
}
|
||||
if (event instanceof TestOutputEvent outputEvent) {
|
||||
@@ -141,7 +142,7 @@ public final class GradleProgressEventConverter {
|
||||
var isStdOut = destination == Destination.StdOut;
|
||||
var message = outputDescriptor.getMessage();
|
||||
var description = (isStdOut ? "StdOut" : "StdErr") + message;
|
||||
var esEvent = new ExternalSystemMessageEventImpl<>(eventId, parentEventId, descriptor, isStdOut, message, description);
|
||||
var esEvent = new ExternalSystemMessageEvent<>(eventId, parentEventId, descriptor, isStdOut, message, description);
|
||||
return new ExternalSystemTaskExecutionEvent(taskId, esEvent);
|
||||
}
|
||||
return null;
|
||||
@@ -151,17 +152,17 @@ public final class GradleProgressEventConverter {
|
||||
var startTime = result.getStartTime();
|
||||
var endTime = result.getEndTime();
|
||||
if (result instanceof TestSuccessResult) {
|
||||
return new SuccessResultImpl(startTime, endTime, false);
|
||||
return new com.intellij.openapi.externalSystem.model.task.event.SuccessResult(startTime, endTime, false);
|
||||
}
|
||||
if (result instanceof TestFailureResult failureResult) {
|
||||
var failures = ContainerUtil.map(failureResult.getFailures(), it -> convertTestFailure(it));
|
||||
return new FailureResultImpl(startTime, endTime, failures);
|
||||
return new com.intellij.openapi.externalSystem.model.task.event.FailureResult(startTime, endTime, failures);
|
||||
}
|
||||
if (result instanceof TestSkippedResult) {
|
||||
return new SkippedResultImpl(startTime, endTime);
|
||||
return new com.intellij.openapi.externalSystem.model.task.event.SkippedResult(startTime, endTime);
|
||||
}
|
||||
LOG.warn("Undefined test operation result " + result.getClass().getName());
|
||||
return new DefaultOperationResult(startTime, endTime);
|
||||
return new com.intellij.openapi.externalSystem.model.task.event.OperationResult(startTime, endTime);
|
||||
}
|
||||
|
||||
private static @NotNull Failure convertTestFailure(@NotNull org.gradle.tooling.Failure failure) {
|
||||
@@ -207,7 +208,7 @@ public final class GradleProgressEventConverter {
|
||||
return new TestFailure(exceptionName, message, stackTrace, description, causes, false);
|
||||
}
|
||||
LOG.warn("Undefined test failure type " + failure.getClass().getName());
|
||||
return new FailureImpl(message, description, Collections.emptyList());
|
||||
return new com.intellij.openapi.externalSystem.model.task.event.Failure(message, description, Collections.emptyList());
|
||||
}
|
||||
|
||||
private static @NotNull TestOperationDescriptor convertTestDescriptor(@NotNull ProgressEvent event) {
|
||||
@@ -218,9 +219,9 @@ public final class GradleProgressEventConverter {
|
||||
var suiteName = jvmDescriptor.getSuiteName();
|
||||
var className = jvmDescriptor.getClassName();
|
||||
var methodName = jvmDescriptor.getMethodName();
|
||||
return new TestOperationDescriptorImpl(displayName, eventTime, suiteName, className, methodName);
|
||||
return new com.intellij.openapi.externalSystem.model.task.event.TestOperationDescriptor(displayName, eventTime, suiteName, className, methodName);
|
||||
}
|
||||
return new TestOperationDescriptorImpl(displayName, eventTime, null, null, null);
|
||||
return new com.intellij.openapi.externalSystem.model.task.event.TestOperationDescriptor(displayName, eventTime, null, null, null);
|
||||
}
|
||||
|
||||
public static @Nullable ExternalSystemTaskNotificationEvent legacyConvertProgressBuildEvent(
|
||||
|
||||
Reference in New Issue
Block a user