mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-22 18:45:29 +01:00
remove tests temporarily
This commit is contained in:
parent
adac4b5442
commit
193a62896d
19
pom.xml
19
pom.xml
@ -27,11 +27,6 @@
|
||||
<id>everything</id>
|
||||
<url>http://repo.citizensnpcs.net/</url>
|
||||
</repository>
|
||||
|
||||
<repository>
|
||||
<id>junit</id>
|
||||
<url>http://mvnrepository.com/artifact/junit/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
@ -56,20 +51,6 @@
|
||||
<type>jar</type>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.1</version>
|
||||
<type>jar</type>
|
||||
<scope>test</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hamcrest</groupId>
|
||||
<artifactId>hamcrest-library</artifactId>
|
||||
<version>1.2.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<url>http://www.citizensnpcs.net</url>
|
||||
|
@ -1,40 +0,0 @@
|
||||
package net.citizensnpcs.test;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.citizensnpcs.util.ByIdArray;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class ByIdArrayTest {
|
||||
|
||||
@Test
|
||||
public void testInsert() {
|
||||
ByIdArray<String> test = new ByIdArray<String>();
|
||||
test.put(0, "one");
|
||||
assert (test.get(0).equals("one"));
|
||||
assert (test.contains(0));
|
||||
assert (test.size() == 1);
|
||||
test.remove(1000); // try illegal remove
|
||||
test.clear();
|
||||
assert (test.size() == 0);
|
||||
test.add("one");
|
||||
assert (test.get(0).equals("one"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIteration() {
|
||||
int iterations = 1000;
|
||||
ByIdArray<String> test = new ByIdArray<String>();
|
||||
String[] values = new String[iterations];
|
||||
for (int i = 0; i < values.length; ++i)
|
||||
values[i] = Integer.toString(i);
|
||||
Random random = new Random(100);
|
||||
int index = 0;
|
||||
for (String value : values)
|
||||
test.put((index += random.nextInt(10) + 1), value);
|
||||
index = 0;
|
||||
for (String value : test)
|
||||
assert (value.equals(values[index++]));
|
||||
}
|
||||
}
|
@ -1,58 +0,0 @@
|
||||
package net.citizensnpcs.test;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.citizensnpcs.command.CommandContext;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class CommandContextTest {
|
||||
@Test(expected = NumberFormatException.class)
|
||||
public void testIllegalInteger() {
|
||||
getContext("notInt").getInteger(0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParsing() {
|
||||
assertTrue(0.0 == getContext("0").getDouble(0));
|
||||
assertTrue(0 == getContext("0").getInteger(0));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testJoining() {
|
||||
assertTrue(getContext("join strings").getJoinedStrings(0).equals("join strings"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValueFlags() {
|
||||
assertTrue(getContext("--test values").getFlag("test").equals("values"));
|
||||
assertTrue(getContext("--t 0").getFlagInteger("t") == 0);
|
||||
assertTrue(getContext("--test 'extended quotes' afterwards").getFlag("test").equals("extended quotes"));
|
||||
assertFalse(getContext("--t").hasFlag('t'));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFlags() {
|
||||
assertTrue(getContext("-f").getFlags().contains('f'));
|
||||
Set<Character> multi = getContext("-f -mm test -ghl").getFlags();
|
||||
List<Character> shouldContain = Arrays.asList('f', 'm', 'g', 'h', 'l');
|
||||
assertTrue(multi.containsAll(shouldContain));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testQuotes() {
|
||||
assertTrue(getContext("'this is a quote'").getString(0).equals("this is a quote"));
|
||||
assertTrue(getContext("'this is unclosed\"").getString(0).equals("'this"));
|
||||
assertTrue(getContext("\"test double quotes\"").getString(0).equals("test double quotes"));
|
||||
assertTrue(getContext("'this is a quote'").getString(0).equals("this is a quote"));
|
||||
}
|
||||
|
||||
private static CommandContext getContext(String cmd) {
|
||||
return new CommandContext("dummy " + cmd);
|
||||
}
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
package net.citizensnpcs.test;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class StorageTest {
|
||||
|
||||
@Test
|
||||
public void testYaml() {
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user