You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ep...@apache.org on 2006/04/06 08:33:23 UTC

svn commit: r391914 - in /maven/plugins/trunk/maven-idea-plugin/src/test: java/org/apache/maven/plugin/idea/ java/org/apache/maven/plugin/idea/stubs/ workspace-plugin-configs/

Author: epunzalan
Date: Wed Apr  5 23:33:22 2006
New Revision: 391914

URL: http://svn.apache.org/viewcvs?rev=391914&view=rev
Log:
PR: MIDEA-43

Added tests for idea:workspace goal

Added:
    maven/plugins/trunk/maven-idea-plugin/src/test/java/org/apache/maven/plugin/idea/IdeaWorkspaceTest.java
    maven/plugins/trunk/maven-idea-plugin/src/test/java/org/apache/maven/plugin/idea/stubs/MavenProjectWithScmConnectionStub.java
    maven/plugins/trunk/maven-idea-plugin/src/test/java/org/apache/maven/plugin/idea/stubs/MavenProjectWithScmDevConnectionStub.java
    maven/plugins/trunk/maven-idea-plugin/src/test/workspace-plugin-configs/
    maven/plugins/trunk/maven-idea-plugin/src/test/workspace-plugin-configs/connection-plugin-config.xml
    maven/plugins/trunk/maven-idea-plugin/src/test/workspace-plugin-configs/devconnection-plugin-config.xml
    maven/plugins/trunk/maven-idea-plugin/src/test/workspace-plugin-configs/min-plugin-config.xml

Added: maven/plugins/trunk/maven-idea-plugin/src/test/java/org/apache/maven/plugin/idea/IdeaWorkspaceTest.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-idea-plugin/src/test/java/org/apache/maven/plugin/idea/IdeaWorkspaceTest.java?rev=391914&view=auto
==============================================================================
--- maven/plugins/trunk/maven-idea-plugin/src/test/java/org/apache/maven/plugin/idea/IdeaWorkspaceTest.java (added)
+++ maven/plugins/trunk/maven-idea-plugin/src/test/java/org/apache/maven/plugin/idea/IdeaWorkspaceTest.java Wed Apr  5 23:33:22 2006
@@ -0,0 +1,65 @@
+package org.apache.maven.plugin.idea;
+
+import org.dom4j.Document;
+import org.dom4j.Element;
+
+/*
+ *
+ *  Copyright 2005-2006 The Apache Software Foundation.
+ *
+ *  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.
+ *
+ */
+
+/**
+ * @author Edwin Punzalan
+ */
+public class IdeaWorkspaceTest
+    extends AbstractIdeaTestCase
+{
+    public void testMinConfig()
+        throws Exception
+    {
+        executeMojo( "src/test/workspace-plugin-configs/min-plugin-config.xml" );
+    }
+
+    public void testScmConnectionConfig()
+        throws Exception
+    {
+        Document iwsDocument = executeMojo( "src/test/workspace-plugin-configs/connection-plugin-config.xml" );
+
+        Element component = findComponent( iwsDocument.getRootElement(), "VcsManagerConfiguration" );
+
+        Element element = findElementByNameAttribute( component, "option", "ACTIVE_VCS_NAME" );
+
+        assertEquals( "Test scm type from scm connection", "type", element.attributeValue( "value" ) );
+    }
+
+    public void testScmDevConnectionConfig()
+        throws Exception
+    {
+        Document iwsDocument = executeMojo( "src/test/workspace-plugin-configs/devconnection-plugin-config.xml" );
+
+        Element component = findComponent( iwsDocument.getRootElement(), "VcsManagerConfiguration" );
+
+        Element element = findElementByNameAttribute( component, "option", "ACTIVE_VCS_NAME" );
+
+        assertEquals( "Test scm type from scm connection", "type", element.attributeValue( "value" ) );
+    }
+
+    private Document executeMojo( String pluginXml )
+        throws Exception
+    {
+        return super.executeMojo( "workspace", pluginXml, "iws" );
+    }
+}
\ No newline at end of file

Added: maven/plugins/trunk/maven-idea-plugin/src/test/java/org/apache/maven/plugin/idea/stubs/MavenProjectWithScmConnectionStub.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-idea-plugin/src/test/java/org/apache/maven/plugin/idea/stubs/MavenProjectWithScmConnectionStub.java?rev=391914&view=auto
==============================================================================
--- maven/plugins/trunk/maven-idea-plugin/src/test/java/org/apache/maven/plugin/idea/stubs/MavenProjectWithScmConnectionStub.java (added)
+++ maven/plugins/trunk/maven-idea-plugin/src/test/java/org/apache/maven/plugin/idea/stubs/MavenProjectWithScmConnectionStub.java Wed Apr  5 23:33:22 2006
@@ -0,0 +1,37 @@
+package org.apache.maven.plugin.idea.stubs;
+
+import org.apache.maven.model.Scm;
+
+/*
+ *
+ *  Copyright 2005-2006 The Apache Software Foundation.
+ *
+ *  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.
+ *
+ */
+
+/**
+ * @author Edwin Punzalan
+ */
+public class MavenProjectWithScmConnectionStub
+    extends SimpleMavenProjectStub
+{
+    public Scm getScm()
+    {
+        Scm scm = new Scm();
+
+        scm.setConnection( "scm:type:" );
+
+        return scm;
+    }
+}

