You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2010/03/28 16:47:50 UTC
svn commit: r928420 - in /myfaces/extensions/scripting/trunk: ./
extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/scripting/api/
extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/scripting/core/util/
extscript-core-...
Author: werpu
Date: Sun Mar 28 14:47:50 2010
New Revision: 928420
URL: http://svn.apache.org/viewvc?rev=928420&view=rev
Log:
http://issues.apache.org/jira/browse/EXTSCRIPT-108
adding additional testcase
Added:
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/extensions/scripting/lifecycle/
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/extensions/scripting/lifecycle/StartupTestCase.java (with props)
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/extensions/scripting/support/
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/extensions/scripting/support/AbstractGeneratorTestCase.java (contents, props changed)
- copied, changed from r928418, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/extensions/scripting/AbstractGeneratorTestCase.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/extensions/scripting/support/MockServletContext.java (with props)
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/resources/webapp/
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/resources/webapp/WEB-INF/
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/resources/webapp/WEB-INF/web.xml (with props)
Removed:
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/extensions/scripting/AbstractGeneratorTestCase.java
Modified:
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/scripting/api/BaseWeaver.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/scripting/core/util/WeavingContext.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/scripting/core/util/WeavingContextInitializer.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/scripting/core/classIdentifier/JavaDynamicClassIdentifierTest.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/scripting/core/classIdentifier/TWeavingContext.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/scripting/sandbox/AbstractJavaCompilerTestCase.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/scripting/sandbox/GroovyCompilerTest.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/scripting/sandbox/ReloadingClassLoaderTest.java
myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/blog/BlogEntry.java
myfaces/extensions/scripting/trunk/pom.xml
Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/scripting/api/BaseWeaver.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/scripting/api/BaseWeaver.java?rev=928420&r1=928419&r2=928420&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/scripting/api/BaseWeaver.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/scripting/api/BaseWeaver.java Sun Mar 28 14:47:50 2010
@@ -93,7 +93,7 @@ public abstract class BaseWeaver impleme
public void appendCustomScriptPath(String scriptPath) {
String normalizedScriptPath = FilenameUtils.normalize(scriptPath);
if (normalizedScriptPath.endsWith(File.separator)) {
- normalizedScriptPath = normalizedScriptPath.substring(0, scriptPath.length() - File.separator.length());
+ normalizedScriptPath = normalizedScriptPath.substring(0, normalizedScriptPath.length() - File.separator.length());
}
WeavingContext.getConfiguration().addSourceDir(getScriptingEngine(), normalizedScriptPath);
Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/scripting/core/util/WeavingContext.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/scripting/core/util/WeavingContext.java?rev=928420&r1=928419&r2=928420&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/scripting/core/util/WeavingContext.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/scripting/core/util/WeavingContext.java Sun Mar 28 14:47:50 2010
@@ -50,7 +50,7 @@ public class WeavingContext {
static class ThreadLocalData {
public Object _weaverHolder;
public Object _refreshContextHolder;
- public Object _configurtion;
+ public Object _configuration;
public Object _externalContext;
}
@@ -310,7 +310,7 @@ public class WeavingContext {
*/
public static void pushThreadingData() {
ThreadLocalData data = new ThreadLocalData();
- data._configurtion = getConfiguration();
+ data._configuration = getConfiguration();
data._refreshContextHolder = getRefreshContext();
data._weaverHolder = getWeaver();
data._externalContext = getExternalContext();
@@ -319,7 +319,7 @@ public class WeavingContext {
public static void popThreadingData() {
ThreadLocalData data = _referenceThreadHolder;
- setConfiguration((Configuration) data._configurtion);
+ setConfiguration((Configuration) data._configuration);
setRefreshContext((RefreshContext) data._refreshContextHolder);
setWeaver(data._weaverHolder);
setExternalContext(data._externalContext);
Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/scripting/core/util/WeavingContextInitializer.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/scripting/core/util/WeavingContextInitializer.java?rev=928420&r1=928419&r2=928420&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/scripting/core/util/WeavingContextInitializer.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/scripting/core/util/WeavingContextInitializer.java Sun Mar 28 14:47:50 2010
@@ -44,7 +44,7 @@ import java.util.logging.Logger;
* @version $Revision$ $Date$
*/
-class WeavingContextInitializer {
+public class WeavingContextInitializer {
static final Logger _logger = Logger.getLogger(WeavingContextInitializer.class.getName());
@@ -55,6 +55,7 @@ class WeavingContextInitializer {
initWeavers(servletContext);
initRefreshContext(servletContext);
initFileChangeDaemon(servletContext);
+ WeavingContext.setExternalContext(servletContext);
}
private static void initFileChangeDaemon(ServletContext servletContext) {
Added: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/extensions/scripting/lifecycle/StartupTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/extensions/scripting/lifecycle/StartupTestCase.java?rev=928420&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/extensions/scripting/lifecycle/StartupTestCase.java (added)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/extensions/scripting/lifecycle/StartupTestCase.java Sun Mar 28 14:47:50 2010
@@ -0,0 +1,62 @@
+/*
+ * 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.myfaces.extensions.scripting.lifecycle;
+
+import org.apache.myfaces.extensions.scripting.support.MockServletContext;
+import org.apache.myfaces.scripting.core.util.WeavingContext;
+import org.apache.myfaces.scripting.core.util.WeavingContextInitializer;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.servlet.ServletContext;
+
+import static org.junit.Assert.*;
+
+/**
+ * Unit tests which should secure the startup cycle
+ *
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+
+public class StartupTestCase {
+ ServletContext context;
+
+ @Before
+ public void init() {
+ context = new MockServletContext();
+ WeavingContextInitializer.initWeavingContext(context);
+ }
+
+ @Test
+ public void testStartup() {
+ assertTrue("Configuration must be reachable", WeavingContext.getConfiguration() != null);
+ assertTrue("RefreshContext must be set", WeavingContext.getRefreshContext() != null);
+ assertTrue("Daemon must be running", WeavingContext.getRefreshContext().getDaemon().isRunning());
+ assertTrue("External context must be reachable", WeavingContext.getExternalContext() == context);
+ }
+
+ @Test
+ public void testConfiguration() {
+ assertTrue("Compile target dir must be set",WeavingContext.getConfiguration().getCompileTarget() != null);
+ assertTrue("Initial compile flag must be set to allow the initial compile",WeavingContext.getConfiguration().isInitialCompile());
+ }
+
+}
Propchange: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/extensions/scripting/lifecycle/StartupTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/extensions/scripting/lifecycle/StartupTestCase.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Copied: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/extensions/scripting/support/AbstractGeneratorTestCase.java (from r928418, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/extensions/scripting/AbstractGeneratorTestCase.java)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/extensions/scripting/support/AbstractGeneratorTestCase.java?p2=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/extensions/scripting/support/AbstractGeneratorTestCase.java&p1=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/extensions/scripting/AbstractGeneratorTestCase.java&r1=928418&r2=928420&rev=928420&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/extensions/scripting/AbstractGeneratorTestCase.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/extensions/scripting/support/AbstractGeneratorTestCase.java Sun Mar 28 14:47:50 2010
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.myfaces.extensions.scripting;
+package org.apache.myfaces.extensions.scripting.support;
import junit.framework.TestCase;
import org.apache.myfaces.scripting.api.CompilationException;
Propchange: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/extensions/scripting/support/AbstractGeneratorTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/extensions/scripting/support/AbstractGeneratorTestCase.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/extensions/scripting/support/MockServletContext.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/extensions/scripting/support/MockServletContext.java?rev=928420&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/extensions/scripting/support/MockServletContext.java (added)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/extensions/scripting/support/MockServletContext.java Sun Mar 28 14:47:50 2010
@@ -0,0 +1,150 @@
+/*
+ * 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.myfaces.extensions.scripting.support;
+
+import javax.servlet.RequestDispatcher;
+import javax.servlet.Servlet;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import java.io.File;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.*;
+
+/**
+ * Basic unit testing servlet context mock
+ *
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+
+public class MockServletContext implements ServletContext {
+
+ Map<String, Object> _attributes = new HashMap<String, Object>();
+ Map<String, String> _initParameters = new HashMap<String, String>();
+ String _resourceRoot = "../../src/test/resources/webapp";
+
+ public void addInitParameter(String key, String value) {
+ _initParameters.put(key, value);
+ }
+
+ public ServletContext getContext(String s) {
+ return this;
+ }
+
+ public int getMajorVersion() {
+ throw new UnsupportedOperationException("getServletContextName()");
+ }
+
+ public int getMinorVersion() {
+ throw new UnsupportedOperationException("getServletContextName()");
+ }
+
+ public String getMimeType(String s) {
+ throw new UnsupportedOperationException("getServletContextName()");
+ }
+
+ public Set getResourcePaths(String s) {
+ HashSet retVal = new HashSet();
+ retVal.add(_resourceRoot);
+ return retVal;
+ }
+
+ public URL getResource(String s) throws MalformedURLException {
+ return (new File(getRealPath(s))).toURI().toURL();
+ }
+
+ public InputStream getResourceAsStream(String s) {
+ throw new UnsupportedOperationException("getServletContextName()");
+ }
+
+ public RequestDispatcher getRequestDispatcher(String s) {
+ throw new UnsupportedOperationException("getServletContextName()");
+ }
+
+ public RequestDispatcher getNamedDispatcher(String s) {
+ throw new UnsupportedOperationException("getServletContextName()");
+ }
+
+ public Servlet getServlet(String s) throws ServletException {
+ throw new UnsupportedOperationException("getServletContextName()");
+ }
+
+ public Enumeration getServlets() {
+ throw new UnsupportedOperationException("getServletContextName()");
+ }
+
+ public Enumeration getServletNames() {
+ throw new UnsupportedOperationException("getServletContextName()");
+ }
+
+ public void log(String s) {
+ throw new UnsupportedOperationException("getServletContextName()");
+ }
+
+ public void log(Exception e, String s) {
+ throw new UnsupportedOperationException("getServletContextName()");
+ }
+
+ public void log(String s, Throwable throwable) {
+ throw new UnsupportedOperationException("getServletContextName()");
+ }
+
+ public String getRealPath(String s) {
+ if (s.startsWith("/") || s.startsWith("\\")) {
+ s = s.substring(1);
+ }
+
+ return Thread.currentThread().getContextClassLoader().getResource("./").getPath() + _resourceRoot + File.separator + s;
+ }
+
+ public String getServerInfo() {
+ throw new UnsupportedOperationException("getServletContextName()");
+ }
+
+ public String getInitParameter(String s) {
+ return _initParameters.get(s);
+ }
+
+ public Enumeration getInitParameterNames() {
+ throw new UnsupportedOperationException("getServletContextName()");
+ }
+
+ public Object getAttribute(String s) {
+ return _attributes.get(s);
+ }
+
+ public Enumeration getAttributeNames() {
+ throw new UnsupportedOperationException("getServletContextName()");
+ }
+
+ public void setAttribute(String s, Object o) {
+ _attributes.put(s, o);
+ }
+
+ public void removeAttribute(String s) {
+ _attributes.remove(s);
+ }
+
+ public String getServletContextName() {
+ throw new UnsupportedOperationException("getServletContextName()");
+ }
+}
Propchange: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/extensions/scripting/support/MockServletContext.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/extensions/scripting/support/MockServletContext.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/scripting/core/classIdentifier/JavaDynamicClassIdentifierTest.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/scripting/core/classIdentifier/JavaDynamicClassIdentifierTest.java?rev=928420&r1=928419&r2=928420&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/scripting/core/classIdentifier/JavaDynamicClassIdentifierTest.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/scripting/core/classIdentifier/JavaDynamicClassIdentifierTest.java Sun Mar 28 14:47:50 2010
@@ -18,19 +18,15 @@
*/
package org.apache.myfaces.scripting.core.classIdentifier;
-import org.junit.Test;
-import org.junit.Before;
-import org.junit.Ignore;
-
-import static org.junit.Assert.*;
-
import org.apache.myfaces.scripting.core.CoreWeaver;
-import org.apache.myfaces.scripting.core.util.ClassUtils;
import org.apache.myfaces.scripting.loaders.java.JavaScriptingWeaver;
+import org.junit.Before;
+import org.junit.Test;
-import java.io.File;
import java.net.URL;
+import static org.junit.Assert.*;
+
/**
* @author werpu
*/
@@ -44,8 +40,10 @@ public class JavaDynamicClassIdentifierT
@Before
public void setUp() {
+
+
+
probe1 = new Probe1();
- //ClassLoader contextLoader = Thread.currentThread().getContextClassLoader();
URL rootPath = this.getClass().getClassLoader().getResource(".");
DynamicClassloader throwAwayClassloader = new DynamicClassloader(this.getClass().getClassLoader(), rootPath.getPath());
@@ -62,8 +60,12 @@ public class JavaDynamicClassIdentifierT
}
@Test
- public void isDynamic() {
+ public void isStatic() {
assertFalse("Class should be static", TWeavingContext.isDynamic(probe1.getClass()));
+ }
+
+ @Test
+ public void isDynamic() {
assertTrue("Class should be dynamic", TWeavingContext.isDynamic(probe2.getClass()));
}
Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/scripting/core/classIdentifier/TWeavingContext.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/scripting/core/classIdentifier/TWeavingContext.java?rev=928420&r1=928419&r2=928420&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/scripting/core/classIdentifier/TWeavingContext.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/scripting/core/classIdentifier/TWeavingContext.java Sun Mar 28 14:47:50 2010
@@ -32,9 +32,9 @@ import org.apache.myfaces.scripting.core
public class TWeavingContext extends WeavingContext {
public static void setWeaverForTesting(Object weaver) {
_weaverHolder.set(weaver);
- if (FileChangedDaemon.getInstance().getWeavers() == null) {
- FileChangedDaemon.getInstance().setWeavers((ScriptingWeaver) weaver);
- }
+ //if (FileChangedDaemon.getInstance().getWeavers() == null) {
+ // FileChangedDaemon.getInstance().setWeavers((ScriptingWeaver) weaver);
+ //}
}
}
Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/scripting/sandbox/AbstractJavaCompilerTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/scripting/sandbox/AbstractJavaCompilerTestCase.java?rev=928420&r1=928419&r2=928420&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/scripting/sandbox/AbstractJavaCompilerTestCase.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/scripting/sandbox/AbstractJavaCompilerTestCase.java Sun Mar 28 14:47:50 2010
@@ -20,7 +20,7 @@ package org.apache.myfaces.scripting.san
import java.io.File;
-import org.apache.myfaces.extensions.scripting.AbstractGeneratorTestCase;
+import org.apache.myfaces.extensions.scripting.support.AbstractGeneratorTestCase;
import org.apache.myfaces.scripting.api.CompilationResult;
import org.apache.myfaces.scripting.sandbox.compiler.Compiler;
import org.junit.Ignore;
Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/scripting/sandbox/GroovyCompilerTest.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/scripting/sandbox/GroovyCompilerTest.java?rev=928420&r1=928419&r2=928420&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/scripting/sandbox/GroovyCompilerTest.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/scripting/sandbox/GroovyCompilerTest.java Sun Mar 28 14:47:50 2010
@@ -18,13 +18,12 @@
*/
package org.apache.myfaces.scripting.sandbox;
-import org.apache.myfaces.extensions.scripting.AbstractGeneratorTestCase;
+import org.apache.myfaces.extensions.scripting.support.AbstractGeneratorTestCase;
import org.apache.myfaces.scripting.api.CompilationResult;
import org.apache.myfaces.scripting.api.Configuration;
import org.apache.myfaces.scripting.core.util.WeavingContext;
import org.apache.myfaces.scripting.sandbox.compiler.*;
import org.apache.myfaces.scripting.sandbox.compiler.Compiler;
-import org.junit.Ignore;
import java.io.File;
Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/scripting/sandbox/ReloadingClassLoaderTest.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/scripting/sandbox/ReloadingClassLoaderTest.java?rev=928420&r1=928419&r2=928420&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/scripting/sandbox/ReloadingClassLoaderTest.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/java/org/apache/myfaces/scripting/sandbox/ReloadingClassLoaderTest.java Sun Mar 28 14:47:50 2010
@@ -18,7 +18,7 @@
*/
package org.apache.myfaces.scripting.sandbox;
-import org.apache.myfaces.extensions.scripting.AbstractGeneratorTestCase;
+import org.apache.myfaces.extensions.scripting.support.AbstractGeneratorTestCase;
import org.apache.myfaces.scripting.sandbox.loader.ReloadingClassLoader;
import org.junit.Ignore;
Added: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/resources/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/resources/webapp/WEB-INF/web.xml?rev=928420&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/resources/webapp/WEB-INF/web.xml (added)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/resources/webapp/WEB-INF/web.xml Sun Mar 28 14:47:50 2010
@@ -0,0 +1,169 @@
+<?xml version="1.0"?>
+
+<!--
+ * 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.
+-->
+<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+
+
+ <description>MyProject web.xml</description>
+ <context-param>
+ <description>
+ Initializes the plugins for our groovy handlers
+ </description>
+ <param-name>org.apache.myfaces.FACES_INIT_PLUGINS</param-name>
+ <param-value>org.apache.myfaces.scripting.servlet.StartupServletContextPluginChainLoader</param-value>
+ </context-param>
+
+
+ <context-param>
+ <description>Additional comma separated loader paths to allow direct editing on the sources directory instead
+ of the deployment dir
+ </description>
+ <param-name>org.apache.myfaces.scripting.groovy.LOADER_PATHS</param-name>
+ <param-value>
+ /Users/werpu2/development/workspace/extensions-scripting3/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/groovy
+ </param-value>
+ </context-param>
+
+
+ <context-param>
+ <description>Additional comma separated loader paths to allow direct editing on the sources directory instead
+ of the deployment dir
+ </description>
+ <param-name>org.apache.myfaces.scripting.java.LOADER_PATHS</param-name>
+ <param-value>
+ /Users/werpu2/development/workspace/extensions-scripting3/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java
+ </param-value>
+ </context-param>
+
+ <context-param>
+ <description>resource paths for our custom JSF2 resource resolver</description>
+ <param-name>org.apache.myfaces.scripting.resources.LOADER_PATHS</param-name>
+ <param-value>
+ /Users/werpu2/development/workspace/extensions-scripting3/extscript-examples/myfaces20-example/src/main/webapp
+ </param-value>
+ </context-param>
+
+ <context-param>
+ <description>a redirecting Facelet resource resolver which allows to pick up templates and resources from our
+ source dir
+ </description>
+ <param-name>facelets.RESOURCE_RESOLVER</param-name>
+ <param-value>org.apache.myfaces.scripting.facelet.ReroutingResourceResolver</param-value>
+ </context-param>
+
+ <!--
+ <context-param>
+ <description>a comma separated whitelist of root packages which are compiled those and nothing else
+ will be compiled during all compile stages, all other files stay permanently as they are
+ </description>
+ <param-name>org.apache.myfaces.scripting.PGK_WHITELIST</param-name>
+ <param-value>org.apache.myfaces.groovyloader.blog</param-value>
+ </context-param>
+ -->
+
+
+ <!--
+ <context-param>
+ <description>Additional comma separated loader paths to allow direct editing on the sources directory instead
+ of the deployment dir
+ </description>
+ <param-name>org.apache.myfaces.scripting.groovy.LOADER_PATHS</param-name>
+ <param-value>D:/dev/work/ideaprojects/threads/extscript/examples/myfaces20-example/src/main/webapp/WEB-INF/groovy</param-value>
+ </context-param>
+
+
+ <context-param>
+ <description>Additional comma separated loader paths to allow direct editing on the sources directory instead
+ of the deployment dir
+ </description>
+ <param-name>org.apache.myfaces.scripting.java.LOADER_PATHS</param-name>
+ <param-value>D:/dev/work/ideaprojects/threads/extscript/examples/myfaces20-example/src/main/webapp/WEB-INF/java</param-value>
+ </context-param>
+
+
+ -->
+
+
+ <context-param>
+ <param-name>javax.faces.PROJECT_STAGE</param-name>
+ <param-value>Development</param-value>
+ </context-param>
+
+
+ <context-param>
+ <description>State saving method: "client" or "server" (= default)
+ See JSF Specification 2.5.3
+ </description>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.FACELETS_LIBRARIES</param-name>
+ <param-value>
+ /WEB-INF/facelets/groovy-taglib.xml;/WEB-INF/facelets/tomahawk.taglib.xml
+ </param-value>
+ </context-param>
+
+
+ <filter>
+ <filter-name>scriptingFilter</filter-name>
+ <filter-class>org.apache.myfaces.scripting.servlet.ScriptingServletFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>scriptingFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ <dispatcher>ERROR</dispatcher>
+ </filter-mapping>
+
+ <!-- Listener, to allow Jetty serving MyFaces apps -->
+ <listener>
+ <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
+ </listener>
+
+ <!-- Faces Servlet -->
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <!-- Faces Servlet Mapping -->
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/*</url-pattern>
+ </servlet-mapping>
+
+
+ <!-- Welcome files -->
+ <welcome-file-list>
+ <welcome-file>index.jsp</welcome-file>
+ <welcome-file>index.html</welcome-file>
+ </welcome-file-list>
+
+</web-app>
Propchange: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/resources/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/test/resources/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Modified: myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/blog/BlogEntry.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/blog/BlogEntry.java?rev=928420&r1=928419&r2=928420&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/blog/BlogEntry.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/blog/BlogEntry.java Sun Mar 28 14:47:50 2010
@@ -27,8 +27,7 @@ public class BlogEntry {
String firstName = "";
String lastName = "";
String topic = "";
- String content = "";
-
+ String content = "";
public String getFirstName() {
return firstName;
Modified: myfaces/extensions/scripting/trunk/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/pom.xml?rev=928420&r1=928419&r2=928420&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/pom.xml (original)
+++ myfaces/extensions/scripting/trunk/pom.xml Sun Mar 28 14:47:50 2010
@@ -59,6 +59,16 @@
</snapshots>
</repository>
<repository>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <id>apache-maven-snapshots</id>
+ <url>http://people.apache.org/repo/m2-snapshot-repository</url>
+ </repository>
+ <repository>
<id>myfaces2beta3</id>
<url>http://people.apache.org/~lu4242/myfaces200beta3/</url>
<releases>
@@ -80,7 +90,7 @@
<scope>provided</scope>
</dependency>
-
+
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
@@ -102,6 +112,25 @@
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.myfaces.test</groupId>
+ <artifactId>myfaces-test20</artifactId>
+ <version>1.0.0-beta</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.easymock</groupId>
+ <artifactId>easymock</artifactId>
+ <version>2.3</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.easymock</groupId>
+ <artifactId>easymockclassextension</artifactId>
+ <version>2.3</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>