You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by si...@apache.org on 2019/03/11 17:16:36 UTC
[sling-whiteboard] branch master updated: [cp2fm]
ContentPackageEntryHandlerTest initial checkin,
ConfigurationEntryHandlerTest path checks split in 2 methods
This is an automated email from the ASF dual-hosted git repository.
simonetripodi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git
The following commit(s) were added to refs/heads/master by this push:
new d52ef4a [cp2fm] ContentPackageEntryHandlerTest initial checkin, ConfigurationEntryHandlerTest path checks split in 2 methods
d52ef4a is described below
commit d52ef4aef7d6b9c7802bf7d81d34f3da54c2c6aa
Author: Simo Tripodi <st...@adobe.com>
AuthorDate: Mon Mar 11 18:16:29 2019 +0100
[cp2fm] ContentPackageEntryHandlerTest initial checkin,
ConfigurationEntryHandlerTest path checks split in 2 methods
---
.../handlers/ConfigurationEntryHandlerTest.java | 6 ++-
.../handlers/ContentPackageEntryHandlerTest.java | 51 ++++++++++++++++++++++
2 files changed, 56 insertions(+), 1 deletion(-)
diff --git a/content-package-2-feature-model/src/test/java/org/apache/sling/cp2fm/handlers/ConfigurationEntryHandlerTest.java b/content-package-2-feature-model/src/test/java/org/apache/sling/cp2fm/handlers/ConfigurationEntryHandlerTest.java
index 449d13c..f852eaf 100644
--- a/content-package-2-feature-model/src/test/java/org/apache/sling/cp2fm/handlers/ConfigurationEntryHandlerTest.java
+++ b/content-package-2-feature-model/src/test/java/org/apache/sling/cp2fm/handlers/ConfigurationEntryHandlerTest.java
@@ -62,8 +62,12 @@ public class ConfigurationEntryHandlerTest {
}
@Test
- public void matches() {
+ public void doesNotMatch() {
assertFalse(configurationEntryHandler.matches("/this/is/a/path/not/pointing/to/a/valid/configuration.asd"));
+ }
+
+ @Test
+ public void matches() {
assertTrue(resourceConfiguration, configurationEntryHandler.matches(resourceConfiguration));
}
diff --git a/content-package-2-feature-model/src/test/java/org/apache/sling/cp2fm/handlers/ContentPackageEntryHandlerTest.java b/content-package-2-feature-model/src/test/java/org/apache/sling/cp2fm/handlers/ContentPackageEntryHandlerTest.java
new file mode 100644
index 0000000..013cf53
--- /dev/null
+++ b/content-package-2-feature-model/src/test/java/org/apache/sling/cp2fm/handlers/ContentPackageEntryHandlerTest.java
@@ -0,0 +1,51 @@
+/*
+ * 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.cp2fm.handlers;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.sling.cp2fm.spi.EntryHandler;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public final class ContentPackageEntryHandlerTest {
+
+ private EntryHandler contentPackageEntryhandler;
+
+ @Before
+ public void setUp() {
+ contentPackageEntryhandler = new ContentPackageEntryHandler();
+ }
+
+ @After
+ public void tearDown() {
+ contentPackageEntryhandler = null;
+ }
+
+ @Test
+ public void doesNotMatch() {
+ assertFalse(contentPackageEntryhandler.matches("/this/is/a/path/not/pointing/to/a/valid/configuration.asd"));
+ }
+
+ @Test
+ public void matches() {
+ assertTrue(contentPackageEntryhandler.matches("jcr_root/etc/packages/asd/v6/sample/asd.content-1.0.zip"));
+ }
+
+}