2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.automation.jsscriptingnashorn;
15 import static org.hamcrest.CoreMatchers.is;
16 import static org.hamcrest.MatcherAssert.assertThat;
17 import static org.hamcrest.Matchers.contains;
19 import java.util.List;
21 import org.eclipse.jdt.annotation.NonNullByDefault;
22 import org.junit.jupiter.api.Test;
23 import org.openhab.automation.jsscriptingnashorn.internal.NashornScriptEngineFactory;
26 * Tests {@link NashornScriptEngineFactory}.
28 * @author Wouter Born - Initial contribution
31 public class NashornScriptEngineFactoryTest {
34 public void scriptTypesAreNashornSpecific() {
35 List<String> scriptTypes = new NashornScriptEngineFactory().getScriptTypes();
37 assertThat(scriptTypes,
38 contains("nashornjs", "application/javascript;version=ECMAScript-5.1",
39 "application/ecmascript;version=ECMAScript-5.1", "text/javascript;version=ECMAScript-5.1",
40 "text/ecmascript;version=ECMAScript-5.1"));
41 assertThat(scriptTypes.size(), is(5));