forked from empear-analytics/zookeeper
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Reinstate missing imports to ZooKeeperMain.
2. Add unit tests for CommandFactory. 3. Remove redundant import from CommandFactory.
- Loading branch information
1 parent
ed76f14
commit 4957d89
Showing
3 changed files
with
23 additions
and
2 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
2 changes: 0 additions & 2 deletions
2
zookeeper-server/src/main/java/org/apache/zookeeper/cli/CommandFactory.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
20 changes: 20 additions & 0 deletions
20
zookeeper-server/src/test/java/org/apache/zookeeper/cli/CommandFactoryTest.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,20 @@ | ||
package org.apache.zookeeper.cli; | ||
|
||
import static org.junit.Assert.assertTrue; | ||
import org.junit.Test; | ||
|
||
/** | ||
* Unit test for {@link CommandFactory}. | ||
*/ | ||
public class CommandFactoryTest { | ||
|
||
/** | ||
* Verify that the {@code CommandFactory} can create a command instance. | ||
*/ | ||
@Test | ||
public void testCommandCreation() { | ||
CliCommand cliCommand = | ||
CommandFactory.getInstance(CommandFactory.Command.CREATE); | ||
assertTrue(cliCommand instanceof CreateCommand); | ||
} | ||
} |