sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From romb...@apache.org
Subject svn commit: r1593144 - in /sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl: BundleDeploymentTest.java DisableDebugStatusHandlers.java
Date Wed, 07 May 2014 21:54:14 GMT
Author: rombert
Date: Wed May  7 21:54:13 2014
New Revision: 1593144

URL: http://svn.apache.org/r1593144
Log:
SLING-3544 - Integration tests running against a live Sling Launchpad
instance

Extract a DisableDebugStatusHandlers junit rule.

Added:
    sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/DisableDebugStatusHandlers.java
  (with props)
Modified:
    sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/BundleDeploymentTest.java

Modified: sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/BundleDeploymentTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/BundleDeploymentTest.java?rev=1593144&r1=1593143&r2=1593144&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/BundleDeploymentTest.java
(original)
+++ sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/BundleDeploymentTest.java
Wed May  7 21:54:13 2014
@@ -31,10 +31,6 @@ import org.apache.sling.ide.osgi.OsgiCli
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
 import org.eclipse.jdt.core.JavaCore;
 import org.junit.Rule;
 import org.junit.Test;
@@ -61,16 +57,13 @@ public class BundleDeploymentTest {
     @Rule
     public TemporaryProject projectRule = new TemporaryProject();
 
+    @Rule
+    public DisableDebugStatusHandlers disableDebugHandlers = new DisableDebugStatusHandlers();
+
     @Test
     public void deployBundleOnServer() throws CoreException, InterruptedException, BackingStoreException,
IOException,
             OsgiClientException {
 
-        // prevent status prompts, since it can lead to the test Eclipse instance hanging
-        // TODO - move to rule/utility class
-        IEclipsePreferences debugPrefs = InstanceScope.INSTANCE.getNode(DebugPlugin.getUniqueIdentifier());
-        debugPrefs.putBoolean(IInternalDebugCoreConstants.PREF_ENABLE_STATUS_HANDLERS, false);
-        debugPrefs.flush();
-
         wstServer.waitForServerToStart();
 
         // create faceted project

Added: sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/DisableDebugStatusHandlers.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/DisableDebugStatusHandlers.java?rev=1593144&view=auto
==============================================================================
--- sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/DisableDebugStatusHandlers.java
(added)
+++ sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/DisableDebugStatusHandlers.java
Wed May  7 21:54:13 2014
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.ide.test.impl;
+
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
+import org.junit.rules.ExternalResource;
+
+/**
+ * The <tt>DisableDebugStatusHandlers</tt> prevents status prompts, since they
can lead to the test Eclipse instance
+ * hanging
+ *
+ */
+public class DisableDebugStatusHandlers extends ExternalResource {
+
+    @Override
+    protected void before() throws Throwable {
+        IEclipsePreferences debugPrefs = InstanceScope.INSTANCE.getNode(DebugPlugin.getUniqueIdentifier());
+        debugPrefs.putBoolean(IInternalDebugCoreConstants.PREF_ENABLE_STATUS_HANDLERS, false);
+        debugPrefs.flush();
+    }
+}

Propchange: sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/DisableDebugStatusHandlers.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/DisableDebugStatusHandlers.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL



Mime
View raw message