[jbosstools-commits] JBoss Tools SVN: r35359 - in trunk/as/tests/org.jboss.tools.openshift.express.client.test: .settings and 12 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Wed Oct 5 07:06:18 EDT 2011


Author: adietish
Date: 2011-10-05 07:06:15 -0400 (Wed, 05 Oct 2011)
New Revision: 35359

Added:
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/.classpath
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/.project
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/.settings/
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/.settings/org.eclipse.jdt.core.prefs
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/META-INF/
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/META-INF/MANIFEST.MF
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/build.properties
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/pom.xml
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/Activator.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/ApplicationIntegrationTest.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/ApplicationLogReaderIntegrationTest.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/ApplicationLogReaderTest.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/ApplicationTest.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/CartridgeTest.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/CartridgesIntegrationTest.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/DomainIntegrationTest.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/DomainTest.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/IOpenshiftTestService.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/JsonSanitizerTest.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/ListCartridgesIntegrationTest.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/ListCartridgesTest.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/LogReaderRunnable.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/OpenshiftIntegrationTestSuite.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/OpenshiftTestSuite.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/SSHKeyTest.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/UserConfigurationTest.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/UserInfoIntegrationTest.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/UserInfoTest.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/UserIntegrationTest.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/UserTest.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/ApplicationResponseFake.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/CartridgeResponseFake.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/NoopOpenshiftServiceFake.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/OpenshiftCredentials.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/OpenshiftTestService.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/TestSSHKey.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/TestUser.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/UserConfigurationFake.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/UserInfoResponseFake.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/ApplicationAsserts.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/ApplicationInfoAsserts.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/ApplicationUtils.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/CartridgeAsserts.java
   trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/StreamUtils.java
