anchela commented on a change in pull request #99: URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/99#discussion_r699131497
########## File path: src/test/java/org/apache/sling/feature/cpconverter/vltpkg/WorkspaceFilterBuilderTest.java ########## @@ -0,0 +1,167 @@ +/* + * 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.feature.cpconverter.vltpkg; + +import org.apache.jackrabbit.vault.fs.api.ImportMode; +import org.apache.jackrabbit.vault.fs.api.PathFilterSet; +import org.apache.jackrabbit.vault.fs.api.WorkspaceFilter; +import org.apache.jackrabbit.vault.fs.filter.DefaultPathFilter; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import static junit.framework.TestCase.assertNotSame; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.reset; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoMoreInteractions; +import static org.mockito.Mockito.when; + +public class WorkspaceFilterBuilderTest { + + private static final String TEST_ROOT_PATH = "/some/test/path"; + private static final String PATH_NOT_COVERED = "/path/not/covered/by/filter"; + + private final WorkspaceFilter base = mock(WorkspaceFilter.class); + + private final PathFilterSet pfs = new PathFilterSet(TEST_ROOT_PATH); + private final List<PathFilterSet> filterSets = new ArrayList<>(); + + @Before + public void before() throws Exception { + pfs.setImportMode(ImportMode.UPDATE); + pfs.addExclude(new DefaultPathFilter("test/exclude")); + pfs.addInclude(new DefaultPathFilter("test/include")); Review comment: this is unit-test for the builder and not an integration test. it's used to verify that the include/exclude entries are copied over not that they are sensible. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
