Added ArgumentValidationException as separate from illegal syntax
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package net.minecraft.commands.arguments;
|
||||
|
||||
import net.minecraft.commands.exceptions.IllegalCommandArgumentException;
|
||||
import net.minecraft.commands.exceptions.ArgumentValidationException;
|
||||
import net.minecraft.commands.exceptions.IllegalArgumentSyntaxException;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -24,12 +25,12 @@ public class IntegerArgumentTypeTest {
|
||||
assertThat(result.getResult(), is(50));
|
||||
}
|
||||
|
||||
@Test(expected = IllegalCommandArgumentException.class)
|
||||
@Test(expected = IllegalArgumentSyntaxException.class)
|
||||
public void testParseInvalid() throws Exception {
|
||||
type.parse("fifty");
|
||||
}
|
||||
|
||||
@Test(expected = IllegalCommandArgumentException.class)
|
||||
@Test(expected = ArgumentValidationException.class)
|
||||
public void testParseTooLow() throws Exception {
|
||||
type.parse("-101");
|
||||
}
|
||||
@@ -42,7 +43,7 @@ public class IntegerArgumentTypeTest {
|
||||
assertThat(result.getResult(), is(-100));
|
||||
}
|
||||
|
||||
@Test(expected = IllegalCommandArgumentException.class)
|
||||
@Test(expected = ArgumentValidationException.class)
|
||||
public void testParseTooHigh() throws Exception {
|
||||
type.parse("101");
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package net.minecraft.commands.tree;
|
||||
|
||||
import net.minecraft.commands.exceptions.IllegalCommandArgumentException;
|
||||
import net.minecraft.commands.exceptions.IllegalArgumentSyntaxException;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -22,7 +22,7 @@ public class ArgumentCommandNodeTest {
|
||||
assertThat((ArgumentCommandNode) node.parse("123"), is(node));
|
||||
}
|
||||
|
||||
@Test(expected = IllegalCommandArgumentException.class)
|
||||
@Test(expected = IllegalArgumentSyntaxException.class)
|
||||
public void testParseInvalid() throws Exception {
|
||||
node.parse("bar");
|
||||
}
|
||||
@@ -36,14 +36,14 @@ public class ArgumentCommandNodeTest {
|
||||
assertThat(node.parse("123 123"), is(child));
|
||||
}
|
||||
|
||||
@Test(expected = IllegalCommandArgumentException.class)
|
||||
@Test(expected = IllegalArgumentSyntaxException.class)
|
||||
public void testParseInvalidChild() throws Exception {
|
||||
node.addChild(argument("bar", integer()).build());
|
||||
|
||||
node.parse("123 bar");
|
||||
}
|
||||
|
||||
@Test(expected = IllegalCommandArgumentException.class)
|
||||
@Test(expected = IllegalArgumentSyntaxException.class)
|
||||
public void testParseNoChildren() throws Exception {
|
||||
node.parse("123 123");
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package net.minecraft.commands.tree;
|
||||
|
||||
import net.minecraft.commands.exceptions.IllegalCommandArgumentException;
|
||||
import net.minecraft.commands.exceptions.IllegalArgumentSyntaxException;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -23,7 +23,7 @@ public class LiteralCommandNodeTest {
|
||||
assertThat((LiteralCommandNode) node.parse("foo"), is(node));
|
||||
}
|
||||
|
||||
@Test(expected = IllegalCommandArgumentException.class)
|
||||
@Test(expected = IllegalArgumentSyntaxException.class)
|
||||
public void testParseInvalid() throws Exception {
|
||||
node.parse("bar");
|
||||
}
|
||||
@@ -37,14 +37,14 @@ public class LiteralCommandNodeTest {
|
||||
assertThat(node.parse("foo 123"), is(child));
|
||||
}
|
||||
|
||||
@Test(expected = IllegalCommandArgumentException.class)
|
||||
@Test(expected = IllegalArgumentSyntaxException.class)
|
||||
public void testParseInvalidChild() throws Exception {
|
||||
node.addChild(argument("bar", integer()).build());
|
||||
|
||||
node.parse("foo bar");
|
||||
}
|
||||
|
||||
@Test(expected = IllegalCommandArgumentException.class)
|
||||
@Test(expected = IllegalArgumentSyntaxException.class)
|
||||
public void testParseNoChildren() throws Exception {
|
||||
node.parse("foo 123");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user