You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-dev@jakarta.apache.org by pt...@apache.org on 2008/03/10 20:52:25 UTC
svn commit: r635673 - in
/jakarta/cactus/trunk/integration/eclipse/org.apache.cactus.eclipse.runner/src:
assemble/ conf/ main/java/org/apache/cactus/eclipse/runner/containers/jetty/
main/java/org/apache/cactus/eclipse/runner/ui/
Author: ptahchiev
Date: Mon Mar 10 12:52:19 2008
New Revision: 635673
URL: http://svn.apache.org/viewvc?rev=635673&view=rev
Log:
#CR-186 - Cactify action now checks if the jars are present and only in case they are not it adds them.
Added:
jakarta/cactus/trunk/integration/eclipse/org.apache.cactus.eclipse.runner/src/conf/jspRedirector.jsp (with props)
Modified:
jakarta/cactus/trunk/integration/eclipse/org.apache.cactus.eclipse.runner/src/assemble/main-bin.xml
jakarta/cactus/trunk/integration/eclipse/org.apache.cactus.eclipse.runner/src/main/java/org/apache/cactus/eclipse/runner/containers/jetty/JettyContainerManager.java
jakarta/cactus/trunk/integration/eclipse/org.apache.cactus.eclipse.runner/src/main/java/org/apache/cactus/eclipse/runner/ui/CactifyActionDelegate.java
Modified: jakarta/cactus/trunk/integration/eclipse/org.apache.cactus.eclipse.runner/src/assemble/main-bin.xml
URL: http://svn.apache.org/viewvc/jakarta/cactus/trunk/integration/eclipse/org.apache.cactus.eclipse.runner/src/assemble/main-bin.xml?rev=635673&r1=635672&r2=635673&view=diff
==============================================================================
--- jakarta/cactus/trunk/integration/eclipse/org.apache.cactus.eclipse.runner/src/assemble/main-bin.xml (original)
+++ jakarta/cactus/trunk/integration/eclipse/org.apache.cactus.eclipse.runner/src/assemble/main-bin.xml Mon Mar 10 12:52:19 2008
@@ -64,8 +64,15 @@
<fileSet>
<directory>src/conf</directory>
<outputDirectory>/</outputDirectory>
+ <excludes>
+ <exclude>jspRedirector.jsp</exclude>
+ </excludes>
+ </fileSet>
+ <fileSet>
+ <directory>src/conf</directory>
+ <outputDirectory>lib/conf</outputDirectory>
<includes>
- <include>*.*</include>
+ <include>jspRedirector.jsp</include>
</includes>
</fileSet>
<fileSet>
Added: jakarta/cactus/trunk/integration/eclipse/org.apache.cactus.eclipse.runner/src/conf/jspRedirector.jsp
URL: http://svn.apache.org/viewvc/jakarta/cactus/trunk/integration/eclipse/org.apache.cactus.eclipse.runner/src/conf/jspRedirector.jsp?rev=635673&view=auto
==============================================================================
--- jakarta/cactus/trunk/integration/eclipse/org.apache.cactus.eclipse.runner/src/conf/jspRedirector.jsp (added)
+++ jakarta/cactus/trunk/integration/eclipse/org.apache.cactus.eclipse.runner/src/conf/jspRedirector.jsp Mon Mar 10 12:52:19 2008
@@ -0,0 +1,28 @@
+<%@page import="org.apache.cactus.server.*,org.apache.cactus.internal.server.*" session="true" %><%
+
+ /**
+ * Note:
+ * It is very important not to put any character between the end
+ * of the page tag and the beginning of the java code expression, otherwise,
+ * the generated servlet containss a 'out.println("\r\n");' and this breaks
+ * our mechanism !
+ */
+
+ /**
+ * This JSP is used as a proxy to call your server-side unit tests. We use
+ * a JSP rather than a servlet because for testing custom JSP tags for
+ * example we need access to JSP implicit objects (PageContext and
+ * JspWriter).
+ */
+
+ JspImplicitObjects objects = new JspImplicitObjects();
+ objects.setHttpServletRequest(request);
+ objects.setHttpServletResponse(response);
+ objects.setServletConfig(config);
+ objects.setServletContext(application);
+ objects.setJspWriter(out);
+ objects.setPageContext(pageContext);
+
+ JspTestRedirector redirector = new JspTestRedirector();
+ redirector.doGet(objects);
+%>
\ No newline at end of file
Propchange: jakarta/cactus/trunk/integration/eclipse/org.apache.cactus.eclipse.runner/src/conf/jspRedirector.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: jakarta/cactus/trunk/integration/eclipse/org.apache.cactus.eclipse.runner/src/main/java/org/apache/cactus/eclipse/runner/containers/jetty/JettyContainerManager.java
URL: http://svn.apache.org/viewvc/jakarta/cactus/trunk/integration/eclipse/org.apache.cactus.eclipse.runner/src/main/java/org/apache/cactus/eclipse/runner/containers/jetty/JettyContainerManager.java?rev=635673&r1=635672&r2=635673&view=diff
==============================================================================
--- jakarta/cactus/trunk/integration/eclipse/org.apache.cactus.eclipse.runner/src/main/java/org/apache/cactus/eclipse/runner/containers/jetty/JettyContainerManager.java (original)
+++ jakarta/cactus/trunk/integration/eclipse/org.apache.cactus.eclipse.runner/src/main/java/org/apache/cactus/eclipse/runner/containers/jetty/JettyContainerManager.java Mon Mar 10 12:52:19 2008
@@ -53,8 +53,8 @@
/**
* The name of the jspRedirector.jsp file
*/
- private static final Path JSPREDIRECTOR_PATH =
- new Path("/lib/confs/jspRedirector.jsp");
+ private static final String JSPREDIRECTOR_PATH =
+ new String("lib/confs/jspRedirector.jsp");
/**
* Directory containg the web application for Jetty
@@ -120,7 +120,12 @@
copy.setProject(antProject);
copy.setTodir(theDir);
CactusPlugin thePlugin = CactusPlugin.getDefault();
- URL jspRedirectorURL = thePlugin.find(JSPREDIRECTOR_PATH);
+ URL jspRedirectorURL = null;
+ try {
+ jspRedirectorURL = Platform.asLocalURL(thePlugin.getBundle().getEntry(JSPREDIRECTOR_PATH));
+ } catch (IOException e1) {
+ //do nothing the exception is called later.
+ }
if (jspRedirectorURL == null)
{
throw CactusPlugin.createCoreException(
@@ -136,7 +141,7 @@
" : " + e.getMessage(),
null);
}
- CactusPlugin.log(jspRedirectorURL.getPath());
+ //CactusPlugin.log(jspRedirectorURL.getPath());
File jspRedirector = new File(jspRedirectorURL.getPath());
FileSet fileSet = new FileSet();
fileSet.setFile(jspRedirector);
Modified: jakarta/cactus/trunk/integration/eclipse/org.apache.cactus.eclipse.runner/src/main/java/org/apache/cactus/eclipse/runner/ui/CactifyActionDelegate.java
URL: http://svn.apache.org/viewvc/jakarta/cactus/trunk/integration/eclipse/org.apache.cactus.eclipse.runner/src/main/java/org/apache/cactus/eclipse/runner/ui/CactifyActionDelegate.java?rev=635673&r1=635672&r2=635673&view=diff
==============================================================================
--- jakarta/cactus/trunk/integration/eclipse/org.apache.cactus.eclipse.runner/src/main/java/org/apache/cactus/eclipse/runner/ui/CactifyActionDelegate.java (original)
+++ jakarta/cactus/trunk/integration/eclipse/org.apache.cactus.eclipse.runner/src/main/java/org/apache/cactus/eclipse/runner/ui/CactifyActionDelegate.java Mon Mar 10 12:52:19 2008
@@ -178,11 +178,15 @@
for (int i = 0; i < theSecondArray.length; i++)
{
IClasspathEntry currentEntry = theSecondArray[i];
+ String currentEntryFileName = currentEntry.getPath().toFile().getName();
boolean entryAlreadyExists = false;
+ boolean isFile = false;
for (int j = 0; j < theFirstArray.length; j++)
{
IClasspathEntry comparedEntry = theFirstArray[j];
- if (comparedEntry.getPath().equals(currentEntry.getPath()))
+ isFile = comparedEntry.getPath().toFile().getAbsolutePath().endsWith(".jar");
+ String comparedFileName = comparedEntry.getPath().toFile().getName();
+ if (comparedEntry.getPath().equals(currentEntry.getPath()) || (comparedFileName.equals(currentEntryFileName) && isFile))
{
entryAlreadyExists = true;
break;
---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-dev-help@jakarta.apache.org