forked from junit-team/junit5
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/LockTests.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,35 @@ | ||
/* | ||
* Copyright 2015-2024 the original author or authors. | ||
* | ||
* All rights reserved. This program and the accompanying materials are | ||
* made available under the terms of the Eclipse Public License v2.0 which | ||
* accompanies this distribution and is available at | ||
* | ||
* https://www.eclipse.org/legal/epl-v20.html | ||
*/ | ||
|
||
package org.junit.platform.engine.support.descriptor; | ||
|
||
import static org.junit.jupiter.api.parallel.ResourceLocksProvider.Lock; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.parallel.ResourceAccessMode; | ||
import org.junit.platform.AbstractEqualsAndHashCodeTests; | ||
|
||
/** | ||
* @since 5.12 | ||
*/ | ||
class LockTests extends AbstractEqualsAndHashCodeTests { | ||
|
||
@Test | ||
void equalsAndHashCode() { | ||
assertEqualsAndHashCode(new Lock("a"), new Lock("a"), new Lock("b")); | ||
// @formatter:off | ||
assertEqualsAndHashCode( | ||
new Lock("a", ResourceAccessMode.READ_WRITE), | ||
new Lock("a", ResourceAccessMode.READ_WRITE), | ||
new Lock("a", ResourceAccessMode.READ) | ||
); | ||
// @formatter:on | ||
} | ||
} |