JBoss Tools SVN: r34587 - trunk/download.jboss.org/jbosstools/builds/cascade.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-09-08 14:14:55 -0400 (Thu, 08 Sep 2011)
New Revision: 34587
Modified:
trunk/download.jboss.org/jbosstools/builds/cascade/swimlanes.txt
Log:
add note about Smooks
Modified: trunk/download.jboss.org/jbosstools/builds/cascade/swimlanes.txt
===================================================================
--- trunk/download.jboss.org/jbosstools/builds/cascade/swimlanes.txt 2011-09-08 18:13:40 UTC (rev 34586)
+++ trunk/download.jboss.org/jbosstools/builds/cascade/swimlanes.txt 2011-09-08 18:14:55 UTC (rev 34587)
@@ -1,4 +1,4 @@
-Revised swimlanes, as implemented in 3.2_stable_branch and 3.3_trunk jobs, 2011/08/03
+Revised swimlanes, as implemented in 3.2_stable_branch and 3.3_trunk jobs, 2011/09/08
------------------------
@@ -34,7 +34,7 @@
examples -> portlet, jst
teiid, runtime -> tests
portlet -> seam
-
tptp [REMOVED]
+smooks [removed from JBDS, still in JBT]
------------------------
14 years, 7 months
JBoss Tools SVN: r34586 - in trunk/jsf/tests: org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs and 14 other directories.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2011-09-08 14:13:40 -0400 (Thu, 08 Sep 2011)
New Revision: 34586
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.classpath
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.project
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.settings/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.settings/.jsdtscope
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.settings/org.eclipse.jdt.core.prefs
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.settings/org.eclipse.wst.common.component
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.settings/org.eclipse.wst.common.project.facet.core.xml
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.settings/org.eclipse.wst.jsdt.ui.superType.container
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.settings/org.eclipse.wst.jsdt.ui.superType.name
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/JavaSource/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/JavaSource/demo/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/JavaSource/demo/User.java
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/JavaSource/resources.properties
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/META-INF/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/META-INF/MANIFEST.MF
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/WEB-INF/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/WEB-INF/.faces-config.xml.jsfdia
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/WEB-INF/faces-config.xml
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/WEB-INF/lib/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/WEB-INF/lib/jsf-api-2.0.3.jar
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/WEB-INF/lib/jsf-tlds.jar
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/WEB-INF/lib/jstl.jar
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/WEB-INF/web.xml
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/index.html
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/pages/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/pages/greeting.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/pages/inputname.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/resources/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/resources/demo/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/resources/demo/input.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/templates/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/templates/common.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/ant/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/ant/build.properties
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/CAJsfMessagesProposalsFilteringTest.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java
Log:
JBIDE-9633
Create JUnit tests to cover JBIDE-9515 issue
JUnit Test is added for proposals filtering check
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.classpath
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.classpath (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.classpath 2011-09-08 18:13:40 UTC (rev 34586)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="JavaSource"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="output" path="WebContent/WEB-INF/classes"/>
+</classpath>
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.classpath
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.project
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.project (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.project 2011-09-08 18:13:40 UTC (rev 34586)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>JSF2KickStartWithoutLibs</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.jboss.tools.jst.web.kb.kbbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ <nature>org.jboss.tools.jsf.jsfnature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ <nature>org.jboss.tools.jst.web.kb.kbnature</nature>
+ <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.project
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.settings/.jsdtscope
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.settings/.jsdtscope (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.settings/.jsdtscope 2011-09-08 18:13:40 UTC (rev 34586)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="WebContent"/>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
+ <attributes>
+ <attribute name="hide" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
+ <classpathentry kind="output" path=""/>
+</classpath>
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.settings/org.eclipse.jdt.core.prefs 2011-09-08 18:13:40 UTC (rev 34586)
@@ -0,0 +1,8 @@
+#Wed Sep 07 21:52:16 MSD 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.settings/org.eclipse.wst.common.component
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.settings/org.eclipse.wst.common.component (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.settings/org.eclipse.wst.common.component 2011-09-08 18:13:40 UTC (rev 34586)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-modules id="moduleCoreId" project-version="1.5.0">
+ <wb-module deploy-name="JSF2KickStartWithoutLibs">
+ <wb-resource deploy-path="/" source-path="/WebContent"/>
+ <wb-resource deploy-path="/WEB-INF/classes" source-path="/JavaSource"/>
+ <property name="context-root" value="JSF2KickStartWithoutLibs"/>
+ <property name="java-output-path" value="/JSF2KickStartWithoutLibs/WebContent/WEB-INF/classes"/>
+ </wb-module>
+</project-modules>
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml 2011-09-08 18:13:40 UTC (rev 34586)
@@ -0,0 +1,7 @@
+<root>
+ <facet id="jst.jsf">
+ <node name="libprov">
+ <attribute name="provider-id" value="jsf-user-library-provider"/>
+ </node>
+ </facet>
+</root>
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.settings/org.eclipse.wst.common.project.facet.core.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.settings/org.eclipse.wst.common.project.facet.core.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.settings/org.eclipse.wst.common.project.facet.core.xml 2011-09-08 18:13:40 UTC (rev 34586)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <runtime name="JBoss 6.x Runtime"/>
+ <fixed facet="wst.jsdt.web"/>
+ <fixed facet="jst.web"/>
+ <fixed facet="jst.jsf"/>
+ <fixed facet="java"/>
+ <installed facet="java" version="1.6"/>
+ <installed facet="jst.web" version="3.0"/>
+ <installed facet="jst.jsf" version="2.0"/>
+ <installed facet="wst.jsdt.web" version="1.0"/>
+</faceted-project>
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.settings/org.eclipse.wst.common.project.facet.core.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.settings/org.eclipse.wst.jsdt.ui.superType.container
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.settings/org.eclipse.wst.jsdt.ui.superType.container (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.settings/org.eclipse.wst.jsdt.ui.superType.container 2011-09-08 18:13:40 UTC (rev 34586)
@@ -0,0 +1 @@
+org.eclipse.wst.jsdt.launching.baseBrowserLibrary
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.settings/org.eclipse.wst.jsdt.ui.superType.name
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.settings/org.eclipse.wst.jsdt.ui.superType.name (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/.settings/org.eclipse.wst.jsdt.ui.superType.name 2011-09-08 18:13:40 UTC (rev 34586)
@@ -0,0 +1 @@
+Window
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/JavaSource/demo/User.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/JavaSource/demo/User.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/JavaSource/demo/User.java 2011-09-08 18:13:40 UTC (rev 34586)
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package demo;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.SessionScoped;
+
+/**
+ * Created by JBoss Tools
+ */
+@ManagedBean(name="user")
+@SessionScoped
+public class User {
+ private String name;
+
+ public User() {
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String sayHello() {
+ return "greeting";
+ }
+}
\ No newline at end of file
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/JavaSource/demo/User.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/JavaSource/resources.properties
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/JavaSource/resources.properties (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/JavaSource/resources.properties 2011-09-08 18:13:40 UTC (rev 34586)
@@ -0,0 +1,2 @@
+prompt=Your Name\:
+greeting=Hello
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/JavaSource/resources.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/META-INF/MANIFEST.MF (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/META-INF/MANIFEST.MF 2011-09-08 18:13:40 UTC (rev 34586)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/META-INF/MANIFEST.MF
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/WEB-INF/.faces-config.xml.jsfdia
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/WEB-INF/.faces-config.xml.jsfdia (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/WEB-INF/.faces-config.xml.jsfdia 2011-09-08 18:13:40 UTC (rev 34586)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<PROCESS model-entity="JSFProcess">
+ <PROCESS-ITEM NAME="rules:#pages#greeting.xhtml"
+ PATH="/pages/greeting.xhtml" SHAPE="240,33,0,0" model-entity="JSFProcessGroup"/>
+ <PROCESS-ITEM NAME="rules:#pages#inputname.xhtml"
+ PATH="/pages/inputname.xhtml" SHAPE="32,17,0,0" model-entity="JSFProcessGroup">
+ <PROCESS-ITEM ID="rules:#pages#inputname.xhtml:0" NAME="item"
+ PATH="/pages/inputname.xhtml" model-entity="JSFProcessItem">
+ <PROCESS-ITEM-OUTPUT ID="greeting::#pages#greeting.xhtml"
+ NAME="output" PATH="/pages/greeting.xhtml"
+ TARGET="rules:#pages#greeting.xhtml" TITLE="greeting" model-entity="JSFProcessItemOutput"/>
+ </PROCESS-ITEM>
+ </PROCESS-ITEM>
+</PROCESS>
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/WEB-INF/faces-config.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/WEB-INF/faces-config.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/WEB-INF/faces-config.xml 2011-09-08 18:13:40 UTC (rev 34586)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<faces-config
+ 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-facesconfig_2_0.xsd"
+ version="2.0">
+
+ <navigation-rule>
+ <from-view-id>/pages/inputname.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>greeting</from-outcome>
+ <to-view-id>/pages/greeting.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+ <application>
+ <resource-bundle>
+ <base-name>resources</base-name>
+ <var>msgs</var>
+ </resource-bundle>
+ </application>
+</faces-config>
\ No newline at end of file
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/WEB-INF/faces-config.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/WEB-INF/lib/jsf-api-2.0.3.jar
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/WEB-INF/lib/jsf-api-2.0.3.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/WEB-INF/lib/jsf-tlds.jar
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/WEB-INF/lib/jsf-tlds.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/WEB-INF/lib/jstl.jar
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/WEB-INF/lib/jstl.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/WEB-INF/web.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/WEB-INF/web.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/WEB-INF/web.xml 2011-09-08 18:13:40 UTC (rev 34586)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
+ <display-name>JSF2KickStartWithoutLibs</display-name>
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ <welcome-file>index.htm</welcome-file>
+ <welcome-file>index.jsp</welcome-file>
+ <welcome-file>default.html</welcome-file>
+ <welcome-file>default.htm</welcome-file>
+ <welcome-file>default.jsp</welcome-file>
+ </welcome-file-list>
+ <context-param>
+ <description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>client</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
+ <param-value>resources.application</param-value>
+ </context-param>
+ <listener>
+ <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
+ </listener>
+</web-app>
\ No newline at end of file
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/WEB-INF/web.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/index.html
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/index.html (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/index.html 2011-09-08 18:13:40 UTC (rev 34586)
@@ -0,0 +1 @@
+<html><head><meta http-equiv="Refresh" content="0; URL=pages/inputname.jsf"/></head></html>
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/index.html
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/pages/greeting.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/pages/greeting.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/pages/greeting.xhtml 2011-09-08 18:13:40 UTC (rev 34586)
@@ -0,0 +1,14 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+
+ <ui:composition template="/templates/common.xhtml">
+ <ui:define name="pageTitle">Greeting to User</ui:define>
+ <ui:define name="pageHeader">Greeting Page</ui:define>
+ <ui:define name="body">
+ #{msgs.greeting} #{user.name}!
+ </ui:define>
+ </ui:composition>
+</html>
\ No newline at end of file
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/pages/greeting.xhtml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/pages/inputname.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/pages/inputname.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/pages/inputname.xhtml 2011-09-08 18:13:40 UTC (rev 34586)
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ez="http://java.sun.com/jsf/composite/demo">
+
+ <ui:composition template="/templates/common.xhtml">
+
+ <ui:define name="pageTitle">Input User Name</ui:define>
+
+ <ui:define name="pageHeader">JSF 2 Hello Application</ui:define>
+
+ <ui:define name="body">
+ <h:message showSummary="true" showDetail="false" style="color: red; font-weight: bold;" for="inputname" />
+ <ez:input id="inputname" label="${msgs.prompt}" value="#{user.name}" action="#{user.sayHello}" submitlabel="Say Hello"/>
+ </ui:define>
+ </ui:composition>
+</html>
\ No newline at end of file
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/pages/inputname.xhtml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/resources/demo/input.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/resources/demo/input.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/resources/demo/input.xhtml 2011-09-08 18:13:40 UTC (rev 34586)
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:composite="http://java.sun.com/jsf/composite">
+
+ <composite:interface>
+ <composite:attribute name="label"/>
+ <composite:attribute name="value" required="true"/>
+ <composite:attribute name="action" required="true" method-signature="java.lang.String f()"/>
+ <composite:attribute name="submitlabel"/>
+ </composite:interface>
+
+ <composite:implementation>
+ <h:form>
+ <h:outputText value="#{cc.attrs.label}" />
+ <h:inputText value="#{cc.attrs.value}" />
+ <h:commandButton action="#{cc.attrs.action}" value="#{cc.attrs.submitlabel}" />
+ </h:form>
+ </composite:implementation>
+</html>
\ No newline at end of file
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/resources/demo/input.xhtml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/templates/common.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/templates/common.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/templates/common.xhtml 2011-09-08 18:13:40 UTC (rev 34586)
@@ -0,0 +1,64 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+
+ <head>
+ <title><ui:insert name="pageTitle">Page Title</ui:insert></title>
+ <style type="text/css">
+ body {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 14px;
+ }
+ .header {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 18px;
+ }
+ .bottom {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 9px;
+ text-align: center;
+ vertical-align: middle;
+ color: #8E969D;
+ }
+ </style>
+ </head>
+
+<body bgcolor="#ffffff">
+<table style="border:1px solid #CAD6E0" align="center" cellpadding="0" cellspacing="0" border="0" width="400">
+<tbody>
+
+ <tr>
+ <td class="header" height="42" align="center" valign="middle" width="100%" bgcolor="#E4EBEB">
+ <ui:insert name="pageHeader">Page Header</ui:insert>
+ </td>
+ </tr>
+ <tr>
+ <td height="1" width="100%" bgcolor="#CAD6E0"></td>
+ </tr>
+
+ <tr>
+ <td width="100%" colspan="2">
+ <table width="100%" style="height:150px" align="left" cellpadding="0" cellspacing="0" border="0">
+ <tbody>
+ <tr>
+ <td align="center" width="100%" valign="middle">
+
+ <ui:insert name="body">Page Body</ui:insert>
+
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2" valign="bottom" height="1" width="100%" bgcolor="#CAD6E0"></td>
+ </tr>
+</tbody>
+</table>
+</body>
+
+</html>
\ No newline at end of file
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/WebContent/templates/common.xhtml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/ant/build.properties
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/ant/build.properties (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/ant/build.properties 2011-09-08 18:13:40 UTC (rev 34586)
@@ -0,0 +1,3 @@
+#
+#Wed Sep 07 21:52:15 MSD 2011
+classpath.external=
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2KickStartWithoutLibs/ant/build.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/CAJsfMessagesProposalsFilteringTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/CAJsfMessagesProposalsFilteringTest.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/CAJsfMessagesProposalsFilteringTest.java 2011-09-08 18:13:40 UTC (rev 34586)
@@ -0,0 +1,90 @@
+package org.jboss.tools.jsf.jsp.ca.test;
+
+import java.util.List;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.jboss.tools.common.base.test.contentassist.CATestUtil;
+import org.jboss.tools.common.base.test.validation.TestUtil;
+import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
+import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
+import org.jboss.tools.test.util.JobUtils;
+import org.jboss.tools.test.util.ProjectImportTestSetup;
+
+public class CAJsfMessagesProposalsFilteringTest extends ContentAssistantTestCase {
+ private static final String PROJECT_NAME = "JSF2KickStartWithoutLibs";
+ private static final String PAGE_NAME = "WebContent/pages/inputname.xhtml";
+
+ private static final String TAG_ATTRIBUTE_COMMON_PREFIX = "value=\"#{";
+ private static final String TAG_ATTRIBUTE_USER_PREFIX = "value=\"#{us";
+ private static final String TAG_ATTRIBUTE_MSGS_PREFIX = "label=\"${ms";
+
+ private static final String[] PROPOSAL_TO_COMPARE_COMMON = {"user : User", "msgs"};
+ private static final String[] PROPOSAL_TO_COMPARE_USER_STRING = {"user : User"};
+ private static final String[] PROPOSAL_TO_COMPARE_MSGS_STRING = {"msgs"};
+
+ public void setUp() throws Exception {
+ project = ProjectImportTestSetup.loadProject(PROJECT_NAME);
+ project.build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
+ }
+
+ public static Test suite() {
+ return new TestSuite(CADefaultELStartingCharTest.class);
+ }
+
+ private void doTestCAJsfMessagesFilteringTest(String pageName, String attrPrefix, String[] correctProposals, String[] wrongProposals) {
+ String documentContent = document.get();
+ int start = (documentContent == null ? -1 : documentContent.indexOf(attrPrefix));
+ assertFalse("Required node '" + attrPrefix + "' not found in document", (start == -1));
+ int offsetToTest = start + attrPrefix.length();
+
+ JobUtils.waitForIdle();
+
+ List<ICompletionProposal> res = CATestUtil.collectProposals(contentAssistant, viewer, offsetToTest);
+
+ assertTrue("Content Assistant returned no proposals", (res != null && res.size() > 0));
+
+ for (String correct : correctProposals) {
+ assertTrue("Proposal '" + correct +"' not found, but it should be amoung the proposals!", proposalExists(correct, res));
+ }
+ for (String wrong : wrongProposals) {
+ assertFalse("Proposal '" + wrong +"' found, but it should not be amoung the proposals!", proposalExists(wrong, res));
+ }
+ }
+
+ private boolean proposalExists(String proposal, List<ICompletionProposal> proposals) {
+ for (ICompletionProposal p : proposals) {
+ if (!(p instanceof AutoContentAssistantProposal))
+ continue;
+ AutoContentAssistantProposal existingProposal = (AutoContentAssistantProposal)p;
+ String proposalString = existingProposal.getDisplayString();
+
+ if (proposal.equals(proposalString)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public void testCAJsfMessagesFiltering() {
+ assertNotNull("Test project '" + PROJECT_NAME + "' is not prepared", project);
+
+ openEditor(PAGE_NAME);
+ try {
+ // Test common case were both, "user" and "msgs" proposals should exist
+ doTestCAJsfMessagesFilteringTest(PAGE_NAME, TAG_ATTRIBUTE_COMMON_PREFIX, PROPOSAL_TO_COMPARE_COMMON, new String[0]);
+
+ // Test user case were the only "user" proposal should exist
+ doTestCAJsfMessagesFilteringTest(PAGE_NAME, TAG_ATTRIBUTE_USER_PREFIX, PROPOSAL_TO_COMPARE_USER_STRING, PROPOSAL_TO_COMPARE_MSGS_STRING);
+
+ // Test user case were the only "msgs" proposal should exist
+ doTestCAJsfMessagesFilteringTest(PAGE_NAME, TAG_ATTRIBUTE_MSGS_PREFIX, PROPOSAL_TO_COMPARE_MSGS_STRING, PROPOSAL_TO_COMPARE_USER_STRING);
+ } finally {
+ closeEditor();
+ }
+ }
+}
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/CAJsfMessagesProposalsFilteringTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java 2011-09-08 16:30:53 UTC (rev 34585)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java 2011-09-08 18:13:40 UTC (rev 34586)
@@ -24,6 +24,7 @@
import org.jboss.tools.jsf.jsp.ca.test.CAForJSF2BeansInJavaTest;
import org.jboss.tools.jsf.jsp.ca.test.CAForJSF2BeansTest;
import org.jboss.tools.jsf.jsp.ca.test.CAForUnclosedELTest;
+import org.jboss.tools.jsf.jsp.ca.test.CAJsfMessagesProposalsFilteringTest;
import org.jboss.tools.jsf.jsp.ca.test.CANotEmptyWhenThereIsNoSpaceBetweenInvertedCommandsInAttributeJBIDE1759Test;
import org.jboss.tools.jsf.jsp.ca.test.CASuggestsNotOnlyELProposalsJBIDE2437Test;
import org.jboss.tools.jsf.jsp.ca.test.CAUnnecessaryElementsForDirAttributeInXHTMLPageJBIDE1813Test;
@@ -118,8 +119,13 @@
suite.addTest(new ProjectImportTestSetup(new TestSuite(
CADefaultELStartingCharTest.class), "org.jboss.tools.jsf.ui.test", //$NON-NLS-1$
new String[] { "projects/JsfJbide1704Test", }, //$NON-NLS-1$
- new String[] { "CAForCompositeComponentTest" })); //$NON-NLS-1$
+ new String[] { "JsfJbide1704Test" })); //$NON-NLS-1$
+ suite.addTest(new ProjectImportTestSetup(new TestSuite(
+ CAJsfMessagesProposalsFilteringTest.class), "org.jboss.tools.jsf.test", //$NON-NLS-1$
+ new String[] { "projects/JSF2KickStartWithoutLibs", }, //$NON-NLS-1$
+ new String[] { "JSF2KickStartWithoutLibs" })); //$NON-NLS-1$
+
// return new TestWizardsProject(suite);
return suite;
}
14 years, 7 months
JBoss Tools SVN: r34585 - in trunk/as/plugins: org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-09-08 12:30:53 -0400 (Thu, 08 Sep 2011)
New Revision: 34585
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Domain.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/SSHKey.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/User.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/marshalling/DomainRequestJsonMarshaller.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/OpenshiftCoreActivator.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/request/AbstractDomainRequest.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/request/ChangeCreateDomainRequest.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/utils/Base64Encoder.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/ApplicationIntegrationTest.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/CartridgesIntegrationTest.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/DomainIntegrationTest.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/SSHKeyTest.java
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/Activator.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/OpenshiftServiceIntegrationTest.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftJsonConstants.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/OpenshiftException.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/UserInfo.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/marshalling/AbstractJsonMarshaller.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/marshalling/ApplicationRequestJsonMarshaller.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/marshalling/ListCartridgesRequestJsonMarshaller.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/OpenshiftService.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/request/CreateDomainRequest.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/OpenshiftServiceTest.java
Log:
[JBIDE-9510] implementing create domain
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/META-INF/MANIFEST.MF 2011-09-08 11:39:03 UTC (rev 34584)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/META-INF/MANIFEST.MF 2011-09-08 16:30:53 UTC (rev 34585)
@@ -3,9 +3,10 @@
Bundle-Name: Openshift Core Plugin
Bundle-SymbolicName: org.jboss.ide.eclipse.as.openshift.core
Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.jboss.ide.eclipse.as.openshift.internal.core.Activator
+Bundle-Activator: org.jboss.ide.eclipse.as.openshift.internal.core.OpenshiftCoreActivator
Bundle-Vendor: JBoss by Red Hat
-Require-Bundle: org.eclipse.core.runtime
+Require-Bundle: org.eclipse.core.runtime,
+ com.jcraft.jsch;bundle-version="[0.1.41,2.0.0)"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: jboss-dmr-1.0.0.Final.jar,
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Domain.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Domain.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Domain.java 2011-09-08 16:30:53 UTC (rev 34585)
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.openshift.core;
+
+
+public class Domain implements IOpenshiftObject {
+
+ private User user;
+
+ public Domain(User user) {
+ this.user = user;
+ }
+
+ public User getUser() {
+ return user;
+ }
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Domain.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftJsonConstants.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftJsonConstants.java 2011-09-08 11:39:03 UTC (rev 34584)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftJsonConstants.java 2011-09-08 16:30:53 UTC (rev 34585)
@@ -28,5 +28,7 @@
public static final String PROPERTY_ACTION = "action";
public static final String PROPERTY_CARTRIDGE = "cartridge";
public static final String PROPERTY_CARTS = "carts";
+ public static final String PROPERTY_NAMESPACE = "namespace";
+ public static final String PROPERTY_ALTER = "alter";
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java 2011-09-08 11:39:03 UTC (rev 34584)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java 2011-09-08 16:30:53 UTC (rev 34585)
@@ -12,7 +12,9 @@
import java.util.List;
-
+/**
+ * @author André Dietisheim
+ */
public interface IOpenshiftService {
public UserInfo getUserInfo() throws OpenshiftException;
@@ -23,5 +25,7 @@
public Application destroyApplication(String name, Cartridge cartridge) throws OpenshiftException;
- public Application createDomain(String name) throws OpenshiftException;
+ public Domain createDomain(String name, String sshKey) throws OpenshiftException;
+
+ public Domain createDomain(String name, SSHKey keyPair) throws OpenshiftException;
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/OpenshiftException.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/OpenshiftException.java 2011-09-08 11:39:03 UTC (rev 34584)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/OpenshiftException.java 2011-09-08 16:30:53 UTC (rev 34585)
@@ -22,4 +22,8 @@
public OpenshiftException(Throwable cause, String message, Object... arguments) {
super(MessageFormat.format(message, arguments), cause);
}
+
+ public OpenshiftException(String message, Object... arguments) {
+ super(MessageFormat.format(message, arguments));
+ }
}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/SSHKey.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/SSHKey.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/SSHKey.java 2011-09-08 16:30:53 UTC (rev 34585)
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.openshift.core;
+
+import org.jboss.ide.eclipse.as.openshift.internal.core.OpenshiftCoreActivator;
+import org.jboss.ide.eclipse.as.openshift.internal.core.utils.Base64Encoder;
+
+import com.jcraft.jsch.JSch;
+import com.jcraft.jsch.JSchException;
+import com.jcraft.jsch.KeyPair;
+
+/**
+ * @author André Dietisheim
+ */
+public class SSHKey {
+
+ private KeyPair keyPair;
+ private String privateKeyPath;
+ private String publicKeyPath;
+
+ private SSHKey(KeyPair keyPair, String privateKeyPath, String publicKeyPath) throws OpenshiftException {
+ this.keyPair = keyPair;
+ this.privateKeyPath = privateKeyPath;
+ this.publicKeyPath = publicKeyPath;
+ }
+
+ /**
+ * Creates private and public ssh-rsa keys and stores them to the given
+ * paths. The key is created while using the given pass phrase.
+ *
+ * @param passPhrase
+ * the pass phrase to set to the new key
+ * @param privateKeyPath
+ * the path where the new private key gets stored
+ * @param publicKeyPath
+ * the path where the new public key gets stored
+ * @return
+ * @throws OpenshiftException
+ * if the key could not be created
+ */
+ public static SSHKey create(String passPhrase, String privateKeyPath, String publicKeyPath)
+ throws OpenshiftException {
+ try {
+ KeyPair keyPair = KeyPair.genKeyPair(new JSch(), KeyPair.RSA);
+ keyPair.setPassphrase(passPhrase);
+ keyPair.writePublicKey(publicKeyPath, "created by " + OpenshiftCoreActivator.PLUGIN_ID);
+ keyPair.writePrivateKey(privateKeyPath);
+ return new SSHKey(keyPair, privateKeyPath, publicKeyPath);
+ } catch (Exception e) {
+ throw new OpenshiftException(e, "Could not create new rsa key", e);
+ }
+ }
+
+ public static SSHKey load(String privateKeyPath, String publicKeyPath)
+ throws OpenshiftException {
+ try {
+ KeyPair keyPair = KeyPair.load(new JSch(), privateKeyPath, publicKeyPath);
+ return new SSHKey(keyPair, privateKeyPath, publicKeyPath);
+ } catch (JSchException e) {
+ throw new OpenshiftException(e, "Could not create new rsa key");
+ }
+ }
+
+ /**
+ * Returns the content of the public key (key content without ssh-rsa
+ * identifier nor comment) of the ssh key
+ *
+ * @return the content of the public key (without signature, without
+ * comment)
+ * @throws OpenshiftException
+ */
+ public String getPublicKeyContent() throws OpenshiftException {
+ return new String(Base64Encoder.encode(keyPair.getPublicKeyBlob()));
+ }
+
+ protected String getPublicKeyPath() {
+ return publicKeyPath;
+ }
+
+ protected String getPrivateKeyPath() {
+ return privateKeyPath;
+ }
+
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/SSHKey.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/User.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/User.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/User.java 2011-09-08 16:30:53 UTC (rev 34585)
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.openshift.core;
+
+/**
+ * @author André Dietisheim
+ */
+public class User {
+
+ private String rhlogin;
+ private String uuid;
+
+ public User(String rhlogin, String uuid) {
+ this.rhlogin = rhlogin;
+ this.uuid = uuid;
+ }
+
+ public String getRhlogin() {
+ return rhlogin;
+ }
+
+ public String getUuid() {
+ return uuid;
+ }
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/User.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/UserInfo.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/UserInfo.java 2011-09-08 11:39:03 UTC (rev 34584)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/UserInfo.java 2011-09-08 16:30:53 UTC (rev 34585)
@@ -10,8 +10,6 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.openshift.core;
-import org.jboss.ide.eclipse.as.openshift.core.internal.marshalling.IOpenshiftRequest;
-
/**
* @author André Dietisheim
*/
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/marshalling/AbstractJsonMarshaller.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/marshalling/AbstractJsonMarshaller.java 2011-09-08 11:39:03 UTC (rev 34584)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/marshalling/AbstractJsonMarshaller.java 2011-09-08 16:30:53 UTC (rev 34585)
@@ -23,11 +23,11 @@
ModelNode node = new ModelNode();
node.get(IOpenshiftJsonConstants.PROPERTY_RHLOGIN).set(request.getRhLogin());
node.get(IOpenshiftJsonConstants.PROPERTY_DEBUG).set(String.valueOf(request.isDebug()));
- setNodeProperties(node, request);
+ setJsonDataProperties(node, request);
return node.toJSONString(true);
}
- protected void setNodeProperties(ModelNode node, REQUEST request) {
+ protected void setJsonDataProperties(ModelNode node, REQUEST request) {
// empty default implementation
}
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/marshalling/ApplicationRequestJsonMarshaller.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/marshalling/ApplicationRequestJsonMarshaller.java 2011-09-08 11:39:03 UTC (rev 34584)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/marshalling/ApplicationRequestJsonMarshaller.java 2011-09-08 16:30:53 UTC (rev 34585)
@@ -22,7 +22,7 @@
public class ApplicationRequestJsonMarshaller extends AbstractJsonMarshaller<ApplicationRequest> {
@Override
- protected void setNodeProperties(ModelNode node, ApplicationRequest request) {
+ protected void setJsonDataProperties(ModelNode node, ApplicationRequest request) {
node.get(IOpenshiftJsonConstants.PROPERTY_CARTRIDGE).set(getCartridgeName(request.getCartridge()));
node.get(IOpenshiftJsonConstants.PROPERTY_ACTION).set(getActionName(request.getAction()));
node.get(IOpenshiftJsonConstants.PROPERTY_APP_NAME).set(request.getName());
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/marshalling/DomainRequestJsonMarshaller.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/marshalling/DomainRequestJsonMarshaller.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/marshalling/DomainRequestJsonMarshaller.java 2011-09-08 16:30:53 UTC (rev 34585)
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.openshift.core.internal.marshalling;
+
+import org.jboss.dmr.ModelNode;
+import org.jboss.ide.eclipse.as.openshift.core.IOpenshiftJsonConstants;
+import org.jboss.ide.eclipse.as.openshift.internal.core.request.AbstractDomainRequest;
+
+/**
+ * @author André Dietisheim
+ */
+public class DomainRequestJsonMarshaller extends AbstractJsonMarshaller<AbstractDomainRequest> {
+
+ @Override
+ protected void setJsonDataProperties(ModelNode node, AbstractDomainRequest request) {
+ node.get(IOpenshiftJsonConstants.PROPERTY_NAMESPACE).set(request.getName());
+ node.get(IOpenshiftJsonConstants.PROPERTY_ALTER).set(request.isAlter());
+ }
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/marshalling/DomainRequestJsonMarshaller.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/marshalling/ListCartridgesRequestJsonMarshaller.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/marshalling/ListCartridgesRequestJsonMarshaller.java 2011-09-08 11:39:03 UTC (rev 34584)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/marshalling/ListCartridgesRequestJsonMarshaller.java 2011-09-08 16:30:53 UTC (rev 34585)
@@ -20,7 +20,7 @@
public class ListCartridgesRequestJsonMarshaller extends AbstractJsonMarshaller<ListCartridgesRequest> {
@Override
- protected void setNodeProperties(ModelNode node, ListCartridgesRequest request) {
+ protected void setJsonDataProperties(ModelNode node, ListCartridgesRequest request) {
node.get(IOpenshiftJsonConstants.PROPERTY_CART_TYPE).set(request.getCartType());
}
}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/Activator.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/Activator.java 2011-09-08 11:39:03 UTC (rev 34584)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/Activator.java 2011-09-08 16:30:53 UTC (rev 34585)
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.openshift.internal.core;
-
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-public class Activator implements BundleActivator {
-
- private static BundleContext context;
-
- static BundleContext getContext() {
- return context;
- }
-
- public void start(BundleContext bundleContext) throws Exception {
- Activator.context = bundleContext;
- }
-
- public void stop(BundleContext bundleContext) throws Exception {
- Activator.context = null;
- }
-}
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/OpenshiftCoreActivator.java (from rev 34538, trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/Activator.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/OpenshiftCoreActivator.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/OpenshiftCoreActivator.java 2011-09-08 16:30:53 UTC (rev 34585)
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.openshift.internal.core;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class OpenshiftCoreActivator implements BundleActivator {
+
+ public static final String PLUGIN_ID = "org.jboss.ide.eclipse.as.openshift.core";
+
+ private static BundleContext context;
+
+ static BundleContext getContext() {
+ return context;
+ }
+
+ public void start(BundleContext bundleContext) throws Exception {
+ OpenshiftCoreActivator.context = bundleContext;
+ }
+
+ public void stop(BundleContext bundleContext) throws Exception {
+ OpenshiftCoreActivator.context = null;
+ }
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/OpenshiftCoreActivator.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/OpenshiftService.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/OpenshiftService.java 2011-09-08 11:39:03 UTC (rev 34584)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/OpenshiftService.java 2011-09-08 16:30:53 UTC (rev 34585)
@@ -16,20 +16,26 @@
import org.jboss.ide.eclipse.as.openshift.core.Application;
import org.jboss.ide.eclipse.as.openshift.core.Cartridge;
+import org.jboss.ide.eclipse.as.openshift.core.Domain;
import org.jboss.ide.eclipse.as.openshift.core.IHttpClient;
import org.jboss.ide.eclipse.as.openshift.core.IOpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.InvalidCredentialsOpenshiftException;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftEndpointException;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
+import org.jboss.ide.eclipse.as.openshift.core.SSHKey;
+import org.jboss.ide.eclipse.as.openshift.core.User;
import org.jboss.ide.eclipse.as.openshift.core.UserInfo;
import org.jboss.ide.eclipse.as.openshift.core.internal.marshalling.ApplicationRequestJsonMarshaller;
+import org.jboss.ide.eclipse.as.openshift.core.internal.marshalling.DomainRequestJsonMarshaller;
import org.jboss.ide.eclipse.as.openshift.core.internal.marshalling.ListCartridgesRequestJsonMarshaller;
import org.jboss.ide.eclipse.as.openshift.core.internal.marshalling.UserInfoRequestJsonMarshaller;
import org.jboss.ide.eclipse.as.openshift.internal.core.httpclient.HttpClientException;
import org.jboss.ide.eclipse.as.openshift.internal.core.httpclient.UnauthorizedException;
import org.jboss.ide.eclipse.as.openshift.internal.core.httpclient.UrlConnectionHttpClient;
+import org.jboss.ide.eclipse.as.openshift.internal.core.request.AbstractDomainRequest;
import org.jboss.ide.eclipse.as.openshift.internal.core.request.ApplicationAction;
import org.jboss.ide.eclipse.as.openshift.internal.core.request.ApplicationRequest;
+import org.jboss.ide.eclipse.as.openshift.internal.core.request.CreateDomainRequest;
import org.jboss.ide.eclipse.as.openshift.internal.core.request.ListCartridgesRequest;
import org.jboss.ide.eclipse.as.openshift.internal.core.request.OpenshiftJsonRequestFactory;
import org.jboss.ide.eclipse.as.openshift.internal.core.request.UserInfoRequest;
@@ -72,7 +78,7 @@
/**
* WARNING: the current server implementation returns invalid json.
*
- * @see ListCartridgesResponseUnmarshaller
+ * @see ListCartridgesResponseUnmarshaller
*/
@Override
public List<Cartridge> getCartridges() throws OpenshiftException {
@@ -91,11 +97,32 @@
}
}
+ public Domain createDomain(String name, SSHKey sshKey) throws OpenshiftException {
+ return createDomain(name, sshKey.getPublicKeyContent());
+ }
+
@Override
- public Application createDomain(String name) throws OpenshiftException {
- throw new UnsupportedOperationException();
+ public Domain createDomain(String name, String sshKey) throws OpenshiftException {
+ return requestDomainAction(new CreateDomainRequest(name, sshKey, username, true));
}
+ protected Domain requestDomainAction(AbstractDomainRequest request) throws OpenshiftException {
+ String url = request.getUrlString(BASE_URL);
+ try {
+ String requestString =
+ new OpenshiftJsonRequestFactory(
+ password,
+ new DomainRequestJsonMarshaller().marshall(request))
+ .create();
+ String domainReponse = createHttpClient(url).post(requestString);
+ return new Domain(new User("", ""));
+ } catch (MalformedURLException e) {
+ throw new OpenshiftEndpointException(url, e, "Could not list available cartridges at \"{0}\"", url);
+ } catch (HttpClientException e) {
+ throw new OpenshiftEndpointException(url, e, "Could not list available cartridges at \"{0}\"", url);
+ }
+ }
+
@Override
public Application createApplication(String name, Cartridge cartridge) throws OpenshiftException {
return requestApplicationAction(name, cartridge,
@@ -125,7 +152,8 @@
applicationRequest.getAction().toHumanReadable(), name, url);
} catch (UnauthorizedException e) {
throw new InvalidCredentialsOpenshiftException(
- url, e, "Could not {0} application \"{1}\" at \"{2}\": Invalid credentials user \"{3}\", password \"{4}\"",
+ url, e,
+ "Could not {0} application \"{1}\" at \"{2}\": Invalid credentials user \"{3}\", password \"{4}\"",
applicationRequest.getAction().toHumanReadable(), name, url, username, password);
} catch (HttpClientException e) {
throw new OpenshiftEndpointException(
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/request/AbstractDomainRequest.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/request/AbstractDomainRequest.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/request/AbstractDomainRequest.java 2011-09-08 16:30:53 UTC (rev 34585)
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.openshift.internal.core.request;
+
+
+/**
+ * @author André Dietisheim
+ */
+public abstract class AbstractDomainRequest extends AbstractOpenshiftRequest {
+
+ private String name;
+ private String sshKey;
+
+ public AbstractDomainRequest(String name, String sshKey, ApplicationAction action, String username) {
+ this(name, sshKey, username, false);
+ }
+
+ public AbstractDomainRequest(String name, String sshKey, String username, boolean debug) {
+ super(username, debug);
+ this.name = name;
+ this.sshKey = sshKey;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getSshKey() {
+ return sshKey;
+ }
+
+ @Override
+ public String getResourcePath() {
+ return "domain";
+ }
+
+ public abstract boolean isAlter();
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/request/AbstractDomainRequest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/request/ChangeCreateDomainRequest.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/request/ChangeCreateDomainRequest.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/request/ChangeCreateDomainRequest.java 2011-09-08 16:30:53 UTC (rev 34585)
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.openshift.internal.core.request;
+
+
+/**
+ * @author André Dietisheim
+ */
+public class ChangeCreateDomainRequest extends AbstractDomainRequest {
+
+ public ChangeCreateDomainRequest(String name, String namespace, String sshKey, ApplicationAction action, String username) {
+ this(name, namespace, sshKey, username, false);
+ }
+
+ public ChangeCreateDomainRequest(String name, String namespace, String sshKey, String username, boolean debug) {
+ super(name, sshKey, username, debug);
+ }
+
+ public boolean isAlter() {
+ return true;
+ }
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/request/ChangeCreateDomainRequest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/request/CreateDomainRequest.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/request/CreateDomainRequest.java 2011-09-08 11:39:03 UTC (rev 34584)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/request/CreateDomainRequest.java 2011-09-08 16:30:53 UTC (rev 34585)
@@ -14,37 +14,17 @@
/**
* @author André Dietisheim
*/
-public class CreateDomainRequest extends AbstractOpenshiftRequest {
+public class CreateDomainRequest extends AbstractDomainRequest {
- private String name;
- private String sshKey;
- private String namespace;
-
- public CreateDomainRequest(String name, String namespace, String sshKey, ApplicationAction action, String username) {
- this(name, namespace, sshKey, username, false);
+ public CreateDomainRequest(String name, String sshKey, ApplicationAction action, String username) {
+ this(name, sshKey, username, false);
}
- public CreateDomainRequest(String name, String namespace, String sshKey, String username, boolean debug) {
- super(username, debug);
- this.name = name;
- this.namespace = namespace;
- this.sshKey = sshKey;
+ public CreateDomainRequest(String name, String sshKey, String username, boolean debug) {
+ super(name, sshKey, username, debug);
}
- public String getName() {
- return name;
+ public boolean isAlter() {
+ return false;
}
-
- protected String getSshKey() {
- return sshKey;
- }
-
- protected String getNamespace() {
- return namespace;
- }
-
- @Override
- public String getResourcePath() {
- return "domain";
- }
}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/utils/Base64Encoder.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/utils/Base64Encoder.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/utils/Base64Encoder.java 2011-09-08 16:30:53 UTC (rev 34585)
@@ -0,0 +1,79 @@
+/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
+/*
+Copyright (c) 2002-2008 ymnk, JCraft,Inc. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the distribution.
+
+ 3. The names of the authors may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
+INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+package org.jboss.ide.eclipse.as.openshift.internal.core.utils;
+
+public class Base64Encoder {
+
+ private static final byte[] b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".getBytes();
+
+ public static byte[] encode(byte[] buf) {
+ return encode(buf, 0, buf.length);
+ }
+
+ public static byte[] encode(byte[] buf, int start, int length) {
+ byte[] tmp = new byte[length * 2];
+ int i, j, k;
+
+ int foo = (length / 3) * 3 + start;
+ i = 0;
+ for (j = start; j < foo; j += 3) {
+ k = (buf[j] >>> 2) & 0x3f;
+ tmp[i++] = b64[k];
+ k = (buf[j] & 0x03) << 4 | (buf[j + 1] >>> 4) & 0x0f;
+ tmp[i++] = b64[k];
+ k = (buf[j + 1] & 0x0f) << 2 | (buf[j + 2] >>> 6) & 0x03;
+ tmp[i++] = b64[k];
+ k = buf[j + 2] & 0x3f;
+ tmp[i++] = b64[k];
+ }
+
+ foo = (start + length) - foo;
+ if (foo == 1) {
+ k = (buf[j] >>> 2) & 0x3f;
+ tmp[i++] = b64[k];
+ k = ((buf[j] & 0x03) << 4) & 0x3f;
+ tmp[i++] = b64[k];
+ tmp[i++] = (byte) '=';
+ tmp[i++] = (byte) '=';
+ }
+ else if (foo == 2) {
+ k = (buf[j] >>> 2) & 0x3f;
+ tmp[i++] = b64[k];
+ k = (buf[j] & 0x03) << 4 | (buf[j + 1] >>> 4) & 0x0f;
+ tmp[i++] = b64[k];
+ k = ((buf[j + 1] & 0x0f) << 2) & 0x3f;
+ tmp[i++] = b64[k];
+ tmp[i++] = (byte) '=';
+ }
+ byte[] bar = new byte[i];
+ System.arraycopy(tmp, 0, bar, 0, i);
+ return bar;
+ }
+
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/utils/Base64Encoder.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/ApplicationIntegrationTest.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/ApplicationIntegrationTest.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/ApplicationIntegrationTest.java 2011-09-08 16:30:53 UTC (rev 34585)
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.openshift.internal.test.core;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import org.jboss.ide.eclipse.as.openshift.core.Application;
+import org.jboss.ide.eclipse.as.openshift.core.Cartridge;
+import org.jboss.ide.eclipse.as.openshift.core.IOpenshiftService;
+import org.jboss.ide.eclipse.as.openshift.core.InvalidCredentialsOpenshiftException;
+import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
+import org.jboss.ide.eclipse.as.openshift.internal.core.OpenshiftService;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * @author André Dietisheim
+ */
+public class ApplicationIntegrationTest {
+
+ private OpenshiftService openshiftService;
+ private OpenshiftService invalidCredentialsOpenshiftService;
+
+ private static final String USERNAME = "toolsjboss(a)gmail.com";
+ private static final String PASSWORD = "1q2w3e";
+
+ @Before
+ public void setUp() {
+ this.openshiftService = new OpenshiftService(USERNAME, PASSWORD);
+ this.invalidCredentialsOpenshiftService = new OpenshiftService(USERNAME, "bogus");
+ }
+
+ @Test(expected = InvalidCredentialsOpenshiftException.class)
+ public void createApplicationWithInvalidCredentialsThrowsException() throws Exception {
+ invalidCredentialsOpenshiftService.createApplication(createRandomApplicationName(), Cartridge.JBOSSAS_7);
+ }
+
+ @Test
+ public void canCreateApplication() throws Exception {
+ String applicationName = createRandomApplicationName();
+ try {
+ Cartridge cartridge = Cartridge.JBOSSAS_7;
+ Application application = openshiftService.createApplication(applicationName, cartridge);
+ assertNotNull(application);
+ assertEquals(applicationName, application.getName());
+ assertEquals(cartridge, application.getCartridge());
+ } finally {
+ silentlyDestroyApplication(applicationName, openshiftService);
+ }
+ }
+
+ @Test
+ public void canDestroyApplication() throws Exception {
+ String applicationName = createRandomApplicationName();
+ openshiftService.createApplication(applicationName, Cartridge.JBOSSAS_7);
+ openshiftService.destroyApplication(applicationName, Cartridge.JBOSSAS_7);
+ }
+
+ @Test(expected = OpenshiftException.class)
+ public void createDuplicateApplicationThrowsException() throws Exception {
+ String applicationName = createRandomApplicationName();
+ openshiftService.createApplication(applicationName, Cartridge.JBOSSAS_7);
+ openshiftService.createApplication(applicationName, Cartridge.JBOSSAS_7);
+ }
+
+ private String createRandomApplicationName() {
+ return String.valueOf(System.currentTimeMillis());
+ }
+
+ private void silentlyDestroyApplication(String name, IOpenshiftService service) {
+ try {
+ service.destroyApplication(name, Cartridge.JBOSSAS_7);
+ } catch (OpenshiftException e) {
+ e.printStackTrace();
+ }
+ }
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/ApplicationIntegrationTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/CartridgesIntegrationTest.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/CartridgesIntegrationTest.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/CartridgesIntegrationTest.java 2011-09-08 16:30:53 UTC (rev 34585)
@@ -0,0 +1,33 @@
+package org.jboss.ide.eclipse.as.openshift.internal.test.core;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.List;
+
+import org.jboss.ide.eclipse.as.openshift.core.Cartridge;
+import org.jboss.ide.eclipse.as.openshift.internal.core.OpenshiftService;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+public class CartridgesIntegrationTest {
+
+ private OpenshiftService openshiftService;
+
+ private static final String USERNAME = "toolsjboss(a)gmail.com";
+ private static final String PASSWORD = "1q2w3e";
+
+ @Before
+ public void setUp() {
+ this.openshiftService = new OpenshiftService(USERNAME, PASSWORD);
+ }
+
+ @Ignore
+ @Test
+ public void canRequestListCartridges() throws Exception {
+ List<Cartridge> cartridges = openshiftService.getCartridges();
+ assertNotNull(cartridges);
+ assertTrue(cartridges.size() > 0);
+ }
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/CartridgesIntegrationTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/DomainIntegrationTest.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/DomainIntegrationTest.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/DomainIntegrationTest.java 2011-09-08 16:30:53 UTC (rev 34585)
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.openshift.internal.test.core;
+
+import static org.junit.Assert.assertNotNull;
+
+import org.jboss.ide.eclipse.as.openshift.core.Domain;
+import org.jboss.ide.eclipse.as.openshift.internal.core.OpenshiftService;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+public class DomainIntegrationTest {
+
+ private OpenshiftService openshiftService;
+
+ private static final String USERNAME = "toolsjboss(a)gmail.com";
+ private static final String PASSWORD = "1q2w3e";
+
+ @Before
+ public void setUp() {
+ this.openshiftService = new OpenshiftService(USERNAME, PASSWORD);
+ }
+
+ @Ignore
+ @Test
+ public void canCreateDomain() throws Exception {
+ String name = createRandomDomainName();
+ Domain domain = openshiftService.createDomain(name, (String) null);
+ assertNotNull(domain);
+ }
+
+ private String createRandomDomainName() {
+ return String.valueOf(System.currentTimeMillis());
+ }
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/DomainIntegrationTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/OpenshiftServiceIntegrationTest.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/OpenshiftServiceIntegrationTest.java 2011-09-08 11:39:03 UTC (rev 34584)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/OpenshiftServiceIntegrationTest.java 2011-09-08 16:30:53 UTC (rev 34585)
@@ -1,92 +0,0 @@
-package org.jboss.ide.eclipse.as.openshift.internal.test.core;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.List;
-
-import org.jboss.ide.eclipse.as.openshift.core.Application;
-import org.jboss.ide.eclipse.as.openshift.core.Cartridge;
-import org.jboss.ide.eclipse.as.openshift.core.IOpenshiftService;
-import org.jboss.ide.eclipse.as.openshift.core.InvalidCredentialsOpenshiftException;
-import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
-import org.jboss.ide.eclipse.as.openshift.internal.core.OpenshiftService;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-
-public class OpenshiftServiceIntegrationTest {
-
- private OpenshiftService openshiftService;
- private OpenshiftService invalidCredentialsOpenshiftService;
-
- private static final String USERNAME = "toolsjboss(a)gmail.com";
- private static final String PASSWORD = "1q2w3e";
-
- @Before
- public void setUp() {
- this.openshiftService = new OpenshiftService(USERNAME, PASSWORD);
- this.invalidCredentialsOpenshiftService = new OpenshiftService(USERNAME, "bogus");
- }
-
- @Ignore
- @Test(expected = OpenshiftException.class)
- public void cannotGetUserInfoIfNotAppNorDomainCreated() throws OpenshiftException {
- openshiftService.getUserInfo();
- }
-
- @Ignore
- @Test
- public void canRequestListCartridges() throws Exception {
- List<Cartridge> cartridges = openshiftService.getCartridges();
- assertNotNull(cartridges);
- assertTrue(cartridges.size() > 0);
- }
-
- @Test(expected = InvalidCredentialsOpenshiftException.class)
- public void createApplicationWithInvalidCredentialsThrowsException() throws Exception {
- invalidCredentialsOpenshiftService.createApplication(createRandomApplicationName(), Cartridge.JBOSSAS_7);
- }
-
- @Test
- public void canCreateApplication() throws Exception {
- String applicationName = createRandomApplicationName();
- try {
- Cartridge cartridge = Cartridge.JBOSSAS_7;
- Application application = openshiftService.createApplication(applicationName, cartridge);
- assertNotNull(application);
- assertEquals(applicationName, application.getName());
- assertEquals(cartridge, application.getCartridge());
- } finally {
- silentlyDestroyApplication(applicationName, openshiftService);
- }
- }
-
- @Test
- public void canDestroyApplication() throws Exception {
- String applicationName = createRandomApplicationName();
- openshiftService.createApplication(applicationName, Cartridge.JBOSSAS_7);
- openshiftService.destroyApplication(applicationName, Cartridge.JBOSSAS_7);
- }
-
- @Test(expected = OpenshiftException.class)
- public void createDuplicateApplicationThrowsException() throws Exception {
- String applicationName = createRandomApplicationName();
- openshiftService.createApplication(applicationName, Cartridge.JBOSSAS_7);
- openshiftService.createApplication(applicationName, Cartridge.JBOSSAS_7);
- }
-
- private String createRandomApplicationName() {
- return String.valueOf(System.currentTimeMillis());
- }
-
- private void silentlyDestroyApplication(String name, IOpenshiftService service) {
- try {
- service.destroyApplication(name, Cartridge.JBOSSAS_7);
- } catch (OpenshiftException e) {
- e.printStackTrace();
- }
-
- }
-}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/OpenshiftServiceTest.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/OpenshiftServiceTest.java 2011-09-08 11:39:03 UTC (rev 34584)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/OpenshiftServiceTest.java 2011-09-08 16:30:53 UTC (rev 34585)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.ide.eclipse.as.openshift.internal.test.core;
import static org.junit.Assert.assertEquals;
@@ -21,6 +31,9 @@
import org.jboss.ide.eclipse.as.openshift.internal.core.response.OpenshiftResponse;
import org.junit.Test;
+/**
+ * @author André Dietisheim
+ */
public class OpenshiftServiceTest {
private static final String USERNAME = "toolsjboss(a)gmail.com";
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/SSHKeyTest.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/SSHKeyTest.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/SSHKeyTest.java 2011-09-08 16:30:53 UTC (rev 34585)
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.openshift.internal.test.core;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.jboss.ide.eclipse.as.openshift.core.SSHKey;
+import org.junit.Test;
+
+public class SSHKeyTest {
+
+ private static final String PASSPHRASE = "12345";
+
+ @Test
+ public void canCreatePublicKey() throws Exception {
+ String publicKeyPath = createTempFile().getAbsolutePath();
+ String privateKeyPath = createTempFile().getAbsolutePath();
+ SSHKey sshKey = SSHKey.create(PASSPHRASE, privateKeyPath, publicKeyPath);
+ String publicKey = sshKey.getPublicKeyContent();
+
+ assertNotNull(publicKey);
+ assertTrue(!publicKey.contains("ssh-rsa")); // no identifier
+ assertTrue(!publicKey.contains(" ")); // no comment
+ }
+
+ @Test
+ public void canLoadPublicKey() throws Exception {
+ String publicKeyPath = createTempFile().getAbsolutePath();
+ String privateKeyPath = createTempFile().getAbsolutePath();
+ SSHKey.create(PASSPHRASE, privateKeyPath, publicKeyPath);
+
+ SSHKey sshKey = SSHKey.load(privateKeyPath, publicKeyPath);
+ String publicKey = sshKey.getPublicKeyContent();
+
+ assertNotNull(publicKey);
+ assertTrue(!publicKey.contains("ssh-rsa")); // no identifier
+ assertTrue(!publicKey.contains(" ")); // no comment
+ }
+
+ private File createTempFile() throws IOException {
+ return File.createTempFile(String.valueOf(System.currentTimeMillis()), null);
+ }
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/SSHKeyTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
14 years, 7 months
JBoss Tools SVN: r34584 - in trunk/as/plugins: org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/marshalling and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-09-08 07:39:03 -0400 (Thu, 08 Sep 2011)
New Revision: 34584
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Cartridge.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/UserInfo.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/OpenshiftService.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/httpclient/
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/httpclient/BadRequestException.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/httpclient/HttpClientException.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/httpclient/InternalServerErrorException.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/httpclient/NotFoundException.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/httpclient/UnauthorizedException.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/httpclient/UrlConnectionHttpClient.java
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/OpenshiftService.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/BadRequestException.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/Cartridge.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/HttpClientException.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/InternalServerErrorException.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/NotFoundException.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/UnauthorizedException.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/UrlConnectionHttpClient.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/UserInfo.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Application.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IHttpClient.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/marshalling/ApplicationRequestJsonMarshaller.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/request/ApplicationRequest.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/response/ApplicationResponseUnmarshaller.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/response/ListCartridgesResponseUnmarshaller.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/OpenshiftServiceIntegrationTest.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/OpenshiftServiceTest.java
Log:
[JBIDE-9510] corrected package structure
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Application.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Application.java 2011-09-08 11:10:05 UTC (rev 34583)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Application.java 2011-09-08 11:39:03 UTC (rev 34584)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.openshift.core;
-import org.jboss.ide.eclipse.as.openshift.internal.core.Cartridge;
public class Application implements IOpenshiftObject {
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Cartridge.java (from rev 34570, trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/Cartridge.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Cartridge.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Cartridge.java 2011-09-08 11:39:03 UTC (rev 34584)
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.openshift.core;
+
+
+/**
+ * @author André Dietisheim
+ */
+public class Cartridge implements IOpenshiftObject {
+
+ public static final Cartridge JBOSSAS_7 = new Cartridge("jbossas-7.0");
+
+ private String name;
+
+ public Cartridge(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Cartridge.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IHttpClient.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IHttpClient.java 2011-09-08 11:10:05 UTC (rev 34583)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IHttpClient.java 2011-09-08 11:39:03 UTC (rev 34584)
@@ -1,6 +1,6 @@
package org.jboss.ide.eclipse.as.openshift.core;
-import org.jboss.ide.eclipse.as.openshift.internal.core.HttpClientException;
+import org.jboss.ide.eclipse.as.openshift.internal.core.httpclient.HttpClientException;
public interface IHttpClient {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java 2011-09-08 11:10:05 UTC (rev 34583)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java 2011-09-08 11:39:03 UTC (rev 34584)
@@ -12,8 +12,6 @@
import java.util.List;
-import org.jboss.ide.eclipse.as.openshift.internal.core.Cartridge;
-import org.jboss.ide.eclipse.as.openshift.internal.core.UserInfo;
public interface IOpenshiftService {
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/OpenshiftService.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/OpenshiftService.java 2011-09-08 11:10:05 UTC (rev 34583)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/OpenshiftService.java 2011-09-08 11:39:03 UTC (rev 34584)
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.openshift.core;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.List;
-
-import org.jboss.ide.eclipse.as.openshift.core.internal.marshalling.ApplicationRequestJsonMarshaller;
-import org.jboss.ide.eclipse.as.openshift.core.internal.marshalling.ListCartridgesRequestJsonMarshaller;
-import org.jboss.ide.eclipse.as.openshift.core.internal.marshalling.UserInfoRequestJsonMarshaller;
-import org.jboss.ide.eclipse.as.openshift.internal.core.Cartridge;
-import org.jboss.ide.eclipse.as.openshift.internal.core.HttpClientException;
-import org.jboss.ide.eclipse.as.openshift.internal.core.UnauthorizedException;
-import org.jboss.ide.eclipse.as.openshift.internal.core.UrlConnectionHttpClient;
-import org.jboss.ide.eclipse.as.openshift.internal.core.UserInfo;
-import org.jboss.ide.eclipse.as.openshift.internal.core.request.ApplicationAction;
-import org.jboss.ide.eclipse.as.openshift.internal.core.request.ApplicationRequest;
-import org.jboss.ide.eclipse.as.openshift.internal.core.request.ListCartridgesRequest;
-import org.jboss.ide.eclipse.as.openshift.internal.core.request.OpenshiftJsonRequestFactory;
-import org.jboss.ide.eclipse.as.openshift.internal.core.request.UserInfoRequest;
-import org.jboss.ide.eclipse.as.openshift.internal.core.response.ApplicationResponseUnmarshaller;
-import org.jboss.ide.eclipse.as.openshift.internal.core.response.OpenshiftResponse;
-
-/**
- * @author André Dietisheim
- */
-public class OpenshiftService implements IOpenshiftService {
-
- private static final String BASE_URL = "https://openshift.redhat.com/broker";
-
- private String username;
- private String password;
-
- public OpenshiftService(String username, String password) {
- this.username = username;
- this.password = password;
- }
-
- public UserInfo getUserInfo() throws OpenshiftException {
- UserInfoRequest userInfoRequest = new UserInfoRequest(username, true);
- String url = userInfoRequest.getUrlString(BASE_URL);
- try {
- String userInfoRequestString = new UserInfoRequestJsonMarshaller().marshall(userInfoRequest);
- String request = new OpenshiftJsonRequestFactory(password, userInfoRequestString).create();
- String userInfoResponse = createHttpClient(url).post(request);
- throw new UnsupportedOperationException();
- } catch (MalformedURLException e) {
- throw new OpenshiftEndpointException(
- url, e, "Could not get user info for user \"{0}\" at \"{1}\"", username, url, e);
- } catch (HttpClientException e) {
- throw new OpenshiftEndpointException(
- url, e, "Could not get user info for user \"{0}\" at \"{1}\"", username, url, e);
- }
- }
-
- @Override
- public List<Cartridge> getCartridges() throws OpenshiftException {
- ListCartridgesRequest listCartridgesRequest = new ListCartridgesRequest(username, true);
- String url = listCartridgesRequest.getUrlString(BASE_URL);
- try {
- String listCartridgesRequestString =
- new ListCartridgesRequestJsonMarshaller().marshall(listCartridgesRequest);
- String request = new OpenshiftJsonRequestFactory(password, listCartridgesRequestString).create();
- String listCatridgesReponse = createHttpClient(url).post(request);
- throw new UnsupportedOperationException();
- } catch (MalformedURLException e) {
- throw new OpenshiftEndpointException(url, e, "Could not list available cartridges at \"{0}\"", url);
- } catch (HttpClientException e) {
- throw new OpenshiftEndpointException(url, e, "Could not list available cartridges at \"{0}\"", url);
- }
- }
-
- @Override
- public Application createDomain(String name) throws OpenshiftException {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public Application createApplication(String name, Cartridge cartridge) throws OpenshiftException {
- return requestApplicationAction(name, cartridge,
- new ApplicationRequest(name, cartridge, ApplicationAction.CONFIGURE, username, true));
- }
-
- @Override
- public Application destroyApplication(String name, Cartridge cartridge) throws OpenshiftException {
- return requestApplicationAction(name, cartridge,
- new ApplicationRequest(name, cartridge, ApplicationAction.DECONFIGURE, username, true));
- }
-
- protected Application requestApplicationAction(String name, Cartridge cartridge,
- ApplicationRequest applicationRequest) throws OpenshiftException {
- String url = applicationRequest.getUrlString(BASE_URL);
- try {
- String applicationRequestString =
- new ApplicationRequestJsonMarshaller().marshall(applicationRequest);
- String request = new OpenshiftJsonRequestFactory(password, applicationRequestString).create();
- String response = createHttpClient(url).post(request);
- OpenshiftResponse<Application> openshiftResponse = new ApplicationResponseUnmarshaller(response, name,
- cartridge).unmarshall();
- return openshiftResponse.getData();
- } catch (MalformedURLException e) {
- throw new OpenshiftException(
- e, "Could not {0} application \"{1}\" at \"{2}\": Invalid url \"{2}\"",
- applicationRequest.getAction().toHumanReadable(), name, url);
- } catch (UnauthorizedException e) {
- throw new InvalidCredentialsOpenshiftException(
- url, e, "Could not {0} application \"{1}\" at \"{2}\": Invalid credentials user \"{3}\", password \"{4}\"",
- applicationRequest.getAction().toHumanReadable(), name, url, username, password);
- } catch (HttpClientException e) {
- throw new OpenshiftEndpointException(
- url, e, "Could not {0} application \"{1}\" at \"{2}\"",
- applicationRequest.getAction().toHumanReadable(), name, url);
- }
- }
-
- private IHttpClient createHttpClient(String url) throws MalformedURLException {
- return new UrlConnectionHttpClient(new URL(url));
- }
-
-}
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/UserInfo.java (from rev 34538, trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/UserInfo.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/UserInfo.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/UserInfo.java 2011-09-08 11:39:03 UTC (rev 34584)
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.openshift.core;
+
+import org.jboss.ide.eclipse.as.openshift.core.internal.marshalling.IOpenshiftRequest;
+
+/**
+ * @author André Dietisheim
+ */
+public class UserInfo implements IOpenshiftObject {
+
+ private String rhlogin;
+ private String uuId;
+ private String sshKey;
+ private String rhcDomain;
+ private String namespace;
+
+ public UserInfo(String rhlogin, String uuid, String sshKey, String rhcDomain, String namespace) {
+ this.rhlogin = rhlogin;
+ this.uuId = uuid;
+ this.sshKey = sshKey;
+ this.rhcDomain = rhcDomain;
+ this.namespace = namespace;
+ }
+
+ public String getRhlogin() {
+ return rhlogin;
+ }
+
+ public String getUuId() {
+ return uuId;
+ }
+
+ public String getRhcDomain() {
+ return rhcDomain;
+ }
+
+ public String getSSHKey() {
+ return sshKey;
+ }
+
+ public String getNamespace() {
+ return namespace;
+ }
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/UserInfo.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/marshalling/ApplicationRequestJsonMarshaller.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/marshalling/ApplicationRequestJsonMarshaller.java 2011-09-08 11:10:05 UTC (rev 34583)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/marshalling/ApplicationRequestJsonMarshaller.java 2011-09-08 11:39:03 UTC (rev 34584)
@@ -11,8 +11,8 @@
package org.jboss.ide.eclipse.as.openshift.core.internal.marshalling;
import org.jboss.dmr.ModelNode;
+import org.jboss.ide.eclipse.as.openshift.core.Cartridge;
import org.jboss.ide.eclipse.as.openshift.core.IOpenshiftJsonConstants;
-import org.jboss.ide.eclipse.as.openshift.internal.core.Cartridge;
import org.jboss.ide.eclipse.as.openshift.internal.core.request.ApplicationAction;
import org.jboss.ide.eclipse.as.openshift.internal.core.request.ApplicationRequest;
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/BadRequestException.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/BadRequestException.java 2011-09-08 11:10:05 UTC (rev 34583)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/BadRequestException.java 2011-09-08 11:39:03 UTC (rev 34584)
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.openshift.internal.core;
-
-/**
- * @author André Dietisheim
- */
-public class BadRequestException extends HttpClientException {
-
- private static final long serialVersionUID = 1L;
-
- public BadRequestException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public BadRequestException(Throwable cause) {
- super(cause);
- }
-}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/Cartridge.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/Cartridge.java 2011-09-08 11:10:05 UTC (rev 34583)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/Cartridge.java 2011-09-08 11:39:03 UTC (rev 34584)
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.openshift.internal.core;
-
-import org.jboss.ide.eclipse.as.openshift.core.IOpenshiftObject;
-
-/**
- * @author André Dietisheim
- */
-public class Cartridge implements IOpenshiftObject {
-
- public static final Cartridge JBOSSAS_7 = new Cartridge("jbossas-7.0");
-
- private String name;
-
- public Cartridge(String name) {
- this.name = name;
- }
-
- public String getName() {
- return name;
- }
-}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/HttpClientException.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/HttpClientException.java 2011-09-08 11:10:05 UTC (rev 34583)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/HttpClientException.java 2011-09-08 11:39:03 UTC (rev 34584)
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.openshift.internal.core;
-
-/**
- * @author André Dietisheim
- */
-public class HttpClientException extends Exception {
-
- private static final long serialVersionUID = 1L;
-
- public HttpClientException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public HttpClientException(String message) {
- super(message);
- }
-
- public HttpClientException(Throwable cause) {
- super(cause);
- }
-
-}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/InternalServerErrorException.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/InternalServerErrorException.java 2011-09-08 11:10:05 UTC (rev 34583)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/InternalServerErrorException.java 2011-09-08 11:39:03 UTC (rev 34584)
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.openshift.internal.core;
-
-/**
- * @author André Dietisheim
- */
-public class InternalServerErrorException extends HttpClientException {
-
- private static final long serialVersionUID = 1L;
-
- public InternalServerErrorException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public InternalServerErrorException(String message) {
- super(message);
- }
-
- public InternalServerErrorException(Throwable cause) {
- super(cause);
- }
-
-}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/NotFoundException.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/NotFoundException.java 2011-09-08 11:10:05 UTC (rev 34583)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/NotFoundException.java 2011-09-08 11:39:03 UTC (rev 34584)
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.openshift.internal.core;
-
-/**
- * @author André Dietisheim
- */
-public class NotFoundException extends HttpClientException {
-
- private static final long serialVersionUID = 1L;
-
- public NotFoundException(String message, Throwable cause) {
- super(message, cause);
- }
-
- private NotFoundException(Throwable cause) {
- super(cause);
- }
-
-}
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/OpenshiftService.java (from rev 34577, trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/OpenshiftService.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/OpenshiftService.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/OpenshiftService.java 2011-09-08 11:39:03 UTC (rev 34584)
@@ -0,0 +1,141 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.openshift.internal.core;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.List;
+
+import org.jboss.ide.eclipse.as.openshift.core.Application;
+import org.jboss.ide.eclipse.as.openshift.core.Cartridge;
+import org.jboss.ide.eclipse.as.openshift.core.IHttpClient;
+import org.jboss.ide.eclipse.as.openshift.core.IOpenshiftService;
+import org.jboss.ide.eclipse.as.openshift.core.InvalidCredentialsOpenshiftException;
+import org.jboss.ide.eclipse.as.openshift.core.OpenshiftEndpointException;
+import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
+import org.jboss.ide.eclipse.as.openshift.core.UserInfo;
+import org.jboss.ide.eclipse.as.openshift.core.internal.marshalling.ApplicationRequestJsonMarshaller;
+import org.jboss.ide.eclipse.as.openshift.core.internal.marshalling.ListCartridgesRequestJsonMarshaller;
+import org.jboss.ide.eclipse.as.openshift.core.internal.marshalling.UserInfoRequestJsonMarshaller;
+import org.jboss.ide.eclipse.as.openshift.internal.core.httpclient.HttpClientException;
+import org.jboss.ide.eclipse.as.openshift.internal.core.httpclient.UnauthorizedException;
+import org.jboss.ide.eclipse.as.openshift.internal.core.httpclient.UrlConnectionHttpClient;
+import org.jboss.ide.eclipse.as.openshift.internal.core.request.ApplicationAction;
+import org.jboss.ide.eclipse.as.openshift.internal.core.request.ApplicationRequest;
+import org.jboss.ide.eclipse.as.openshift.internal.core.request.ListCartridgesRequest;
+import org.jboss.ide.eclipse.as.openshift.internal.core.request.OpenshiftJsonRequestFactory;
+import org.jboss.ide.eclipse.as.openshift.internal.core.request.UserInfoRequest;
+import org.jboss.ide.eclipse.as.openshift.internal.core.response.ApplicationResponseUnmarshaller;
+import org.jboss.ide.eclipse.as.openshift.internal.core.response.ListCartridgesResponseUnmarshaller;
+import org.jboss.ide.eclipse.as.openshift.internal.core.response.OpenshiftResponse;
+
+/**
+ * @author André Dietisheim
+ */
+public class OpenshiftService implements IOpenshiftService {
+
+ private static final String BASE_URL = "https://openshift.redhat.com/broker";
+
+ private String username;
+ private String password;
+
+ public OpenshiftService(String username, String password) {
+ this.username = username;
+ this.password = password;
+ }
+
+ public UserInfo getUserInfo() throws OpenshiftException {
+ UserInfoRequest userInfoRequest = new UserInfoRequest(username, true);
+ String url = userInfoRequest.getUrlString(BASE_URL);
+ try {
+ String userInfoRequestString = new UserInfoRequestJsonMarshaller().marshall(userInfoRequest);
+ String request = new OpenshiftJsonRequestFactory(password, userInfoRequestString).create();
+ String userInfoResponse = createHttpClient(url).post(request);
+ throw new UnsupportedOperationException();
+ } catch (MalformedURLException e) {
+ throw new OpenshiftEndpointException(
+ url, e, "Could not get user info for user \"{0}\" at \"{1}\"", username, url, e);
+ } catch (HttpClientException e) {
+ throw new OpenshiftEndpointException(
+ url, e, "Could not get user info for user \"{0}\" at \"{1}\"", username, url, e);
+ }
+ }
+
+ /**
+ * WARNING: the current server implementation returns invalid json.
+ *
+ * @see ListCartridgesResponseUnmarshaller
+ */
+ @Override
+ public List<Cartridge> getCartridges() throws OpenshiftException {
+ ListCartridgesRequest listCartridgesRequest = new ListCartridgesRequest(username, true);
+ String url = listCartridgesRequest.getUrlString(BASE_URL);
+ try {
+ String listCartridgesRequestString =
+ new ListCartridgesRequestJsonMarshaller().marshall(listCartridgesRequest);
+ String request = new OpenshiftJsonRequestFactory(password, listCartridgesRequestString).create();
+ String listCatridgesReponse = createHttpClient(url).post(request);
+ throw new UnsupportedOperationException();
+ } catch (MalformedURLException e) {
+ throw new OpenshiftEndpointException(url, e, "Could not list available cartridges at \"{0}\"", url);
+ } catch (HttpClientException e) {
+ throw new OpenshiftEndpointException(url, e, "Could not list available cartridges at \"{0}\"", url);
+ }
+ }
+
+ @Override
+ public Application createDomain(String name) throws OpenshiftException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Application createApplication(String name, Cartridge cartridge) throws OpenshiftException {
+ return requestApplicationAction(name, cartridge,
+ new ApplicationRequest(name, cartridge, ApplicationAction.CONFIGURE, username, true));
+ }
+
+ @Override
+ public Application destroyApplication(String name, Cartridge cartridge) throws OpenshiftException {
+ return requestApplicationAction(name, cartridge,
+ new ApplicationRequest(name, cartridge, ApplicationAction.DECONFIGURE, username, true));
+ }
+
+ protected Application requestApplicationAction(String name, Cartridge cartridge,
+ ApplicationRequest applicationRequest) throws OpenshiftException {
+ String url = applicationRequest.getUrlString(BASE_URL);
+ try {
+ String applicationRequestString =
+ new ApplicationRequestJsonMarshaller().marshall(applicationRequest);
+ String request = new OpenshiftJsonRequestFactory(password, applicationRequestString).create();
+ String response = createHttpClient(url).post(request);
+ OpenshiftResponse<Application> openshiftResponse = new ApplicationResponseUnmarshaller(response, name,
+ cartridge).unmarshall();
+ return openshiftResponse.getData();
+ } catch (MalformedURLException e) {
+ throw new OpenshiftException(
+ e, "Could not {0} application \"{1}\" at \"{2}\": Invalid url \"{2}\"",
+ applicationRequest.getAction().toHumanReadable(), name, url);
+ } catch (UnauthorizedException e) {
+ throw new InvalidCredentialsOpenshiftException(
+ url, e, "Could not {0} application \"{1}\" at \"{2}\": Invalid credentials user \"{3}\", password \"{4}\"",
+ applicationRequest.getAction().toHumanReadable(), name, url, username, password);
+ } catch (HttpClientException e) {
+ throw new OpenshiftEndpointException(
+ url, e, "Could not {0} application \"{1}\" at \"{2}\"",
+ applicationRequest.getAction().toHumanReadable(), name, url);
+ }
+ }
+
+ private IHttpClient createHttpClient(String url) throws MalformedURLException {
+ return new UrlConnectionHttpClient(new URL(url));
+ }
+
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/OpenshiftService.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/UnauthorizedException.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/UnauthorizedException.java 2011-09-08 11:10:05 UTC (rev 34583)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/UnauthorizedException.java 2011-09-08 11:39:03 UTC (rev 34584)
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.openshift.internal.core;
-
-/**
- * @author André Dietisheim
- */
-public class UnauthorizedException extends HttpClientException {
-
- private static final long serialVersionUID = 1L;
-
- public UnauthorizedException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public UnauthorizedException(Throwable cause) {
- super(cause);
- }
-
-}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/UrlConnectionHttpClient.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/UrlConnectionHttpClient.java 2011-09-08 11:10:05 UTC (rev 34583)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/UrlConnectionHttpClient.java 2011-09-08 11:39:03 UTC (rev 34584)
@@ -1,71 +0,0 @@
-package org.jboss.ide.eclipse.as.openshift.internal.core;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.text.MessageFormat;
-
-import org.jboss.ide.eclipse.as.openshift.core.IHttpClient;
-import org.jboss.ide.eclipse.as.openshift.internal.core.utils.StreamUtils;
-
-public class UrlConnectionHttpClient implements IHttpClient {
-
- private static final String PROPERTY_CONTENT_TYPE = "Content-Type";
- private static final int TIMEOUT = 10 * 1024;
-
- private URL url;
-
- public UrlConnectionHttpClient(URL url) {
- this.url = url;
- }
-
- public String post(String data) throws HttpClientException {
- HttpURLConnection connection = null;
- try {
- connection = createConnection(url);
- connection.setDoOutput(true);
- StreamUtils.writeTo(data.getBytes(), connection.getOutputStream());
- return StreamUtils.readToString(connection.getInputStream());
- } catch (FileNotFoundException e) {
- throw new NotFoundException(
- MessageFormat.format("Could not find resource {0}", url.toString()), e);
- } catch (IOException e) {
- throw getException(e, connection);
- } finally {
- if (connection != null) {
- connection.disconnect();
- }
- }
- }
-
- private HttpClientException getException(IOException ioe, HttpURLConnection connection) {
- try {
- int responseCode = connection.getResponseCode();
- String errorMessage = StreamUtils.readToString(connection.getErrorStream());
- switch (responseCode) {
- case 500:
- return new InternalServerErrorException(errorMessage, ioe);
- case 400:
- return new BadRequestException(errorMessage, ioe);
- case 401:
- return new UnauthorizedException(errorMessage, ioe);
- default:
- return new HttpClientException(errorMessage, ioe);
- }
- } catch (IOException e) {
- return new HttpClientException(e);
- }
- }
-
- private HttpURLConnection createConnection(URL url) throws IOException {
- HttpURLConnection connection = (HttpURLConnection) url.openConnection();
- connection.setUseCaches(false);
- connection.setDoInput(true);
- connection.setAllowUserInteraction(false);
- connection.setConnectTimeout(TIMEOUT);
- connection.setRequestProperty(PROPERTY_CONTENT_TYPE, "application/x-www-form-urlencoded");
- connection.setInstanceFollowRedirects(true);
- return connection;
- }
-}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/UserInfo.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/UserInfo.java 2011-09-08 11:10:05 UTC (rev 34583)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/UserInfo.java 2011-09-08 11:39:03 UTC (rev 34584)
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.openshift.internal.core;
-
-import org.jboss.ide.eclipse.as.openshift.core.IOpenshiftObject;
-import org.jboss.ide.eclipse.as.openshift.core.internal.marshalling.IOpenshiftRequest;
-
-/**
- * @author André Dietisheim
- */
-public class UserInfo implements IOpenshiftObject {
-
- private String rhlogin;
- private String uuId;
- private String sshKey;
- private String rhcDomain;
- private String namespace;
-
- public UserInfo(String rhlogin, String uuid, String sshKey, String rhcDomain, String namespace) {
- this.rhlogin = rhlogin;
- this.uuId = uuid;
- this.sshKey = sshKey;
- this.rhcDomain = rhcDomain;
- this.namespace = namespace;
- }
-
- public String getRhlogin() {
- return rhlogin;
- }
-
- public String getUuId() {
- return uuId;
- }
-
- public String getRhcDomain() {
- return rhcDomain;
- }
-
- public String getSSHKey() {
- return sshKey;
- }
-
- public String getNamespace() {
- return namespace;
- }
-}
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/httpclient/BadRequestException.java (from rev 34578, trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/BadRequestException.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/httpclient/BadRequestException.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/httpclient/BadRequestException.java 2011-09-08 11:39:03 UTC (rev 34584)
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.openshift.internal.core.httpclient;
+
+/**
+ * @author André Dietisheim
+ */
+public class BadRequestException extends HttpClientException {
+
+ private static final long serialVersionUID = 1L;
+
+ public BadRequestException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public BadRequestException(Throwable cause) {
+ super(cause);
+ }
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/httpclient/BadRequestException.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/httpclient/HttpClientException.java (from rev 34571, trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/HttpClientException.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/httpclient/HttpClientException.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/httpclient/HttpClientException.java 2011-09-08 11:39:03 UTC (rev 34584)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.openshift.internal.core.httpclient;
+
+/**
+ * @author André Dietisheim
+ */
+public class HttpClientException extends Exception {
+
+ private static final long serialVersionUID = 1L;
+
+ public HttpClientException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public HttpClientException(String message) {
+ super(message);
+ }
+
+ public HttpClientException(Throwable cause) {
+ super(cause);
+ }
+
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/httpclient/HttpClientException.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/httpclient/InternalServerErrorException.java (from rev 34577, trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/InternalServerErrorException.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/httpclient/InternalServerErrorException.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/httpclient/InternalServerErrorException.java 2011-09-08 11:39:03 UTC (rev 34584)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.openshift.internal.core.httpclient;
+
+/**
+ * @author André Dietisheim
+ */
+public class InternalServerErrorException extends HttpClientException {
+
+ private static final long serialVersionUID = 1L;
+
+ public InternalServerErrorException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public InternalServerErrorException(String message) {
+ super(message);
+ }
+
+ public InternalServerErrorException(Throwable cause) {
+ super(cause);
+ }
+
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/httpclient/InternalServerErrorException.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/httpclient/NotFoundException.java (from rev 34577, trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/NotFoundException.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/httpclient/NotFoundException.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/httpclient/NotFoundException.java 2011-09-08 11:39:03 UTC (rev 34584)
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.openshift.internal.core.httpclient;
+
+/**
+ * @author André Dietisheim
+ */
+public class NotFoundException extends HttpClientException {
+
+ private static final long serialVersionUID = 1L;
+
+ public NotFoundException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ private NotFoundException(Throwable cause) {
+ super(cause);
+ }
+
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/httpclient/NotFoundException.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/httpclient/UnauthorizedException.java (from rev 34577, trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/UnauthorizedException.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/httpclient/UnauthorizedException.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/httpclient/UnauthorizedException.java 2011-09-08 11:39:03 UTC (rev 34584)
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.openshift.internal.core.httpclient;
+
+/**
+ * @author André Dietisheim
+ */
+public class UnauthorizedException extends HttpClientException {
+
+ private static final long serialVersionUID = 1L;
+
+ public UnauthorizedException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public UnauthorizedException(Throwable cause) {
+ super(cause);
+ }
+
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/httpclient/UnauthorizedException.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/httpclient/UrlConnectionHttpClient.java (from rev 34578, trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/UrlConnectionHttpClient.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/httpclient/UrlConnectionHttpClient.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/httpclient/UrlConnectionHttpClient.java 2011-09-08 11:39:03 UTC (rev 34584)
@@ -0,0 +1,71 @@
+package org.jboss.ide.eclipse.as.openshift.internal.core.httpclient;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.text.MessageFormat;
+
+import org.jboss.ide.eclipse.as.openshift.core.IHttpClient;
+import org.jboss.ide.eclipse.as.openshift.internal.core.utils.StreamUtils;
+
+public class UrlConnectionHttpClient implements IHttpClient {
+
+ private static final String PROPERTY_CONTENT_TYPE = "Content-Type";
+ private static final int TIMEOUT = 10 * 1024;
+
+ private URL url;
+
+ public UrlConnectionHttpClient(URL url) {
+ this.url = url;
+ }
+
+ public String post(String data) throws HttpClientException {
+ HttpURLConnection connection = null;
+ try {
+ connection = createConnection(url);
+ connection.setDoOutput(true);
+ StreamUtils.writeTo(data.getBytes(), connection.getOutputStream());
+ return StreamUtils.readToString(connection.getInputStream());
+ } catch (FileNotFoundException e) {
+ throw new NotFoundException(
+ MessageFormat.format("Could not find resource {0}", url.toString()), e);
+ } catch (IOException e) {
+ throw getException(e, connection);
+ } finally {
+ if (connection != null) {
+ connection.disconnect();
+ }
+ }
+ }
+
+ private HttpClientException getException(IOException ioe, HttpURLConnection connection) {
+ try {
+ int responseCode = connection.getResponseCode();
+ String errorMessage = StreamUtils.readToString(connection.getErrorStream());
+ switch (responseCode) {
+ case 500:
+ return new InternalServerErrorException(errorMessage, ioe);
+ case 400:
+ return new BadRequestException(errorMessage, ioe);
+ case 401:
+ return new UnauthorizedException(errorMessage, ioe);
+ default:
+ return new HttpClientException(errorMessage, ioe);
+ }
+ } catch (IOException e) {
+ return new HttpClientException(e);
+ }
+ }
+
+ private HttpURLConnection createConnection(URL url) throws IOException {
+ HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+ connection.setUseCaches(false);
+ connection.setDoInput(true);
+ connection.setAllowUserInteraction(false);
+ connection.setConnectTimeout(TIMEOUT);
+ connection.setRequestProperty(PROPERTY_CONTENT_TYPE, "application/x-www-form-urlencoded");
+ connection.setInstanceFollowRedirects(true);
+ return connection;
+ }
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/httpclient/UrlConnectionHttpClient.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/request/ApplicationRequest.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/request/ApplicationRequest.java 2011-09-08 11:10:05 UTC (rev 34583)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/request/ApplicationRequest.java 2011-09-08 11:39:03 UTC (rev 34584)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.openshift.internal.core.request;
-import org.jboss.ide.eclipse.as.openshift.internal.core.Cartridge;
+import org.jboss.ide.eclipse.as.openshift.core.Cartridge;
/**
* @author André Dietisheim
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/response/ApplicationResponseUnmarshaller.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/response/ApplicationResponseUnmarshaller.java 2011-09-08 11:10:05 UTC (rev 34583)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/response/ApplicationResponseUnmarshaller.java 2011-09-08 11:39:03 UTC (rev 34584)
@@ -12,7 +12,7 @@
import org.jboss.dmr.ModelNode;
import org.jboss.ide.eclipse.as.openshift.core.Application;
-import org.jboss.ide.eclipse.as.openshift.internal.core.Cartridge;
+import org.jboss.ide.eclipse.as.openshift.core.Cartridge;
/**
* @author André Dietisheim
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/response/ListCartridgesResponseUnmarshaller.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/response/ListCartridgesResponseUnmarshaller.java 2011-09-08 11:10:05 UTC (rev 34583)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/response/ListCartridgesResponseUnmarshaller.java 2011-09-08 11:39:03 UTC (rev 34584)
@@ -14,14 +14,20 @@
import java.util.List;
import org.jboss.dmr.ModelNode;
+import org.jboss.ide.eclipse.as.openshift.core.Cartridge;
import org.jboss.ide.eclipse.as.openshift.core.IOpenshiftJsonConstants;
-import org.jboss.ide.eclipse.as.openshift.internal.core.Cartridge;
/**
* @author André Dietisheim
*/
public class ListCartridgesResponseUnmarshaller extends AbstractOpenshiftJsonResponseUnmarshaller<List<Cartridge>> {
+ /*
+ * WARNING: the current (9-7-2011) response from the openshift rest
+ * service is invalid. It quotes the nested json object in the data
+ * property: '"data" : "{'. My current unmarshalling code does not
+ * handle this bad json.
+ */
public ListCartridgesResponseUnmarshaller(String response) {
super(response);
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/OpenshiftServiceIntegrationTest.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/OpenshiftServiceIntegrationTest.java 2011-09-08 11:10:05 UTC (rev 34583)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/OpenshiftServiceIntegrationTest.java 2011-09-08 11:39:03 UTC (rev 34584)
@@ -7,11 +7,11 @@
import java.util.List;
import org.jboss.ide.eclipse.as.openshift.core.Application;
+import org.jboss.ide.eclipse.as.openshift.core.Cartridge;
import org.jboss.ide.eclipse.as.openshift.core.IOpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.InvalidCredentialsOpenshiftException;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
-import org.jboss.ide.eclipse.as.openshift.core.OpenshiftService;
-import org.jboss.ide.eclipse.as.openshift.internal.core.Cartridge;
+import org.jboss.ide.eclipse.as.openshift.internal.core.OpenshiftService;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/OpenshiftServiceTest.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/OpenshiftServiceTest.java 2011-09-08 11:10:05 UTC (rev 34583)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/OpenshiftServiceTest.java 2011-09-08 11:39:03 UTC (rev 34584)
@@ -7,11 +7,11 @@
import java.text.MessageFormat;
import java.util.List;
+import org.jboss.ide.eclipse.as.openshift.core.Cartridge;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
import org.jboss.ide.eclipse.as.openshift.core.internal.marshalling.ApplicationRequestJsonMarshaller;
import org.jboss.ide.eclipse.as.openshift.core.internal.marshalling.ListCartridgesRequestJsonMarshaller;
import org.jboss.ide.eclipse.as.openshift.core.internal.marshalling.UserInfoRequestJsonMarshaller;
-import org.jboss.ide.eclipse.as.openshift.internal.core.Cartridge;
import org.jboss.ide.eclipse.as.openshift.internal.core.request.ApplicationAction;
import org.jboss.ide.eclipse.as.openshift.internal.core.request.ApplicationRequest;
import org.jboss.ide.eclipse.as.openshift.internal.core.request.ListCartridgesRequest;
@@ -102,12 +102,6 @@
@Test
public void canUnmarshallCartridgeListResponse() throws OpenshiftException {
- /*
- * WARNING: the current (9-7-2011) response from the openshift rest
- * service is invalid. It quotes the nested json object in the data
- * property: '"data" : "{'. My current unmarshalling code does not
- * handle this bad json.
- */
String cartridgeListResponse =
"{"
+ "\"messages\":\"\","
14 years, 7 months
JBoss Tools SVN: r34583 - in trunk/documentation/whatsnew: maven and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2011-09-08 07:10:05 -0400 (Thu, 08 Sep 2011)
New Revision: 34583
Added:
trunk/documentation/whatsnew/images/maven-jaxrs-configurator.png
trunk/documentation/whatsnew/images/maven-jboss-repos-autocompletion.png
trunk/documentation/whatsnew/images/maven-jbosspackaging-configurator.png
trunk/documentation/whatsnew/images/maven-profile-selection-multi-projects.jpg
trunk/documentation/whatsnew/images/maven-profile-selection-single-project.jpg
trunk/documentation/whatsnew/maven/maven-news-3.3.0.M3.html
Log:
JBIDE-9628 : Maven Integration in JBT 3.3.0.M3 N&N
Added: trunk/documentation/whatsnew/images/maven-jaxrs-configurator.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/images/maven-jaxrs-configurator.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/images/maven-jboss-repos-autocompletion.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/images/maven-jboss-repos-autocompletion.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/images/maven-jbosspackaging-configurator.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/images/maven-jbosspackaging-configurator.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/images/maven-profile-selection-multi-projects.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/images/maven-profile-selection-multi-projects.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/images/maven-profile-selection-single-project.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/images/maven-profile-selection-single-project.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/maven/maven-news-3.3.0.M3.html
===================================================================
--- trunk/documentation/whatsnew/maven/maven-news-3.3.0.M3.html (rev 0)
+++ trunk/documentation/whatsnew/maven/maven-news-3.3.0.M3.html 2011-09-08 11:10:05 UTC (rev 34583)
@@ -0,0 +1,186 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Language" content="en-us" />
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<link rel="stylesheet" href="../whatsnew.css" />
+<title>What's New in Maven Tools</title>
+<script type="text/javascript">
+
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-17645367-5']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+
+</script></head>
+<body>
+<h1>Maven Tools</h1>
+
+<p align="right"><a href="../index.html">< Main Index</a> <a
+ href="../hibernate/hibernate-news-3.3.0.M3.html">Hibernate Tools ></a></p>
+<table border="0" cellpadding="10" cellspacing="0" width="80%">
+ <tr>
+ <td colspan="2">
+ <hr />
+ <h3>JBoss Maven Integration</h3>
+ <hr />
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left">
+ <a name="itemname1" id="itemname1"></a><b>Maven Profile selection interface</b></td>
+ <td valign="top">
+ <p>The JBoss Tools Maven integration features a brand new Maven Profile selection interface that will ease switching between different profiles.<br/>
+ Rather than right-clicking on a project, going to the Properties > Maven page, then manually (mis)typing a list of active or disabled profile,
+ You just use the <b>Ctrl+Alt+P</b> shortcut to open the new Maven Profile selection interface :</p>
+ <a href="../images/maven-profile-selection-single-project.jpg"><img src="../images/maven-profile-selection-single-project.jpg" width="829" height="598"/></a>
+ <p>The new interface is also accessible from the Maven contextual menu : <br/>
+ <b>Right-click on project > Maven > Select Maven Profiles...</b>
+ </p>
+ <p>
+ The list of available profiles is inferred from profiles defined in :
+ <ul>
+ <li>the project pom.xml</li>
+ <li>the project's parent hierarchy </li>
+ <li>user and global maven settings.xml</li>
+ </ul>
+ The source columns indicates where the profile is defined. An <i>undefined</i> source means the profile is present in the Maven property page of the project, but there is no available definition.
+ <br/>
+ You can right-click on a profile to (de)activate it. The list of (in)active profiles for the project is updated as you manage the profiles in the upper text area.
+ What you select is what you get in the Maven property page of the project.
+ </p>
+ <p>
+ When several projects are selected, only the common available profiles are displayed for selection.
+ Common profiles are profiles defined in settings.xml or profiles having the same id in different pom.xml.
+ </p>
+ <a href="../images/maven-profile-selection-multi-projects.jpg"><img src="../images/maven-profile-selection-multi-projects.jpg" width="829" height="528"/></a>
+ <p>Since only a subset of profiles are selected, the "Available profiles" text area is hidden. Each project may have a different profile settings, all non-common profiles are kept unmodified</p>
+ <p>
+ <small>
+ See <a href="https://issues.jboss.org/browse/JBIDE-8969">JBIDE-8969</a> for more details.
+
+ </small></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <hr/>
+ </td>
+ </tr>
+
+ <tr>
+ <td valign="top" align="left">
+ <a name="itemname2" id="itemname2"></a><b>New JAX-RS configurator</b></td>
+ <td valign="top">
+ <p>If a maven project has a dependency on any JAX-RS API (resteasy, jersey ...), the JAX-RS Facet will be automatically applied during m2e's project configuration.<br/>
+ The JAX-RS configurator feature can be selected from the Maven Support category in the JBoss Tools update site :
+ </p>
+ <img src="../images/maven-jaxrs-configurator.png" />
+ <p>
+ <small>
+ See <a href="https://issues.jboss.org/browse/JBIDE-9290">JBIDE-9290</a> , for more details.
+ </small></p>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <hr/>
+ </td>
+ </tr>
+
+
+ <tr>
+ <td valign="top" align="left">
+ <a name="itemname3" id="itemname3"></a><b>New JBoss SAR configurator</b></td>
+ <td valign="top">
+ <p>Mavenized <a href="http://community.jboss.org/wiki/ServiceArchive">JBoss Service Archive</a> projects can now be configured automagically with the new JBoss SAR configurator.
+ The jboss-sar packaging must be enabled via the <a href="http://mojo.codehaus.org/jboss-packaging-maven-plugin/usage.html">jboss-packaging-maven-plugin</a>.<br/>
+ The configurator reads the <a href="http://mojo.codehaus.org/jboss-packaging-maven-plugin/sar-mojo.html">jboss-packaging SAR configuration</a>
+ and installs the new JBoss SAR facet to the project. <br/>
+ SAR projects can be deployed within EARs (being declared as dependencies), or standalone on JBoss application servers (<b>right-click on project > Run As > Run on Server</b>).
+ </p>
+ <p>The JBoss SAR configurator is part of the JBoss Packaging Maven Configurators feature, from the Maven Support category in the JBoss Tools update site :
+ </p>
+ <img src="../images/maven-jbosspackaging-configurator.png" />
+ <p>
+ <small>
+ For more details, see :
+ <br/>
+ - <a href="http://community.jboss.org/wiki/ServiceArchive">http://community.jboss.org/wiki/ServiceArchive</a>
+ <br/>
+ - <a href="http://mojo.codehaus.org/jboss-packaging-maven-plugin/usage.html">http://mojo.codehaus.org/jboss-packaging-maven-plugin/usage.html</a>
+ <br/>
+ - <a href="http://mojo.codehaus.org/jboss-packaging-maven-plugin/sar-mojo.html">http://mojo.codehaus.org/jboss-packaging-maven-plugin/sar-mojo.html</a>
+ <br/>
+ - <a href="https://issues.jboss.org/browse/JBIDE-9497">JBIDE-9497</a>
+ </small></p>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <hr/>
+ </td>
+ </tr>
+
+ <tr>
+ <td valign="top" align="left">
+ <a name="itemname4" id="itemname4"></a><b>Better JSF detection</b></td>
+ <td valign="top">
+ <p>The JSF configurator now adds the JSF Facet automatically, depending on the JSF classes found on the project classpath. It means jboss-jsf-api, mojarra, myfaces or any other dependency bringing JSF classes now triggers the JSF facet installation.
+ </p>
+ <p>
+ <small>
+ See <a href="https://issues.jboss.org/browse/JBIDE-9242">JBIDE-9242</a> , for more details.
+ </small></p>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <hr/>
+ </td>
+ </tr>
+
+ <tr>
+ <td valign="top" align="left">
+ <a name="itemname5" id="itemname5"></a><b>JBoss Maven repository available in m2e's XML editor</b></td>
+ <td valign="top">
+ <p>If you ever need to declare one of the JBoss maven repositories in your settings.xml (or pom.xml, if you plan on easing the distribution of an example project on Internet),
+ then you can add a <repositories> element to your document, press <b>Ctrl + Space</b> for content assist and easily add one of the JBoss repositories :
+ <ul>
+ <li>The JBoss public repository (releases and snapshots) : composite repository of several major repositories.</li>
+ <li>The JBoss artifacts repository (releases) : containing JBoss community project artifacts</li>
+ </ul>
+ <a href="../images/maven-jboss-repos-autocompletion.png"><img src="../images/maven-jboss-repos-autocompletion.png" width="800" height="410"/></a>
+
+ Keep in mind that <a href="http://www.sonatype.com/people/2009/02/why-putting-repositories-in-your-p...">putting repositories in your POMs is a Bad Idea</a>. So try to keep the repositories in your settings.xml (Windows > Preferences > Maven > User settings > open file).
+
+
+ </p>
+ <p>
+ <small>
+ See <a href="https://issues.jboss.org/browse/JBIDE-9321">JBIDE-9321</a> , for more details.
+ </small></p>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <hr/>
+ </td>
+ </tr>
+
+
+</table>
+
+</body>
+
+</html>
+
+
14 years, 7 months
JBoss Tools SVN: r34582 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-09-08 07:07:07 -0400 (Thu, 08 Sep 2011)
New Revision: 34582
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/ProcessTerminatedPoller.java
Log:
JBIDE-9243
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/ProcessTerminatedPoller.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/ProcessTerminatedPoller.java 2011-09-08 10:05:19 UTC (rev 34581)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/ProcessTerminatedPoller.java 2011-09-08 11:07:07 UTC (rev 34582)
@@ -13,8 +13,11 @@
import java.util.List;
import java.util.Properties;
+import org.eclipse.debug.core.model.IProcess;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
+import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
+import org.jboss.ide.eclipse.as.core.server.internal.IProcessProvider;
import org.jboss.ide.eclipse.as.core.server.internal.PollThread;
import org.jboss.ide.eclipse.as.core.server.internal.ServerStatePollerType;
@@ -57,12 +60,14 @@
}
public boolean isComplete() throws PollingException {
-// IJBossBehaviourDelegate del = server.getDelegate();
-// if( del instanceof IProcessProvider ) {
-// IProcess p = ((IProcessProvider)del).getProcess();
-// boolean b = p == null || p.isTerminated();
-// System.out.println(p + " " + b); //$NON-NLS-1$
-// }
+ if( server.getServerState() == IServer.STATE_STOPPED)
+ return true;
+ DelegatingServerBehavior beh = (DelegatingServerBehavior) server.getAdapter(DelegatingServerBehavior.class);
+ if(beh != null && beh.getDelegate() != null && beh.getDelegate() instanceof IProcessProvider) {
+ IProcess p = ((IProcessProvider)beh.getDelegate()).getProcess();
+ if( p == null || p.isTerminated())
+ return true;
+ }
return false;
}
14 years, 7 months
JBoss Tools SVN: r34581 - trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-09-08 06:05:19 -0400 (Thu, 08 Sep 2011)
New Revision: 34581
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/OpenshiftServiceIntegrationTest.java
Log:
[JBIDE-9510] implemented destroy application request
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/OpenshiftServiceIntegrationTest.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/OpenshiftServiceIntegrationTest.java 2011-09-08 10:03:52 UTC (rev 34580)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/OpenshiftServiceIntegrationTest.java 2011-09-08 10:05:19 UTC (rev 34581)
@@ -7,6 +7,7 @@
import java.util.List;
import org.jboss.ide.eclipse.as.openshift.core.Application;
+import org.jboss.ide.eclipse.as.openshift.core.IOpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.InvalidCredentialsOpenshiftException;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftService;
@@ -51,11 +52,15 @@
@Test
public void canCreateApplication() throws Exception {
String applicationName = createRandomApplicationName();
- Cartridge cartridge = Cartridge.JBOSSAS_7;
- Application application = openshiftService.createApplication(applicationName, cartridge);
- assertNotNull(application);
- assertEquals(applicationName, application.getName());
- assertEquals(cartridge, application.getCartridge());
+ try {
+ Cartridge cartridge = Cartridge.JBOSSAS_7;
+ Application application = openshiftService.createApplication(applicationName, cartridge);
+ assertNotNull(application);
+ assertEquals(applicationName, application.getName());
+ assertEquals(cartridge, application.getCartridge());
+ } finally {
+ silentlyDestroyApplication(applicationName, openshiftService);
+ }
}
@Test
@@ -75,4 +80,13 @@
private String createRandomApplicationName() {
return String.valueOf(System.currentTimeMillis());
}
+
+ private void silentlyDestroyApplication(String name, IOpenshiftService service) {
+ try {
+ service.destroyApplication(name, Cartridge.JBOSSAS_7);
+ } catch (OpenshiftException e) {
+ e.printStackTrace();
+ }
+
+ }
}
14 years, 7 months
JBoss Tools SVN: r34580 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-09-08 06:03:52 -0400 (Thu, 08 Sep 2011)
New Revision: 34580
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploymentModuleOptionCompositeAssistant.java
Log:
JBIDE-9241 - null values not being persisted due to xmlmemento implementation. Must use empty string.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploymentModuleOptionCompositeAssistant.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploymentModuleOptionCompositeAssistant.java 2011-09-08 09:21:50 UTC (rev 34579)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploymentModuleOptionCompositeAssistant.java 2011-09-08 10:03:52 UTC (rev 34580)
@@ -783,9 +783,9 @@
.getOrCreateModulePrefs(module);
if (property == COLUMN_LOC) {
String outputName, outPath;
- if( ((String)value).equals("")) {
- outputName = null;
- outPath = null;
+ if( value == null || ((String)value).equals("")) { //$NON-NLS-1$
+ outputName = ""; //$NON-NLS-1$
+ outPath = ""; //$NON-NLS-1$
} else {
outputName = new Path(((String)value)).lastSegment();
outPath = ((String)value).substring(0, ((String)value).length()-outputName.length());
14 years, 7 months
JBoss Tools SVN: r34579 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-09-08 05:21:50 -0400 (Thu, 08 Sep 2011)
New Revision: 34579
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleDeployableWorkspaceListener.java
Log:
JBIDE-9677
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleDeployableWorkspaceListener.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleDeployableWorkspaceListener.java 2011-09-08 08:56:04 UTC (rev 34578)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleDeployableWorkspaceListener.java 2011-09-08 09:21:50 UTC (rev 34579)
@@ -23,6 +23,7 @@
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.server.core.ServerCore;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.modules.SingleDeployableFactory.SingleDeployableModuleDelegate;
public class SingleDeployableWorkspaceListener implements
@@ -41,9 +42,10 @@
changedMods = shouldChange.toArray(new IModule[shouldChange.size()]);
} else {
try {
- event.getDelta().accept(this);
+ if( event.getDelta() != null )
+ event.getDelta().accept(this);
} catch( CoreException ce) {
- // TODO
+ JBossServerCorePlugin.log(ce.getStatus());
}
}
}
14 years, 7 months
JBoss Tools SVN: r34578 - in trunk/as/plugins: org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-09-08 04:56:04 -0400 (Thu, 08 Sep 2011)
New Revision: 34578
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/BadRequestException.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/UrlConnectionHttpClient.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/OpenshiftServiceIntegrationTest.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/OpenshiftServiceTest.java
Log:
[JBIDE-9510] implementing destroy application request
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/BadRequestException.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/BadRequestException.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/BadRequestException.java 2011-09-08 08:56:04 UTC (rev 34578)
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.openshift.internal.core;
+
+/**
+ * @author André Dietisheim
+ */
+public class BadRequestException extends HttpClientException {
+
+ private static final long serialVersionUID = 1L;
+
+ public BadRequestException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public BadRequestException(Throwable cause) {
+ super(cause);
+ }
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/BadRequestException.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/UrlConnectionHttpClient.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/UrlConnectionHttpClient.java 2011-09-08 07:47:01 UTC (rev 34577)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/UrlConnectionHttpClient.java 2011-09-08 08:56:04 UTC (rev 34578)
@@ -46,6 +46,8 @@
switch (responseCode) {
case 500:
return new InternalServerErrorException(errorMessage, ioe);
+ case 400:
+ return new BadRequestException(errorMessage, ioe);
case 401:
return new UnauthorizedException(errorMessage, ioe);
default:
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/OpenshiftServiceIntegrationTest.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/OpenshiftServiceIntegrationTest.java 2011-09-08 07:47:01 UTC (rev 34577)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/OpenshiftServiceIntegrationTest.java 2011-09-08 08:56:04 UTC (rev 34578)
@@ -1,5 +1,6 @@
package org.jboss.ide.eclipse.as.openshift.internal.test.core;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
@@ -11,13 +12,14 @@
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftService;
import org.jboss.ide.eclipse.as.openshift.internal.core.Cartridge;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
public class OpenshiftServiceIntegrationTest {
private OpenshiftService openshiftService;
private OpenshiftService invalidCredentialsOpenshiftService;
-
+
private static final String USERNAME = "toolsjboss(a)gmail.com";
private static final String PASSWORD = "1q2w3e";
@@ -27,11 +29,13 @@
this.invalidCredentialsOpenshiftService = new OpenshiftService(USERNAME, "bogus");
}
- @Test(expected=OpenshiftException.class)
+ @Ignore
+ @Test(expected = OpenshiftException.class)
public void cannotGetUserInfoIfNotAppNorDomainCreated() throws OpenshiftException {
openshiftService.getUserInfo();
}
+ @Ignore
@Test
public void canRequestListCartridges() throws Exception {
List<Cartridge> cartridges = openshiftService.getCartridges();
@@ -39,17 +43,35 @@
assertTrue(cartridges.size() > 0);
}
- @Test(expected=InvalidCredentialsOpenshiftException.class)
+ @Test(expected = InvalidCredentialsOpenshiftException.class)
public void createApplicationWithInvalidCredentialsThrowsException() throws Exception {
invalidCredentialsOpenshiftService.createApplication(createRandomApplicationName(), Cartridge.JBOSSAS_7);
}
@Test
public void canCreateApplication() throws Exception {
- Application application = openshiftService.createApplication("test-application", Cartridge.JBOSSAS_7);
+ String applicationName = createRandomApplicationName();
+ Cartridge cartridge = Cartridge.JBOSSAS_7;
+ Application application = openshiftService.createApplication(applicationName, cartridge);
assertNotNull(application);
+ assertEquals(applicationName, application.getName());
+ assertEquals(cartridge, application.getCartridge());
}
-
+
+ @Test
+ public void canDestroyApplication() throws Exception {
+ String applicationName = createRandomApplicationName();
+ openshiftService.createApplication(applicationName, Cartridge.JBOSSAS_7);
+ openshiftService.destroyApplication(applicationName, Cartridge.JBOSSAS_7);
+ }
+
+ @Test(expected = OpenshiftException.class)
+ public void createDuplicateApplicationThrowsException() throws Exception {
+ String applicationName = createRandomApplicationName();
+ openshiftService.createApplication(applicationName, Cartridge.JBOSSAS_7);
+ openshiftService.createApplication(applicationName, Cartridge.JBOSSAS_7);
+ }
+
private String createRandomApplicationName() {
return String.valueOf(System.currentTimeMillis());
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/OpenshiftServiceTest.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/OpenshiftServiceTest.java 2011-09-08 07:47:01 UTC (rev 34577)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/OpenshiftServiceTest.java 2011-09-08 08:56:04 UTC (rev 34578)
@@ -71,13 +71,36 @@
String createApplicationRequest = new ApplicationRequestJsonMarshaller().marshall(
new ApplicationRequest(
- "test-application", new Cartridge("jbossas-7.0"), ApplicationAction.CONFIGURE, USERNAME, true));
+ "test-application", Cartridge.JBOSSAS_7, ApplicationAction.CONFIGURE, USERNAME, true));
String effectiveRequest = new OpenshiftJsonRequestFactory(PASSWORD, createApplicationRequest).create();
assertEquals(expectedRequestString, effectiveRequest);
}
@Test
+ public void canMarshallApplicationDestroyRequest() throws Exception {
+ String expectedRequestString =
+ "password="
+ + PASSWORD
+ + "&json_data=%7B"
+ + "%22rhlogin%22+%3A+%22"
+ + URLEncoder.encode(USERNAME, "UTF-8")
+ + "%22"
+ + "%2C+%22debug%22+%3A+%22true%22"
+ + "%2C+%22cartridge%22+%3A+%22jbossas-7.0%22"
+ + "%2C+%22action%22+%3A+%22deconfigure%22"
+ + "%2C+%22app_name%22+%3A+%22test-application%22"
+ + "%7D";
+
+ String createApplicationRequest = new ApplicationRequestJsonMarshaller().marshall(
+ new ApplicationRequest(
+ "test-application", Cartridge.JBOSSAS_7, ApplicationAction.DECONFIGURE, USERNAME, true));
+ String effectiveRequest = new OpenshiftJsonRequestFactory(PASSWORD, createApplicationRequest).create();
+
+ assertEquals(expectedRequestString, effectiveRequest);
+ }
+
+ @Test
public void canUnmarshallCartridgeListResponse() throws OpenshiftException {
/*
* WARNING: the current (9-7-2011) response from the openshift rest
14 years, 7 months