Return-Path: X-Original-To: apmail-felix-commits-archive@www.apache.org Delivered-To: apmail-felix-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 73CE4184A4 for ; Mon, 30 Nov 2015 09:00:45 +0000 (UTC) Received: (qmail 43808 invoked by uid 500); 30 Nov 2015 09:00:45 -0000 Delivered-To: apmail-felix-commits-archive@felix.apache.org Received: (qmail 43763 invoked by uid 500); 30 Nov 2015 09:00:45 -0000 Mailing-List: contact commits-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list commits@felix.apache.org Received: (qmail 43754 invoked by uid 99); 30 Nov 2015 09:00:45 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Nov 2015 09:00:45 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id DF3E6C0472 for ; Mon, 30 Nov 2015 09:00:44 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.246 X-Spam-Level: * X-Spam-Status: No, score=1.246 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-0.554] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id vH5Jp6Tp7ol6 for ; Mon, 30 Nov 2015 09:00:43 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTP id C59E020DD2 for ; Mon, 30 Nov 2015 09:00:42 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id CE4D5E02E7 for ; Mon, 30 Nov 2015 09:00:41 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id C79073A0234 for ; Mon, 30 Nov 2015 09:00:41 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1717205 - in /felix/trunk/webconsole-plugins/script-console/src/test/java/org/apache/felix/webconsole/plugins/scriptconsole/internal: ./ ScriptEngineManagerTest.java Date: Mon, 30 Nov 2015 09:00:41 -0000 To: commits@felix.apache.org From: chetanm@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20151130090041.C79073A0234@svn01-us-west.apache.org> Author: chetanm Date: Mon Nov 30 09:00:41 2015 New Revision: 1717205 URL: http://svn.apache.org/viewvc?rev=1717205&view=rev Log: FELIX-5120 - ScriptEngineManager not able to parse service file with comments at end of classname Add a failing testcase Added: felix/trunk/webconsole-plugins/script-console/src/test/java/org/apache/felix/webconsole/plugins/scriptconsole/internal/ felix/trunk/webconsole-plugins/script-console/src/test/java/org/apache/felix/webconsole/plugins/scriptconsole/internal/ScriptEngineManagerTest.java (with props) Added: felix/trunk/webconsole-plugins/script-console/src/test/java/org/apache/felix/webconsole/plugins/scriptconsole/internal/ScriptEngineManagerTest.java URL: http://svn.apache.org/viewvc/felix/trunk/webconsole-plugins/script-console/src/test/java/org/apache/felix/webconsole/plugins/scriptconsole/internal/ScriptEngineManagerTest.java?rev=1717205&view=auto ============================================================================== --- felix/trunk/webconsole-plugins/script-console/src/test/java/org/apache/felix/webconsole/plugins/scriptconsole/internal/ScriptEngineManagerTest.java (added) +++ felix/trunk/webconsole-plugins/script-console/src/test/java/org/apache/felix/webconsole/plugins/scriptconsole/internal/ScriptEngineManagerTest.java Mon Nov 30 09:00:41 2015 @@ -0,0 +1,65 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.felix.webconsole.plugins.scriptconsole.internal; + +import java.io.BufferedReader; +import java.io.StringReader; +import java.util.List; + +import org.junit.Ignore; +import org.junit.Test; + +import static java.util.Arrays.asList; +import static org.junit.Assert.assertEquals; + +public class ScriptEngineManagerTest { + + @Test + public void simpleConfig() throws Exception + { + String config = "org.codehaus.groovy.jsr223.GroovyScriptEngineFactory\n"; + List classNames = ScriptEngineManager.getClassNames(new BufferedReader(new StringReader(config))); + assertEquals(asList("org.codehaus.groovy.jsr223.GroovyScriptEngineFactory"),classNames); + } + + @Test + public void configWithComment() throws Exception + { + String config = "#Groovy Script Support\n" + + "\n" + + "org.codehaus.groovy.jsr223.GroovyScriptEngineFactory"; + List classNames = ScriptEngineManager.getClassNames(new BufferedReader(new StringReader(config))); + assertEquals(asList("org.codehaus.groovy.jsr223.GroovyScriptEngineFactory"),classNames); + } + + @Ignore("FELIX-5120") + @Test + public void configWithCommentAtEnd() throws Exception + { + String config = "\n" + + "#script engines supported\n" + + "\n" + + "com.sun.script.javascript.RhinoScriptEngineFactory #javascript\n" + + "\n"; + List classNames = ScriptEngineManager.getClassNames(new BufferedReader(new StringReader(config))); + assertEquals(asList("com.sun.script.javascript.RhinoScriptEngineFactory"),classNames); + + } +} Propchange: felix/trunk/webconsole-plugins/script-console/src/test/java/org/apache/felix/webconsole/plugins/scriptconsole/internal/ScriptEngineManagerTest.java ------------------------------------------------------------------------------ svn:eol-style = native