summaryrefslogtreecommitdiff
path: root/examples/scala-js/test-suite/src/test/scala/scala/scalajs/testsuite/javalib/ThrowablesTest.scala
blob: 7e53975aa6d725f0b847a8b296fde8a0c8645b3b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*                     __                                               *\
**     ________ ___   / /  ___      __ ____  Scala.js Test Suite        **
**    / __/ __// _ | / /  / _ | __ / // __/  (c) 2013, LAMP/EPFL        **
**  __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \    http://scala-js.org/       **
** /____/\___/_/ |_/____/_/ | |__/ /____/                               **
**                          |/____/                                     **
\*                                                                      */
package scala.scalajs.testsuite.javalib

import org.scalajs.jasminetest.JasmineTest

object ThrowablesTest extends JasmineTest {
  describe("java.lang.Throwables, java.util.Throwables") {

    it("should define all java.lang and java.util Errors/Exceptions") {
      new ArithmeticException()
      new ArrayIndexOutOfBoundsException()
      new ArrayStoreException()
      new ClassCastException()
      new ClassNotFoundException()
      new CloneNotSupportedException()
      // Needs an instance of java.lang.Enum.
      // import scala.language.existentials
      // new EnumConstantNotPresentException(null.asInstanceOf[Class[_ <: Enum[T] forSome { type T <: Enum[T] }]], null)
      new Exception()
      new IllegalAccessException()
      new IllegalArgumentException()
      new IllegalMonitorStateException()
      new IllegalStateException()
      new IllegalThreadStateException()
      new IndexOutOfBoundsException()
      new InstantiationException()
      new InterruptedException()
      new NegativeArraySizeException()
      new NoSuchFieldException()
      new NoSuchMethodException()
      new NullPointerException()
      new NumberFormatException()
      new RuntimeException()
      new SecurityException()
      new StringIndexOutOfBoundsException()
      new TypeNotPresentException(null, null)
      new UnsupportedOperationException()
      new AbstractMethodError()
      new AssertionError()
      new ClassCircularityError()
      new ClassFormatError()
      new Error()
      new ExceptionInInitializerError()
      new IllegalAccessError()
      new IncompatibleClassChangeError()
      new InstantiationError()
      new InternalError()
      new LinkageError()
      new NoClassDefFoundError()
      new NoSuchFieldError()
      new NoSuchMethodError()
      new OutOfMemoryError()
      new StackOverflowError()
      new UnknownError()
      new UnsatisfiedLinkError()
      new UnsupportedClassVersionError()
      new VerifyError()
      new VirtualMachineError() {}

      import java.util._
      new ServiceConfigurationError("")
      new ConcurrentModificationException()
      new DuplicateFormatFlagsException("")
      new EmptyStackException()
      new FormatFlagsConversionMismatchException("", '\u0000')
      new FormatterClosedException()
      new IllegalFormatCodePointException(0)
      new IllegalFormatConversionException('\u0000', new Object().getClass)
      new IllegalFormatFlagsException("")
      new IllegalFormatPrecisionException(0)
      new IllegalFormatWidthException(0)
      new InputMismatchException()
      // Needs java.io.IOException.
      // new InvalidPropertiesFormatException("")
      new MissingFormatArgumentException("")
      new MissingFormatWidthException("")
      new MissingResourceException(null, null, null)
      new NoSuchElementException()
      new TooManyListenersException()
      new UnknownFormatConversionException("")
      new UnknownFormatFlagsException("")
    }
  }
}