mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -08:00
Fix checkstyle warnings after migration to the new version
This commit is contained in:
parent
43437fd9b2
commit
0cff9e104c
|
@ -1,6 +1,7 @@
|
||||||
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
|
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
|
||||||
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
|
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
|
||||||
<module name="Checker">
|
<module name="Checker">
|
||||||
|
<property name="fileExtensions" value="java"/>
|
||||||
<module name="LineLength">
|
<module name="LineLength">
|
||||||
<property name="max" value="120"/>
|
<property name="max" value="120"/>
|
||||||
</module>
|
</module>
|
||||||
|
|
|
@ -47,11 +47,10 @@ public class ScalaHacks implements ClassHolderTransformer {
|
||||||
transformProperties(cls);
|
transformProperties(cls);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
{
|
|
||||||
if (cls.getName().endsWith(SCALA_INTERNAL_CLASS_MARKER)) {
|
if (cls.getName().endsWith(SCALA_INTERNAL_CLASS_MARKER)) {
|
||||||
checkAndRemoveExportAnnotation(cls);
|
checkAndRemoveExportAnnotation(cls);
|
||||||
}
|
}
|
||||||
} break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
package org.teavm.classlib.impl.unicode;
|
package org.teavm.classlib.impl.unicode;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
import org.teavm.classlib.impl.Base46;
|
import org.teavm.classlib.impl.Base46;
|
||||||
import org.teavm.classlib.impl.CharFlow;
|
import org.teavm.classlib.impl.CharFlow;
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,6 @@ import java.util.function.Consumer;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
import org.teavm.classlib.java.util.stream.TStream;
|
import org.teavm.classlib.java.util.stream.TStream;
|
||||||
|
|
||||||
public final class TOptional<T> {
|
public final class TOptional<T> {
|
||||||
|
|
|
@ -1410,15 +1410,15 @@ public final class LocalDateTime
|
||||||
if ((hours | minutes | seconds | nanos) == 0) {
|
if ((hours | minutes | seconds | nanos) == 0) {
|
||||||
return with(newDate, time);
|
return with(newDate, time);
|
||||||
}
|
}
|
||||||
long totDays = nanos / NANOS_PER_DAY + // max/24*60*60*1B
|
long totDays = nanos / NANOS_PER_DAY // max/24*60*60*1B
|
||||||
seconds / SECONDS_PER_DAY + // max/24*60*60
|
+ seconds / SECONDS_PER_DAY // max/24*60*60
|
||||||
minutes / MINUTES_PER_DAY + // max/24*60
|
+ minutes / MINUTES_PER_DAY // max/24*60
|
||||||
hours / HOURS_PER_DAY; // max/24
|
+ hours / HOURS_PER_DAY; // max/24
|
||||||
totDays *= sign; // total max*0.4237...
|
totDays *= sign; // total max*0.4237...
|
||||||
long totNanos = nanos % NANOS_PER_DAY + // max 86400000000000
|
long totNanos = nanos % NANOS_PER_DAY // max 86400000000000
|
||||||
(seconds % SECONDS_PER_DAY) * NANOS_PER_SECOND + // max 86400000000000
|
+ (seconds % SECONDS_PER_DAY) * NANOS_PER_SECOND // max 86400000000000
|
||||||
(minutes % MINUTES_PER_DAY) * NANOS_PER_MINUTE + // max 86400000000000
|
+ (minutes % MINUTES_PER_DAY) * NANOS_PER_MINUTE // max 86400000000000
|
||||||
(hours % HOURS_PER_DAY) * NANOS_PER_HOUR; // max 86400000000000
|
+ (hours % HOURS_PER_DAY) * NANOS_PER_HOUR; // max 86400000000000
|
||||||
long curNoD = time.toNanoOfDay(); // max 86400000000000
|
long curNoD = time.toNanoOfDay(); // max 86400000000000
|
||||||
totNanos = totNanos * sign + curNoD; // total 432000000000000
|
totNanos = totNanos * sign + curNoD; // total 432000000000000
|
||||||
totDays += Jdk8Methods.floorDiv(totNanos, NANOS_PER_DAY);
|
totDays += Jdk8Methods.floorDiv(totNanos, NANOS_PER_DAY);
|
||||||
|
|
|
@ -307,14 +307,14 @@ final class ChronoLocalDateTimeImpl<D extends ChronoLocalDate>
|
||||||
if ((hours | minutes | seconds | nanos) == 0) {
|
if ((hours | minutes | seconds | nanos) == 0) {
|
||||||
return with(newDate, time);
|
return with(newDate, time);
|
||||||
}
|
}
|
||||||
long totDays = nanos / NANOS_PER_DAY + // max/24*60*60*1B
|
long totDays = nanos / NANOS_PER_DAY // max/24*60*60*1B
|
||||||
seconds / SECONDS_PER_DAY + // max/24*60*60
|
+ seconds / SECONDS_PER_DAY // max/24*60*60
|
||||||
minutes / MINUTES_PER_DAY + // max/24*60
|
+ minutes / MINUTES_PER_DAY // max/24*60
|
||||||
hours / HOURS_PER_DAY; // max/24
|
+ hours / HOURS_PER_DAY; // max/24
|
||||||
long totNanos = nanos % NANOS_PER_DAY + // max 86400000000000
|
long totNanos = nanos % NANOS_PER_DAY // max 86400000000000
|
||||||
(seconds % SECONDS_PER_DAY) * NANOS_PER_SECOND + // max 86400000000000
|
+ (seconds % SECONDS_PER_DAY) * NANOS_PER_SECOND // max 86400000000000
|
||||||
(minutes % MINUTES_PER_DAY) * NANOS_PER_MINUTE + // max 86400000000000
|
+ (minutes % MINUTES_PER_DAY) * NANOS_PER_MINUTE // max 86400000000000
|
||||||
(hours % HOURS_PER_DAY) * NANOS_PER_HOUR; // max 86400000000000
|
+ (hours % HOURS_PER_DAY) * NANOS_PER_HOUR; // max 86400000000000
|
||||||
long curNoD = time.toNanoOfDay(); // max 86400000000000
|
long curNoD = time.toNanoOfDay(); // max 86400000000000
|
||||||
totNanos = totNanos + curNoD; // total 432000000000000
|
totNanos = totNanos + curNoD; // total 432000000000000
|
||||||
totDays += Jdk8Methods.floorDiv(totNanos, NANOS_PER_DAY);
|
totDays += Jdk8Methods.floorDiv(totNanos, NANOS_PER_DAY);
|
||||||
|
|
|
@ -48,7 +48,6 @@ package org.threeten.bp.chrono;
|
||||||
|
|
||||||
import static org.threeten.bp.temporal.ChronoField.ERA;
|
import static org.threeten.bp.temporal.ChronoField.ERA;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import org.threeten.bp.format.DateTimeFormatterBuilder;
|
import org.threeten.bp.format.DateTimeFormatterBuilder;
|
||||||
import org.threeten.bp.format.TextStyle;
|
import org.threeten.bp.format.TextStyle;
|
||||||
import org.threeten.bp.temporal.ChronoField;
|
import org.threeten.bp.temporal.ChronoField;
|
||||||
|
|
|
@ -51,7 +51,6 @@ import static org.threeten.bp.temporal.ChronoUnit.DAYS;
|
||||||
import static org.threeten.bp.temporal.ChronoUnit.FOREVER;
|
import static org.threeten.bp.temporal.ChronoUnit.FOREVER;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import org.threeten.bp.DateTimeException;
|
import org.threeten.bp.DateTimeException;
|
||||||
import org.threeten.bp.chrono.Chronology;
|
import org.threeten.bp.chrono.Chronology;
|
||||||
|
|
|
@ -70,40 +70,40 @@ public class JavaScriptBodyConversionTest {
|
||||||
assertEquals(int[].class, returnAsIntArray(new Integer[] { 23, 42 }).getClass());
|
assertEquals(int[].class, returnAsIntArray(new Integer[] { 23, 42 }).getClass());
|
||||||
}
|
}
|
||||||
|
|
||||||
@JavaScriptBody(args = { "value" }, body = "return value;")
|
@JavaScriptBody(args = "value", body = "return value;")
|
||||||
private native int returnAsInt(Object value);
|
private native int returnAsInt(Object value);
|
||||||
|
|
||||||
@JavaScriptBody(args = { "value" }, body = "return value;")
|
@JavaScriptBody(args = "value", body = "return value;")
|
||||||
private native boolean returnAsBoolean(Object value);
|
private native boolean returnAsBoolean(Object value);
|
||||||
|
|
||||||
@JavaScriptBody(args = { "value" }, body = "return value;")
|
@JavaScriptBody(args = "value", body = "return value;")
|
||||||
private native Boolean returnAsBooleanWrapper(boolean value);
|
private native Boolean returnAsBooleanWrapper(boolean value);
|
||||||
|
|
||||||
@JavaScriptBody(args = { "value" }, body = "return value;")
|
@JavaScriptBody(args = "value", body = "return value;")
|
||||||
private native Integer returnAsInteger(Integer value);
|
private native Integer returnAsInteger(Integer value);
|
||||||
|
|
||||||
@JavaScriptBody(args = { "value" }, body = "return value;")
|
@JavaScriptBody(args = "value", body = "return value;")
|
||||||
private native Object returnAsObject(int value);
|
private native Object returnAsObject(int value);
|
||||||
|
|
||||||
@JavaScriptBody(args = { "value" }, body = "return value + 1;")
|
@JavaScriptBody(args = "value", body = "return value + 1;")
|
||||||
private native int addOne(Object value);
|
private native int addOne(Object value);
|
||||||
|
|
||||||
@JavaScriptBody(args = { "value" }, body = "return value + 1;")
|
@JavaScriptBody(args = "value", body = "return value + 1;")
|
||||||
private native Integer addOne(Integer value);
|
private native Integer addOne(Integer value);
|
||||||
|
|
||||||
@JavaScriptBody(args = { "value" }, body = "return value + 1;")
|
@JavaScriptBody(args = "value", body = "return value + 1;")
|
||||||
private native int addOne(int value);
|
private native int addOne(int value);
|
||||||
|
|
||||||
@JavaScriptBody(args = { "array" }, body = "return array;")
|
@JavaScriptBody(args = "array", body = "return array;")
|
||||||
private native Object returnAsObject(Object array);
|
private native Object returnAsObject(Object array);
|
||||||
|
|
||||||
@JavaScriptBody(args = { "array" }, body = "return array;")
|
@JavaScriptBody(args = "array", body = "return array;")
|
||||||
private native int[] returnAsIntArray(Object array);
|
private native int[] returnAsIntArray(Object array);
|
||||||
|
|
||||||
@JavaScriptBody(args = { "array" }, body = "return array;")
|
@JavaScriptBody(args = "array", body = "return array;")
|
||||||
private native Integer[] returnAsIntegerArray(Object array);
|
private native Integer[] returnAsIntegerArray(Object array);
|
||||||
|
|
||||||
@JavaScriptBody(args = { "value" }, body = "value[0] = 1; return value;")
|
@JavaScriptBody(args = "value", body = "value[0] = 1; return value;")
|
||||||
private native Object modifyIntegerArray(Object value);
|
private native Object modifyIntegerArray(Object value);
|
||||||
|
|
||||||
@JavaScriptBody(args = { "array", "index" }, body = "return array[index];")
|
@JavaScriptBody(args = { "array", "index" }, body = "return array[index];")
|
||||||
|
|
|
@ -90,19 +90,19 @@ public class JavaScriptBodyTest {
|
||||||
@JavaScriptBody(args = {}, body = "return 23;")
|
@JavaScriptBody(args = {}, body = "return 23;")
|
||||||
private native int simpleNativeMethod();
|
private native int simpleNativeMethod();
|
||||||
|
|
||||||
@JavaScriptBody(args = { "value" }, body = "return value;")
|
@JavaScriptBody(args = "value", body = "return value;")
|
||||||
private native Object returnValuePassed(Object value);
|
private native Object returnValuePassed(Object value);
|
||||||
|
|
||||||
@JavaScriptBody(args = { "obj" }, body = "window._global_ = obj;")
|
@JavaScriptBody(args = "obj", body = "window._global_ = obj;")
|
||||||
private native void storeObject(Object obj);
|
private native void storeObject(Object obj);
|
||||||
|
|
||||||
@JavaScriptBody(args = {}, body = "return window._global_;")
|
@JavaScriptBody(args = {}, body = "return window._global_;")
|
||||||
private native Object retrieveObject();
|
private native Object retrieveObject();
|
||||||
|
|
||||||
@JavaScriptBody(args = { "callback" }, body = "return callback.@org.teavm.html4j.test.A::foo()()", javacall = true)
|
@JavaScriptBody(args = "callback", body = "return callback.@org.teavm.html4j.test.A::foo()()", javacall = true)
|
||||||
private native int invokeCallback(A callback);
|
private native int invokeCallback(A callback);
|
||||||
|
|
||||||
@JavaScriptBody(args = { "callback" }, body = ""
|
@JavaScriptBody(args = "callback", body = ""
|
||||||
+ "return callback."
|
+ "return callback."
|
||||||
+ "@org.teavm.html4j.test.B::bar("
|
+ "@org.teavm.html4j.test.B::bar("
|
||||||
+ "Lorg/teavm/html4j/test/A;)(_global_)",
|
+ "Lorg/teavm/html4j/test/A;)(_global_)",
|
||||||
|
@ -113,7 +113,7 @@ public class JavaScriptBodyTest {
|
||||||
return a.foo();
|
return a.foo();
|
||||||
}
|
}
|
||||||
|
|
||||||
@JavaScriptBody(args = { "a" }, body = "return "
|
@JavaScriptBody(args = "a", body = "return "
|
||||||
+ "@org.teavm.html4j.test.JavaScriptBodyTest::staticCallback("
|
+ "@org.teavm.html4j.test.JavaScriptBodyTest::staticCallback("
|
||||||
+ "Lorg/teavm/html4j/test/A;)(a)", javacall = true)
|
+ "Lorg/teavm/html4j/test/A;)(a)", javacall = true)
|
||||||
private native int invokeStaticCallback(A a);
|
private native int invokeStaticCallback(A a);
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
package org.teavm.jso.ajax;
|
package org.teavm.jso.ajax;
|
||||||
|
|
||||||
import org.teavm.jso.JSFunctor;
|
import org.teavm.jso.JSFunctor;
|
||||||
|
|
||||||
import org.teavm.jso.JSObject;
|
import org.teavm.jso.JSObject;
|
||||||
|
|
||||||
@JSFunctor
|
@JSFunctor
|
||||||
|
|
|
@ -105,7 +105,7 @@ public abstract class Window implements JSObject, WindowEventTarget, StorageProv
|
||||||
@JSBody(params = { "handler", "delay" }, script = "return setTimeout(handler, delay);")
|
@JSBody(params = { "handler", "delay" }, script = "return setTimeout(handler, delay);")
|
||||||
public static native int setTimeout(TimerHandler handler, double delay);
|
public static native int setTimeout(TimerHandler handler, double delay);
|
||||||
|
|
||||||
@JSBody(params = { "timeoutId" }, script = "clearTimeout(timeoutId);")
|
@JSBody(params = "timeoutId", script = "clearTimeout(timeoutId);")
|
||||||
public static native void clearTimeout(int timeoutId);
|
public static native void clearTimeout(int timeoutId);
|
||||||
|
|
||||||
@JSBody(params = { "handler", "delay" }, script = "return setInterval(handler, delay);")
|
@JSBody(params = { "handler", "delay" }, script = "return setInterval(handler, delay);")
|
||||||
|
@ -114,13 +114,13 @@ public abstract class Window implements JSObject, WindowEventTarget, StorageProv
|
||||||
@JSBody(params = { "handler", "delay" }, script = "return setInterval(handler, delay);")
|
@JSBody(params = { "handler", "delay" }, script = "return setInterval(handler, delay);")
|
||||||
public static native int setInterval(TimerHandler handler, double delay);
|
public static native int setInterval(TimerHandler handler, double delay);
|
||||||
|
|
||||||
@JSBody(params = { "timeoutId" }, script = "clearInterval(timeoutId);")
|
@JSBody(params = "timeoutId", script = "clearInterval(timeoutId);")
|
||||||
public static native void clearInterval(int timeoutId);
|
public static native void clearInterval(int timeoutId);
|
||||||
|
|
||||||
@JSBody(params = { "callback" }, script = "return requestAnimationFrame(callback);")
|
@JSBody(params = "callback", script = "return requestAnimationFrame(callback);")
|
||||||
public static native int requestAnimationFrame(AnimationFrameCallback callback);
|
public static native int requestAnimationFrame(AnimationFrameCallback callback);
|
||||||
|
|
||||||
@JSBody(params = { "requestId" }, script = "cancelAnimationFrame(requestId);")
|
@JSBody(params = "requestId", script = "cancelAnimationFrame(requestId);")
|
||||||
public static native void cancelAnimationFrame(int requestId);
|
public static native void cancelAnimationFrame(int requestId);
|
||||||
|
|
||||||
public abstract void blur();
|
public abstract void blur();
|
||||||
|
|
|
@ -22,9 +22,9 @@ public final class JSON {
|
||||||
private JSON() {
|
private JSON() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@JSBody(params = { "object" }, script = "return JSON.stringify(object);")
|
@JSBody(params = "object", script = "return JSON.stringify(object);")
|
||||||
public static native String stringify(JSObject object);
|
public static native String stringify(JSObject object);
|
||||||
|
|
||||||
@JSBody(params = { "string" }, script = "return JSON.parse(string);")
|
@JSBody(params = "string", script = "return JSON.parse(string);")
|
||||||
public static native JSObject parse(String string);
|
public static native JSObject parse(String string);
|
||||||
}
|
}
|
||||||
|
|
8
pom.xml
8
pom.xml
|
@ -105,6 +105,7 @@
|
||||||
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
|
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
|
||||||
<exec-maven-plugin.version>3.0.0</exec-maven-plugin.version>
|
<exec-maven-plugin.version>3.0.0</exec-maven-plugin.version>
|
||||||
<wagon-ftp.version>3.4.3</wagon-ftp.version>
|
<wagon-ftp.version>3.4.3</wagon-ftp.version>
|
||||||
|
<checkstyle.version>8.41</checkstyle.version>
|
||||||
|
|
||||||
<teavm.test.incremental>false</teavm.test.incremental>
|
<teavm.test.incremental>false</teavm.test.incremental>
|
||||||
<teavm.test.threads>1</teavm.test.threads>
|
<teavm.test.threads>1</teavm.test.threads>
|
||||||
|
@ -337,6 +338,13 @@
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||||
<version>${maven-checkstyle-plugin.version}</version>
|
<version>${maven-checkstyle-plugin.version}</version>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.puppycrawl.tools</groupId>
|
||||||
|
<artifactId>checkstyle</artifactId>
|
||||||
|
<version>${checkstyle.version}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>validate</id>
|
<id>validate</id>
|
||||||
|
|
|
@ -22,7 +22,6 @@ import static org.junit.Assert.fail;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.net.URLDecoder;
|
import java.net.URLDecoder;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.teavm.junit.TeaVMTestRunner;
|
import org.teavm.junit.TeaVMTestRunner;
|
||||||
|
|
|
@ -21,7 +21,6 @@ import static org.junit.Assert.fail;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.net.URLDecoder;
|
import java.net.URLDecoder;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.teavm.junit.TeaVMTestRunner;
|
import org.teavm.junit.TeaVMTestRunner;
|
||||||
|
|
|
@ -48,12 +48,10 @@ package org.teavm.classlib.java.time;
|
||||||
|
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
import static org.testng.Assert.fail;
|
import static org.testng.Assert.fail;
|
||||||
|
|
||||||
import java.time.DateTimeException;
|
import java.time.DateTimeException;
|
||||||
import java.time.temporal.TemporalAccessor;
|
import java.time.temporal.TemporalAccessor;
|
||||||
import java.time.temporal.TemporalField;
|
import java.time.temporal.TemporalField;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -47,7 +47,6 @@
|
||||||
package org.teavm.classlib.java.time;
|
package org.teavm.classlib.java.time;
|
||||||
|
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
|
|
||||||
import java.time.Clock;
|
import java.time.Clock;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
|
|
|
@ -48,7 +48,6 @@ package org.teavm.classlib.java.time;
|
||||||
|
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
import static org.testng.Assert.assertSame;
|
import static org.testng.Assert.assertSame;
|
||||||
|
|
||||||
import java.time.Clock;
|
import java.time.Clock;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
|
@ -48,7 +48,6 @@ package org.teavm.classlib.java.time;
|
||||||
|
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
import static org.testng.Assert.assertSame;
|
import static org.testng.Assert.assertSame;
|
||||||
|
|
||||||
import java.time.Clock;
|
import java.time.Clock;
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
|
|
|
@ -49,7 +49,6 @@ package org.teavm.classlib.java.time;
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
import static org.testng.Assert.assertSame;
|
import static org.testng.Assert.assertSame;
|
||||||
import static org.testng.Assert.fail;
|
import static org.testng.Assert.fail;
|
||||||
|
|
||||||
import java.time.Clock;
|
import java.time.Clock;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
|
|
|
@ -48,7 +48,6 @@ package org.teavm.classlib.java.time;
|
||||||
|
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
import static org.testng.Assert.assertSame;
|
import static org.testng.Assert.assertSame;
|
||||||
|
|
||||||
import java.time.Clock;
|
import java.time.Clock;
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
|
|
|
@ -47,7 +47,6 @@
|
||||||
package org.teavm.classlib.java.time;
|
package org.teavm.classlib.java.time;
|
||||||
|
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
|
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.teavm.junit.TeaVMTestRunner;
|
import org.teavm.junit.TeaVMTestRunner;
|
||||||
import org.teavm.junit.WholeClassCompilation;
|
import org.teavm.junit.WholeClassCompilation;
|
||||||
|
|
|
@ -52,7 +52,6 @@ import static java.time.DayOfWeek.WEDNESDAY;
|
||||||
import static java.time.temporal.ChronoField.DAY_OF_WEEK;
|
import static java.time.temporal.ChronoField.DAY_OF_WEEK;
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
import static org.testng.Assert.assertSame;
|
import static org.testng.Assert.assertSame;
|
||||||
|
|
||||||
import java.time.DateTimeException;
|
import java.time.DateTimeException;
|
||||||
import java.time.DayOfWeek;
|
import java.time.DayOfWeek;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
@ -69,7 +68,6 @@ import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.teavm.junit.TeaVMTestRunner;
|
import org.teavm.junit.TeaVMTestRunner;
|
||||||
import org.teavm.junit.WholeClassCompilation;
|
import org.teavm.junit.WholeClassCompilation;
|
||||||
|
|
|
@ -57,14 +57,12 @@ import static java.time.temporal.ChronoUnit.SECONDS;
|
||||||
import static java.time.temporal.ChronoUnit.WEEKS;
|
import static java.time.temporal.ChronoUnit.WEEKS;
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
import static org.testng.Assert.fail;
|
import static org.testng.Assert.fail;
|
||||||
|
|
||||||
import java.time.DateTimeException;
|
import java.time.DateTimeException;
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.time.format.DateTimeParseException;
|
import java.time.format.DateTimeParseException;
|
||||||
import java.time.temporal.TemporalUnit;
|
import java.time.temporal.TemporalUnit;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.teavm.junit.TeaVMTestRunner;
|
import org.teavm.junit.TeaVMTestRunner;
|
||||||
import org.teavm.junit.WholeClassCompilation;
|
import org.teavm.junit.WholeClassCompilation;
|
||||||
|
@ -900,13 +898,13 @@ public class TestDuration extends AbstractTest {
|
||||||
assertEquals(t.getNano(), expectedNanoOfSecond);
|
assertEquals(t.getNano(), expectedNanoOfSecond);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {ArithmeticException.class})
|
@Test(expectedExceptions = ArithmeticException.class)
|
||||||
public void plusSeconds_long_overflowTooBig() {
|
public void plusSeconds_long_overflowTooBig() {
|
||||||
Duration t = Duration.ofSeconds(1, 0);
|
Duration t = Duration.ofSeconds(1, 0);
|
||||||
t.plusSeconds(Long.MAX_VALUE);
|
t.plusSeconds(Long.MAX_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {ArithmeticException.class})
|
@Test(expectedExceptions = ArithmeticException.class)
|
||||||
public void plusSeconds_long_overflowTooSmall() {
|
public void plusSeconds_long_overflowTooSmall() {
|
||||||
Duration t = Duration.ofSeconds(-1, 0);
|
Duration t = Duration.ofSeconds(-1, 0);
|
||||||
t.plusSeconds(Long.MIN_VALUE);
|
t.plusSeconds(Long.MIN_VALUE);
|
||||||
|
@ -1002,7 +1000,7 @@ public class TestDuration extends AbstractTest {
|
||||||
assertEquals(t.getNano(), 999999999);
|
assertEquals(t.getNano(), 999999999);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {ArithmeticException.class})
|
@Test(expectedExceptions = ArithmeticException.class)
|
||||||
public void plusMillis_long_overflowTooBig() {
|
public void plusMillis_long_overflowTooBig() {
|
||||||
Duration t = Duration.ofSeconds(Long.MAX_VALUE, 999000000);
|
Duration t = Duration.ofSeconds(Long.MAX_VALUE, 999000000);
|
||||||
t.plusMillis(1);
|
t.plusMillis(1);
|
||||||
|
@ -1016,7 +1014,7 @@ public class TestDuration extends AbstractTest {
|
||||||
assertEquals(t.getNano(), 0);
|
assertEquals(t.getNano(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {ArithmeticException.class})
|
@Test(expectedExceptions = ArithmeticException.class)
|
||||||
public void plusMillis_long_overflowTooSmall() {
|
public void plusMillis_long_overflowTooSmall() {
|
||||||
Duration t = Duration.ofSeconds(Long.MIN_VALUE, 0);
|
Duration t = Duration.ofSeconds(Long.MIN_VALUE, 0);
|
||||||
t.plusMillis(-1);
|
t.plusMillis(-1);
|
||||||
|
@ -1106,13 +1104,13 @@ public class TestDuration extends AbstractTest {
|
||||||
assertEquals(t.getNano(), expectedNanoOfSecond);
|
assertEquals(t.getNano(), expectedNanoOfSecond);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {ArithmeticException.class})
|
@Test(expectedExceptions = ArithmeticException.class)
|
||||||
public void plusNanos_long_overflowTooBig() {
|
public void plusNanos_long_overflowTooBig() {
|
||||||
Duration t = Duration.ofSeconds(Long.MAX_VALUE, 999999999);
|
Duration t = Duration.ofSeconds(Long.MAX_VALUE, 999999999);
|
||||||
t.plusNanos(1);
|
t.plusNanos(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {ArithmeticException.class})
|
@Test(expectedExceptions = ArithmeticException.class)
|
||||||
public void plusNanos_long_overflowTooSmall() {
|
public void plusNanos_long_overflowTooSmall() {
|
||||||
Duration t = Duration.ofSeconds(Long.MIN_VALUE, 0);
|
Duration t = Duration.ofSeconds(Long.MIN_VALUE, 0);
|
||||||
t.plusNanos(-1);
|
t.plusNanos(-1);
|
||||||
|
@ -1399,13 +1397,13 @@ public class TestDuration extends AbstractTest {
|
||||||
assertEquals(t.getNano(), expectedNanoOfSecond);
|
assertEquals(t.getNano(), expectedNanoOfSecond);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {ArithmeticException.class})
|
@Test(expectedExceptions = ArithmeticException.class)
|
||||||
public void minusSeconds_long_overflowTooBig() {
|
public void minusSeconds_long_overflowTooBig() {
|
||||||
Duration t = Duration.ofSeconds(1, 0);
|
Duration t = Duration.ofSeconds(1, 0);
|
||||||
t.minusSeconds(Long.MIN_VALUE + 1);
|
t.minusSeconds(Long.MIN_VALUE + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {ArithmeticException.class})
|
@Test(expectedExceptions = ArithmeticException.class)
|
||||||
public void minusSeconds_long_overflowTooSmall() {
|
public void minusSeconds_long_overflowTooSmall() {
|
||||||
Duration t = Duration.ofSeconds(-2, 0);
|
Duration t = Duration.ofSeconds(-2, 0);
|
||||||
t.minusSeconds(Long.MAX_VALUE);
|
t.minusSeconds(Long.MAX_VALUE);
|
||||||
|
@ -1501,7 +1499,7 @@ public class TestDuration extends AbstractTest {
|
||||||
assertEquals(t.getNano(), 999999999);
|
assertEquals(t.getNano(), 999999999);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {ArithmeticException.class})
|
@Test(expectedExceptions = ArithmeticException.class)
|
||||||
public void minusMillis_long_overflowTooBig() {
|
public void minusMillis_long_overflowTooBig() {
|
||||||
Duration t = Duration.ofSeconds(Long.MAX_VALUE, 999000000);
|
Duration t = Duration.ofSeconds(Long.MAX_VALUE, 999000000);
|
||||||
t.minusMillis(-1);
|
t.minusMillis(-1);
|
||||||
|
@ -1515,7 +1513,7 @@ public class TestDuration extends AbstractTest {
|
||||||
assertEquals(t.getNano(), 0);
|
assertEquals(t.getNano(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {ArithmeticException.class})
|
@Test(expectedExceptions = ArithmeticException.class)
|
||||||
public void minusMillis_long_overflowTooSmall() {
|
public void minusMillis_long_overflowTooSmall() {
|
||||||
Duration t = Duration.ofSeconds(Long.MIN_VALUE, 0);
|
Duration t = Duration.ofSeconds(Long.MIN_VALUE, 0);
|
||||||
t.minusMillis(1);
|
t.minusMillis(1);
|
||||||
|
@ -1605,13 +1603,13 @@ public class TestDuration extends AbstractTest {
|
||||||
assertEquals(t.getNano(), expectedNanoOfSecond);
|
assertEquals(t.getNano(), expectedNanoOfSecond);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {ArithmeticException.class})
|
@Test(expectedExceptions = ArithmeticException.class)
|
||||||
public void minusNanos_long_overflowTooBig() {
|
public void minusNanos_long_overflowTooBig() {
|
||||||
Duration t = Duration.ofSeconds(Long.MAX_VALUE, 999999999);
|
Duration t = Duration.ofSeconds(Long.MAX_VALUE, 999999999);
|
||||||
t.minusNanos(-1);
|
t.minusNanos(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {ArithmeticException.class})
|
@Test(expectedExceptions = ArithmeticException.class)
|
||||||
public void minusNanos_long_overflowTooSmall() {
|
public void minusNanos_long_overflowTooSmall() {
|
||||||
Duration t = Duration.ofSeconds(Long.MIN_VALUE, 0);
|
Duration t = Duration.ofSeconds(Long.MIN_VALUE, 0);
|
||||||
t.minusNanos(1);
|
t.minusNanos(1);
|
||||||
|
|
|
@ -1177,13 +1177,13 @@ public class TestInstant extends AbstractDateTimeTest {
|
||||||
assertEquals(i.getNano(), expectedNanoOfSecond);
|
assertEquals(i.getNano(), expectedNanoOfSecond);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {ArithmeticException.class})
|
@Test(expectedExceptions = ArithmeticException.class)
|
||||||
public void minusSeconds_long_overflowTooBig() {
|
public void minusSeconds_long_overflowTooBig() {
|
||||||
Instant i = Instant.ofEpochSecond(1, 0);
|
Instant i = Instant.ofEpochSecond(1, 0);
|
||||||
i.minusSeconds(Long.MIN_VALUE + 1);
|
i.minusSeconds(Long.MIN_VALUE + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {ArithmeticException.class})
|
@Test(expectedExceptions = ArithmeticException.class)
|
||||||
public void minusSeconds_long_overflowTooSmall() {
|
public void minusSeconds_long_overflowTooSmall() {
|
||||||
Instant i = Instant.ofEpochSecond(-2, 0);
|
Instant i = Instant.ofEpochSecond(-2, 0);
|
||||||
i.minusSeconds(Long.MAX_VALUE);
|
i.minusSeconds(Long.MAX_VALUE);
|
||||||
|
|
|
@ -521,7 +521,7 @@ public class TestLocalDate extends AbstractDateTimeTest {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(dataProvider = "sampleBadParse", expectedExceptions = {DateTimeParseException.class})
|
@Test(dataProvider = "sampleBadParse", expectedExceptions = DateTimeParseException.class)
|
||||||
public void factory_parse_invalidText(String unparsable) {
|
public void factory_parse_invalidText(String unparsable) {
|
||||||
LocalDate.parse(unparsable);
|
LocalDate.parse(unparsable);
|
||||||
}
|
}
|
||||||
|
@ -1069,7 +1069,7 @@ public class TestLocalDate extends AbstractDateTimeTest {
|
||||||
assertEquals(test, LocalDate.of((int) (-40L + months / 12), 6 + (int) (months % 12), 1));
|
assertEquals(test, LocalDate.of((int) (-40L + months / 12), 6 + (int) (months % 12), 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {DateTimeException.class})
|
@Test(expectedExceptions = DateTimeException.class)
|
||||||
public void test_plusMonths_long_invalidTooLarge() {
|
public void test_plusMonths_long_invalidTooLarge() {
|
||||||
LocalDate.of(Year.MAX_VALUE, 12, 1).plusMonths(1);
|
LocalDate.of(Year.MAX_VALUE, 12, 1).plusMonths(1);
|
||||||
}
|
}
|
||||||
|
@ -1086,7 +1086,7 @@ public class TestLocalDate extends AbstractDateTimeTest {
|
||||||
test.plusMonths(Long.MIN_VALUE);
|
test.plusMonths(Long.MIN_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {DateTimeException.class})
|
@Test(expectedExceptions = DateTimeException.class)
|
||||||
public void test_plusMonths_long_invalidTooSmall() {
|
public void test_plusMonths_long_invalidTooSmall() {
|
||||||
LocalDate.of(Year.MIN_VALUE, 1, 1).plusMonths(-1);
|
LocalDate.of(Year.MIN_VALUE, 1, 1).plusMonths(-1);
|
||||||
}
|
}
|
||||||
|
@ -1147,22 +1147,22 @@ public class TestLocalDate extends AbstractDateTimeTest {
|
||||||
assertEquals(t, expected);
|
assertEquals(t, expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {DateTimeException.class})
|
@Test(expectedExceptions = DateTimeException.class)
|
||||||
public void test_plusWeeks_invalidTooLarge() {
|
public void test_plusWeeks_invalidTooLarge() {
|
||||||
LocalDate.of(Year.MAX_VALUE, 12, 25).plusWeeks(1);
|
LocalDate.of(Year.MAX_VALUE, 12, 25).plusWeeks(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {DateTimeException.class})
|
@Test(expectedExceptions = DateTimeException.class)
|
||||||
public void test_plusWeeks_invalidTooSmall() {
|
public void test_plusWeeks_invalidTooSmall() {
|
||||||
LocalDate.of(Year.MIN_VALUE, 1, 7).plusWeeks(-1);
|
LocalDate.of(Year.MIN_VALUE, 1, 7).plusWeeks(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {ArithmeticException.class})
|
@Test(expectedExceptions = ArithmeticException.class)
|
||||||
public void test_plusWeeks_invalidMaxMinusMax() {
|
public void test_plusWeeks_invalidMaxMinusMax() {
|
||||||
LocalDate.of(Year.MAX_VALUE, 12, 25).plusWeeks(Long.MAX_VALUE);
|
LocalDate.of(Year.MAX_VALUE, 12, 25).plusWeeks(Long.MAX_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {ArithmeticException.class})
|
@Test(expectedExceptions = ArithmeticException.class)
|
||||||
public void test_plusWeeks_invalidMaxMinusMin() {
|
public void test_plusWeeks_invalidMaxMinusMin() {
|
||||||
LocalDate.of(Year.MAX_VALUE, 12, 25).plusWeeks(Long.MIN_VALUE);
|
LocalDate.of(Year.MAX_VALUE, 12, 25).plusWeeks(Long.MIN_VALUE);
|
||||||
}
|
}
|
||||||
|
@ -1223,12 +1223,12 @@ public class TestLocalDate extends AbstractDateTimeTest {
|
||||||
assertEquals(t, expected);
|
assertEquals(t, expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {DateTimeException.class})
|
@Test(expectedExceptions = DateTimeException.class)
|
||||||
public void test_plusDays_invalidTooLarge() {
|
public void test_plusDays_invalidTooLarge() {
|
||||||
LocalDate.of(Year.MAX_VALUE, 12, 31).plusDays(1);
|
LocalDate.of(Year.MAX_VALUE, 12, 31).plusDays(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {DateTimeException.class})
|
@Test(expectedExceptions = DateTimeException.class)
|
||||||
public void test_plusDays_invalidTooSmall() {
|
public void test_plusDays_invalidTooSmall() {
|
||||||
LocalDate.of(Year.MIN_VALUE, 1, 1).plusDays(-1);
|
LocalDate.of(Year.MIN_VALUE, 1, 1).plusDays(-1);
|
||||||
}
|
}
|
||||||
|
@ -1424,7 +1424,7 @@ public class TestLocalDate extends AbstractDateTimeTest {
|
||||||
assertEquals(test, LocalDate.of((int) (40L - months / 12), 6 - (int) (months % 12), 1));
|
assertEquals(test, LocalDate.of((int) (40L - months / 12), 6 - (int) (months % 12), 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {DateTimeException.class})
|
@Test(expectedExceptions = DateTimeException.class)
|
||||||
public void test_minusMonths_long_invalidTooLarge() {
|
public void test_minusMonths_long_invalidTooLarge() {
|
||||||
LocalDate.of(Year.MAX_VALUE, 12, 1).minusMonths(-1);
|
LocalDate.of(Year.MAX_VALUE, 12, 1).minusMonths(-1);
|
||||||
}
|
}
|
||||||
|
@ -1441,7 +1441,7 @@ public class TestLocalDate extends AbstractDateTimeTest {
|
||||||
test.minusMonths(Long.MIN_VALUE);
|
test.minusMonths(Long.MIN_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {DateTimeException.class})
|
@Test(expectedExceptions = DateTimeException.class)
|
||||||
public void test_minusMonths_long_invalidTooSmall() {
|
public void test_minusMonths_long_invalidTooSmall() {
|
||||||
LocalDate.of(Year.MIN_VALUE, 1, 1).minusMonths(1);
|
LocalDate.of(Year.MIN_VALUE, 1, 1).minusMonths(1);
|
||||||
}
|
}
|
||||||
|
@ -1502,22 +1502,22 @@ public class TestLocalDate extends AbstractDateTimeTest {
|
||||||
assertEquals(t, expected);
|
assertEquals(t, expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {DateTimeException.class})
|
@Test(expectedExceptions = DateTimeException.class)
|
||||||
public void test_minusWeeks_invalidTooLarge() {
|
public void test_minusWeeks_invalidTooLarge() {
|
||||||
LocalDate.of(Year.MAX_VALUE, 12, 25).minusWeeks(-1);
|
LocalDate.of(Year.MAX_VALUE, 12, 25).minusWeeks(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {DateTimeException.class})
|
@Test(expectedExceptions = DateTimeException.class)
|
||||||
public void test_minusWeeks_invalidTooSmall() {
|
public void test_minusWeeks_invalidTooSmall() {
|
||||||
LocalDate.of(Year.MIN_VALUE, 1, 7).minusWeeks(1);
|
LocalDate.of(Year.MIN_VALUE, 1, 7).minusWeeks(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {ArithmeticException.class})
|
@Test(expectedExceptions = ArithmeticException.class)
|
||||||
public void test_minusWeeks_invalidMaxMinusMax() {
|
public void test_minusWeeks_invalidMaxMinusMax() {
|
||||||
LocalDate.of(Year.MAX_VALUE, 12, 25).minusWeeks(Long.MAX_VALUE);
|
LocalDate.of(Year.MAX_VALUE, 12, 25).minusWeeks(Long.MAX_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {ArithmeticException.class})
|
@Test(expectedExceptions = ArithmeticException.class)
|
||||||
public void test_minusWeeks_invalidMaxMinusMin() {
|
public void test_minusWeeks_invalidMaxMinusMin() {
|
||||||
LocalDate.of(Year.MAX_VALUE, 12, 25).minusWeeks(Long.MIN_VALUE);
|
LocalDate.of(Year.MAX_VALUE, 12, 25).minusWeeks(Long.MIN_VALUE);
|
||||||
}
|
}
|
||||||
|
@ -1578,12 +1578,12 @@ public class TestLocalDate extends AbstractDateTimeTest {
|
||||||
assertEquals(t, expected);
|
assertEquals(t, expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {DateTimeException.class})
|
@Test(expectedExceptions = DateTimeException.class)
|
||||||
public void test_minusDays_invalidTooLarge() {
|
public void test_minusDays_invalidTooLarge() {
|
||||||
LocalDate.of(Year.MAX_VALUE, 12, 31).minusDays(-1);
|
LocalDate.of(Year.MAX_VALUE, 12, 31).minusDays(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {DateTimeException.class})
|
@Test(expectedExceptions = DateTimeException.class)
|
||||||
public void test_minusDays_invalidTooSmall() {
|
public void test_minusDays_invalidTooSmall() {
|
||||||
LocalDate.of(Year.MIN_VALUE, 1, 1).minusDays(1);
|
LocalDate.of(Year.MIN_VALUE, 1, 1).minusDays(1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -516,7 +516,7 @@ public class TestLocalTime extends AbstractDateTimeTest {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(dataProvider = "sampleBadParse", expectedExceptions = {DateTimeParseException.class})
|
@Test(dataProvider = "sampleBadParse", expectedExceptions = DateTimeParseException.class)
|
||||||
public void factory_parse_invalidText(String unparsable) {
|
public void factory_parse_invalidText(String unparsable) {
|
||||||
LocalTime.parse(unparsable);
|
LocalTime.parse(unparsable);
|
||||||
}
|
}
|
||||||
|
@ -538,7 +538,7 @@ public class TestLocalTime extends AbstractDateTimeTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------s
|
//-----------------------------------------------------------------------s
|
||||||
@Test(expectedExceptions = {NullPointerException.class})
|
@Test(expectedExceptions = NullPointerException.class)
|
||||||
public void factory_parse_nullTest() {
|
public void factory_parse_nullTest() {
|
||||||
LocalTime.parse(null);
|
LocalTime.parse(null);
|
||||||
}
|
}
|
||||||
|
@ -961,7 +961,7 @@ public class TestLocalTime extends AbstractDateTimeTest {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(groups = {"tck"}, dataProvider = "truncatedToValid")
|
@Test(groups = "tck", dataProvider = "truncatedToValid")
|
||||||
public void test_truncatedTo_valid(LocalTime input, TemporalUnit unit, LocalTime expected) {
|
public void test_truncatedTo_valid(LocalTime input, TemporalUnit unit, LocalTime expected) {
|
||||||
assertEquals(input.truncatedTo(unit), expected);
|
assertEquals(input.truncatedTo(unit), expected);
|
||||||
}
|
}
|
||||||
|
@ -976,12 +976,12 @@ public class TestLocalTime extends AbstractDateTimeTest {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(groups = {"tck"}, dataProvider = "truncatedToInvalid", expectedExceptions = DateTimeException.class)
|
@Test(groups = "tck", dataProvider = "truncatedToInvalid", expectedExceptions = DateTimeException.class)
|
||||||
public void test_truncatedTo_invalid(LocalTime input, TemporalUnit unit) {
|
public void test_truncatedTo_invalid(LocalTime input, TemporalUnit unit) {
|
||||||
input.truncatedTo(unit);
|
input.truncatedTo(unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = NullPointerException.class, groups = {"tck"})
|
@Test(expectedExceptions = NullPointerException.class, groups = "tck")
|
||||||
public void test_truncatedTo_null() {
|
public void test_truncatedTo_null() {
|
||||||
test12x30x40x987654321.truncatedTo(null);
|
test12x30x40x987654321.truncatedTo(null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,6 @@
|
||||||
package org.teavm.classlib.java.time;
|
package org.teavm.classlib.java.time;
|
||||||
|
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
|
|
||||||
import java.time.DateTimeException;
|
import java.time.DateTimeException;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
|
|
@ -406,23 +406,23 @@ public class TestOffsetTime extends AbstractDateTimeTest {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(dataProvider = "sampleBadParse", expectedExceptions = {DateTimeParseException.class})
|
@Test(dataProvider = "sampleBadParse", expectedExceptions = DateTimeParseException.class)
|
||||||
public void factory_parse_invalidText(String unparsable) {
|
public void factory_parse_invalidText(String unparsable) {
|
||||||
OffsetTime.parse(unparsable);
|
OffsetTime.parse(unparsable);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------s
|
//-----------------------------------------------------------------------s
|
||||||
@Test(expectedExceptions = {DateTimeParseException.class})
|
@Test(expectedExceptions = DateTimeParseException.class)
|
||||||
public void factory_parse_illegalHour() {
|
public void factory_parse_illegalHour() {
|
||||||
OffsetTime.parse("25:00+01:00");
|
OffsetTime.parse("25:00+01:00");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {DateTimeParseException.class})
|
@Test(expectedExceptions = DateTimeParseException.class)
|
||||||
public void factory_parse_illegalMinute() {
|
public void factory_parse_illegalMinute() {
|
||||||
OffsetTime.parse("12:60+01:00");
|
OffsetTime.parse("12:60+01:00");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {DateTimeParseException.class})
|
@Test(expectedExceptions = DateTimeParseException.class)
|
||||||
public void factory_parse_illegalSecond() {
|
public void factory_parse_illegalSecond() {
|
||||||
OffsetTime.parse("12:12:60+01:00");
|
OffsetTime.parse("12:12:60+01:00");
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,6 @@ package org.teavm.classlib.java.time;
|
||||||
|
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
import static org.testng.Assert.assertSame;
|
import static org.testng.Assert.assertSame;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.Period;
|
import java.time.Period;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
|
@ -47,11 +47,9 @@
|
||||||
package org.teavm.classlib.java.time.format;
|
package org.teavm.classlib.java.time.format;
|
||||||
|
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
|
|
||||||
import java.time.format.DecimalStyle;
|
import java.time.format.DecimalStyle;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.teavm.junit.TeaVMProperties;
|
import org.teavm.junit.TeaVMProperties;
|
||||||
import org.teavm.junit.TeaVMProperty;
|
import org.teavm.junit.TeaVMProperty;
|
||||||
|
|
|
@ -48,7 +48,6 @@ package org.teavm.classlib.java.time.temporal;
|
||||||
|
|
||||||
import static java.time.temporal.ChronoUnit.MONTHS;
|
import static java.time.temporal.ChronoUnit.MONTHS;
|
||||||
import static java.time.temporal.ChronoUnit.WEEKS;
|
import static java.time.temporal.ChronoUnit.WEEKS;
|
||||||
|
|
||||||
import java.time.DateTimeException;
|
import java.time.DateTimeException;
|
||||||
import java.time.format.ResolverStyle;
|
import java.time.format.ResolverStyle;
|
||||||
import java.time.temporal.Temporal;
|
import java.time.temporal.Temporal;
|
||||||
|
|
|
@ -47,7 +47,6 @@
|
||||||
package org.teavm.classlib.java.time.temporal;
|
package org.teavm.classlib.java.time.temporal;
|
||||||
|
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
|
|
||||||
import java.time.temporal.ChronoField;
|
import java.time.temporal.ChronoField;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.teavm.junit.TeaVMTestRunner;
|
import org.teavm.junit.TeaVMTestRunner;
|
||||||
|
|
|
@ -47,7 +47,6 @@
|
||||||
package org.teavm.classlib.java.time.temporal;
|
package org.teavm.classlib.java.time.temporal;
|
||||||
|
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.temporal.ChronoField;
|
import java.time.temporal.ChronoField;
|
||||||
import java.time.temporal.JulianFields;
|
import java.time.temporal.JulianFields;
|
||||||
|
|
|
@ -47,7 +47,6 @@
|
||||||
package org.teavm.classlib.java.time.temporal;
|
package org.teavm.classlib.java.time.temporal;
|
||||||
|
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
|
|
||||||
import java.time.temporal.ValueRange;
|
import java.time.temporal.ValueRange;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.teavm.classlib.java.time.AbstractTest;
|
import org.teavm.classlib.java.time.AbstractTest;
|
||||||
|
|
|
@ -622,7 +622,7 @@ public class TestYearMonth extends AbstractDateTimeTest {
|
||||||
assertEquals(test.plusMonths(months), YearMonth.of((int) (-40L + months / 12), 6 + (int) (months % 12)));
|
assertEquals(test.plusMonths(months), YearMonth.of((int) (-40L + months / 12), 6 + (int) (months % 12)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {DateTimeException.class})
|
@Test(expectedExceptions = DateTimeException.class)
|
||||||
public void test_plusMonths_long_invalidTooLarge() {
|
public void test_plusMonths_long_invalidTooLarge() {
|
||||||
YearMonth test = YearMonth.of(Year.MAX_VALUE, 12);
|
YearMonth test = YearMonth.of(Year.MAX_VALUE, 12);
|
||||||
test.plusMonths(1);
|
test.plusMonths(1);
|
||||||
|
@ -640,7 +640,7 @@ public class TestYearMonth extends AbstractDateTimeTest {
|
||||||
test.plusMonths(Long.MIN_VALUE);
|
test.plusMonths(Long.MIN_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {DateTimeException.class})
|
@Test(expectedExceptions = DateTimeException.class)
|
||||||
public void test_plusMonths_long_invalidTooSmall() {
|
public void test_plusMonths_long_invalidTooSmall() {
|
||||||
YearMonth test = YearMonth.of(Year.MIN_VALUE, 1);
|
YearMonth test = YearMonth.of(Year.MIN_VALUE, 1);
|
||||||
test.plusMonths(-1);
|
test.plusMonths(-1);
|
||||||
|
@ -737,7 +737,7 @@ public class TestYearMonth extends AbstractDateTimeTest {
|
||||||
assertEquals(test.minusMonths(months), YearMonth.of((int) (40L - months / 12), 6 - (int) (months % 12)));
|
assertEquals(test.minusMonths(months), YearMonth.of((int) (40L - months / 12), 6 - (int) (months % 12)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {DateTimeException.class})
|
@Test(expectedExceptions = DateTimeException.class)
|
||||||
public void test_minusMonths_long_invalidTooLarge() {
|
public void test_minusMonths_long_invalidTooLarge() {
|
||||||
YearMonth test = YearMonth.of(Year.MAX_VALUE, 12);
|
YearMonth test = YearMonth.of(Year.MAX_VALUE, 12);
|
||||||
test.minusMonths(-1);
|
test.minusMonths(-1);
|
||||||
|
@ -755,7 +755,7 @@ public class TestYearMonth extends AbstractDateTimeTest {
|
||||||
test.minusMonths(Long.MIN_VALUE);
|
test.minusMonths(Long.MIN_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = {DateTimeException.class})
|
@Test(expectedExceptions = DateTimeException.class)
|
||||||
public void test_minusMonths_long_invalidTooSmall() {
|
public void test_minusMonths_long_invalidTooSmall() {
|
||||||
YearMonth test = YearMonth.of(Year.MIN_VALUE, 1);
|
YearMonth test = YearMonth.of(Year.MIN_VALUE, 1);
|
||||||
test.minusMonths(1);
|
test.minusMonths(1);
|
||||||
|
|
|
@ -47,7 +47,6 @@
|
||||||
package org.teavm.classlib.java.time.zone;
|
package org.teavm.classlib.java.time.zone;
|
||||||
|
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
|
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
|
@ -788,7 +788,7 @@ public class HashtableTest {
|
||||||
ht10.put("Key" + i, "Val" + i);
|
ht10.put("Key" + i, "Val" + i);
|
||||||
}
|
}
|
||||||
|
|
||||||
String newVal = ht10.computeIfAbsent("absent key", (k) -> "added");
|
String newVal = ht10.computeIfAbsent("absent key", k -> "added");
|
||||||
assertEquals("added", newVal);
|
assertEquals("added", newVal);
|
||||||
assertEquals(11, ht10.size());
|
assertEquals(11, ht10.size());
|
||||||
|
|
||||||
|
@ -805,7 +805,7 @@ public class HashtableTest {
|
||||||
ht10.put("Key" + i, "Val" + i);
|
ht10.put("Key" + i, "Val" + i);
|
||||||
}
|
}
|
||||||
|
|
||||||
String newVal = ht10.computeIfAbsent("Key5", (v) -> "changed");
|
String newVal = ht10.computeIfAbsent("Key5", v -> "changed");
|
||||||
assertEquals("Val5", newVal);
|
assertEquals("Val5", newVal);
|
||||||
assertEquals(10, ht10.size());
|
assertEquals(10, ht10.size());
|
||||||
|
|
||||||
|
@ -821,7 +821,7 @@ public class HashtableTest {
|
||||||
ht10.put("Key" + i, "Val" + i);
|
ht10.put("Key" + i, "Val" + i);
|
||||||
}
|
}
|
||||||
|
|
||||||
String newVal = ht10.computeIfAbsent("absent key", (v) -> null);
|
String newVal = ht10.computeIfAbsent("absent key", v -> null);
|
||||||
assertEquals(null, newVal);
|
assertEquals(null, newVal);
|
||||||
assertEquals(10, ht10.size());
|
assertEquals(10, ht10.size());
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,6 @@ import static org.junit.Assert.assertArrayEquals;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -27,7 +26,6 @@ import java.util.Spliterator;
|
||||||
import java.util.Spliterators;
|
import java.util.Spliterators;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
import java.util.function.IntConsumer;
|
import java.util.function.IntConsumer;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.teavm.junit.TeaVMTestRunner;
|
import org.teavm.junit.TeaVMTestRunner;
|
||||||
|
|
|
@ -45,7 +45,7 @@ public class ImplementationTest {
|
||||||
assertEquals(1, instance.counter);
|
assertEquals(1, instance.counter);
|
||||||
}
|
}
|
||||||
|
|
||||||
@JSBody(params = { "a" }, script = "console.log(a, a);")
|
@JSBody(params = "a", script = "console.log(a, a);")
|
||||||
private static native void wrongInlineCandidate(JSObject a);
|
private static native void wrongInlineCandidate(JSObject a);
|
||||||
|
|
||||||
static class ForInliningTest implements JSObject {
|
static class ForInliningTest implements JSObject {
|
||||||
|
|
|
@ -36,7 +36,7 @@ public class JavaInvocationTest {
|
||||||
assertEquals(7, Num.create(5).add(Num.create(2)).value());
|
assertEquals(7, Num.create(5).add(Num.create(2)).value());
|
||||||
}
|
}
|
||||||
|
|
||||||
@JSBody(params = { "a" }, script = "return javaMethods.get('org.teavm.jso.test.JavaInvocationTest.sum(II)I')"
|
@JSBody(params = "a", script = "return javaMethods.get('org.teavm.jso.test.JavaInvocationTest.sum(II)I')"
|
||||||
+ ".invoke(a, 2);")
|
+ ".invoke(a, 2);")
|
||||||
private static native int staticInvocation(int a);
|
private static native int staticInvocation(int a);
|
||||||
|
|
||||||
|
|
|
@ -243,6 +243,7 @@ public class BrowserRunStrategy implements TestRunStrategy {
|
||||||
resp.getOutputStream().flush();
|
resp.getOutputStream().flush();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case "/client.js":
|
case "/client.js":
|
||||||
case "/frame.js":
|
case "/frame.js":
|
||||||
|
@ -255,6 +256,7 @@ public class BrowserRunStrategy implements TestRunStrategy {
|
||||||
resp.getOutputStream().flush();
|
resp.getOutputStream().flush();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (path.startsWith("/tests/")) {
|
if (path.startsWith("/tests/")) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user