mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2025-04-28 16:00:33 +05:30
Fix typo and reword some explanations
This commit is contained in:
parent
adf9d7d10f
commit
e13e237392
@ -9,7 +9,7 @@ import java.lang.annotation.Target;
|
|||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Marker annotation to skip test if it not run with mocks.
|
* Marker annotation to skip test in certain cases.
|
||||||
*
|
*
|
||||||
* {@link MockOnlyRule}
|
* {@link MockOnlyRule}
|
||||||
*/
|
*/
|
||||||
@ -19,7 +19,7 @@ import javax.annotation.Nonnull;
|
|||||||
public @interface MockOnly {
|
public @interface MockOnly {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Explanation why this test shold only be run with mocks and not against real websites
|
* Explanation why this test should be skipped
|
||||||
*/
|
*/
|
||||||
@Nonnull String reason();
|
@Nonnull String reason();
|
||||||
}
|
}
|
@ -9,19 +9,21 @@ import org.schabi.newpipe.downloader.DownloaderType;
|
|||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
|
||||||
* Checks if the system variable "downloader" is set to "REAL" and skips the tests if it is.
|
|
||||||
* Otherwise execute the test.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* Use it by creating a public variable of this inside the test class and annotate it with
|
|
||||||
* {@link org.junit.Rule}. Then annotate the tests to be skipped with {@link MockOnly}
|
|
||||||
* </p>
|
|
||||||
*
|
*
|
||||||
* <p>
|
* <p>
|
||||||
* Allows skipping unreliable or time sensitive tests in CI pipeline.
|
* Allows skipping unreliable or time sensitive tests in CI pipeline.
|
||||||
* </p>
|
* </p>
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* Use it by creating a public variable of this inside the test class and annotate it with
|
||||||
|
* {@link org.junit.Rule}. Then annotate the specific tests to be skipped with {@link MockOnly}
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* It works by checking if the system variable "downloader" is set to "REAL" and skips the tests if it is.
|
||||||
|
* Otherwise it executes the test.
|
||||||
|
* </p>
|
||||||
|
|
||||||
*/
|
*/
|
||||||
public class MockOnlyRule implements TestRule {
|
public class MockOnlyRule implements TestRule {
|
||||||
|
|
||||||
@ -42,7 +44,6 @@ public class MockOnlyRule implements TestRule {
|
|||||||
+ annotation.reason(), isMockDownloader);
|
+ annotation.reason(), isMockDownloader);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
base.evaluate();
|
base.evaluate();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user