Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2237 - in infrastructure/jira-dpml: . svn svn/src svn/src/main svn/src/main/net svn/src/main/net/dpml svn/src/main/net/dpml/jira svn/src/test svn/src/test/net svn/src/test/net/dpml svn/src/test/net/dpml/jira

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: peter AT neubauer.se
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r2237 - in infrastructure/jira-dpml: . svn svn/src svn/src/main svn/src/main/net svn/src/main/net/dpml svn/src/main/net/dpml/jira svn/src/test svn/src/test/net svn/src/test/net/dpml svn/src/test/net/dpml/jira
  • Date: Thu, 07 Apr 2005 12:01:47 -0400

Author: peter AT neubauer.se
Date: Thu Apr 7 12:01:42 2005
New Revision: 2237

Added:
infrastructure/jira-dpml/
infrastructure/jira-dpml/.classpath
infrastructure/jira-dpml/.project
infrastructure/jira-dpml/build.xml
infrastructure/jira-dpml/index.xml
infrastructure/jira-dpml/svn/
infrastructure/jira-dpml/svn/build.xml
infrastructure/jira-dpml/svn/src/
infrastructure/jira-dpml/svn/src/main/
infrastructure/jira-dpml/svn/src/main/net/
infrastructure/jira-dpml/svn/src/main/net/dpml/
infrastructure/jira-dpml/svn/src/main/net/dpml/jira/
infrastructure/jira-dpml/svn/src/main/net/dpml/jira/SvnHelper.java
infrastructure/jira-dpml/svn/src/main/net/dpml/jira/SvnUpdateListener.java
infrastructure/jira-dpml/svn/src/test/
infrastructure/jira-dpml/svn/src/test/net/
infrastructure/jira-dpml/svn/src/test/net/dpml/
infrastructure/jira-dpml/svn/src/test/net/dpml/jira/
infrastructure/jira-dpml/svn/src/test/net/dpml/jira/SvnCommandTest.java
Log:
starting on the jira svn adapter - INFRA-3


Added: infrastructure/jira-dpml/.classpath
==============================================================================
--- (empty file)
+++ infrastructure/jira-dpml/.classpath Thu Apr 7 12:01:42 2005
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER">
+ <attributes>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="src" path="svn/src/main">
+ <attributes>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="var"
path="MAGIC_CACHE/atlassian-jira/jars/atlassian-jira-3.1.jar">
+ <attributes>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="var"
path="MAGIC_CACHE/osuser/jars/osuser-1.0-dev-16Feb05.jar">
+ <attributes>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="src" path="svn/src/test">
+ <attributes>
+ </attributes>
+ </classpathentry>
+ <classpathentry
sourcepath="ECLIPSE_HOME/plugins/org.eclipse.jdt.source_3.0.0/src/org.junit_3.8.1/junitsrc.zip"
kind="var" path="JUNIT_HOME/junit.jar"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>

Added: infrastructure/jira-dpml/.project
==============================================================================
--- (empty file)
+++ infrastructure/jira-dpml/.project Thu Apr 7 12:01:42 2005
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jira-dpml</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>

Added: infrastructure/jira-dpml/build.xml
==============================================================================
--- (empty file)
+++ infrastructure/jira-dpml/build.xml Thu Apr 7 12:01:42 2005
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<project name="jira" default="install" basedir="."
+ xmlns:transit="antlib:net.dpml.transit">
+
+ <transit:import uri="artifact:template:dpml/magic/reactor"/>
+
+</project>

Added: infrastructure/jira-dpml/index.xml
==============================================================================
--- (empty file)
+++ infrastructure/jira-dpml/index.xml Thu Apr 7 12:01:42 2005
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<index>
+
+<resource>
+ <info>
+ <group>atlassian-jira</group>
+ <name>atlassian-jira</name>
+ <version>3.1</version>
+ </info>
+</resource>
+<resource>
+ <info>
+ <group>osuser</group>
+ <name>osuser</name>
+ <version>1.0-dev-16Feb05</version>
+ </info>
+</resource>
+ <project basedir="svn">
+ <info>
+ <group>dpml/jira</group>
+ <name>dpml-jira-svn</name>
+ <type>jar</type>
+ </info>
+ <dependencies>
+ <include key="atlassian-jira"/>
+ <include key="osuser"/>
+ </dependencies>
+ </project>
+
+</index>