Added: maven/plugins/trunk/maven-idea-plugin/src/test/java/org/apache/maven/plugin/idea/stubs/MavenProjectWithScmDevConnectionStub.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-idea-plugin/src/test/java/org/apache/maven/plugin/idea/stubs/MavenProjectWithScmDevConnectionStub.java?rev=391914&view=auto
==============================================================================
--- maven/plugins/trunk/maven-idea-plugin/src/test/java/org/apache/maven/plugin/idea/stubs/MavenProjectWithScmDevConnectionStub.java (added)
+++ maven/plugins/trunk/maven-idea-plugin/src/test/java/org/apache/maven/plugin/idea/stubs/MavenProjectWithScmDevConnectionStub.java Wed Apr  5 23:33:22 2006
@@ -0,0 +1,37 @@
+package org.apache.maven.plugin.idea.stubs;
+
+/*
+ *
+ *  Copyright 2005-2006 The Apache Software Foundation.
+ *
+ *  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.
+ *
+ */
+
+import org.apache.maven.model.Scm;
+
+/**
+ * @author Edwin Punzalan
+ */
+public class MavenProjectWithScmDevConnectionStub
+    extends SimpleMavenProjectStub
+{
+    public Scm getScm()
+    {
+        Scm scm = new Scm();
+
+        scm.setDeveloperConnection( "scm:type:" );
+
+        return scm;
+    }
+}

Added: maven/plugins/trunk/maven-idea-plugin/src/test/workspace-plugin-configs/connection-plugin-config.xml
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-idea-plugin/src/test/workspace-plugin-configs/connection-plugin-config.xml?rev=391914&view=auto
==============================================================================
--- maven/plugins/trunk/maven-idea-plugin/src/test/workspace-plugin-configs/connection-plugin-config.xml (added)
+++ maven/plugins/trunk/maven-idea-plugin/src/test/workspace-plugin-configs/connection-plugin-config.xml Wed Apr  5 23:33:22 2006
@@ -0,0 +1,32 @@
+<!--
+  ~
+  ~  Copyright 2005-2006 The Apache Software Foundation.
+  ~
+  ~  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.
+  ~
+  -->
+
+<project>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-idea-plugin</artifactId>
+        <configuration>
+          <executedProject implementation="org.apache.maven.plugin.idea.stubs.MavenProjectWithScmConnectionStub"/>
+          <localRepo>${localRepository}</localRepo>
+          <overwrite>false</overwrite>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
\ No newline at end of file

Added: maven/plugins/trunk/maven-idea-plugin/src/test/workspace-plugin-configs/devconnection-plugin-config.xml
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-idea-plugin/src/test/workspace-plugin-configs/devconnection-plugin-config.xml?rev=391914&view=auto
==============================================================================
--- maven/plugins/trunk/maven-idea-plugin/src/test/workspace-plugin-configs/devconnection-plugin-config.xml (added)
+++ maven/plugins/trunk/maven-idea-plugin/src/test/workspace-plugin-configs/devconnection-plugin-config.xml Wed Apr  5 23:33:22 2006
@@ -0,0 +1,32 @@
+<!--
+  ~
+  ~  Copyright 2005-2006 The Apache Software Foundation.
+  ~
+  ~  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.
+  ~
+  -->
+
+<project>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-idea-plugin</artifactId>
+        <configuration>
+          <executedProject implementation="org.apache.maven.plugin.idea.stubs.MavenProjectWithScmDevConnectionStub"/>
+          <localRepo>${localRepository}</localRepo>
+          <overwrite>false</overwrite>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
\ No newline at end of file

Added: maven/plugins/trunk/maven-idea-plugin/src/test/workspace-plugin-configs/min-plugin-config.xml
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-idea-plugin/src/test/workspace-plugin-configs/min-plugin-config.xml?rev=391914&view=auto
==============================================================================
--- maven/plugins/trunk/maven-idea-plugin/src/test/workspace-plugin-configs/min-plugin-config.xml (added)
+++ maven/plugins/trunk/maven-idea-plugin/src/test/workspace-plugin-configs/min-plugin-config.xml Wed Apr  5 23:33:22 2006
@@ -0,0 +1,32 @@
+<!--
+  ~
+  ~  Copyright 2005-2006 The Apache Software Foundation.
+  ~
+  ~  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.
+  ~
+  -->
+
+<project>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-idea-plugin</artifactId>
+        <configuration>
+          <executedProject implementation="org.apache.maven.plugin.idea.stubs.SimpleMavenProjectStub"/>
+          <localRepo>${localRepository}</localRepo>
+          <overwrite>false</overwrite>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
\ No newline at end of file