Author: frm
Date: Mon Jul  2 12:55:27 2018
New Revision: 1834845

URL: http://svn.apache.org/viewvc?rev=1834845&view=rev
Log:
OAK-6770 - Test the SCR component descriptors

Added:
    
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/
    
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/ComponentDescriptor.java
   (with props)
    
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/SegmentNodeStoreFactoryTest.java
   (with props)
    
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/SegmentNodeStoreMonitorServiceTest.java
   (with props)
    
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/SegmentNodeStoreServiceDeprecationErrorTest.java
   (with props)
    
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/SegmentNodeStoreServiceTest.java
   (with props)
    
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/StandbyStoreServiceDeprecationErrorTest.java
   (with props)
    
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/StandbyStoreServiceTest.java
   (with props)

Added: 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/ComponentDescriptor.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/ComponentDescriptor.java?rev=1834845&view=auto
==============================================================================
--- 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/ComponentDescriptor.java
 (added)
+++ 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/ComponentDescriptor.java
 Mon Jul  2 12:55:27 2018
@@ -0,0 +1,287 @@
+/*
+ * 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.jackrabbit.oak.segment.osgi;
+
+import java.io.InputStream;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+class ComponentDescriptor {
+
+    public static ComponentDescriptor open(InputStream stream) throws 
Exception {
+        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        DocumentBuilder builder = factory.newDocumentBuilder();
+        Document document = builder.parse(stream);
+        return new ComponentDescriptor(document.getDocumentElement());
+    }
+
+    private final Element root;
+
+    private ComponentDescriptor(Element root) {
+        this.root = root;
+    }
+
+    private static boolean hasAttribute(Element element, String name, String 
value) {
+        return element.hasAttribute(name) && 
element.getAttribute(name).equals(value);
+    }
+
+    boolean hasName(String name) {
+        return hasAttribute(root, "name", name);
+    }
+
+    boolean hasRequireConfigurationPolicy() {
+        return hasAttribute(root, "configuration-policy", "require");
+    }
+
+    boolean hasActivateMethod(String name) {
+        return hasAttribute(root, "activate", name);
+    }
+
+    boolean hasDeactivateMethod(String name) {
+        return hasAttribute(root, "deactivate", name);
+    }
+
+    boolean hasConfigurationPid(String name) {
+        return hasAttribute(root, "configuration-pid", name);
+    }
+
+    boolean hasImplementationClass(String value) {
+        NodeList implementations = root.getElementsByTagName("implementation");
+        if (implementations.getLength() == 0) {
+            return false;
+        }
+        return hasImplementationClass((Element) implementations.item(0), 
value);
+    }
+
+    private static boolean hasImplementationClass(Element implementation, 
String value) {
+        return hasAttribute(implementation, "class", value);
+    }
+
+    class HasProperty {
+
+        private String name;
+
+        private String type;
+
+        private String value;
+
+        private HasProperty(String name) {
+            this.name = name;
+        }
+
+        HasProperty withStringType() {
+            this.type = "String";
+            return this;
+        }
+
+        HasProperty withLongType() {
+            this.type = "Long";
+            return this;
+        }
+
+        HasProperty withDoubleType() {
+            this.type = "Double";
+            return this;
+        }
+
+        HasProperty withFloatType() {
+            this.type = "Float";
+            return this;
+        }
+
+        HasProperty withIntegerType() {
+            this.type = "Integer";
+            return this;
+        }
+
+        HasProperty withByteType() {
+            this.type = "Byte";
+            return this;
+        }
+
+        HasProperty withCharacterType() {
+            this.type = "Character";
+            return this;
+        }
+
+        HasProperty withBooleanType() {
+            this.type = "Boolean";
+            return this;
+        }
+
+        HasProperty withShortType() {
+            this.type = "Short";
+            return this;
+        }
+
+        HasProperty withValue(String value) {
+            this.value = value;
+            return this;
+        }
+
+        boolean check() {
+            NodeList properties = root.getElementsByTagName("property");
+            for (int i = 0; i < properties.getLength(); i++) {
+                Element property = (Element) properties.item(i);
+                if (hasAttribute(property, "name", name)) {
+                    if (type != null && !hasAttribute(property, "type", type)) 
{
+                        return false;
+                    }
+                    if (value != null && !hasAttribute(property, "value", 
value)) {
+                        return false;
+                    }
+                    return true;
+                }
+            }
+            return false;
+        }
+
+    }
+
+    HasProperty hasProperty(String name) {
+        return new HasProperty(name);
+    }
+
+    class HasReference {
+
+        private String name;
+
+        private String iface;
+
+        private String cardinality;
+
+        private String policy;
+
+        private String policyOption;
+
+        private String target;
+
+        private String bind;
+
+        private String unbind;
+
+        private HasReference(String name) {
+            this.name = name;
+        }
+
+        HasReference withInterface(String iface) {
+            this.iface = iface;
+            return this;
+        }
+
+        HasReference withOptionalUnaryCardinality() {
+            this.cardinality = "0..1";
+            return this;
+        }
+
+        HasReference withMandatoryUnaryCardinality() {
+            this.cardinality = "1..1";
+            return this;
+        }
+
+        HasReference withOptionalMultipleCardinality() {
+            this.cardinality = "0..n";
+            return this;
+        }
+
+        HasReference withMandatoryMultipleCardinality() {
+            this.cardinality = "1..n";
+            return this;
+        }
+
+        HasReference withStaticPolicy() {
+            this.policy = "static";
+            return this;
+        }
+
+        HasReference withDynamicPolicy() {
+            this.policy = "dynamic";
+            return this;
+        }
+
+        HasReference withReluctantPolicyOption() {
+            this.policyOption = "reluctant";
+            return this;
+        }
+
+        HasReference withGreedyPolicyOption() {
+            this.policyOption = "greedy";
+            return this;
+        }
+
+        HasReference withTarget(String target) {
+            this.target = target;
+            return this;
+        }
+
+        HasReference withBind(String bind) {
+            this.bind = bind;
+            return this;
+        }
+
+        HasReference withUnbind(String unbind) {
+            this.unbind = unbind;
+            return this;
+        }
+
+        boolean check() {
+            NodeList references = root.getElementsByTagName("reference");
+            for (int i = 0; i < references.getLength(); i++) {
+                Element reference = (Element) references.item(i);
+                if (hasAttribute(reference, "name", name)) {
+                    if (iface != null && !hasAttribute(reference, "interface", 
iface)) {
+                        return false;
+                    }
+                    if (cardinality != null && !hasAttribute(reference, 
"cardinality", cardinality)) {
+                        return false;
+                    }
+                    if (policy != null && !hasAttribute(reference, "policy", 
policy)) {
+                        return false;
+                    }
+                    if (policyOption != null && !hasAttribute(reference, 
"policy-option", policyOption)) {
+                        return false;
+                    }
+                    if (target != null && !hasAttribute(reference, "target", 
target)) {
+                        return false;
+                    }
+                    if (bind != null && !hasAttribute(reference, "bind", 
bind)) {
+                        return false;
+                    }
+                    if (unbind != null && !hasAttribute(reference, "unbind", 
unbind)) {
+                        return false;
+                    }
+                    return true;
+                }
+            }
+            return false;
+        }
+
+    }
+
+    HasReference hasReference(String name) {
+        return new HasReference(name);
+    }
+
+}

Propchange: 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/ComponentDescriptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/SegmentNodeStoreFactoryTest.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/SegmentNodeStoreFactoryTest.java?rev=1834845&view=auto
==============================================================================
--- 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/SegmentNodeStoreFactoryTest.java
 (added)
+++ 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/SegmentNodeStoreFactoryTest.java
 Mon Jul  2 12:55:27 2018
@@ -0,0 +1,74 @@
+/*
+ * 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.jackrabbit.oak.segment.osgi;
+
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+public class SegmentNodeStoreFactoryTest {
+
+    @Test
+    public void testComponentDescriptor() throws Exception {
+        ComponentDescriptor cd = 
ComponentDescriptor.open(getClass().getResourceAsStream("/OSGI-INF/org.apache.jackrabbit.oak.segment.SegmentNodeStoreFactory.xml"));
+        
assertTrue(cd.hasName("org.apache.jackrabbit.oak.segment.SegmentNodeStoreFactory"));
+        assertTrue(cd.hasRequireConfigurationPolicy());
+        assertTrue(cd.hasActivateMethod("activate"));
+        assertTrue(cd.hasDeactivateMethod("deactivate"));
+        assertTrue(cd.hasProperty("role").check());
+        assertTrue(cd.hasProperty("customBlobStore")
+            .withBooleanType()
+            .withValue("false")
+            .check());
+        assertTrue(cd.hasProperty("customSegmentStore")
+            .withBooleanType()
+            .withValue("false")
+            .check());
+        assertTrue(cd.hasProperty("registerDescriptors")
+            .withBooleanType()
+            .withValue("false")
+            .check());
+        assertTrue(cd.hasReference("blobStore")
+            .withInterface("org.apache.jackrabbit.oak.spi.blob.BlobStore")
+            .withOptionalUnaryCardinality()
+            .withStaticPolicy()
+            .withGreedyPolicyOption()
+            .withTarget("(&(!(split.blobstore=old))(!(split.blobstore=new)))")
+            .withBind("bindBlobStore")
+            .withUnbind("unbindBlobStore")
+            .check());
+        assertTrue(cd.hasReference("segmentStore")
+            
.withInterface("org.apache.jackrabbit.oak.segment.spi.persistence.SegmentNodeStorePersistence")
+            .withOptionalUnaryCardinality()
+            .withStaticPolicy()
+            .withGreedyPolicyOption()
+            .withBind("bindSegmentStore")
+            .withUnbind("unbindSegmentStore")
+            .check());
+        assertTrue(cd.hasReference("statisticsProvider")
+            
.withInterface("org.apache.jackrabbit.oak.stats.StatisticsProvider")
+            .withMandatoryUnaryCardinality()
+            .withStaticPolicy()
+            .withBind("bindStatisticsProvider")
+            .withUnbind("unbindStatisticsProvider")
+            .check());
+
+    }
+}

Propchange: 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/SegmentNodeStoreFactoryTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/SegmentNodeStoreMonitorServiceTest.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/SegmentNodeStoreMonitorServiceTest.java?rev=1834845&view=auto
==============================================================================
--- 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/SegmentNodeStoreMonitorServiceTest.java
 (added)
+++ 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/SegmentNodeStoreMonitorServiceTest.java
 Mon Jul  2 12:55:27 2018
@@ -0,0 +1,44 @@
+/*
+ * 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.jackrabbit.oak.segment.osgi;
+
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+public class SegmentNodeStoreMonitorServiceTest {
+
+    @Test
+    public void testComponentDescriptor() throws Exception {
+        ComponentDescriptor cd = 
ComponentDescriptor.open(getClass().getResourceAsStream("/OSGI-INF/org.apache.jackrabbit.oak.segment.SegmentNodeStoreMonitorService.xml"));
+        
assertTrue(cd.hasName("org.apache.jackrabbit.oak.segment.SegmentNodeStoreMonitorService"));
+        assertTrue(cd.hasRequireConfigurationPolicy());
+        assertTrue(cd.hasActivateMethod("activate"));
+        
assertTrue(cd.hasImplementationClass("org.apache.jackrabbit.oak.segment.SegmentNodeStoreMonitorService"));
+        assertTrue(cd.hasProperty("commitsTrackerWriterGroups").check());
+        assertTrue(cd.hasReference("snsStatsMBean")
+            
.withInterface("org.apache.jackrabbit.oak.segment.SegmentNodeStoreStatsMBean")
+            .withMandatoryUnaryCardinality()
+            .withStaticPolicy()
+            .withBind("bindSnsStatsMBean")
+            .withUnbind("unbindSnsStatsMBean")
+            .check());
+    }
+}

Propchange: 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/SegmentNodeStoreMonitorServiceTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/SegmentNodeStoreServiceDeprecationErrorTest.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/SegmentNodeStoreServiceDeprecationErrorTest.java?rev=1834845&view=auto
==============================================================================
--- 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/SegmentNodeStoreServiceDeprecationErrorTest.java
 (added)
+++ 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/SegmentNodeStoreServiceDeprecationErrorTest.java
 Mon Jul  2 12:55:27 2018
@@ -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.jackrabbit.oak.segment.osgi;
+
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+public class SegmentNodeStoreServiceDeprecationErrorTest {
+
+    @Test
+    public void testComponentDescriptor() throws Exception {
+        ComponentDescriptor cd = 
ComponentDescriptor.open(getClass().getResourceAsStream("/OSGI-INF/org.apache.jackrabbit.oak.segment.osgi.SegmentNodeStoreServiceDeprecationError.xml"));
+        
assertTrue(cd.hasName("org.apache.jackrabbit.oak.segment.osgi.SegmentNodeStoreServiceDeprecationError"));
+        assertTrue(cd.hasRequireConfigurationPolicy());
+        assertTrue(cd.hasActivateMethod("activate"));
+        
assertTrue(cd.hasConfigurationPid("org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService"));
+        
assertTrue(cd.hasImplementationClass("org.apache.jackrabbit.oak.segment.osgi.SegmentNodeStoreServiceDeprecationError"));
+    }
+
+}

Propchange: 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/SegmentNodeStoreServiceDeprecationErrorTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/SegmentNodeStoreServiceTest.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/SegmentNodeStoreServiceTest.java?rev=1834845&view=auto
==============================================================================
--- 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/SegmentNodeStoreServiceTest.java
 (added)
+++ 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/SegmentNodeStoreServiceTest.java
 Mon Jul  2 12:55:27 2018
@@ -0,0 +1,144 @@
+/*
+ * 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.jackrabbit.oak.segment.osgi;
+
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+public class SegmentNodeStoreServiceTest {
+
+    @Test
+    public void testComponentDescriptor() throws Exception {
+        ComponentDescriptor cd = 
ComponentDescriptor.open(getClass().getResourceAsStream("/OSGI-INF/org.apache.jackrabbit.oak.segment.SegmentNodeStoreService.xml"));
+        
assertTrue(cd.hasName("org.apache.jackrabbit.oak.segment.SegmentNodeStoreService"));
+        assertTrue(cd.hasRequireConfigurationPolicy());
+        assertTrue(cd.hasActivateMethod("activate"));
+        assertTrue(cd.hasDeactivateMethod("deactivate"));
+        
assertTrue(cd.hasImplementationClass("org.apache.jackrabbit.oak.segment.SegmentNodeStoreService"));
+        assertTrue(cd.hasProperty("repository.home").check());
+        assertTrue(cd.hasProperty("tarmk.mode").check());
+        assertTrue(cd.hasProperty("repository.backup.dir").check());
+        assertTrue(cd.hasProperty("tarmk.size")
+            .withIntegerType()
+            .withValue("256")
+            .check());
+        assertTrue(cd.hasProperty("segmentCache.size")
+            .withIntegerType()
+            .withValue("256")
+            .check());
+        assertTrue(cd.hasProperty("stringCache.size")
+            .withIntegerType()
+            .withValue("256")
+            .check());
+        assertTrue(cd.hasProperty("templateCache.size")
+            .withIntegerType()
+            .withValue("64")
+            .check());
+        assertTrue(cd.hasProperty("stringDeduplicationCache.size")
+            .withIntegerType()
+            .withValue("15000")
+            .check());
+        assertTrue(cd.hasProperty("templateDeduplicationCache.size")
+            .withIntegerType()
+            .withValue("3000")
+            .check());
+        assertTrue(cd.hasProperty("nodeDeduplicationCache.size")
+            .withIntegerType()
+            .withValue("1048576")
+            .check());
+        assertTrue(cd.hasProperty("pauseCompaction")
+            .withBooleanType()
+            .withValue("false")
+            .check());
+        assertTrue(cd.hasProperty("compaction.retryCount")
+            .withIntegerType()
+            .withValue("5")
+            .check());
+        assertTrue(cd.hasProperty("compaction.force.timeout")
+            .withIntegerType()
+            .withValue("60")
+            .check());
+        assertTrue(cd.hasProperty("compaction.sizeDeltaEstimation")
+            .withLongType()
+            .withValue("1073741824")
+            .check());
+        assertTrue(cd.hasProperty("compaction.disableEstimation")
+            .withBooleanType()
+            .withValue("false")
+            .check());
+        assertTrue(cd.hasProperty("compaction.retainedGenerations")
+            .withIntegerType()
+            .withValue("2")
+            .check());
+        assertTrue(cd.hasProperty("compaction.memoryThreshold")
+            .withIntegerType()
+            .withValue("15")
+            .check());
+        assertTrue(cd.hasProperty("compaction.progressLog")
+            .withLongType()
+            .withValue("-1")
+            .check());
+        assertTrue(cd.hasProperty("standby")
+            .withBooleanType()
+            .withValue("false")
+            .check());
+        assertTrue(cd.hasProperty("customBlobStore")
+            .withBooleanType()
+            .withValue("false")
+            .check());
+        assertTrue(cd.hasProperty("customSegmentStore")
+            .withBooleanType()
+            .withValue("false")
+            .check());
+        assertTrue(cd.hasProperty("blobGcMaxAgeInSecs")
+            .withLongType()
+            .withValue("86400")
+            .check());
+        assertTrue(cd.hasProperty("blobTrackSnapshotIntervalInSecs")
+            .withLongType()
+            .withValue("43200")
+            .check());
+        assertTrue(cd.hasReference("blobStore")
+            .withInterface("org.apache.jackrabbit.oak.spi.blob.BlobStore")
+            .withOptionalUnaryCardinality()
+            .withStaticPolicy()
+            .withGreedyPolicyOption()
+            .withTarget("(&(!(split.blobstore=old))(!(split.blobstore=new)))")
+            .withBind("bindBlobStore")
+            .withUnbind("unbindBlobStore")
+            .check());
+        assertTrue(cd.hasReference("segmentStore")
+            
.withInterface("org.apache.jackrabbit.oak.segment.spi.persistence.SegmentNodeStorePersistence")
+            .withOptionalUnaryCardinality()
+            .withStaticPolicy()
+            .withGreedyPolicyOption()
+            .withBind("bindSegmentStore")
+            .withUnbind("unbindSegmentStore")
+            .check());
+        assertTrue(cd.hasReference("statisticsProvider")
+            
.withInterface("org.apache.jackrabbit.oak.stats.StatisticsProvider")
+            .withMandatoryUnaryCardinality()
+            .withStaticPolicy()
+            .withBind("bindStatisticsProvider")
+            .withUnbind("unbindStatisticsProvider")
+            .check());
+    }
+}

Propchange: 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/SegmentNodeStoreServiceTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/StandbyStoreServiceDeprecationErrorTest.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/StandbyStoreServiceDeprecationErrorTest.java?rev=1834845&view=auto
==============================================================================
--- 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/StandbyStoreServiceDeprecationErrorTest.java
 (added)
+++ 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/StandbyStoreServiceDeprecationErrorTest.java
 Mon Jul  2 12:55:27 2018
@@ -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.jackrabbit.oak.segment.osgi;
+
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+public class StandbyStoreServiceDeprecationErrorTest {
+
+    @Test
+    public void testComponentDescriptor() throws Exception {
+        ComponentDescriptor cd = 
ComponentDescriptor.open(getClass().getResourceAsStream("/OSGI-INF/org.apache.jackrabbit.oak.segment.osgi.StandbyStoreServiceDeprecationError.xml"));
+        
assertTrue(cd.hasName("org.apache.jackrabbit.oak.segment.osgi.StandbyStoreServiceDeprecationError"));
+        assertTrue(cd.hasRequireConfigurationPolicy());
+        assertTrue(cd.hasActivateMethod("activate"));
+        
assertTrue(cd.hasConfigurationPid("org.apache.jackrabbit.oak.plugins.segment.standby.store.StandbyStoreService"));
+        
assertTrue(cd.hasImplementationClass("org.apache.jackrabbit.oak.segment.osgi.StandbyStoreServiceDeprecationError"));
+    }
+
+}

Propchange: 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/StandbyStoreServiceDeprecationErrorTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/StandbyStoreServiceTest.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/StandbyStoreServiceTest.java?rev=1834845&view=auto
==============================================================================
--- 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/StandbyStoreServiceTest.java
 (added)
+++ 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/StandbyStoreServiceTest.java
 Mon Jul  2 12:55:27 2018
@@ -0,0 +1,78 @@
+/*
+ * 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.jackrabbit.oak.segment.osgi;
+
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+public class StandbyStoreServiceTest {
+
+    @Test
+    public void testComponentDescriptor() throws Exception {
+        ComponentDescriptor cd = 
ComponentDescriptor.open(getClass().getResourceAsStream("/OSGI-INF/org.apache.jackrabbit.oak.segment.standby.store.StandbyStoreService.xml"));
+        
assertTrue(cd.hasName("org.apache.jackrabbit.oak.segment.standby.store.StandbyStoreService"));
+        assertTrue(cd.hasRequireConfigurationPolicy());
+        assertTrue(cd.hasActivateMethod("activate"));
+        assertTrue(cd.hasDeactivateMethod("deactivate"));
+        
assertTrue(cd.hasImplementationClass("org.apache.jackrabbit.oak.segment.standby.store.StandbyStoreService"));
+        
assertTrue(cd.hasProperty("org.apache.sling.installer.configuration.persist")
+            .withBooleanType()
+            .withValue("false")
+            .check());
+        assertTrue(cd.hasProperty("mode")
+            .withValue("primary")
+            .check());
+        assertTrue(cd.hasProperty("port")
+            .withIntegerType()
+            .withValue("8023")
+            .check());
+        assertTrue(cd.hasProperty("primary.host")
+            .withValue("127.0.0.1")
+            .check());
+        assertTrue(cd.hasProperty("interval")
+            .withIntegerType()
+            .withValue("5")
+            .check());
+        assertTrue(cd.hasProperty("primary.allowed-client-ip-ranges")
+            .check());
+        assertTrue(cd.hasProperty("secure")
+            .withBooleanType()
+            .withValue("false")
+            .check());
+        assertTrue(cd.hasProperty("standby.readtimeout")
+            .withIntegerType()
+            .withValue("60000")
+            .check());
+        assertTrue(cd.hasProperty("standby.autoclean")
+            .withBooleanType()
+            .withValue("true")
+            .check());
+        assertTrue(cd.hasReference("storeProvider")
+            
.withInterface("org.apache.jackrabbit.oak.segment.SegmentStoreProvider")
+            .withMandatoryUnaryCardinality()
+            .withStaticPolicy()
+            .withGreedyPolicyOption()
+            .withBind("bindStoreProvider")
+            .withUnbind("unbindStoreProvider")
+            .check());
+    }
+
+}

Propchange: 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/osgi/StandbyStoreServiceTest.java
------------------------------------------------------------------------------
    svn:eol-style = native


Reply via email to