-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #524 from zinggAI/main
fixing junits
- Loading branch information
Showing
20 changed files
with
174 additions
and
141 deletions.
There are no files selected for viewing
60 changes: 0 additions & 60 deletions
60
common/client/src/test/java/zingg/client/TestClientOption.java
This file was deleted.
Oops, something went wrong.
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
64 changes: 64 additions & 0 deletions
64
common/client/src/test/java/zingg/common/client/TestClientOption.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,64 @@ | ||
package zingg.common.client; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertNull; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
import static org.junit.jupiter.api.Assertions.fail; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
public class TestClientOption { | ||
|
||
|
||
@Test | ||
public void testParseArguments() { | ||
String[] args = {"--phase", "train", | ||
"--conf", "conf.json", | ||
"--zinggDir", "/tmp/z_main", | ||
"--email", "zingg@zingg.ai", | ||
"--license", "zinggLicense.txt"}; | ||
|
||
ClientOptions co = new ClientOptions(args); | ||
assertEquals("conf.json", co.get(ClientOptions.CONF).value); | ||
assertEquals("train", co.get(ClientOptions.PHASE).value); | ||
assertEquals("/tmp/z_main", co.get(ClientOptions.ZINGG_DIR).value); | ||
assertNull(co.get(ClientOptions.HELP)); | ||
} | ||
|
||
@Test | ||
public void testParseUnsupportedArgumentsConf() { | ||
try { | ||
String[] args = {"--phase", "train", | ||
"--conf1", "conf.json", | ||
"--zinggDir", "/tmp/z_main", | ||
"--email", "zingg@zingg.ai", | ||
"--license", "zinggLicense.txt"}; | ||
|
||
ClientOptions co = new ClientOptions(args); | ||
fail("exception should have been raised due to invalid conf option"); | ||
} catch (Exception e) { | ||
assertTrue(true); | ||
} | ||
} | ||
|
||
@Test | ||
public void testParseUnsupportedArgumentsPhase() { | ||
try { | ||
String[] args = {"--phase1", "train", | ||
"--conf1", "conf.json", | ||
"--zinggDir", "/tmp/z_main", | ||
"--email", "zingg@zingg.ai", | ||
"--license", "zinggLicense.txt"}; | ||
|
||
ClientOptions co = new ClientOptions(args); | ||
fail("exception should have been raised due to invalid phase option"); | ||
} catch (Exception e) { | ||
assertTrue(true); | ||
} | ||
} | ||
|
||
|
||
} |
2 changes: 1 addition & 1 deletion
2
...ava/zingg/client/TestFieldDefinition.java → ...gg/common/client/TestFieldDefinition.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package zingg.client; | ||
package zingg.common.client; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...st/java/zingg/client/input/TestToCSV.java → ...t/java/zingg/common/client/TestToCSV.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package zingg.client.input; | ||
package zingg.common.client; | ||
|
||
import java.io.File; | ||
|
||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.