Log:
[JBIDE-9841] renamed org.jboss.ide.eclipse.as.openshift.core.test to org.jboss.tools.openshift.express.client.test

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/.classpath
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/.classpath	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/.classpath	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/.classpath
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/.project
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/.project	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/.project	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.jboss.tools.openshift.express.client.test</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/.project
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/.settings/org.eclipse.jdt.core.prefs	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/.settings/org.eclipse.jdt.core.prefs	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,8 @@
+#Thu Aug 25 16:44:11 CEST 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/as/tests/org.jboss.tools.openshift.express.client.test/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/META-INF/MANIFEST.MF	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/META-INF/MANIFEST.MF	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Openshift Test Plugin
+Bundle-SymbolicName: org.jboss.tools.openshift.express.client.test 
+Bundle-Version: 2.3.0.qualifier
+Bundle-Activator: org.jboss.tools.openshift.express.internal.client.test.Activator
+Bundle-Vendor: JBoss by Red Hat
+Require-Bundle: org.jboss.tools.openshift.express.client;bundle-version="2.3.0",
+ org.junit;bundle-version="[4.8.0,5.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.7.0,4.0.0)"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/META-INF/MANIFEST.MF
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/build.properties
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/build.properties	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/build.properties	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/build.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/pom.xml
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/pom.xml	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/pom.xml	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion> 
+	<parent>
+		<groupId>org.jboss.tools.as</groupId>
+		<artifactId>plugins</artifactId>
+		<version>2.3.0-SNAPSHOT</version>
+	</parent>
+	<groupId>org.jboss.tools.as.plugins</groupId>
+	<artifactId>org.jboss.tools.openshift.express.client.test</artifactId> 
+	<packaging>eclipse-plugin</packaging>
+</project>


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/pom.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/Activator.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/Activator.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/Activator.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -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.tools.openshift.express.internal.client.test;
+
+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;
+	}
+
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/Activator.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/ApplicationIntegrationTest.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/ApplicationIntegrationTest.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/ApplicationIntegrationTest.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,199 @@
+/******************************************************************************* 
+ * 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.tools.openshift.express.internal.client.test;
+
+import static org.jboss.tools.openshift.express.internal.client.test.utils.ApplicationAsserts.assertAppliactionUrl;
+import static org.jboss.tools.openshift.express.internal.client.test.utils.ApplicationAsserts.assertGitUri;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import org.jboss.tools.openshift.express.client.IApplication;
+import org.jboss.tools.openshift.express.client.ICartridge;
+import org.jboss.tools.openshift.express.client.IOpenshiftService;
+import org.jboss.tools.openshift.express.client.InvalidCredentialsOpenshiftException;
+import org.jboss.tools.openshift.express.client.OpenshiftException;
+import org.jboss.tools.openshift.express.client.OpenshiftService;
+import org.jboss.tools.openshift.express.client.User;
+import org.jboss.tools.openshift.express.internal.client.test.fakes.TestUser;
+import org.jboss.tools.openshift.express.internal.client.test.utils.ApplicationUtils;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * @author André Dietisheim
+ */
+public class ApplicationIntegrationTest {
+
+	private IOpenshiftService service;
+
+	private User user;
+	private User invalidUser;
+
+	@Before
+	public void setUp() {
+		this.service = new OpenshiftService();
+		this.user = new TestUser();
+		this.invalidUser = new TestUser("bogusPassword");
+	}
+
+	@Test(expected = InvalidCredentialsOpenshiftException.class)
+	public void createApplicationWithInvalidCredentialsThrowsException() throws Exception {
+		service.createApplication(ApplicationUtils.createRandomApplicationName(), ICartridge.JBOSSAS_7, invalidUser);
+	}
+
+	@Test
+	public void canCreateApplication() throws Exception {
+		String applicationName = ApplicationUtils.createRandomApplicationName();
+		try {
+			ICartridge cartridge = ICartridge.JBOSSAS_7;
+			IApplication application = service.createApplication(applicationName, cartridge, user);
+			assertNotNull(application);
+			assertEquals(applicationName, application.getName());
+			assertEquals(cartridge, application.getCartridge());
+		} finally {
+			ApplicationUtils.silentlyDestroyAS7Application(applicationName, user, service);
+		}
+	}
+
+	@Test
+	public void canDestroyApplication() throws Exception {
+		String applicationName = ApplicationUtils.createRandomApplicationName();
+		service.createApplication(applicationName, ICartridge.JBOSSAS_7, user);
+		service.destroyApplication(applicationName, ICartridge.JBOSSAS_7, user);
+	}
+
+	@Test(expected = OpenshiftException.class)
+	public void createDuplicateApplicationThrowsException() throws Exception {
+		String applicationName = ApplicationUtils.createRandomApplicationName();
+		try {
+			service.createApplication(applicationName, ICartridge.JBOSSAS_7, user);
+			service.createApplication(applicationName, ICartridge.JBOSSAS_7, user);
+		} finally {
+			ApplicationUtils.silentlyDestroyAS7Application(applicationName, user, service);
+		}
+	}
+
+	@Test
+	public void canStopApplication() throws Exception {
+		String applicationName = ApplicationUtils.createRandomApplicationName();
+		try {
+			service.createApplication(applicationName, ICartridge.JBOSSAS_7, user);
+			service.stopApplication(applicationName, ICartridge.JBOSSAS_7, user);
+		} finally {
+			ApplicationUtils.silentlyDestroyAS7Application(applicationName, user, service);
+		}
+	}
+
+	@Test
+	public void canStartStoppedApplication() throws Exception {
+		String applicationName = ApplicationUtils.createRandomApplicationName();
+		try {
+			service.createApplication(applicationName, ICartridge.JBOSSAS_7, user);
+			service.stopApplication(applicationName, ICartridge.JBOSSAS_7, user);
+			service.startApplication(applicationName, ICartridge.JBOSSAS_7, user);
+		} finally {
+			ApplicationUtils.silentlyDestroyAS7Application(applicationName, user, service);
+		}
+	}
+
+	@Test
+	public void canStartStartedApplication() throws Exception {
+		String applicationName = ApplicationUtils.createRandomApplicationName();
+		try {
+			/**
+			 * freshly created apps are started
+			 * 
+			 * @link 
+			 *       https://github.com/openshift/os-client-tools/blob/master/express
+			 *       /doc/API
+			 */
+			service.createApplication(applicationName, ICartridge.JBOSSAS_7, user);
+			service.startApplication(applicationName, ICartridge.JBOSSAS_7, user);
+		} finally {
+			ApplicationUtils.silentlyDestroyAS7Application(applicationName, user, service);
+		}
+	}
+
+	@Test
+	public void canStopStoppedApplication() throws Exception {
+		String applicationName = ApplicationUtils.createRandomApplicationName();
+		try {
+			/**
+			 * freshly created apps are started
+			 * 
+			 * @link 
+			 *       https://github.com/openshift/os-client-tools/blob/master/express
+			 *       /doc/API
+			 */
+			service.createApplication(applicationName, ICartridge.JBOSSAS_7, user);
+			service.stopApplication(applicationName, ICartridge.JBOSSAS_7, user);
+			service.stopApplication(applicationName, ICartridge.JBOSSAS_7, user);
+		} finally {
+			ApplicationUtils.silentlyDestroyAS7Application(applicationName, user, service);
+		}
+	}
+
+	@Test
+	public void canRestartApplication() throws Exception {
+		String applicationName = ApplicationUtils.createRandomApplicationName();
+		try {
+			/**
+			 * freshly created apps are started
+			 * 
+			 * @link 
+			 *       https://github.com/openshift/os-client-tools/blob/master/express
+			 *       /doc/API
+			 */
+			service.createApplication(applicationName, ICartridge.JBOSSAS_7, user);
+			service.restartApplication(applicationName, ICartridge.JBOSSAS_7, user);
+		} finally {
+			ApplicationUtils.silentlyDestroyAS7Application(applicationName, user, service);
+		}
+	}
+
+	@Test
+	public void canGetStatus() throws Exception {
+		String applicationName = ApplicationUtils.createRandomApplicationName();
+		try {
+			IApplication application = service.createApplication(applicationName, ICartridge.JBOSSAS_7, user);
+			String applicationStatus = service.getStatus(application.getName(), application.getCartridge(), user);
+			assertNotNull(applicationStatus);
+		} finally {
+			ApplicationUtils.silentlyDestroyAS7Application(applicationName, user, service);
+		}
+	}
+
+	@Test
+	public void returnsValidGitUri() throws Exception {
+		String applicationName = ApplicationUtils.createRandomApplicationName();
+		try {
+			IApplication application = service.createApplication(applicationName, ICartridge.JBOSSAS_7, user);
+			String gitUri = application.getGitUri();
+			assertNotNull(gitUri);
+			assertGitUri(applicationName, gitUri);
+		} finally {
+			ApplicationUtils.silentlyDestroyAS7Application(applicationName, user, service);
+		}
+	}
+
+	@Test
+	public void returnsValidApplicationUrl() throws Exception {
+		String applicationName = ApplicationUtils.createRandomApplicationName();
+		try {
+			IApplication application = service.createApplication(applicationName, ICartridge.JBOSSAS_7, user);
+			String applicationUrl = application.getApplicationUrl();
+			assertNotNull(applicationUrl);
+			assertAppliactionUrl(applicationName, applicationUrl);
+		} finally {
+			ApplicationUtils.silentlyDestroyAS7Application(applicationName, user, service);
+		}
+	}
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/ApplicationIntegrationTest.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/ApplicationLogReaderIntegrationTest.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/ApplicationLogReaderIntegrationTest.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/ApplicationLogReaderIntegrationTest.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,116 @@
+/******************************************************************************* 
+ * 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.tools.openshift.express.internal.client.test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+import org.jboss.tools.openshift.express.client.ApplicationLogReader;
+import org.jboss.tools.openshift.express.client.IApplication;
+import org.jboss.tools.openshift.express.client.ICartridge;
+import org.jboss.tools.openshift.express.client.IOpenshiftService;
+import org.jboss.tools.openshift.express.client.OpenshiftService;
+import org.jboss.tools.openshift.express.internal.client.test.fakes.TestUser;
+import org.jboss.tools.openshift.express.internal.client.test.utils.ApplicationUtils;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * @author André Dietisheim
+ */
+public class ApplicationLogReaderIntegrationTest {
+
+	private static final int LOGREADER_TIMEOUT = 10 * 1024;
+	private IOpenshiftService service;
+	private TestUser user;
+
+	@Before
+	public void setUp() {
+		this.service = new OpenshiftService();
+		this.user = new TestUser();
+	}
+
+	/**
+	 * Asserts the service implementation: getStatus returns the same log if no
+	 * new log entry is available
+	 * 
+	 * @throws Exception
+	 */
+	@Ignore
+	@Test
+	public void getStatusReturnsTheWholeLogIfNoNewLogEntryOnServer() throws Exception {
+		String applicationName = ApplicationUtils.createRandomApplicationName();
+		try {
+			IApplication application = service.createApplication(applicationName, ICartridge.JBOSSAS_7, user);
+			String applicationStatus = service.getStatus(application.getName(), application.getCartridge(), user);
+			String applicationStatus2 = service.getStatus(application.getName(), application.getCartridge(), user);
+			assertEquals(applicationStatus, applicationStatus2);
+		} finally {
+			ApplicationUtils.silentlyDestroyAS7Application(applicationName, user, service);
+		}
+	}
+
+	/**
+	 * Asserts the service implementation: getStatus returns the new entries
+	 * (and a tailing-header) if new log entries are available
+	 */
+	@Ignore
+	@Test
+	public void getStatusReturnsNewEntriesIfNewLogEntriesOnServer() throws Exception {
+		String applicationName = ApplicationUtils.createRandomApplicationName();
+		try {
+			IApplication application = service.createApplication(applicationName, ICartridge.JBOSSAS_7, user);
+			String applicationStatus = service.getStatus(application.getName(), application.getCartridge(), user);
+			application.restart();
+			String applicationStatus2 = service.getStatus(application.getName(), application.getCartridge(), user);
+			assertFalse(applicationStatus.equals(applicationStatus2));
+		} finally {
+			ApplicationUtils.silentlyDestroyAS7Application(applicationName, user, service);
+		}
+	}
+
+	@Test
+	public void logReaderReturnsNewEntriesAfterApplicationRestart() throws Exception {
+		IApplication application = null;
+		ExecutorService executor = null;
+		try {
+			application = user.createTestApplication();
+			ApplicationLogReader logReader = application.getLogReader();
+			LogReaderRunnable logReaderRunnable = new LogReaderRunnable(logReader, LOGREADER_TIMEOUT);
+			executor = Executors.newSingleThreadExecutor();
+			executor.submit(logReaderRunnable);
+
+			String log = logReaderRunnable.waitUntilNoNewLogentries();
+			assertNotNull(log);
+			assertTrue(log.length() > 0);
+			
+			application.restart();
+
+			String newLog = logReaderRunnable.waitUntilNoNewLogentries();
+			assertNotNull(newLog);
+			assertTrue(newLog.length() > 0);
+			assertFalse(log.equals(newLog));
+		} finally {
+			if (executor != null) {
+				executor.shutdownNow();
+			}
+			if (application != null) {
+				user.silentlyDestroyApplication(application);
+			}
+		}
+	}
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/ApplicationLogReaderIntegrationTest.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/ApplicationLogReaderTest.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/ApplicationLogReaderTest.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/ApplicationLogReaderTest.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,123 @@
+/******************************************************************************* 
+ * 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.tools.openshift.express.internal.client.test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+import org.jboss.tools.openshift.express.client.ApplicationLogReader;
+import org.jboss.tools.openshift.express.client.ICartridge;
+import org.jboss.tools.openshift.express.client.IOpenshiftService;
+import org.jboss.tools.openshift.express.client.OpenshiftException;
+import org.jboss.tools.openshift.express.internal.client.Application;
+import org.jboss.tools.openshift.express.internal.client.InternalUser;
+import org.jboss.tools.openshift.express.internal.client.test.fakes.NoopOpenshiftServiceFake;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * @author André Dietisheim
+ */
+public class ApplicationLogReaderTest {
+
+	private static final int LOGREADER_TIMEOUT = 2 * 1024;
+
+	private static final String LOG_HEADER = 
+			"tailing /var/lib/libra/f36a4acf8a73450cb98637ed4483ea02/1317146294966//jbossas-7.0/standalone/log/server.log"
+					+ "------ Tail of 1317146294966 application server.log ------\n";
+
+	private static final String INITIAL_LOG =
+					"11:31:36,289 INFO  [org.jboss.as.ee] (Controller Boot Thread) Activating EE subsystem\n"
+					+ "11:31:36,340 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-1) Starting Coyote HTTP/1.1 on http--127.1.9.1-8080\n"
+					+ "11:31:36,440 INFO  [org.jboss.as.connector] (MSC service thread 1-4) Starting JCA Subsystem (JBoss IronJacamar 1.0.3.Final)\n"
+					+ "11:31:36,471 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) Bound data source [java:jboss/datasources/ExampleDS]\n"
+					+ "11:31:36,966 INFO  [org.jboss.as.deployment] (MSC service thread 1-3) Started FileSystemDeploymentService for directory /var/lib/libra/b8ea642ed6aa4dd0af2a4fe94c0ff07c/1317137507620/jbossas-7.0/standalone/deployments\n"
+					+ "11:31:36,982 INFO  [org.jboss.as] (Controller Boot Thread) JBoss AS 7.0.1.Final \"Zap\" started in 2796ms - Started 82 of 107 services (22 services are passive or on-demand)\n"
+					+ "11:31:37,004 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) Starting deployment of \"ROOT.war\"\n"
+					+ "11:31:37,084 INFO  [org.jboss.as.jpa] (MSC service thread 1-4) added javax.persistence.api dependency to ROOT.war\n"
+					+ "11:31:37,403 INFO  [org.jboss.web] (MSC service thread 1-3) registering web context: \n"
+					+ "11:31:37,445 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployed \"ROOT.war\"\n";
+
+	private static final String LOG_CONTINUATION =
+			"11:32:13,187 INFO  [org.apache.catalina.core.AprLifecycleListener] (MSC service thread 1-3) The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/server:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib\n"
+					+ "11:32:13,295 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-1) Starting Coyote HTTP/1.1 on http--127.1.9.1-8080\n"
+					+ "11:32:13,344 INFO  [org.jboss.as.connector] (MSC service thread 1-1) Starting JCA Subsystem (JBoss IronJacamar 1.0.3.Final)\n"
+					+ "11:32:13,383 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) Bound data source [java:jboss/datasources/ExampleDS]\n"
+					+ "11:32:13,746 INFO  [org.jboss.as.deployment] (MSC service thread 1-2) Started FileSystemDeploymentService for directory /var/lib/libra/b8ea642ed6aa4dd0af2a4fe94c0ff07c/1317137507620/jbossas-7.0/standalone/deployments\n"
+					+ "11:32:13,764 INFO  [org.jboss.as] (Controller Boot Thread) JBoss AS 7.0.1.Final \"Zap\" started in 2736ms - Started 82 of 107 services (22 services are passive or on-demand)\n"
+					+ "11:32:13,772 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) Starting deployment of \"ROOT.war\"\n"
+					+ "11:32:13,868 INFO  [org.jboss.as.jpa] (MSC service thread 1-1) added javax.persistence.api dependency to ROOT.war\n"
+					+ "11:32:14,176 INFO  [org.jboss.web] (MSC service thread 1-2) registering web context: \n"
+					+ "11:32:14,207 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployed \"ROOT.war\"\n";
+
+	private String status = LOG_HEADER + INITIAL_LOG;
+	private IOpenshiftService statusService;
+	private Application application;
+
+	@Before
+	public void setUp() {
+		this.statusService = new NoopOpenshiftServiceFake() {
+
+			@Override
+			public String getStatus(String applicationName, ICartridge cartridge, InternalUser user)
+					throws OpenshiftException {
+				return status;
+			}
+		};
+
+		this.application = new ApplicationLogFake(statusService);
+	}
+
+	@Test
+	public void logReaderReturnsNewEntriesAfterApplicationRestart() throws Exception {
+		ExecutorService executor = null;
+		try {
+			ApplicationLogReader logReader = application.getLogReader();
+			LogReaderRunnable logReaderRunnable = new LogReaderRunnable(logReader, LOGREADER_TIMEOUT);
+			executor = Executors.newSingleThreadExecutor();
+			executor.submit(logReaderRunnable);
+
+			String log = logReaderRunnable.waitUntilNoNewLogentries();
+			assertNotNull(log);
+			assertTrue(log.length() > 0);
+
+			application.restart();
+
+			String newLog = logReaderRunnable.waitUntilNoNewLogentries();
+			assertNotNull(newLog);
+			assertTrue(newLog.length() > 0);
+			assertFalse(log.equals(newLog));
+			assertEquals(INITIAL_LOG + LOG_CONTINUATION, logReaderRunnable.getLog());
+		} finally {
+			if (executor != null) {
+				executor.shutdownNow();
+			}
+		}
+	}
+
+	private class ApplicationLogFake extends Application {
+
+		private ApplicationLogFake(IOpenshiftService service) {
+			super("fakeApplication", ICartridge.JBOSSAS_7, null, service);
+		}
+
+		@Override
+		public synchronized void restart() throws OpenshiftException {
+			status = LOG_CONTINUATION;
+			this.notifyAll();
+		}
+	};
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/ApplicationLogReaderTest.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/ApplicationTest.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/ApplicationTest.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/ApplicationTest.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,233 @@
+/******************************************************************************* 
+ * 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.tools.openshift.express.internal.client.test;
+
+import static org.jboss.tools.openshift.express.internal.client.test.utils.ApplicationAsserts.assertAppliactionUrl;
+import static org.jboss.tools.openshift.express.internal.client.test.utils.ApplicationAsserts.assertGitUri;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.net.URLEncoder;
+import java.util.Arrays;
+
+import org.jboss.tools.openshift.express.client.ApplicationLogReader;
+import org.jboss.tools.openshift.express.client.IApplication;
+import org.jboss.tools.openshift.express.client.ICartridge;
+import org.jboss.tools.openshift.express.client.OpenshiftException;
+import org.jboss.tools.openshift.express.client.OpenshiftService;
+import org.jboss.tools.openshift.express.internal.client.Application;
+import org.jboss.tools.openshift.express.internal.client.ApplicationInfo;
+import org.jboss.tools.openshift.express.internal.client.InternalUser;
+import org.jboss.tools.openshift.express.internal.client.UserInfo;
+import org.jboss.tools.openshift.express.internal.client.request.ApplicationAction;
+import org.jboss.tools.openshift.express.internal.client.request.ApplicationRequest;
+import org.jboss.tools.openshift.express.internal.client.request.OpenshiftEnvelopeFactory;
+import org.jboss.tools.openshift.express.internal.client.request.marshalling.ApplicationRequestJsonMarshaller;
+import org.jboss.tools.openshift.express.internal.client.response.OpenshiftResponse;
+import org.jboss.tools.openshift.express.internal.client.response.unmarshalling.ApplicationResponseUnmarshaller;
+import org.jboss.tools.openshift.express.internal.client.response.unmarshalling.ApplicationStatusResponseUnmarshaller;
+import org.jboss.tools.openshift.express.internal.client.response.unmarshalling.JsonSanitizer;
+import org.jboss.tools.openshift.express.internal.client.test.fakes.ApplicationResponseFake;
+import org.jboss.tools.openshift.express.internal.client.test.fakes.NoopOpenshiftServiceFake;
+import org.junit.Test;
+
+/**
+ * @author André Dietisheim
+ */
+public class ApplicationTest {
+
+	private InternalUser user = new InternalUser(ApplicationResponseFake.RHLOGIN, ApplicationResponseFake.PASSWORD,
+			new NoopOpenshiftServiceFake());
+
+	@Test
+	public void canMarshallApplicationCreateRequest() throws Exception {
+		String expectedRequestString =
+				"password="
+						+ URLEncoder.encode(ApplicationResponseFake.PASSWORD, "UTF-8")
+						+ "&json_data=%7B"
+						+ "%22rhlogin%22+%3A+%22"
+						+ URLEncoder.encode(ApplicationResponseFake.RHLOGIN, "UTF-8")
+						+ "%22"
+						+ "%2C+%22debug%22+%3A+%22true%22"
+						+ "%2C+%22cartridge%22+%3A+%22jbossas-7.0%22"
+						+ "%2C+%22action%22+%3A+%22"
+						+ "configure"
+						+ "%22%2C+%22app_name%22+%3A+%22test-application%22"
+						+ "%7D";
+
+		String createApplicationRequest = new ApplicationRequestJsonMarshaller().marshall(
+				new ApplicationRequest(
+						"test-application", ICartridge.JBOSSAS_7, ApplicationAction.CONFIGURE,
+						ApplicationResponseFake.RHLOGIN, true));
+		String effectiveRequest = new OpenshiftEnvelopeFactory(ApplicationResponseFake.PASSWORD,
+				createApplicationRequest).createString();
+
+		assertEquals(expectedRequestString, effectiveRequest);
+	}
+
+	@Test
+	public void canMarshallApplicationDestroyRequest() throws Exception {
+		String expectedRequestString =
+				"password="
+						+ URLEncoder.encode(ApplicationResponseFake.PASSWORD, "UTF-8")
+						+ "&json_data=%7B"
+						+ "%22rhlogin%22+%3A+"
+						+ "%22" + URLEncoder.encode(ApplicationResponseFake.RHLOGIN, "UTF-8") + "%22"
+						+ "%2C+%22debug%22+%3A+%22true%22"
+						+ "%2C+%22cartridge%22+%3A+%22jbossas-7.0%22"
+						+ "%2C+%22action%22+%3A+%22"
+						+ "deconfigure"
+						+ "%22%2C+%22app_name%22+%3A+%22test-application%22"
+						+ "%7D";
+
+		String createApplicationRequest = new ApplicationRequestJsonMarshaller().marshall(
+				new ApplicationRequest(
+						"test-application", ICartridge.JBOSSAS_7, ApplicationAction.DECONFIGURE,
+						ApplicationResponseFake.RHLOGIN, true));
+		String effectiveRequest = new OpenshiftEnvelopeFactory(ApplicationResponseFake.PASSWORD,
+				createApplicationRequest).createString();
+
+		assertEquals(expectedRequestString, effectiveRequest);
+	}
+
+	@Test
+	public void canUnmarshallApplicationResponse() throws OpenshiftException {
+		String response = JsonSanitizer.sanitize(ApplicationResponseFake.appResponse);
+		OpenshiftResponse<Application> openshiftResponse =
+				new ApplicationResponseUnmarshaller(
+						ApplicationResponseFake.APPLICATION_NAME, ApplicationResponseFake.APPLICATION_CARTRIDGE,
+						user, new NoopOpenshiftServiceFake())
+						.unmarshall(response);
+		Application application = openshiftResponse.getOpenshiftObject();
+		assertNotNull(application);
+		assertEquals(ApplicationResponseFake.APPLICATION_NAME, application.getName());
+		assertEquals(ApplicationResponseFake.APPLICATION_CARTRIDGE, application.getCartridge());
+	}
+
+	@Test
+	public void returnsValidGitUri() throws OpenshiftException {
+		OpenshiftService userInfoService = createUserInfoService();
+		InternalUser user = createUser(userInfoService);
+		IApplication application = createApplication(userInfoService, user);
+
+		String gitUri = application.getGitUri();
+		assertNotNull(gitUri);
+		assertGitUri(
+				ApplicationResponseFake.APPLICATION_UUID
+				, ApplicationResponseFake.APPLICATION_NAME
+				, ApplicationResponseFake.NAMESPACE
+				, ApplicationResponseFake.RHC_DOMAIN
+				, gitUri);
+	}
+
+	@Test
+	public void returnsValidApplicationUrl() throws OpenshiftException {
+		OpenshiftService userInfoService = createUserInfoService();
+		InternalUser user = createUser(userInfoService);
+		IApplication application = createApplication(userInfoService, user);
+
+		String applicationUrl = application.getApplicationUrl();
+		assertNotNull(applicationUrl);
+		assertAppliactionUrl(
+				ApplicationResponseFake.APPLICATION_NAME
+				, ApplicationResponseFake.NAMESPACE
+				, ApplicationResponseFake.RHC_DOMAIN
+				, applicationUrl);
+	}
+
+	@Test
+	public void canUnmarshallApplicationStatus() throws OpenshiftException {
+		String response = JsonSanitizer.sanitize(ApplicationResponseFake.statusResponse);
+		OpenshiftResponse<String> openshiftResponse =
+				new ApplicationStatusResponseUnmarshaller().unmarshall(response);
+		String status = openshiftResponse.getOpenshiftObject();
+		assertNotNull(status);
+		assertTrue(status.startsWith("tailing "));
+	}
+
+	@Test
+	public void canReadFromApplicationLogReader() throws IOException {
+
+		OpenshiftService service = new NoopOpenshiftServiceFake() {
+			@Override
+			public String getStatus(String applicationName, ICartridge cartridge, InternalUser user) throws OpenshiftException {
+				return ApplicationResponseFake.tail;
+			}
+		};
+
+		Application application =
+				new Application(ApplicationResponseFake.APPLICATION_NAME,
+						ApplicationResponseFake.APPLICATION_CARTRIDGE, user, service);
+		ApplicationLogReader reader = new ApplicationLogReader(application, user, service);
+
+		int charactersRead = 0;
+		int character = -1;
+		while (charactersRead < ApplicationResponseFake.log.length()
+				&& (character = reader.read()) != -1) {
+			char characterToMatch = ApplicationResponseFake.log.charAt(charactersRead++);
+			assertEquals(
+					"character at position " + charactersRead
+							+ " was '" + character + "'"
+							+ " but we expected '" + characterToMatch + "'.",
+					characterToMatch, character);
+		}
+	}
+
+	private IApplication createApplication(OpenshiftService userInfoService, InternalUser user) {
+		Application application = new Application(
+				ApplicationResponseFake.APPLICATION_NAME
+				, ApplicationResponseFake.APPLICATION_CARTRIDGE
+				, new ApplicationInfo(
+						ApplicationResponseFake.APPLICATION_NAME
+						, ApplicationResponseFake.APPLICATION_UUID
+						, ApplicationResponseFake.APPLICATION_EMBEDDED
+						, ApplicationResponseFake.APPLICATION_CARTRIDGE
+						, ApplicationResponseFake.APPLICATION_CREATIONTIME)
+				, user
+				, userInfoService);
+		/**
+		 * we have to add it manually since we dont create the application with
+		 * the user class
+		 * 
+		 * @see user#createApplication
+		 */
+		user.add(application);
+		return application;
+	}
+
+	private InternalUser createUser(OpenshiftService userInfoService) {
+		return new InternalUser(ApplicationResponseFake.RHLOGIN, ApplicationResponseFake.PASSWORD, userInfoService);
+	}
+
+	private OpenshiftService createUserInfoService() {
+		OpenshiftService userInfoService = new NoopOpenshiftServiceFake() {
+			@Override
+			public UserInfo getUserInfo(InternalUser user) throws OpenshiftException {
+				ApplicationInfo applicationInfo = new ApplicationInfo(
+						ApplicationResponseFake.APPLICATION_NAME,
+						ApplicationResponseFake.APPLICATION_UUID,
+						ApplicationResponseFake.APPLICATION_EMBEDDED,
+						ApplicationResponseFake.APPLICATION_CARTRIDGE,
+						ApplicationResponseFake.APPLICATION_CREATIONTIME);
+				return new UserInfo(
+						ApplicationResponseFake.RHLOGIN,
+						ApplicationResponseFake.UUID,
+						ApplicationResponseFake.SSHPUBLICKEY,
+						ApplicationResponseFake.RHC_DOMAIN,
+						ApplicationResponseFake.NAMESPACE,
+						Arrays.asList(new ApplicationInfo[] { applicationInfo }));
+			}
+		};
+		return userInfoService;
+	}
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/ApplicationTest.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/CartridgeTest.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/CartridgeTest.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/CartridgeTest.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -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.tools.openshift.express.internal.client.test;
+
+import static org.jboss.tools.openshift.express.internal.client.test.utils.CartridgeAsserts.assertThatContainsCartridge;
+import static org.junit.Assert.assertNotNull;
+
+import java.util.List;
+
+import org.jboss.tools.openshift.express.client.ICartridge;
+import org.jboss.tools.openshift.express.client.OpenshiftException;
+import org.jboss.tools.openshift.express.internal.client.response.OpenshiftResponse;
+import org.jboss.tools.openshift.express.internal.client.response.unmarshalling.JsonSanitizer;
+import org.jboss.tools.openshift.express.internal.client.response.unmarshalling.ListCartridgesResponseUnmarshaller;
+import org.jboss.tools.openshift.express.internal.client.test.fakes.CartridgeResponseFake;
+import org.junit.Test;
+
+/**
+ * @author André Dietisheim
+ */
+public class CartridgeTest {
+
+	@Test
+	public void canUnmarshallApplicationResponse() throws OpenshiftException {
+		String response = JsonSanitizer.sanitize(CartridgeResponseFake.RESPONSE);
+		OpenshiftResponse<List<ICartridge>> openshiftResponse =
+				new ListCartridgesResponseUnmarshaller().unmarshall(response);
+		List<ICartridge> cartridges = openshiftResponse.getOpenshiftObject();
+		assertNotNull(cartridges);
+		assertThatContainsCartridge(CartridgeResponseFake.CARTRIDGE_JBOSSAS70, cartridges);
+		assertThatContainsCartridge(CartridgeResponseFake.CARTRIDGE_PERL5, cartridges);
+		assertThatContainsCartridge(CartridgeResponseFake.CARTRIDGE_PHP53, cartridges);
+		assertThatContainsCartridge(CartridgeResponseFake.CARTRIDGE_RACK11, cartridges);
+		assertThatContainsCartridge(CartridgeResponseFake.CARTRIDGE_WSGI32, cartridges);
+	}
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/CartridgeTest.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/CartridgesIntegrationTest.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/CartridgesIntegrationTest.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/CartridgesIntegrationTest.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,48 @@
+/******************************************************************************* 
+ * 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.tools.openshift.express.internal.client.test;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.List;
+
+import org.jboss.tools.openshift.express.client.ICartridge;
+import org.jboss.tools.openshift.express.client.OpenshiftService;
+import org.jboss.tools.openshift.express.client.User;
+import org.jboss.tools.openshift.express.internal.client.test.fakes.TestUser;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * @author André Dietisheim
+ */
+public class CartridgesIntegrationTest {
+
+	private OpenshiftService openshiftService;
+
+	private User user;
+	
+	@Before
+	public void setUp() {
+		this.openshiftService = new OpenshiftService();
+		this.user = new TestUser();
+	}
+
+	@Ignore
+	@Test
+	public void canRequestListCartridges() throws Exception {
+		List<ICartridge> cartridges = openshiftService.getCartridges(user);
+		assertNotNull(cartridges);
+		assertTrue(cartridges.size() > 0);
+	}
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/CartridgesIntegrationTest.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/DomainIntegrationTest.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/DomainIntegrationTest.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/DomainIntegrationTest.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,72 @@
+/******************************************************************************* 
+ * 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.tools.openshift.express.internal.client.test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import org.jboss.tools.openshift.express.client.IDomain;
+import org.jboss.tools.openshift.express.client.OpenshiftService;
+import org.jboss.tools.openshift.express.client.SSHKeyPair;
+import org.jboss.tools.openshift.express.internal.client.test.fakes.TestSSHKey;
+import org.jboss.tools.openshift.express.internal.client.test.fakes.TestUser;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+public class DomainIntegrationTest {
+
+	private OpenshiftService openshiftService;
+	private TestUser user;
+
+	@Before
+	public void setUp() {
+		this.openshiftService = new OpenshiftService();
+		this.user = new TestUser();
+	}
+
+	@Ignore
+	@Test
+	public void canCreateDomain() throws Exception {
+
+		String domainName = createRandomString();
+		SSHKeyPair sshKey = TestSSHKey.create();
+		IDomain domain = openshiftService.createDomain(domainName, sshKey, user);
+
+		assertNotNull(domain);
+		assertEquals(domainName, domain.getNamespace());
+	}
+
+	@Ignore
+	@Test
+	public void canChangeDomain() throws Exception {
+
+		String domainName = createRandomString();
+		SSHKeyPair sshKey = TestSSHKey.create();
+		IDomain domain = openshiftService.changeDomain(domainName, sshKey, user);
+
+		assertNotNull(domain);
+		assertEquals(domainName, domain.getNamespace());
+	}
+
+	@Test
+	public void canSetNamespaceOnDomain() throws Exception {
+		IDomain domain = user.getDomain();
+		assertNotNull(domain);
+		String newDomainName = createRandomString();
+		domain.setNamespace(newDomainName);
+		assertEquals(newDomainName, domain.getNamespace());
+	}
+
+	private String createRandomString() {
+		return String.valueOf(System.currentTimeMillis());
+	}
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/DomainIntegrationTest.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/DomainTest.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/DomainTest.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/DomainTest.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,124 @@
+/******************************************************************************* 
+ * 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.tools.openshift.express.internal.client.test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+
+import org.jboss.tools.openshift.express.client.IDomain;
+import org.jboss.tools.openshift.express.client.IOpenshiftService;
+import org.jboss.tools.openshift.express.client.OpenshiftException;
+import org.jboss.tools.openshift.express.client.SSHKeyPair;
+import org.jboss.tools.openshift.express.internal.client.InternalUser;
+import org.jboss.tools.openshift.express.internal.client.request.ChangeDomainRequest;
+import org.jboss.tools.openshift.express.internal.client.request.CreateDomainRequest;
+import org.jboss.tools.openshift.express.internal.client.request.OpenshiftEnvelopeFactory;
+import org.jboss.tools.openshift.express.internal.client.request.marshalling.DomainRequestJsonMarshaller;
+import org.jboss.tools.openshift.express.internal.client.response.OpenshiftResponse;
+import org.jboss.tools.openshift.express.internal.client.response.unmarshalling.DomainResponseUnmarshaller;
+import org.jboss.tools.openshift.express.internal.client.response.unmarshalling.JsonSanitizer;
+import org.jboss.tools.openshift.express.internal.client.test.fakes.NoopOpenshiftServiceFake;
+import org.jboss.tools.openshift.express.internal.client.test.fakes.TestSSHKey;
+import org.junit.Test;
+
+/**
+ * @author André Dietisheim
+ */
+public class DomainTest {
+
+	private static final String RHLOGIN = "toolsjboss at gmail.com";
+	private static final String PASSWORD = "1q2w3e";
+	private static final String UUID = "0c82860dae904a4d87f8e5d87a5af840";
+
+	@Test
+	public void canMarshallDomainCreateRequest() throws IOException, OpenshiftException {
+		SSHKeyPair sshKey = TestSSHKey.create();
+		String expectedRequestString = createDomainRequestString(PASSWORD, RHLOGIN, true, "myDomain", false,
+				sshKey.getPublicKey());
+
+		CreateDomainRequest request = new CreateDomainRequest("myDomain", sshKey, RHLOGIN, true);
+		String requestString =
+				new OpenshiftEnvelopeFactory(
+						PASSWORD,
+						new DomainRequestJsonMarshaller().marshall(request))
+						.createString();
+		assertEquals(expectedRequestString, requestString);
+	}
+
+	@Test
+	public void canUnmarshallDomainCreateResponse() throws IOException, OpenshiftException {
+		String domainName = "myDomain";
+		String responseString = createDomainResponseString(RHLOGIN, UUID);
+
+		responseString = JsonSanitizer.sanitize(responseString);
+		IOpenshiftService service = new NoopOpenshiftServiceFake();
+		InternalUser user = new InternalUser(RHLOGIN, PASSWORD, service);
+		OpenshiftResponse<IDomain> response = new DomainResponseUnmarshaller(domainName, user, service).unmarshall(responseString);
+
+		assertNotNull(response);
+		IDomain domain = response.getOpenshiftObject();
+		assertEquals(domainName, domain.getNamespace());
+	}
+
+	@Test
+	public void canMarshallDomainAlterRequest() throws IOException, OpenshiftException {
+		SSHKeyPair sshKey = TestSSHKey.create();
+		String expectedRequestString = createDomainRequestString(PASSWORD, RHLOGIN, true, "myDomain", true,
+				sshKey.getPublicKey());
+
+		ChangeDomainRequest request = new ChangeDomainRequest("myDomain", sshKey, RHLOGIN, true);
+		String requestString =
+				new OpenshiftEnvelopeFactory(
+						PASSWORD,
+						new DomainRequestJsonMarshaller().marshall(request))
+						.createString();
+		assertEquals(expectedRequestString, requestString);
+	}
+
+	private String createDomainRequestString(String password, String username, boolean debug, String namespace,
+			boolean alter, String sshPublicKey) throws UnsupportedEncodingException {
+		return "password="
+				+ password
+				+ "&json_data=%7B"
+				+ "%22rhlogin%22+%3A+"
+				+ "%22"
+				+ URLEncoder.encode(username, "UTF-8")
+				+ "%22"
+				+ "%2C+%22debug%22+%3A+%22" + String.valueOf(debug) + "%22"
+				+ "%2C+%22namespace%22+%3A+%22" + URLEncoder.encode(namespace, "UTF-8") + "%22"
+				+ "%2C+%22alter%22+%3A+%22" + String.valueOf(alter) + "%22"
+				+ "%2C+%22ssh%22+%3A+%22"
+				+ URLEncoder.encode(sshPublicKey, "UTF-8")
+				+ "%22"
+				+ "%7D";
+	}
+
+	/**
+	 * WARNING: the response this method returns matches the actual response
+	 * from the openshift service (9-12-2011). It is not valid json since it quotes the
+	 * nested json object
+	 * <p>
+	 * "data": "{\"rhlogin\": ...
+	 */
+	private String createDomainResponseString(String username, String uuid) {
+		return "{\"messages\":\"\",\"debug\":\"\",\"data\":\""
+				+ "{\\\"rhlogin\\\":\\\""
+				+ username
+				+ "\\\",\\\"uuid\\\":\\\""
+				+ uuid
+				+ "\\\"}"
+				+ "\",\"api\":\"1.1.1\",\"api_c\":[\"placeholder\"],\"result\":null,\"broker\":\"1.1.1\",\"broker_c\":[\"namespace\",\"rhlogin\",\"ssh\",\"app_uuid\",\"debug\",\"alter\",\"cartridge\",\"cart_type\",\"action\",\"app_name\",\"api\"],\"exit_code\":0}";
+	}
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/DomainTest.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/IOpenshiftTestService.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/IOpenshiftTestService.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/IOpenshiftTestService.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,22 @@
+/******************************************************************************* 
+ * 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.tools.openshift.express.internal.client.test;
+
+import org.jboss.tools.openshift.express.client.IOpenshiftService;
+
+/**
+ * @author André Dietisheim
+ */
+public interface IOpenshiftTestService extends IOpenshiftService {
+
+	public static final String STAGING_BASE_URL = "";
+
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/IOpenshiftTestService.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/JsonSanitizerTest.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/JsonSanitizerTest.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/JsonSanitizerTest.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,77 @@
+/******************************************************************************* 
+ * 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.tools.openshift.express.internal.client.test;
+
+import static org.junit.Assert.assertEquals;
+
+import org.jboss.dmr.ModelNode;
+import org.jboss.tools.openshift.express.client.OpenshiftException;
+import org.jboss.tools.openshift.express.internal.client.response.unmarshalling.JsonSanitizer;
+import org.junit.Test;
+
+/**
+ * @author André Dietisheim
+ */
+public class JsonSanitizerTest {
+
+	@Test
+	public void canSanitizeQuotedJsonObject() throws OpenshiftException {
+		String quotedJsonObject =
+				"\"{"
+						+ "\\\"carts\\\":"
+						+ "\\\"perl-5.10\\\""
+						+ "}\"";
+
+		String sanitizedJson = JsonSanitizer.sanitize(quotedJsonObject);
+		assertEquals("{\"carts\":\"perl-5.10\"}", sanitizedJson);
+	}
+
+	@Test
+	public void doesNotTuchValidJson() throws OpenshiftException {
+		String quotedJsonObject =
+				"{"
+						+ "\"carts\":"
+						+ "\"perl-5.10\""
+						+ "}";
+
+		String sanitizedJson = JsonSanitizer.sanitize(quotedJsonObject);
+		assertEquals("{\"carts\":\"perl-5.10\"}", sanitizedJson);
+	}
+
+	@Test
+	public void doesNotRemoveEscapedQuoteInStringValue() throws OpenshiftException {
+		String quotedJsonObject =
+				"\"{"
+						+ "\\\"property\\\":"
+						+ "\\\"stringWithA\\\\\"Quote\""
+						+ "}\"";
+
+		String sanitizedJson = JsonSanitizer.sanitize(quotedJsonObject);
+		assertEquals("{\"property\":\"stringWithA\\\"Quote\"}", sanitizedJson);
+		ModelNode node = ModelNode.fromJSONString(sanitizedJson);
+		assertEquals("stringWithA\"Quote", node.get("property").asString());
+	}
+
+	@Test
+	public void doesNotRemoveEscapedQuoteInStringValueWithinValidJsonObject() throws OpenshiftException {
+		String quotedJsonObject =
+				"{"
+						+ "\"property\":"
+						+ "\"stringWithA\\\"Quote\""
+						+ "}";
+
+		String sanitizedJson = JsonSanitizer.sanitize(quotedJsonObject);
+		assertEquals("{\"property\":\"stringWithA\\\"Quote\"}", sanitizedJson);
+		ModelNode node = ModelNode.fromJSONString(sanitizedJson);
+		assertEquals("stringWithA\"Quote", node.get("property").asString());
+	}
+	
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/JsonSanitizerTest.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/ListCartridgesIntegrationTest.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/ListCartridgesIntegrationTest.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/ListCartridgesIntegrationTest.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -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.tools.openshift.express.internal.client.test;
+
+import static org.jboss.tools.openshift.express.internal.client.test.utils.CartridgeAsserts.assertThatContainsCartridge;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.List;
+
+import org.jboss.tools.openshift.express.client.ICartridge;
+import org.jboss.tools.openshift.express.client.OpenshiftService;
+import org.jboss.tools.openshift.express.internal.client.test.fakes.TestUser;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * @author André Dietisheim
+ */
+public class ListCartridgesIntegrationTest {
+
+	private OpenshiftService openshiftService;
+	private TestUser user;
+
+	@Before
+	public void setUp() {
+		this.openshiftService = new OpenshiftService();
+		this.user = new TestUser();
+	}
+
+	@Test
+	public void canListCartridges() throws Exception {
+		List<ICartridge> cartridges = openshiftService.getCartridges(user);
+		assertNotNull(cartridges);
+		assertTrue(cartridges.size() > 0);
+		assertThatContainsCartridge("jbossas-7.0", cartridges);
+	}
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/ListCartridgesIntegrationTest.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/ListCartridgesTest.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/ListCartridgesTest.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/ListCartridgesTest.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,94 @@
+/******************************************************************************* 
+ * 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.tools.openshift.express.internal.client.test;
+
+import static org.jboss.tools.openshift.express.internal.client.test.utils.CartridgeAsserts.assertThatContainsCartridge;
+import static org.junit.Assert.assertEquals;
+
+import java.net.URLEncoder;
+import java.util.List;
+
+import org.jboss.tools.openshift.express.client.ICartridge;
+import org.jboss.tools.openshift.express.client.OpenshiftException;
+import org.jboss.tools.openshift.express.internal.client.request.ListCartridgesRequest;
+import org.jboss.tools.openshift.express.internal.client.request.OpenshiftEnvelopeFactory;
+import org.jboss.tools.openshift.express.internal.client.request.marshalling.ListCartridgesRequestJsonMarshaller;
+import org.jboss.tools.openshift.express.internal.client.response.OpenshiftResponse;
+import org.jboss.tools.openshift.express.internal.client.response.unmarshalling.JsonSanitizer;
+import org.jboss.tools.openshift.express.internal.client.response.unmarshalling.ListCartridgesResponseUnmarshaller;
+import org.junit.Test;
+
+/**
+ * @author André Dietisheim
+ */
+public class ListCartridgesTest {
+
+	private static final String USERNAME = "toolsjboss at gmail.com";
+	private static final String PASSWORD = "1q2w3e";
+
+	@Test
+	public void canMarshallListCartridgesRequest() 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+%22cart_type%22+%3A+%22standalone%22%7D";
+
+		String listCartridgeRequest = new ListCartridgesRequestJsonMarshaller().marshall(
+				new ListCartridgesRequest(USERNAME, true));
+		String effectiveRequest = new OpenshiftEnvelopeFactory(PASSWORD, listCartridgeRequest).createString();
+
+		assertEquals(expectedRequestString, effectiveRequest);
+	}
+
+	@Test
+	public void canUnmarshallCartridgeListResponse() throws OpenshiftException {
+		String cartridgeListResponse =
+				"{"
+						+ "\"messages\":\"\","
+						+ "\"debug\":\"\","
+						+ "\"data\":"
+						+ "\"{\\\"carts\\\":[\\\"perl-5.10\\\",\\\"jbossas-7.0\\\",\\\"wsgi-3.2\\\",\\\"rack-1.1\\\",\\\"php-5.3\\\"]}\","
+						+ "\"api\":\"1.1.1\","
+						+ "\"api_c\":[\"placeholder\"],"
+						+ "\"result\":null,"
+						+ "\"broker\":\"1.1.1\","
+						+ "\"broker_c\":["
+						+ "\"namespace\","
+						+ "\"rhlogin\","
+						+ "\"ssh\","
+						+ "\"app_uuid\","
+						+ "\"debug\","
+						+ "\"alter\","
+						+ "\"cartridge\","
+						+ "\"cart_type\","
+						+ "\"action\","
+						+ "\"app_name\","
+						+ "\"api"
+						+ "\"],"
+						+ "\"exit_code\":0}";
+
+		cartridgeListResponse = JsonSanitizer.sanitize(cartridgeListResponse);
+		OpenshiftResponse<List<ICartridge>> response =
+				new ListCartridgesResponseUnmarshaller().unmarshall(cartridgeListResponse);
+		assertEquals("", response.getMessages());
+		assertEquals(false, response.isDebug());
+
+		List<ICartridge> cartridges = response.getOpenshiftObject();
+		assertEquals(5, cartridges.size());
+		assertThatContainsCartridge("perl-5.10", cartridges);
+		assertThatContainsCartridge("jbossas-7.0", cartridges);
+		assertThatContainsCartridge("wsgi-3.2", cartridges);
+		assertThatContainsCartridge("rack-1.1", cartridges);
+		assertThatContainsCartridge("php-5.3", cartridges);
+		assertEquals(null, response.getResult());
+		assertEquals(0, response.getExitCode());
+	}
+
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/ListCartridgesTest.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/LogReaderRunnable.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/LogReaderRunnable.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/LogReaderRunnable.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,65 @@
+/******************************************************************************* 
+ * 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.tools.openshift.express.internal.client.test;
+
+import static org.junit.Assert.fail;
+
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingDeque;
+import java.util.concurrent.TimeUnit;
+
+import org.jboss.tools.openshift.express.client.ApplicationLogReader;
+
+public class LogReaderRunnable implements Runnable {
+
+	private ApplicationLogReader logReader;
+	private long timeout;
+	private BlockingQueue<Character> logQueue = new LinkedBlockingDeque<Character>();
+	private StringBuilder logBuilder = new StringBuilder();
+	
+	public LogReaderRunnable(ApplicationLogReader logReader, long timeout) {
+		this.logReader = logReader;
+		this.timeout = timeout;
+	}
+
+	@Override
+	public void run() {
+		try {
+			for (int data = -1; (data = logReader.read()) != -1;) {
+				logQueue.put((char) data);
+			}
+		} catch (Exception e) {
+			fail(e.getMessage());
+		}
+	}
+
+	private boolean waitForNewLogentries(StringBuilder builder) throws InterruptedException {
+		Character character = logQueue.poll(timeout, TimeUnit.MILLISECONDS);
+		boolean isNewEntry = character != null;
+		if (isNewEntry) {
+			builder.append(character);
+			logBuilder.append(character);
+		}
+		return isNewEntry;
+	}
+
+	public String waitUntilNoNewLogentries() throws InterruptedException {
+		StringBuilder builder = new StringBuilder();
+		while (waitForNewLogentries(builder)) {
+			;
+		}
+		return builder.toString();
+	}
+
+	public String getLog() {
+		return logBuilder.toString();
+	}
+}
\ No newline at end of file


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/LogReaderRunnable.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/OpenshiftIntegrationTestSuite.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/OpenshiftIntegrationTestSuite.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/OpenshiftIntegrationTestSuite.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -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.tools.openshift.express.internal.client.test;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+
+ at RunWith(Suite.class)
+ at Suite.SuiteClasses({
+	ApplicationIntegrationTest.class,
+	ApplicationLogReaderIntegrationTest.class,
+	CartridgesIntegrationTest.class,
+	DomainIntegrationTest.class,
+	ListCartridgesIntegrationTest.class,
+	UserInfoIntegrationTest.class,
+	UserIntegrationTest.class
+})
+/**
+ * @author André Dietisheim
+ */
+public class OpenshiftIntegrationTestSuite {
+
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/OpenshiftIntegrationTestSuite.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/OpenshiftTestSuite.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/OpenshiftTestSuite.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/OpenshiftTestSuite.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,34 @@
+/******************************************************************************* 
+ * 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.tools.openshift.express.internal.client.test;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+
+ at RunWith(Suite.class)
+ at Suite.SuiteClasses({
+	UserConfigurationTest.class,
+	ApplicationTest.class,
+	ApplicationLogReaderTest.class,
+	ListCartridgesTest.class,
+	DomainTest.class,
+	UserInfoTest.class,
+	UserTest.class,
+	CartridgeTest.class,
+	SSHKeyTest.class
+})
+/**
+ * @author André Dietisheim
+ */
+public class OpenshiftTestSuite {
+
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/OpenshiftTestSuite.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/SSHKeyTest.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/SSHKeyTest.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/SSHKeyTest.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,75 @@
+/******************************************************************************* 
+ * 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.tools.openshift.express.internal.client.test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.jboss.tools.openshift.express.client.ISSHPublicKey;
+import org.jboss.tools.openshift.express.client.SSHKeyPair;
+import org.jboss.tools.openshift.express.client.SSHPublicKey;
+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();
+		SSHKeyPair sshKey = SSHKeyPair.create(PASSPHRASE, privateKeyPath, publicKeyPath);
+		String publicKey = sshKey.getPublicKey();
+
+		assertNotNull(publicKey);
+		assertTrue(!publicKey.contains("ssh-rsa")); // no identifier
+		assertTrue(!publicKey.contains(" ")); // no comment
+	}
+
+	@Test
+	public void canLoadKeyPair() throws Exception {
+		String publicKeyPath = createTempFile().getAbsolutePath();
+		String privateKeyPath = createTempFile().getAbsolutePath();
+		SSHKeyPair.create(PASSPHRASE, privateKeyPath, publicKeyPath);
+
+		SSHKeyPair sshKey = SSHKeyPair.load(privateKeyPath, publicKeyPath);
+		String publicKey = sshKey.getPublicKey();
+
+		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();
+		SSHKeyPair.create(PASSPHRASE, privateKeyPath, publicKeyPath);
+
+		ISSHPublicKey sshKey = new SSHPublicKey(new File(publicKeyPath));
+		String publicKey = sshKey.getPublicKey();
+
+		assertNotNull(publicKey);
+		assertTrue(!publicKey.contains("ssh-rsa")); // no identifier
+		assertTrue(!publicKey.contains(" ")); // no comment
+
+		SSHKeyPair keyPair = SSHKeyPair.load(privateKeyPath, publicKeyPath);
+		assertEquals(publicKey, keyPair.getPublicKey());
+	}
+
+	private File createTempFile() throws IOException {
+		return File.createTempFile(String.valueOf(System.currentTimeMillis()), null);
+	}
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/SSHKeyTest.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/UserConfigurationTest.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/UserConfigurationTest.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/UserConfigurationTest.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,96 @@
+/******************************************************************************* 
+ * 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.tools.openshift.express.internal.client.test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.Writer;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.jboss.tools.openshift.express.client.OpenshiftException;
+import org.jboss.tools.openshift.express.internal.client.test.fakes.UserConfigurationFake;
+import org.jboss.tools.openshift.express.internal.client.utils.StreamUtils;
+import org.junit.Test;
+
+/**
+ * @author André Dietisheim
+ */
+public class UserConfigurationTest {
+
+	private static final String USERNAME_REGEX = "[^=]+=(.+)";
+	private static final String USERNAME = "dummyUser";
+	private static final String ANOTHER_USERNAME = "anotherUser";
+
+	@Test
+	public void canReadUsername() throws OpenshiftException, IOException {
+		UserConfigurationFake userConfiguration = new UserConfigurationFake() {
+
+			@Override
+			protected void initFile(Writer writer) throws IOException {
+				writer.append(KEY_RHLOGIN).append('=').append(USERNAME).append('\n');
+			}
+
+		};
+		assertEquals(USERNAME, userConfiguration.getRhlogin());
+	}
+
+	@Test
+	public void canStoreUsername() throws OpenshiftException, IOException {
+		UserConfigurationFake userConfiguration = new UserConfigurationFake() {
+
+			@Override
+			protected void initFile(Writer writer) throws IOException {
+				writer.append(KEY_RHLOGIN).append('=').append(USERNAME).append('\n');
+			}
+
+		};
+		userConfiguration.setRhlogin(ANOTHER_USERNAME);
+		userConfiguration.store();
+		final File userConfigurationFile = userConfiguration.getFile();
+		assertNotNull(userConfigurationFile);
+		String fileContent = StreamUtils.readToString(new FileReader(userConfigurationFile));
+		Pattern pattern = Pattern.compile(USERNAME_REGEX);
+		Matcher matcher = pattern.matcher(fileContent);
+		assertTrue(matcher.matches());
+		assertEquals(1, matcher.groupCount());
+		assertEquals(ANOTHER_USERNAME, matcher.group(1));
+	}
+
+	@Test
+	public void canStoreAndReadUsername() throws OpenshiftException, IOException {
+		UserConfigurationFake userConfiguration = new UserConfigurationFake() {
+
+			@Override
+			protected void initFile(Writer writer) throws IOException {
+				writer.append(KEY_RHLOGIN).append('=').append(USERNAME).append('\n');
+			}
+
+		};
+		userConfiguration.setRhlogin(ANOTHER_USERNAME);
+		userConfiguration.store();
+		final File userConfigurationFile = userConfiguration.getFile();
+		assertNotNull(userConfigurationFile);
+		UserConfigurationFake userConfiguration2 = new UserConfigurationFake() {
+
+			@Override
+			protected File getUserConfigurationFile() throws OpenshiftException, IOException {
+				return userConfigurationFile;
+			}
+		};
+		assertEquals(ANOTHER_USERNAME, userConfiguration2.getRhlogin());
+	}
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/UserConfigurationTest.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/UserInfoIntegrationTest.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/UserInfoIntegrationTest.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/UserInfoIntegrationTest.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,112 @@
+/******************************************************************************* 
+ * 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.tools.openshift.express.internal.client.test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.util.List;
+
+import org.jboss.tools.openshift.express.client.ICartridge;
+import org.jboss.tools.openshift.express.client.IOpenshiftService;
+import org.jboss.tools.openshift.express.client.ISSHPublicKey;
+import org.jboss.tools.openshift.express.client.InvalidCredentialsOpenshiftException;
+import org.jboss.tools.openshift.express.client.NotFoundOpenshiftException;
+import org.jboss.tools.openshift.express.client.OpenshiftException;
+import org.jboss.tools.openshift.express.client.OpenshiftService;
+import org.jboss.tools.openshift.express.internal.client.ApplicationInfo;
+import org.jboss.tools.openshift.express.internal.client.InternalUser;
+import org.jboss.tools.openshift.express.internal.client.UserInfo;
+import org.jboss.tools.openshift.express.internal.client.test.fakes.TestUser;
+import org.jboss.tools.openshift.express.internal.client.test.utils.ApplicationInfoAsserts;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * @author André Dietisheim
+ */
+public class UserInfoIntegrationTest {
+
+	private OpenshiftService openshiftService;
+	private TestUser user;
+
+	@Before
+	public void setUp() {
+		this.openshiftService = new OpenshiftService();
+		this.user = new TestUser();
+	}
+
+	@Test
+	public void canGetUserInfo() throws Exception {
+		UserInfo userInfo = openshiftService.getUserInfo(user);
+		assertNotNull(userInfo);
+
+		assertEquals(user.getRhlogin(), userInfo.getRhLogin());
+	}
+
+	@Test(expected = InvalidCredentialsOpenshiftException.class)
+	public void getUserInfoForInexistantUserThrowsException() throws Exception {
+		TestUser inexistantUser = new TestUser("inexistantUsername", "bogusPassword");
+		openshiftService.getUserInfo(inexistantUser);
+	}
+
+	/**
+	 * {@link OpenshiftService#getUserInfo(InternalUser)} for a user without
+	 * domain throws {@link NotFoundOpenshiftException}
+	 */
+	@Test(expected = NotFoundOpenshiftException.class)
+	public void canGetUserInfoForUserWithoutDomain() throws Exception {
+		TestUser inexistantUser = new TestUser(TestUser.RHLOGIN_USER_WITHOUT_DOMAIN, TestUser.PASSWORD_USER_WITHOUT_DOMAIN);
+		openshiftService.getUserInfo(inexistantUser);
+	}
+
+	@Test
+	public void userInfoContainsOneMoreApplicationAfterCreatingNewApplication() throws Exception {
+		UserInfo userInfo = openshiftService.getUserInfo(user);
+		assertNotNull(userInfo);
+
+		List<ApplicationInfo> applicationInfos = userInfo.getApplicationInfos();
+		assertNotNull(applicationInfos);
+		int numberOfApplicationInfos = applicationInfos.size();
+
+		String applicationName = createRandomName();
+		try {
+			openshiftService.createApplication(applicationName, ICartridge.JBOSSAS_7, user);
+
+			UserInfo userInfo2 = openshiftService.getUserInfo(user);
+			assertEquals(numberOfApplicationInfos + 1, userInfo2.getApplicationInfos().size());
+			ApplicationInfoAsserts.assertThatContainsApplicationInfo(applicationName, userInfo2.getApplicationInfos());
+		} finally {
+			silentlyDestroyAS7Application(applicationName, openshiftService);
+		}
+	}
+
+	@Test
+	public void canUseReturnedSSHKeyToChangeDomain() throws Exception {
+		UserInfo userInfo = openshiftService.getUserInfo(user);
+		assertNotNull(userInfo);
+
+		ISSHPublicKey sshKey = userInfo.getSshPublicKey();
+		openshiftService.changeDomain(createRandomName(), sshKey, user);
+	}
+
+	private String createRandomName() {
+		return String.valueOf(System.currentTimeMillis());
+	}
+
+	private void silentlyDestroyAS7Application(String name, IOpenshiftService service) {
+		try {
+			service.destroyApplication(name, ICartridge.JBOSSAS_7, user);
+		} catch (OpenshiftException e) {
+			e.printStackTrace();
+		}
+	}
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/UserInfoIntegrationTest.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/UserInfoTest.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/UserInfoTest.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/UserInfoTest.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,102 @@
+/******************************************************************************* 
+ * 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.tools.openshift.express.internal.client.test;
+
+import static org.jboss.tools.openshift.express.internal.client.test.utils.ApplicationInfoAsserts.assertThatContainsApplicationInfo;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.net.URLEncoder;
+import java.util.List;
+
+import org.jboss.tools.openshift.express.client.ISSHPublicKey;
+import org.jboss.tools.openshift.express.client.OpenshiftException;
+import org.jboss.tools.openshift.express.internal.client.ApplicationInfo;
+import org.jboss.tools.openshift.express.internal.client.UserInfo;
+import org.jboss.tools.openshift.express.internal.client.request.OpenshiftEnvelopeFactory;
+import org.jboss.tools.openshift.express.internal.client.request.UserInfoRequest;
+import org.jboss.tools.openshift.express.internal.client.request.marshalling.UserInfoRequestJsonMarshaller;
+import org.jboss.tools.openshift.express.internal.client.response.OpenshiftResponse;
+import org.jboss.tools.openshift.express.internal.client.response.unmarshalling.JsonSanitizer;
+import org.jboss.tools.openshift.express.internal.client.response.unmarshalling.UserInfoResponseUnmarshaller;
+import org.jboss.tools.openshift.express.internal.client.test.fakes.UserInfoResponseFake;
+import org.junit.Test;
+
+/**
+ * @author André Dietisheim
+ */
+public class UserInfoTest {
+
+	@Test
+	public void canMarshallUserInfoRequest() throws Exception {
+		String expectedRequestString =
+				"password=" + URLEncoder.encode(UserInfoResponseFake.PASSWORD, "UTF-8")
+						+ "&json_data=%7B"
+						+ "%22rhlogin%22+%3A+%22" + URLEncoder.encode(UserInfoResponseFake.RHLOGIN, "UTF-8")
+						+ "%22%2C+"
+						+ "%22debug%22+%3A+%22true%22"
+						+ "%7D";
+
+		String userInfoRequest = new UserInfoRequestJsonMarshaller().marshall(
+				new UserInfoRequest(UserInfoResponseFake.RHLOGIN, true));
+		String effectiveRequest =
+				new OpenshiftEnvelopeFactory(UserInfoResponseFake.PASSWORD, userInfoRequest).createString();
+
+		assertEquals(expectedRequestString, effectiveRequest);
+	}
+
+	@Test
+	public void canUnmarshallUserInfoResponse() throws Exception {
+		UserInfo userInfo = getUserInfo(JsonSanitizer.sanitize(UserInfoResponseFake.RESPONSE));
+		assertNotNull(userInfo);
+
+		assertEquals(UserInfoResponseFake.RHLOGIN, userInfo.getRhLogin());
+		assertEquals(UserInfoResponseFake.UUID, userInfo.getUuid());
+		ISSHPublicKey sshPublicKey = userInfo.getSshPublicKey();
+		assertNotNull(sshPublicKey);
+		assertEquals(UserInfoResponseFake.SSH_KEY, sshPublicKey.getPublicKey());
+
+		assertEquals(UserInfoResponseFake.NAMESPACE, userInfo.getNamespace());
+		assertEquals(UserInfoResponseFake.RHC_DOMAIN, userInfo.getRhcDomain());
+
+		List<ApplicationInfo> applicationInfos = userInfo.getApplicationInfos();
+		assertNotNull(applicationInfos);
+		assertEquals(2, applicationInfos.size());
+		assertThatContainsApplicationInfo(
+				UserInfoResponseFake.APP1_NAME,
+				UserInfoResponseFake.APP1_EMBEDDED,
+				UserInfoResponseFake.APP1_UUID,
+				UserInfoResponseFake.APP1_CARTRIDGE,
+				UserInfoResponseFake.APP1_CREATION_TIME,
+				applicationInfos);
+		assertThatContainsApplicationInfo(
+				UserInfoResponseFake.APP2_NAME,
+				UserInfoResponseFake.APP2_EMBEDDED,
+				UserInfoResponseFake.APP2_UUID,
+				UserInfoResponseFake.APP2_CARTRIDGE,
+				UserInfoResponseFake.APP2_CREATION_TIME,
+				applicationInfos);
+	}
+
+	@Test
+	public void canGetApplicationByName() throws OpenshiftException {
+		UserInfo userInfo = getUserInfo(JsonSanitizer.sanitize(UserInfoResponseFake.RESPONSE));
+		ApplicationInfo applicationInfo = userInfo.getApplicationInfoByName(UserInfoResponseFake.APP1_NAME);
+		assertNotNull(applicationInfo);
+		assertEquals(UserInfoResponseFake.APP1_NAME, applicationInfo.getName());
+	}
+
+	protected UserInfo getUserInfo(String response) throws OpenshiftException {
+		UserInfoResponseUnmarshaller unmarshaller = new UserInfoResponseUnmarshaller();
+		OpenshiftResponse<UserInfo> openshiftResponse = unmarshaller.unmarshall(response);
+		return openshiftResponse.getOpenshiftObject();
+	}
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/UserInfoTest.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/UserIntegrationTest.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/UserIntegrationTest.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/UserIntegrationTest.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,151 @@
+/******************************************************************************* 
+ * 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.tools.openshift.express.internal.client.test;
+
+import static org.jboss.tools.openshift.express.internal.client.test.utils.ApplicationAsserts.assertApplication;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Collection;
+
+import javax.xml.datatype.DatatypeConfigurationException;
+
+import org.jboss.tools.openshift.express.client.IApplication;
+import org.jboss.tools.openshift.express.client.ICartridge;
+import org.jboss.tools.openshift.express.client.IDomain;
+import org.jboss.tools.openshift.express.client.ISSHPublicKey;
+import org.jboss.tools.openshift.express.client.NotFoundOpenshiftException;
+import org.jboss.tools.openshift.express.client.OpenshiftEndpointException;
+import org.jboss.tools.openshift.express.client.OpenshiftException;
+import org.jboss.tools.openshift.express.client.OpenshiftService;
+import org.jboss.tools.openshift.express.client.User;
+import org.jboss.tools.openshift.express.internal.client.test.fakes.TestUser;
+import org.jboss.tools.openshift.express.internal.client.test.utils.ApplicationUtils;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * @author André Dietisheim
+ */
+public class UserIntegrationTest {
+
+	private User user;
+	private TestUser invalidUser;
+	private TestUser badUrlUser;
+	private TestUser userWithoutDomain;
+
+	@Before
+	public void setUp() throws OpenshiftException, DatatypeConfigurationException {
+		this.user = new TestUser();
+		this.invalidUser = new TestUser("bogusPassword");
+		this.badUrlUser = new TestUser(TestUser.RHLOGIN, TestUser.PASSWORD, "http://www.redhat.com");
+		this.userWithoutDomain = new TestUser(TestUser.RHLOGIN_USER_WITHOUT_DOMAIN, TestUser.PASSWORD_USER_WITHOUT_DOMAIN);
+	}
+
+	@Test
+	public void canCheckIfUserIsValid() throws OpenshiftException {
+		assertTrue(user.isValid());
+	}
+
+	@Test
+	public void throwsExceptionIfInvalidCredentials() throws OpenshiftException {
+		assertFalse(invalidUser.isValid());
+	}
+
+	@Test(expected = NotFoundOpenshiftException.class)
+	public void throwsExceptionIfBadUrl() throws OpenshiftException {
+		badUrlUser.isValid();
+	}
+
+	@Test
+	public void canGetUserUUID() throws OpenshiftException {
+		String uuid = user.getUUID();
+		assertNotNull(uuid);
+		assertTrue(uuid.length() > 0);
+	}
+
+	@Test
+	public void canGetPublicKey() throws OpenshiftException {
+		ISSHPublicKey key = user.getSshKey();
+		assertNotNull(key);
+		assertNotNull(key.getPublicKey());
+		assertTrue(key.getPublicKey().length() > 0);
+	}
+
+	@Test
+	public void canGetDomain() throws OpenshiftException {
+		IDomain domain = user.getDomain();
+		assertNotNull(domain);
+		assertNotNull(domain.getRhcDomain());
+		assertTrue(domain.getRhcDomain().length() > 0);
+		assertNotNull(domain.getNamespace());
+		assertTrue(domain.getNamespace().length() > 0);
+	}
+
+	@Test(expected = OpenshiftEndpointException.class)
+	public void cannotCreateDomainIfAlreadyExists() throws OpenshiftException {
+		IDomain domain = user.getDomain();
+		assertNotNull(domain);
+		ISSHPublicKey key = user.getSshKey();
+		assertNotNull(key);
+		user.createDomain("newDomain", key);
+	}
+
+	@Test
+	public void getNullIfNoDomainPresent() throws OpenshiftException {
+		IDomain domain = userWithoutDomain.getDomain();
+		assertNull(domain);
+	}
+
+	@Test
+	public void canGetCartridges() throws OpenshiftException {
+		Collection<ICartridge> cartridges = user.getCartridges();
+		assertNotNull(cartridges);
+		assertTrue(cartridges.size() >= 5);
+	}
+
+	@Test
+	public void canGetApplications() throws OpenshiftException {
+		Collection<IApplication> applications = user.getApplications();
+		assertNotNull(applications);
+	}
+
+	@Test
+	public void canCreateApplication() throws OpenshiftException {
+		String applicationName = ApplicationUtils.createRandomApplicationName();
+		try {
+			Collection<IApplication> applications = user.getApplications();
+			assertNotNull(applications);
+			int numOfApplications = applications.size();
+			IApplication application = user.createApplication(applicationName, ICartridge.JBOSSAS_7);
+			assertEquals(numOfApplications + 1, applications.size());
+			assertApplication(applicationName, ICartridge.JBOSSAS_7.getName(), application);
+		} finally {
+			ApplicationUtils.silentlyDestroyAS7Application(applicationName, user, new OpenshiftService());
+		}
+	}
+
+	@Test
+	public void canGetApplicationByName() throws OpenshiftException, DatatypeConfigurationException {
+		String applicationName = ApplicationUtils.createRandomApplicationName();
+		try {
+			IApplication application = user.createApplication(applicationName, ICartridge.JBOSSAS_7);
+			IApplication applicationFound = user.getApplicationByName(applicationName);
+			assertNotNull(applicationFound);
+			assertEquals(application, applicationFound);
+		} finally {
+			ApplicationUtils.silentlyDestroyAS7Application(applicationName, user, new OpenshiftService());
+		}
+	}
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/UserIntegrationTest.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/UserTest.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/UserTest.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/UserTest.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,154 @@
+/******************************************************************************* 
+ * 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.tools.openshift.express.internal.client.test;
+
+import static org.jboss.tools.openshift.express.internal.client.test.utils.ApplicationAsserts.assertApplication;
+import static org.jboss.tools.openshift.express.internal.client.test.utils.CartridgeAsserts.assertThatContainsCartridge;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
+import javax.xml.datatype.DatatypeConfigurationException;
+
+import org.jboss.tools.openshift.express.client.Cartridge;
+import org.jboss.tools.openshift.express.client.IApplication;
+import org.jboss.tools.openshift.express.client.ICartridge;
+import org.jboss.tools.openshift.express.client.IDomain;
+import org.jboss.tools.openshift.express.client.ISSHPublicKey;
+import org.jboss.tools.openshift.express.client.OpenshiftException;
+import org.jboss.tools.openshift.express.client.OpenshiftService;
+import org.jboss.tools.openshift.express.internal.client.ApplicationInfo;
+import org.jboss.tools.openshift.express.internal.client.InternalUser;
+import org.jboss.tools.openshift.express.internal.client.UserInfo;
+import org.jboss.tools.openshift.express.internal.client.test.fakes.CartridgeResponseFake;
+import org.jboss.tools.openshift.express.internal.client.test.fakes.NoopOpenshiftServiceFake;
+import org.jboss.tools.openshift.express.internal.client.test.fakes.UserInfoResponseFake;
+import org.jboss.tools.openshift.express.internal.client.utils.RFC822DateUtils;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * @author André Dietisheim
+ */
+public class UserTest {
+
+	private OpenshiftService userInfoservice;
+	private InternalUser user;
+
+	@Before
+	public void setUp() throws OpenshiftException, DatatypeConfigurationException {
+		UserInfo userInfo = createUserInfo();
+		this.userInfoservice = createUserInfoService(userInfo);
+		this.user = new InternalUser(UserInfoResponseFake.RHLOGIN, UserInfoResponseFake.PASSWORD, userInfoservice);
+	}
+
+	@Test
+	public void canGetUserUUID() throws OpenshiftException {
+		assertEquals(UserInfoResponseFake.UUID, user.getUUID());
+	}
+	
+	@Test
+	public void canGetPublicKey() throws OpenshiftException {
+		ISSHPublicKey key = user.getSshKey();
+		assertNotNull(key);
+		assertEquals(UserInfoResponseFake.SSH_KEY, key.getPublicKey());
+	}
+
+	@Test
+	public void canGetDomain() throws OpenshiftException {
+		IDomain domain = user.getDomain();
+		assertNotNull(domain);
+		assertEquals(UserInfoResponseFake.RHC_DOMAIN, domain.getRhcDomain());
+		assertEquals(UserInfoResponseFake.NAMESPACE, domain.getNamespace());
+	}
+
+	@Test
+	public void canGetCartridges() throws OpenshiftException {
+		OpenshiftService cartridgeListService = new NoopOpenshiftServiceFake() {
+
+			@Override
+			public List<ICartridge> getCartridges(InternalUser user) throws OpenshiftException {
+				ArrayList<ICartridge> cartridges = new ArrayList<ICartridge>();
+				cartridges.add(new Cartridge(CartridgeResponseFake.CARTRIDGE_JBOSSAS70));
+				cartridges.add(new Cartridge(CartridgeResponseFake.CARTRIDGE_PERL5));
+				cartridges.add(new Cartridge(CartridgeResponseFake.CARTRIDGE_PHP53));
+				cartridges.add(new Cartridge(CartridgeResponseFake.CARTRIDGE_RACK11));
+				cartridges.add(new Cartridge(CartridgeResponseFake.CARTRIDGE_WSGI32));
+				return cartridges;
+			}
+		};
+		InternalUser user = new InternalUser(UserInfoResponseFake.RHLOGIN, UserInfoResponseFake.PASSWORD, cartridgeListService);
+		Collection<ICartridge> cartridges = user.getCartridges();
+		assertNotNull(cartridges);
+		assertEquals(5, cartridges.size());
+		assertThatContainsCartridge(CartridgeResponseFake.CARTRIDGE_JBOSSAS70, cartridges);
+		assertThatContainsCartridge(CartridgeResponseFake.CARTRIDGE_PERL5, cartridges);
+		assertThatContainsCartridge(CartridgeResponseFake.CARTRIDGE_PHP53, cartridges);
+		assertThatContainsCartridge(CartridgeResponseFake.CARTRIDGE_RACK11, cartridges);
+		assertThatContainsCartridge(CartridgeResponseFake.CARTRIDGE_WSGI32, cartridges);
+	}
+
+	@Test
+	public void canGetApplications() throws OpenshiftException {
+		/** response is UserInfoResponseFake */
+		Collection<IApplication> applications = user.getApplications();
+		assertNotNull(applications);
+		assertEquals(2, applications.size());
+	}
+
+	@Test
+	public void canGetApplicationByName() throws OpenshiftException, DatatypeConfigurationException {
+		IApplication application = user.getApplicationByName(UserInfoResponseFake.APP2_NAME);
+		assertApplication(
+				UserInfoResponseFake.APP2_NAME
+				, UserInfoResponseFake.APP2_UUID
+				, UserInfoResponseFake.APP2_CARTRIDGE
+				, UserInfoResponseFake.APP2_EMBEDDED
+				, UserInfoResponseFake.APP2_CREATION_TIME
+				, application);
+	}
+
+	private UserInfo createUserInfo() throws OpenshiftException, DatatypeConfigurationException {
+		ApplicationInfo[] applicationInfos = new ApplicationInfo[] {
+				new ApplicationInfo(UserInfoResponseFake.APP1_NAME
+						, UserInfoResponseFake.APP1_UUID
+						, UserInfoResponseFake.APP1_EMBEDDED
+						, Cartridge.valueOf(UserInfoResponseFake.APP1_CARTRIDGE)
+						, RFC822DateUtils.getDate(UserInfoResponseFake.APP1_CREATION_TIME))
+				, new ApplicationInfo(UserInfoResponseFake.APP2_NAME
+						, UserInfoResponseFake.APP2_UUID
+						, UserInfoResponseFake.APP2_EMBEDDED
+						, Cartridge.valueOf(UserInfoResponseFake.APP2_CARTRIDGE)
+						, RFC822DateUtils.getDate(UserInfoResponseFake.APP2_CREATION_TIME))
+		};
+		return new UserInfo(
+				UserInfoResponseFake.RHLOGIN
+				, UserInfoResponseFake.UUID
+				, UserInfoResponseFake.SSH_KEY
+				, UserInfoResponseFake.RHC_DOMAIN
+				, UserInfoResponseFake.NAMESPACE
+				, Arrays.asList(applicationInfos));
+	}
+
+	private OpenshiftService createUserInfoService(final UserInfo userInfo) {
+		return new NoopOpenshiftServiceFake() {
+
+			@Override
+			public UserInfo getUserInfo(InternalUser user) throws OpenshiftException {
+				return userInfo;
+			}
+		};
+	}
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/UserTest.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/ApplicationResponseFake.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/ApplicationResponseFake.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/ApplicationResponseFake.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,113 @@
+/******************************************************************************* 
+ * 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.tools.openshift.express.internal.client.test.fakes;
+
+import java.util.Date;
+
+import org.jboss.tools.openshift.express.client.ICartridge;
+
+/**
+ * @author André Dietisheim
+ */
+public class ApplicationResponseFake {
+
+	public static final String RHLOGIN = "jbosstools at redhat.com";
+	public static final String PASSWORD = "$!445password%&";
+	public static final String UUID = "0123456789abcdefghijklmnopqrstuvwz";
+	public static final String SSHPUBLICKEY = "sshpublicKey&!%$123456";
+	
+	public static final String RHC_DOMAIN = "rhcloud.com";
+	public static final String NAMESPACE = "1315839296868";
+
+	public static final String APPLICATION_NAME = "1316010645406";
+	public static final ICartridge APPLICATION_CARTRIDGE = ICartridge.JBOSSAS_7;
+
+	public static final String APPLICATION_UUID = "0123456789abcdefg";
+	public static final String APPLICATION_EMBEDDED = null;
+	public static final Date APPLICATION_CREATIONTIME = new Date();
+	
+	public static final String appResponse =
+			"{"
+					+ "	\"messages\":\"\","
+					+ "	\"debug\":\"Validating application limit toolsjboss at gmail.com: num of apps(0) must be < app limit(5)\n\","
+					+ "	\"data\":{"
+					+ "		\"health_check_path\":\"health\""
+					+ "	},"
+					+ "	\"api\":\"1.1.1\","
+					+ "	\"api_c\":[\"placeholder\"],"
+					+ "	\"result\":\"Successfully created application: "
+
+					+ APPLICATION_NAME
+
+					+ "\","
+					+ "	\"broker\":\"1.1.1\","
+					+ "	\"broker_c\":[\"namespace\","
+					+ "	\"rhlogin\","
+					+ "	\"ssh\","
+					+ "	\"app_uuid\","
+					+ "	\"debug\","
+					+ "	\"alter\","
+					+ "	\"cartridge\","
+					+ "	\"cart_type\","
+					+ "	\"action\","
+					+ "	\"app_name\","
+					+ "	\"api\"],"
+					+ "	\"exit_code\":0"
+					+ "}";
+
+
+
+
+	public static final String log =
+			"10:30:38,700 INFO  [org.apache.catalina.core.AprLifecycleListener] (MSC service thread 1-1) "
+					+ "The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path:"
+					+ "/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/server:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64:"
+					+ "/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib\n"
+					+ "10:30:38,792 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-3) Starting Coyote HTTP/1.1 on http--127.1.7.1-8080\n"
+					+ "10:30:38,836 INFO  [org.jboss.as.connector] (MSC service thread 1-4) Starting JCA Subsystem (JBoss IronJacamar 1.0.3.Final)\n"
+					+ "10:30:38,892 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) Bound data source [java:jboss/datasources/ExampleDS]\n"
+					+ "10:30:39,293 INFO  [org.jboss.as.deployment] (MSC service thread 1-2) Started FileSystemDeploymentService for directory /var/lib/libra/664e4d4dbce74c69ac321053149546df/1316010645406/jbossas-7.0/standalone/deployments\n"
+					+ "10:30:39,314 INFO  [org.jboss.as] (Controller Boot Thread) JBoss AS 7.0.1.Final \\\"Zap\\\" started in 2732ms - Started 82 of 107 services (22 services are passive or on-demand)\n"
+					+ "10:30:39,339 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) Starting deployment of \\\"ROOT.war\\\"\n"
+					+ "10:30:39,424 INFO  [org.jboss.as.jpa] (MSC service thread 1-1) added javax.persistence.api dependency to ROOT.war\n"
+					+ "10:30:39,700 INFO  [org.jboss.web] (MSC service thread 1-2) registering web context: \n"
+					+ "10:30:39,742 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployed \\\"ROOT.war\\\"\n";
+
+	public static final String tail =
+			"tailing /var/lib/libra/664e4d4dbce74c69ac321053149546df/"
+
+					+ APPLICATION_NAME
+
+					+ "//"
+
+					+ APPLICATION_CARTRIDGE
+
+					+ "/standalone/log/server.log\n"
+					+ "------ Tail of 1316010645406 application server.log ------\n"
+
+					+ log;
+
+	public static final String statusResponse =
+			"{\"messages\":\"\","
+					+ "\"debug\":\"\","
+					+ "\"data\":null,"
+					+ "\"api\":\"1.1.1\","
+					+ "\"api_c\":[\"placeholder\"],"
+					+ "\"result\":\""
+
+					+ tail
+
+					+ "\","
+					+ "\"broker\":\"1.1.1\","
+					+ "\"broker_c\":[\"namespace\",\"rhlogin\",\"ssh\",\"app_uuid\",\"debug\",\"alter\",\"cartridge\",\"cart_type\",\"action\",\"app_name\",\"api\"],"
+					+ "\"exit_code\":0}";
+
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/ApplicationResponseFake.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/CartridgeResponseFake.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/CartridgeResponseFake.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/CartridgeResponseFake.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,45 @@
+package org.jboss.tools.openshift.express.internal.client.test.fakes;
+
+/**
+ * 
+ * @author André Dietisheim
+ *
+ */
+public class CartridgeResponseFake {
+
+	public static final String CARTRIDGE_PERL5 = "perl-5.10";
+	public static final String CARTRIDGE_JBOSSAS70 = "jbossas-7.0";
+	public static final String CARTRIDGE_WSGI32 = "wsgi-3.2";
+	public static final String CARTRIDGE_RACK11 = "rack-1.1";
+	public static final String CARTRIDGE_PHP53 = "php-5.3";
+	
+	public static final String RESPONSE = 
+			"{"
+					+"	\"messages\":\"\","
+					+"	\"debug\":\"\","
+					+"	\"data\":\"{"
+					+"		\\\"carts\\\":"
+					+"			[\\\"" + CARTRIDGE_PERL5 +"\\\","
+					+"			\\\"" + CARTRIDGE_JBOSSAS70 + "\\\","
+					+"			\\\"" + CARTRIDGE_WSGI32+ "\\\","
+					+"			\\\"" + CARTRIDGE_RACK11 + "\\\","
+					+"			\\\"" + CARTRIDGE_PHP53 + "\\\"]"
+					+"	}\","
+					+"	\"api\":\"1.1.1\","
+					+"	\"api_c\":[\"placeholder\"],"
+					+"	\"result\":null,"
+					+"	\"broker\":\"1.1.1\","
+					+"	\"broker_c\":[\"namespace\","
+					+"	\"rhlogin\","
+					+"	\"ssh\","
+					+"	\"app_uuid\","
+					+"	\"debug\","
+					+"	\"alter\","
+					+"	\"cartridge\","
+					+"	\"cart_type\","
+					+"	\"action\","
+					+"	\"app_name\","
+					+"	\"api\"],"
+					+"	\"exit_code\":0"
+					+ "}";	
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/CartridgeResponseFake.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/NoopOpenshiftServiceFake.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/NoopOpenshiftServiceFake.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/NoopOpenshiftServiceFake.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,78 @@
+/******************************************************************************* 
+ * 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.tools.openshift.express.internal.client.test.fakes;
+
+import java.util.List;
+
+import org.jboss.tools.openshift.express.client.IApplication;
+import org.jboss.tools.openshift.express.client.ICartridge;
+import org.jboss.tools.openshift.express.client.IDomain;
+import org.jboss.tools.openshift.express.client.ISSHPublicKey;
+import org.jboss.tools.openshift.express.client.OpenshiftException;
+import org.jboss.tools.openshift.express.internal.client.Application;
+import org.jboss.tools.openshift.express.internal.client.InternalUser;
+import org.jboss.tools.openshift.express.internal.client.UserInfo;
+
+/**
+ * @author André Dietisheim
+ */
+public class NoopOpenshiftServiceFake extends OpenshiftTestService  {
+
+	@Override
+	public UserInfo getUserInfo(InternalUser user) throws OpenshiftException {
+		throw new UnsupportedOperationException();
+	}
+
+	@Override
+	public List<ICartridge> getCartridges(InternalUser user) throws OpenshiftException {
+		throw new UnsupportedOperationException();
+	}
+
+	@Override
+	public Application createApplication(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException {
+		throw new UnsupportedOperationException();
+	}
+
+	@Override
+	public void destroyApplication(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException {
+		throw new UnsupportedOperationException();
+	}
+
+	@Override
+	public IApplication startApplication(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException {
+		throw new UnsupportedOperationException();
+	}
+
+	@Override
+	public IApplication restartApplication(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException {
+		throw new UnsupportedOperationException();
+	}
+
+	@Override
+	public IApplication stopApplication(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException {
+		throw new UnsupportedOperationException();
+	}
+
+	@Override
+	public String getStatus(String applicationName, ICartridge cartridge, InternalUser user) throws OpenshiftException {
+		throw new UnsupportedOperationException();
+	}
+
+	@Override
+	public IDomain changeDomain(String domainName, ISSHPublicKey sshKey, InternalUser user) throws OpenshiftException {
+		throw new UnsupportedOperationException();
+	}
+
+	@Override
+	public IDomain createDomain(String name, ISSHPublicKey keyPair, InternalUser user) throws OpenshiftException {
+		throw new UnsupportedOperationException();
+	}
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/NoopOpenshiftServiceFake.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/OpenshiftCredentials.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/OpenshiftCredentials.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/OpenshiftCredentials.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,18 @@
+/******************************************************************************* 
+ * 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.tools.openshift.express.internal.client.test.fakes;
+
+public class OpenshiftCredentials {
+
+	public static final String USERNAME = "toolsjboss at gmail.com";
+	public static final String PASSWORD = "1q2w3e";
+
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/OpenshiftCredentials.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/OpenshiftTestService.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/OpenshiftTestService.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/OpenshiftTestService.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,21 @@
+/******************************************************************************* 
+ * 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.tools.openshift.express.internal.client.test.fakes;
+
+import org.jboss.tools.openshift.express.client.OpenshiftService;
+import org.jboss.tools.openshift.express.internal.client.test.IOpenshiftTestService;
+
+public class OpenshiftTestService extends OpenshiftService implements IOpenshiftTestService {
+
+	public OpenshiftTestService() {
+		super(STAGING_BASE_URL);
+	}
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/OpenshiftTestService.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/TestSSHKey.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/TestSSHKey.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/TestSSHKey.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,68 @@
+/******************************************************************************* 
+ * 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.tools.openshift.express.internal.client.test.fakes;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.jboss.tools.openshift.express.client.OpenshiftException;
+import org.jboss.tools.openshift.express.client.SSHKeyPair;
+import org.jboss.tools.openshift.express.internal.client.test.utils.StreamUtils;
+
+/**
+ * @author André Dietisheim
+ */
+public class TestSSHKey {
+
+	private static final String privateKey =
+			"-----BEGIN RSA PRIVATE KEY-----\n" +
+					"Proc-Type: 4,ENCRYPTED\n" +
+					"DEK-Info: DES-EDE3-CBC,30E8B3A668E44D77\n" +
+					"\n" +
+					"wsXCU31SUTYhjPnOiW56UlZ7VXKlIjItLo5Wrk5LwCLv/OERK7UWJkrwM2bHPb6n\n" +
+					"3zAaDDZfQe786URQjfmUYWBdVeI7DrRMwoLaaUcR1tuJtMu3Jv3CK72YMkOzGapZ\n" +
+					"ZAAoTno/GRhTwptXG1KPSqKyzfqlxjbZry1HZmY+P6ikw9DWOPZC6rISIqQ3u9zm\n" +
+					"iPvi/Oo7JWZtX1d1MYp3vVt2bo2duD4RSoXWWaW471WUOIQZUh0V4dxp+eAHZziu\n" +
+					"osAfU4WoIrrSCSVl2uiKS2Zijn77PvcCXnm45eMQpww32AlslzIBNsMzUXhPtVAZ\n" +
+					"a9uvfZxlOIRu4ObN7AB3WExucbBHCvTOgxpSs95br1QtfMVl62d9VkIAXg1x9gH8\n" +
+					"kjcEP+0OS3EItYTFj1tCKC8GgBImj44AxbPSWu3SfTnYfAtFnO0pUqhPOBN63DCC\n" +
+					"XxzMm13UeER7Z3s968Swa48r6LRAbHI8JD0Ld4E02fgBYM/N/aGtPppD0FoJJwo3\n" +
+					"QVafS2PY+bALgy4qrI9daOo1mTS3gWDSAG0QbLoKd3hD8ZnLEk6rfR/0SE34Fc7j\n" +
+					"mviCy78C16hkllhWz27ROl5pheHV0Xt6ZlUsNWVz7tg/AcIFB0geMuzuM0Kd7ufj\n" +
+					"g5c8mhlI06n4vzo0uB6UXtwTBzNqyUl8yxA31S2VJfBZxkEwKc5cktNUiejQuWbU\n" +
+					"iwapdiSR0gNGyYBNMYax9OOfYH+BBQeD5kboVU3yvT7UNcz0T9GZiEhfvcaYSP8C\n" +
+					"ejQ1vuTNTKMrgyLpNi/4Sq8lm8OukRqQyE0EKYCwvkI=\n" +
+					"-----END RSA PRIVATE KEY-----";
+
+	private static final String publicKey =
+			"ssh-rsa "
+					+
+					"AAAAB3NzaC1yc2EAAAADAQABAAAAgQC6BGRDydfGsQHhnZgo43dEfLzSJBke/hE8MLBBG1+5Z" +
+					"wktsrE+f2VdVt0McRLVAO6rdJRyMUX0rTbm7SABRVSX+zeQjlfqbbUtYFc7TIfd4RQc3GaISG" +
+					"1rS3C4svRSjdWaG36vDY2KxowdFvpKj8i8IYNPlLoRA/7EzzyneS6iyw" +
+					"== created by org.jboss.tools.openshift.express.client";
+
+	public static SSHKeyPair create() throws IOException, OpenshiftException {
+		File privateKeyFile = File.createTempFile(createRandomString(), null);
+		StreamUtils.writeTo(privateKey, privateKeyFile);
+
+		File publicKeyFile = File.createTempFile(createRandomString(), null);
+		StreamUtils.writeTo(publicKey, publicKeyFile);
+		
+		return SSHKeyPair.load(privateKeyFile.getAbsolutePath(), publicKeyFile.getAbsolutePath());
+	}
+	
+	private static String createRandomString() {
+		return String.valueOf(System.currentTimeMillis());
+	}
+
+	
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/TestSSHKey.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/TestUser.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/TestUser.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/TestUser.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,57 @@
+/******************************************************************************* 
+ * 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.tools.openshift.express.internal.client.test.fakes;
+
+import org.jboss.tools.openshift.express.client.Cartridge;
+import org.jboss.tools.openshift.express.client.IApplication;
+import org.jboss.tools.openshift.express.client.OpenshiftException;
+import org.jboss.tools.openshift.express.client.User;
+import org.jboss.tools.openshift.express.internal.client.test.utils.ApplicationUtils;
+
+/**
+ * @author André Dietisheim
+ */
+public class TestUser extends User {
+
+	public static final String RHLOGIN_USER_WITHOUT_DOMAIN = "toolsjboss.no.domain2 at gmail.com";
+	public static final String PASSWORD_USER_WITHOUT_DOMAIN = "1q2w3e";
+
+	public static final String RHLOGIN = "toolsjboss at gmail.com";
+	public static final String PASSWORD = "1q2w3e";
+
+	public TestUser() {
+		super(RHLOGIN, PASSWORD);
+	}
+
+	public TestUser(String password) {
+		super(RHLOGIN, password);
+	}
+
+	public TestUser(String rhlogin, String password) {
+		super(rhlogin, password);
+	}
+
+	public TestUser(String rhlogin, String password, String url) {
+		super(rhlogin, password, url);
+	}
+	
+	public IApplication createTestApplication() throws OpenshiftException {
+		return createApplication(ApplicationUtils.createRandomApplicationName(), Cartridge.JBOSSAS_7);
+	}
+
+	public void silentlyDestroyApplication(IApplication application) {
+		try {
+			getService().destroyApplication(application.getName(), application.getCartridge(), this);
+		} catch (OpenshiftException e) {
+			e.printStackTrace();
+		}
+	}
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/TestUser.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/UserConfigurationFake.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/UserConfigurationFake.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/UserConfigurationFake.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.tools.openshift.express.internal.client.test.fakes;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.Writer;
+
+import org.jboss.tools.openshift.express.client.OpenshiftException;
+import org.jboss.tools.openshift.express.client.UserConfiguration;
+import org.jboss.tools.openshift.express.internal.client.utils.StreamUtils;
+
+/**
+ * @author André Dietisheim
+ */
+public class UserConfigurationFake extends UserConfiguration {
+
+	
+	public UserConfigurationFake() throws OpenshiftException, IOException {
+		super();
+	}
+
+	@Override
+	protected File getUserConfigurationFile() throws OpenshiftException, IOException {
+		Writer writer = null;
+		try {
+			File file = File.createTempFile(createRandomString(), null);
+			writer = new FileWriter(file);
+			initFile(writer);
+			return file;
+		} finally {
+			StreamUtils.close(writer);
+		}
+	}
+
+	protected void initFile(Writer writer) throws IOException {
+	}
+
+	public File getFile() {
+		return file;
+	}
+	
+	private String createRandomString() {
+		return String.valueOf(System.currentTimeMillis());
+	}
+
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/UserConfigurationFake.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/UserInfoResponseFake.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/UserInfoResponseFake.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/UserInfoResponseFake.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,81 @@
+package org.jboss.tools.openshift.express.internal.client.test.fakes;
+
+public class UserInfoResponseFake {
+
+	public static final String RHLOGIN = "jbosstools at redhat.com";
+	public static final String PASSWORD = "$!445password%&";
+	
+	public static final String RHC_DOMAIN = "rhcloud.com";
+	public static final String NAMESPACE = "1315839296868";
+	public static final String UUID = "5f34b742db754cc9ab70fd1db2c9a2bd";
+	public static final String SSH_KEY =
+			"AAAAB3NzaC1yc2EAAAADAQABAAAAgQC6BGRDydfGsQHhnZgo43dEfLz"
+					+ "SJBke/hE8MLBBG1+5ZwktsrE+f2VdVt0McRLVAO6rdJRyMUX0rTbm7"
+					+ "SABRVSX+zeQjlfqbbUtYFc7TIfd4RQc3GaISG1rS3C4svRSjdWaG36"
+					+ "vDY2KxowdFvpKj8i8IYNPlLoRA/7EzzyneS6iyw==";
+
+	public static final String APP1_NAME = "1315836963263";
+	public static final String APP1_EMBEDDED = null;
+	public static final String APP1_UUID = "810540bafc1c4b5e8cac830fb8ca786f";
+	public static final String APP1_CARTRIDGE = "jbossas-7.0";
+	public static final String APP1_CREATION_TIME = "2011-09-12T10:15:48-04:00";
+
+	public static final String APP2_NAME = "1315903559289";
+	public static final String APP2_EMBEDDED = null;
+	public static final String APP2_UUID = "f5496311f43b42cd8fa5db5ecf83a352";
+	public static final String APP2_CARTRIDGE = "jbossas-7.0";
+	public static final String APP2_CREATION_TIME = "2011-09-13T04:45:44-04:00";
+
+	public static final String RESPONSE =
+			"{"
+					+ "	\"messages\":\"\","
+					+ " 	\"debug\":\"\","
+					+ "	\"data\":"
+					+ ""
+					+ "\"{"
+					+ "		\\\"user_info\\\":"
+					+ "		{"
+					+ "			\\\"rhc_domain\\\":\\\"" + RHC_DOMAIN + "\\\"," //
+					+ "			\\\"rhlogin\\\":\\\"" + RHLOGIN + "\\\","
+					+ "			\\\"namespace\\\":\\\"" + NAMESPACE + "\\\","
+					+ "			\\\"uuid\\\":\\\"" + UUID + "\\\","
+					+ "			\\\"ssh_key\\\":\\\"" + SSH_KEY + "\\\""
+					+ "		},"
+					+ "		\\\"app_info\\\":"
+					+ "		{"
+					+ "			\\\"" + APP1_NAME + "\\\":"
+					+ "			{"
+					+ "				\\\"embedded\\\":" + APP1_EMBEDDED + ","
+					+ "				\\\"uuid\\\":\\\"" + APP1_UUID + "\\\","
+					+ "				\\\"framework\\\":\\\"" + APP1_CARTRIDGE + "\\\","
+					+ "				\\\"creation_time\\\":\\\"" + APP1_CREATION_TIME + "\\\""
+					+ "			},"
+					+ "			\\\"" + APP2_NAME + "\\\":"
+					+ "			{"
+					+ "				\\\"embedded\\\":" + APP2_EMBEDDED + ","
+					+ "				\\\"uuid\\\":\\\"" + APP2_UUID + "\\\","
+					+ "				\\\"framework\\\":\\\"" + APP2_CARTRIDGE + "\\\","
+					+ "				\\\"creation_time\\\":\\\"" + APP2_CREATION_TIME + "\\\""
+					+ "			}"
+					+ "		}"
+					+ "	}\","
+					+ "	\"api\":\"1.1.1\","
+					+ "	\"api_c\":[\"placeholder\"],"
+					+ "	\"result\":null,"
+					+ "	\"broker\":\"1.1.1\","
+					+ "	\"broker_c\":["
+					+ "		\"namespace\","
+					+ "		\"rhlogin\","
+					+ "		\"ssh\","
+					+ "		\"app_uuid\","
+					+ "		\"debug\","
+					+ "		\"alter\","
+					+ "		\"cartridge\","
+					+ "		\"cart_type\","
+					+ "		\"action\","
+					+ "		\"app_name\","
+					+ "		\"api\""
+					+ "		],"
+					+ "	\"exit_code\":0"
+					+ "}";
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/fakes/UserInfoResponseFake.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/ApplicationAsserts.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/ApplicationAsserts.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/ApplicationAsserts.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,122 @@
+/******************************************************************************* 
+ * 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.tools.openshift.express.internal.client.test.utils;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.text.MessageFormat;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.xml.datatype.DatatypeConfigurationException;
+
+import org.jboss.tools.openshift.express.client.IApplication;
+import org.jboss.tools.openshift.express.client.OpenshiftException;
+import org.jboss.tools.openshift.express.internal.client.Application;
+import org.jboss.tools.openshift.express.internal.client.utils.RFC822DateUtils;
+
+/**
+ * @author André Dietisheim
+ */
+public class ApplicationAsserts {
+
+	/**
+	 * $1 = application uuid
+	 * $2 = application name
+	 * $3 = InternalUser uuid
+	 * $4 = rhc cloud domain (rhcloud.com)
+	 * $5 = application name 
+	 */
+	public static final Pattern GIT_URI_REGEXP = Pattern.compile("ssh://(.+)@(.+)-([^\\.]+)\\.(.+)/~/git/(.+).git/");
+
+	public static final Pattern APPLICATION_URL_REGEXP = Pattern.compile("http://(.+)-([^\\.]+)\\.(.+)/");
+
+	public static void assertThatContainsApplication(String applicationName, String embedded, String applicationUUID,
+			String cartridgeName, String creationTime, List<Application> applications) throws OpenshiftException {
+		IApplication application = getApplication(applicationName, applications);
+		if (application == null) {
+			fail(MessageFormat.format("Could not find application with name \"{0}\"", applicationName));
+		}
+		assertApplication(applicationName, applicationUUID, cartridgeName, embedded, creationTime, application);
+	}
+
+	public static void assertThatContainsApplication(String applicationName, List<Application> applications) {
+		assertNotNull(getApplication(applicationName, applications));
+	}
+
+	private static IApplication getApplication(String name, List<Application> applications) {
+		IApplication matchingApplication = null;
+		for (Application application : applications) {
+			if (name.equals(application.getName())) {
+				matchingApplication = application;
+				break;
+			}
+		}
+		return matchingApplication;
+	}
+
+	public static void assertApplication(String name, String uuid, String cartridgeName, String embedded,
+			String creationTime, IApplication application) throws OpenshiftException {
+		assertNotNull(application);
+		assertEquals(embedded, application.getEmbedded());
+		assertEquals(uuid, application.getUUID());
+		try {
+			assertEquals(RFC822DateUtils.getDate(creationTime), application.getCreationTime());
+		} catch (DatatypeConfigurationException e) {
+			fail(e.getMessage());
+		}
+	}
+
+	public static void assertApplication(String name, String cartridgeName, IApplication application) throws OpenshiftException {
+		assertNotNull(application);
+		assertNotNull(application.getCartridge());
+		assertEquals(cartridgeName, application.getCartridge().getName());
+	}
+	
+	public static void assertGitUri(String applicationName, String gitUri) {
+		Matcher matcher = GIT_URI_REGEXP.matcher(gitUri);
+		assertTrue(matcher.matches());
+		assertEquals(5, matcher.groupCount());
+		assertEquals(applicationName, matcher.group(2));
+		assertEquals(applicationName, matcher.group(5));
+	}
+	
+	public static void assertGitUri(String uuid, String name, String namespace, String rhcDomain, String gitUri) {
+		Matcher matcher = GIT_URI_REGEXP.matcher(gitUri);
+		assertTrue(matcher.matches());
+		assertEquals(5, matcher.groupCount());
+		assertEquals(uuid, matcher.group(1));
+		assertEquals(name, matcher.group(2));
+		assertEquals(namespace, matcher.group(3));
+		assertEquals(rhcDomain, matcher.group(4));
+		assertEquals(name, matcher.group(5));
+	}
+
+	public static void assertAppliactionUrl(String name, String applicationUrl) {
+		Matcher matcher = APPLICATION_URL_REGEXP.matcher(applicationUrl);
+		assertTrue(matcher.matches());
+		assertEquals(3, matcher.groupCount());
+		assertEquals(name, matcher.group(1));
+	}
+
+	public static void assertAppliactionUrl(String name, String namespace, String rhcDomain, String applicationUrl) {
+		Matcher matcher = APPLICATION_URL_REGEXP.matcher(applicationUrl);
+		assertTrue(matcher.matches());
+		assertEquals(3, matcher.groupCount());
+		assertEquals(name, matcher.group(1));
+		assertEquals(namespace, matcher.group(2));
+		assertEquals(rhcDomain, matcher.group(3));
+	}
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/ApplicationAsserts.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/ApplicationInfoAsserts.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/ApplicationInfoAsserts.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/ApplicationInfoAsserts.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,68 @@
+/******************************************************************************* 
+ * 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.tools.openshift.express.internal.client.test.utils;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import java.text.MessageFormat;
+import java.util.List;
+
+import javax.xml.datatype.DatatypeConfigurationException;
+
+import org.jboss.tools.openshift.express.client.OpenshiftException;
+import org.jboss.tools.openshift.express.internal.client.ApplicationInfo;
+import org.jboss.tools.openshift.express.internal.client.utils.RFC822DateUtils;
+
+/**
+ * @author André Dietisheim
+ */
+public class ApplicationInfoAsserts {
+
+	public static void assertThatContainsApplicationInfo(String applicationName, String embedded, String applicationUUID,
+			String cartridgeName, String creationTime, List<ApplicationInfo> applicationInfos) throws OpenshiftException {
+		ApplicationInfo applicationInfo = getApplicationInfo(applicationName, applicationInfos);
+		if (applicationInfo == null) {
+			fail(MessageFormat.format("Could not find application with name \"{0}\"", applicationName));
+		}
+		assertApplicationInfo(embedded, applicationUUID, cartridgeName, creationTime, applicationInfo);
+	}
+
+	public static void assertThatContainsApplicationInfo(String applicationName, List<ApplicationInfo> applicationInfos) {
+		assertNotNull(getApplicationInfo(applicationName, applicationInfos));
+	}
+
+	private static ApplicationInfo getApplicationInfo(String name, List<ApplicationInfo> applicationInfos) {
+		ApplicationInfo matchingApplicationInfo = null;
+		for (ApplicationInfo applicationInfo : applicationInfos) {
+			if (name.equals(applicationInfo.getName())) {
+				matchingApplicationInfo = applicationInfo;
+				break;
+			}
+		}
+		return matchingApplicationInfo;
+	}
+	
+	private static void assertApplicationInfo(String embedded, String uuid, String cartridgeName,
+			String creationTime, ApplicationInfo applicationInfo) throws OpenshiftException {
+		assertEquals(embedded, applicationInfo.getEmbedded());
+		assertEquals(uuid, applicationInfo.getUuid());
+		assertNotNull(applicationInfo.getCartridge());
+		assertEquals(cartridgeName, applicationInfo.getCartridge().getName());
+		try {
+			assertEquals(RFC822DateUtils.getDate(creationTime), applicationInfo.getCreationTime());
+		} catch (DatatypeConfigurationException e) {
+			fail(e.getMessage());
+		}
+	}
+
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/ApplicationInfoAsserts.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/ApplicationUtils.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/ApplicationUtils.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/ApplicationUtils.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,40 @@
+/******************************************************************************* 
+ * 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.tools.openshift.express.internal.client.test.utils;
+
+import org.jboss.tools.openshift.express.client.Cartridge;
+import org.jboss.tools.openshift.express.client.IApplication;
+import org.jboss.tools.openshift.express.client.ICartridge;
+import org.jboss.tools.openshift.express.client.IOpenshiftService;
+import org.jboss.tools.openshift.express.client.OpenshiftException;
+import org.jboss.tools.openshift.express.client.User;
+
+/**
+ * @author André Dietisheim
+ */
+public class ApplicationUtils {
+
+	public static String createRandomApplicationName() {
+		return String.valueOf(System.currentTimeMillis());
+	}
+
+	public static IApplication createApplication(User user, IOpenshiftService service) throws OpenshiftException {
+		return service.createApplication(createRandomApplicationName(), Cartridge.JBOSSAS_7, user);
+	}
+	
+	public static void silentlyDestroyAS7Application(String name, User user, IOpenshiftService service) {
+		try {
+			service.destroyApplication(name, ICartridge.JBOSSAS_7, user);
+		} catch (OpenshiftException e) {
+			e.printStackTrace();
+		}
+	}
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/ApplicationUtils.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/CartridgeAsserts.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/CartridgeAsserts.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/CartridgeAsserts.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,37 @@
+/******************************************************************************* 
+ * 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.tools.openshift.express.internal.client.test.utils;
+
+import static org.junit.Assert.fail;
+
+import java.text.MessageFormat;
+import java.util.Collection;
+
+import org.jboss.tools.openshift.express.client.ICartridge;
+
+/**
+ * @author André Dietisheim
+ */
+public class CartridgeAsserts {
+
+	public static void assertThatContainsCartridge(String cartridgeName, Collection<ICartridge> cartridges) {
+		boolean found = false;
+		for (ICartridge cartridge : cartridges) {
+			if (cartridgeName.equals(cartridge.getName())) {
+				found = true;
+				break;
+			}
+		}
+		if (!found) {
+			fail(MessageFormat.format("Could not find cartridge with name \"{0}\"", cartridgeName));
+		}
+	}
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/CartridgeAsserts.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/StreamUtils.java
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/StreamUtils.java	                        (rev 0)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/StreamUtils.java	2011-10-05 11:06:15 UTC (rev 35359)
@@ -0,0 +1,43 @@
+/******************************************************************************* 
+ * 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.tools.openshift.express.internal.client.test.utils;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.StringReader;
+
+public class StreamUtils {
+
+	public static void writeTo(String data, String path) throws IOException {
+		writeTo(data, new File(path));
+	}
+
+	public static void writeTo(String data, File file) throws IOException {
+		StringReader reader = null;
+		FileWriter writer = null;
+		try {
+			writer = new FileWriter(file);
+			reader = new StringReader(data);
+			for (int character = -1; (character = reader.read()) != -1;) {
+				writer.write(character);
+			}
+		} finally {
+			if (writer != null) {
+				writer.flush();
+				writer.close();
+			}
+			if (reader != null) {
+				reader.close();
+			}
+		}
+	}
+}


Property changes on: trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/StreamUtils.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain



More information about the jbosstools-commits mailing list