Added: infrastructure/jira-dpml/svn/build.xml
==============================================================================
--- (empty file)
+++ infrastructure/jira-dpml/svn/build.xml Thu Apr 7 12:01:42 2005
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<project name="dpml-jira-svn" default="install" basedir="."
+ xmlns:transit="antlib:net.dpml.transit">
+
+ <transit:import uri="artifact:template:dpml/magic/standard"/>
+
+</project>

Added: infrastructure/jira-dpml/svn/src/main/net/dpml/jira/SvnHelper.java
==============================================================================
--- (empty file)
+++ infrastructure/jira-dpml/svn/src/main/net/dpml/jira/SvnHelper.java Thu
Apr 7 12:01:42 2005
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2004 Peter Neubauer.
+ *
+ * Licensed 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 net.dpml.jira;
+
+import java.io.IOException;
+import java.io.PrintStream;
+
+public class SvnHelper
+{
+ public static void checkout( String url, String user, String password,
String destinationPath, PrintStream log ) throws Exception
+ {
+ String[] t_args = new String[]{"svn","checkout", url,
+ "--username", user, "--password", password,
destinationPath};
+ log.println( format(t_args) );
+ executeCommand( log, t_args );
+ return;
+
+
+ }
+ public static void commit( String file, String user, String password,
PrintStream log ) throws Exception
+ {
+ String[] t_args = new String[]{"svn","commit", file,
+ "--username", user, "--password", password};
+ log.println( format(t_args) );
+ executeCommand( log, t_args );
+ return;
+
+
+ }
+
+ private static String format( String[] iT_args )
+ {
+ StringBuffer result = new StringBuffer();
+ for (int i=0; i<iT_args.length; i++ )
+ {
+ result.append(iT_args[i] + " ");
+ }
+ return result.toString();
+ }
+
+ public static void updateSvnPassword( String htpasswordPath, String
passwordFilePath,
+ String confirmedUser, String password, PrintStream log )
+ {
+ try
+ {
+ String m_CommandLine = htpasswordPath + " " + "-b "
+ + passwordFilePath + " " + confirmedUser + " " +
password;
+ String[] t_args = new String[]{htpasswordPath, "-b",
passwordFilePath,
+ confirmedUser, password};
+ log.println( t_args );
+ executeCommand( log, t_args );
+ return;
+ }
+ catch ( Exception e )
+ {
+ java.io.StringWriter sw = new java.io.StringWriter();
+ e.printStackTrace( new java.io.PrintWriter( sw ) );
+ log.println( "error: " + sw );
+ return;
+ }
+
+ }
+
+ private static void executeCommand( PrintStream log, String[] t_args )
throws Exception
+ {
+ Process p = Runtime.getRuntime().exec(
+ t_args );
+ if ( p.waitFor() != 0 )
+ {
+ java.io.DataInputStream dis = new java.io.DataInputStream( p
+ .getErrorStream() );
+ StringBuffer sb = new StringBuffer();
+ String str;
+ while ( ( str = dis.readLine() ) != null )
+ sb.append( str );
+ log.println( "error: " + sb );
+ throw new Exception(sb.toString());
+ }
+ return;
+ }
+
+}

