Skip to content

Commit

Permalink
HDDS-11719. Remove dependency on server components from ozonefs-common (
Browse files Browse the repository at this point in the history
  • Loading branch information
adoroszlai authored Dec 4, 2024
1 parent 9fcecc1 commit 8a1967e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 34 deletions.
5 changes: 1 addition & 4 deletions hadoop-hdds/hadoop-dependency-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
<exclusion>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
</exclusion>
<!-- commons-cli is required by OzoneFsShell -->
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
Expand Down
25 changes: 0 additions & 25 deletions hadoop-ozone/ozonefs-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,35 +112,10 @@
</dependency>

<!-- Test dependencies -->
<dependency>
<groupId>org.apache.ozone</groupId>
<artifactId>hdds-container-service</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.ozone</groupId>
<artifactId>hdds-hadoop-dependency-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.ozone</groupId>
<artifactId>hdds-server-framework</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.ozone</groupId>
<artifactId>hdds-server-scm</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.ozone</groupId>
<artifactId>hdds-test-utils</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.ozone</groupId>
<artifactId>ozone-manager</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import org.apache.hadoop.util.ToolRunner;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Arrays;

Expand All @@ -32,15 +31,14 @@

import org.junit.jupiter.api.Test;


/**
* Tests the behavior of OzoneFsShell.
*/
public class TestOzoneFsShell {

// tests command handler for FsShell bound to OzoneDelete class
@Test
public void testOzoneFsShellRegisterDeleteCmd() throws IOException {
public void testOzoneFsShellRegisterDeleteCmd() throws Exception {
final String rmCmdName = "rm";
final String rmCmd = "-" + rmCmdName;
final String arg = "arg1";
Expand All @@ -52,16 +50,17 @@ public void testOzoneFsShellRegisterDeleteCmd() throws IOException {
System.setErr(bytesPrintStream);
try {
ToolRunner.run(shell, argv);
} catch (Exception e) {
} finally {

// test command bindings for "rm" command handled by OzoneDelete class
CommandFactory factory = shell.getCommandFactory();
assertNotNull(factory);
assertEquals(1, Arrays.stream(factory.getNames())
.filter(c -> c.equals(rmCmd)).count());
Command instance = factory.getInstance(rmCmd);
assertNotNull(instance);
assertEquals(OzoneFsDelete.Rm.class, instance.getClass());
assertEquals(rmCmdName, instance.getCommandName());
} finally {
shell.close();
System.setErr(oldErr);
}
Expand Down

0 comments on commit 8a1967e

Please sign in to comment.