-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Arthur McGibbon
committed
May 28, 2024
1 parent
77ac9e4
commit 687927e
Showing
19 changed files
with
1,044 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
108 changes: 108 additions & 0 deletions
108
server/src/main/java/ch/epfl/scala/bsp4j/extended/TestFinishEx.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
package ch.epfl.scala.bsp4j.extended; | ||
|
||
import java.util.Objects; | ||
|
||
import org.eclipse.lsp4j.jsonrpc.validation.NonNull; | ||
import org.eclipse.xtext.xbase.lib.Pure; | ||
import org.eclipse.xtext.xbase.lib.util.ToStringBuilder; | ||
|
||
import ch.epfl.scala.bsp4j.TestFinish; | ||
import ch.epfl.scala.bsp4j.TestStatus; | ||
|
||
/** | ||
* Extended {@link TestFinish}, which contains the Suite, class, method. | ||
* {@link TestFinish} only contains file location which Gradle doesn't have. | ||
*/ | ||
public class TestFinishEx extends TestFinish { | ||
|
||
private String suiteName; | ||
|
||
private String className; | ||
|
||
private String methodName; | ||
|
||
private String stackTrace; | ||
|
||
/** | ||
* Create a new instance of {@link TestFinishEx}. | ||
*/ | ||
public TestFinishEx(@NonNull String displayName, @NonNull TestStatus status, String suiteName, | ||
String className, String methodName) { | ||
super(displayName, status); | ||
this.suiteName = suiteName; | ||
this.className = className; | ||
this.methodName = methodName; | ||
} | ||
|
||
public String getSuiteName() { | ||
return suiteName; | ||
} | ||
|
||
public void setSuiteName(String suiteName) { | ||
this.suiteName = suiteName; | ||
} | ||
|
||
public String getClassName() { | ||
return className; | ||
} | ||
|
||
public void setClassName(String className) { | ||
this.className = className; | ||
} | ||
|
||
public String getMethodName() { | ||
return methodName; | ||
} | ||
|
||
public void setMethodName(String methodName) { | ||
this.methodName = methodName; | ||
} | ||
|
||
public String getStackTrace() { | ||
return stackTrace; | ||
} | ||
|
||
public void setStackTrace(String stackTrace) { | ||
this.stackTrace = stackTrace; | ||
} | ||
|
||
@Override | ||
@Pure | ||
public String toString() { | ||
ToStringBuilder b = new ToStringBuilder(this); | ||
b.add(super.toString()); | ||
b.add("suiteName", this.suiteName); | ||
b.add("className", this.className); | ||
b.add("methodName", this.methodName); | ||
return b.toString(); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
final int prime = 31; | ||
int result = super.hashCode(); | ||
result = prime * result + Objects.hash(suiteName, className, methodName, stackTrace); | ||
return result; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) { | ||
return true; | ||
} | ||
if (!super.equals(obj)) { | ||
return false; | ||
} | ||
if (getClass() != obj.getClass()) { | ||
return false; | ||
} | ||
TestFinishEx other = (TestFinishEx) obj; | ||
return Objects.equals(suiteName, other.suiteName) | ||
&& Objects.equals(className, other.className) | ||
&& Objects.equals(methodName, other.methodName) | ||
&& Objects.equals(stackTrace, other.stackTrace); | ||
} | ||
} |
96 changes: 96 additions & 0 deletions
96
server/src/main/java/ch/epfl/scala/bsp4j/extended/TestStartEx.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
package ch.epfl.scala.bsp4j.extended; | ||
|
||
import java.util.Objects; | ||
|
||
import org.eclipse.lsp4j.jsonrpc.validation.NonNull; | ||
import org.eclipse.xtext.xbase.lib.Pure; | ||
import org.eclipse.xtext.xbase.lib.util.ToStringBuilder; | ||
|
||
import ch.epfl.scala.bsp4j.TestStart; | ||
|
||
/** | ||
* Extended {@link TestStart}, which contains the Suite, class, method. | ||
* {@link TestStart} only contains file location which Gradle doesn't have. | ||
*/ | ||
public class TestStartEx extends TestStart { | ||
|
||
private String suiteName; | ||
|
||
private String className; | ||
|
||
private String methodName; | ||
|
||
/** | ||
* Create a new instance of {@link TestStartEx}. | ||
*/ | ||
public TestStartEx(@NonNull String displayName, String suiteName, | ||
String className, String methodName) { | ||
super(displayName); | ||
this.suiteName = suiteName; | ||
this.className = className; | ||
this.methodName = methodName; | ||
} | ||
|
||
public String getSuiteName() { | ||
return suiteName; | ||
} | ||
|
||
public void setSuiteName(String suiteName) { | ||
this.suiteName = suiteName; | ||
} | ||
|
||
public String getClassName() { | ||
return className; | ||
} | ||
|
||
public void setClassName(String className) { | ||
this.className = className; | ||
} | ||
|
||
public String getMethodName() { | ||
return methodName; | ||
} | ||
|
||
public void setMethodName(String methodName) { | ||
this.methodName = methodName; | ||
} | ||
|
||
@Override | ||
@Pure | ||
public String toString() { | ||
ToStringBuilder b = new ToStringBuilder(this); | ||
b.add(super.toString()); | ||
b.add("suiteName", this.suiteName); | ||
b.add("className", this.className); | ||
b.add("methodName", this.methodName); | ||
return b.toString(); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
final int prime = 31; | ||
int result = super.hashCode(); | ||
result = prime * result + Objects.hash(suiteName, className, methodName); | ||
return result; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) { | ||
return true; | ||
} | ||
if (!super.equals(obj)) { | ||
return false; | ||
} | ||
if (getClass() != obj.getClass()) { | ||
return false; | ||
} | ||
TestStartEx other = (TestStartEx) obj; | ||
return Objects.equals(suiteName, other.suiteName) | ||
&& Objects.equals(className, other.className) | ||
&& Objects.equals(methodName, other.methodName); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.