Added:
infrastructure/jira-dpml/svn/src/main/net/dpml/jira/SvnUpdateListener.java
==============================================================================
--- (empty file)
+++
infrastructure/jira-dpml/svn/src/main/net/dpml/jira/SvnUpdateListener.java
Thu Apr 7 12:01:42 2005
@@ -0,0 +1,183 @@
+/*
+ * Copyright 2004 Peter Neubauer.
+ *
+ * Licensed 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 net.dpml.jira;
+
+import com.atlassian.jira.event.JiraEvent;
+import com.atlassian.jira.event.issue.AbstractIssueEventListener;
+import com.atlassian.jira.event.issue.IssueEvent;
+import com.atlassian.jira.event.user.UserEvent;
+import com.atlassian.jira.event.user.UserEventListener;
+
+import java.util.Map;
+
+/**
+ * A listener for debugging - prints everything it 'hears' to System.err
+ * <p>
+ * Useful for debuggin when certain events are fired, and the content of
those
+ * events.
+ */
+public class SvnUpdateListener extends AbstractIssueEventListener implements
UserEventListener
+{
+ public void init(Map params)
+ {
+ log("DebugListener.init");
+ log(params.toString());
+ }
+
+ public String[] getAcceptedParams()
+ {
+ return new String[0];
+ }
+
+ // IssueEventListener implementation
+ public void issueAssigned(IssueEvent event)
+ {
+ log("DebugListener.issueAssigned");
+ logEvent(event);
+ }
+
+ public void issueClosed(IssueEvent event)
+ {
+ log("DebugListener.issueClosed");
+ logEvent(event);
+ }
+
+ public void issueCreated(IssueEvent event)
+ {
+ log("DebugListener.issueCreated");
+ logEvent(event);
+ }
+
+ public void issueResolved(IssueEvent event)
+ {
+ log("DebugListener.issueResolved");
+ logEvent(event);
+ }
+
+ public void issueReopened(IssueEvent event)
+ {
+ log("DebugListener.issueReopened");
+ logEvent(event);
+ }
+
+ public void issueUpdated(IssueEvent event)
+ {
+ log("DebugListener.issueUpdated");
+ logEvent(event);
+ }
+
+ public void issueCommented(IssueEvent event)
+ {
+ log("DebugListener.issueCommented");
+ logEvent(event);
+ }
+
+ public void issueDeleted(IssueEvent event)
+ {
+ log("DebugListener.issueCommented");
+ logEvent(event);
+ }
+
+ public void issueMoved(IssueEvent event)
+ {
+ log("DebugListener.issueMoved");
+ logEvent(event);
+ }
+
+ public void issueWorkLogged(IssueEvent event)
+ {
+ log("DebugListener.issueWorkLogged");
+ logEvent(event);
+ }
+
+ public void issueGenericEvent(IssueEvent event)
+ {
+ log("DebugListener.issueGenericEvent");
+ logEvent(event);
+ }
+
+ // UserEventListener implementation
+ public void userSignup(UserEvent event)
+ {
+ log("DebugListener.userSignup");
+ logEvent(event);
+ }
+
+ public void userCreated(UserEvent event)
+ {
+ log("DebugListener.userCreated");
+ logEvent(event);
+ }
+
+ public void userForgotPassword(UserEvent event)
+ {
+ log("DebugListener.userForgotPassword");
+ logEvent(event);
+ }
+
+ public void userForgotUsername(UserEvent event)
+ {
+ log("DebugListener.userForgotUsername");
+ logEvent(event);
+ }
+
+ private void logEvent(JiraEvent event)
+ {
+ try
+ {
+ if (event instanceof IssueEvent)
+ {
+ IssueEvent issueEvent = (IssueEvent) event;
+ //log("Issue: [#" + issueEvent.getIssue().getLong("id") + "]
" + issueEvent.getIssue().getString("summary"));
+ //log("Comment: " + issueEvent.getComment());
+ //log("Change Group: " + issueEvent.getChangeLog());
+ }
+ else if (event instanceof UserEvent)
+ {
+ UserEvent userEvent = (UserEvent) event;
+ log("User: " + userEvent.getUser().getName() + " (" +
userEvent.getUser().getEmail() + ")");
+ }
+
+ log(" Time: " + event.getTime());
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ private void log(String msg)
+ {
+ System.err.println(this.getClass().getName() + msg);
+ }
+
+ public boolean isInternal()
+ {
+ return false;
+ }
+
+ public boolean isUnique()
+ {
+ return false;
+ }
+
+ public String getDescription()
+ {
+ return "This listener will debug the events it receives to
System.err";
+ }
+}

Added: infrastructure/jira-dpml/svn/src/test/net/dpml/jira/SvnCommandTest.java
==============================================================================
--- (empty file)
+++ infrastructure/jira-dpml/svn/src/test/net/dpml/jira/SvnCommandTest.java
Thu Apr 7 12:01:42 2005
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2004 Peter Neubauer.
+ *
+ * Licensed 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 net.dpml.jira;
+
+import junit.framework.TestCase;
+
+public class SvnCommandTest extends TestCase
+{
+ public void testSvnCheckout() throws Exception
+ {
+
SvnHelper.checkout("https://scm.dpml.net/repos/dpml/development/main/transit/core/etc/";,
"peter AT neubauer.se", "test", "/tmp/", System.out );
+ }
+ public void testSvnCommit() throws Exception
+ {
+ SvnHelper.commit("/tmp/project.module", "peter AT neubauer.se",
"jhsmssf", "testing jira adapter", System.out );
+ }
+
+}



  • svn commit: r2237 - in infrastructure/jira-dpml: . svn svn/src svn/src/main svn/src/main/net svn/src/main/net/dpml svn/src/main/net/dpml/jira svn/src/test svn/src/test/net svn/src/test/net/dpml svn/src/test/net/dpml/jira, peter, 04/07/2005

Archive powered by MHonArc 2.6.24.

Top of Page