You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2018/01/30 09:42:34 UTC

[sling-org-apache-sling-repoinit-it] 19/30: SLING-6031 switch to latest teleporter version not requiring a WaitFor class This closes #164

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-repoinit-it.git

commit 8738d904441ef6914060a3e2bf8bb632bafd23c1
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Tue Sep 6 20:02:31 2016 +0000

    SLING-6031 switch to latest teleporter version not requiring a WaitFor class
    This closes #164
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1759500 13f79535-47bb-0310-9956-ffa450edef68
---
 src/main/provisioning/repoinit.txt                 |  2 +-
 .../sling/repoinit/it/ProvisioningModelIT.java     |  3 --
 .../org/apache/sling/repoinit/it/RepoInitIT.java   |  1 -
 .../java/org/apache/sling/repoinit/it/WaitFor.java | 50 ----------------------
 4 files changed, 1 insertion(+), 55 deletions(-)

diff --git a/src/main/provisioning/repoinit.txt b/src/main/provisioning/repoinit.txt
index e81a475..be58599 100644
--- a/src/main/provisioning/repoinit.txt
+++ b/src/main/provisioning/repoinit.txt
@@ -24,7 +24,7 @@
   org.apache.sling/org.apache.sling.provisioning.model/1.4.2
 
 [artifacts]
-  org.apache.sling/org.apache.sling.junit.core/1.0.14
+  org.apache.sling/org.apache.sling.junit.core/1.0.17-SNAPSHOT
   org.apache.sling/org.apache.sling.testing.tools/1.0.10
     
 [settings]
diff --git a/src/test/java/org/apache/sling/repoinit/it/ProvisioningModelIT.java b/src/test/java/org/apache/sling/repoinit/it/ProvisioningModelIT.java
index e5c1776..f06f8e4 100644
--- a/src/test/java/org/apache/sling/repoinit/it/ProvisioningModelIT.java
+++ b/src/test/java/org/apache/sling/repoinit/it/ProvisioningModelIT.java
@@ -21,12 +21,10 @@ import static org.junit.Assert.assertTrue;
 
 import java.util.UUID;
 
-import javax.jcr.Node;
 import javax.jcr.Session;
 
 import org.apache.sling.jcr.api.SlingRepository;
 import org.apache.sling.junit.rules.TeleporterRule;
-import org.apache.sling.repoinit.parser.RepoInitParser;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Rule;
@@ -46,7 +44,6 @@ public class ProvisioningModelIT {
     
     @Before
     public void setup() throws Exception {
-        WaitFor.services(teleporter, SlingRepository.class, RepoInitParser.class);
         session = teleporter.getService(SlingRepository.class).loginAdministrative(null);
     }
     
diff --git a/src/test/java/org/apache/sling/repoinit/it/RepoInitIT.java b/src/test/java/org/apache/sling/repoinit/it/RepoInitIT.java
index 77072f3..2a49fbb 100644
--- a/src/test/java/org/apache/sling/repoinit/it/RepoInitIT.java
+++ b/src/test/java/org/apache/sling/repoinit/it/RepoInitIT.java
@@ -50,7 +50,6 @@ public class RepoInitIT {
     
     @Before
     public void setup() throws Exception {
-        WaitFor.services(teleporter, SlingRepository.class, RepoInitParser.class);
         session = teleporter.getService(SlingRepository.class).loginAdministrative(null);
         
         // Execute some repoinit statements
diff --git a/src/test/java/org/apache/sling/repoinit/it/WaitFor.java b/src/test/java/org/apache/sling/repoinit/it/WaitFor.java
deleted file mode 100644
index 60d2b81..0000000
--- a/src/test/java/org/apache/sling/repoinit/it/WaitFor.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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.repoinit.it;
-
-import static org.junit.Assert.fail;
-
-import org.apache.sling.junit.rules.TeleporterRule;
-import org.apache.sling.testing.tools.sling.TimeoutsProvider;
-
-public class WaitFor {
-    /** Block until the specified set of serviceClasss are present, or timeout */
-    public static void services(TeleporterRule teleporter, Class <?> ... serviceClasses) {
-        for(Class<?> serviceClass : serviceClasses) {
-            service(teleporter, serviceClass);
-        }
-    }
-    
-    /** Block until the specified serviceClass is present, or timeout */
-    public static void service(TeleporterRule teleporter, Class <?> serviceClass) {
-        final long timeout = System.currentTimeMillis() + TimeoutsProvider.getInstance().getTimeout(10000);
-        while(System.currentTimeMillis() < timeout) {
-            try {
-                if(teleporter.getService(serviceClass) != null) {
-                    return;
-                }
-            } catch(IllegalStateException ignore) {
-            }
-            
-            try {
-                Thread.sleep(50L);
-            } catch(InterruptedException ignore) {
-            }
-        }
-        fail("Timeout waiting for serviceClass " + serviceClass.getName());
-    }
-}

-- 
To stop receiving notification emails like this one, please contact
rombert@apache.org.