// Path: impl/src/main/java/com/geewhiz/pacify/checks/impl/CheckCorrectPacifyFilter.java
// public class CheckCorrectPacifyFilter implements PMarkerCheck {
// 
//     public LinkedHashSet<Defect> checkForErrors(EntityManager entityManager, PMarker pMarker) {
//         LinkedHashSet<Defect> defects = new LinkedHashSet<Defect>();
// 
//         for (PFile pFile : entityManager.getPFilesFrom(pMarker)) {
//             try {
//                 Utils.getPacifyFilter(pFile);
//             } catch (DefectException e) {
//                 defects.add(new FilterNotFoundDefect(pFile));
//             }
// 
//         }
//         return defects;
//     }
// }
// 
// Path: api/src/main/java/com/geewhiz/pacify/defect/Defect.java
// public interface Defect {
// 
//     String getDefectMessage();
// 
// }
// 
// Path: api/src/main/java/com/geewhiz/pacify/defect/FilterNotFoundDefect.java
// public class FilterNotFoundDefect extends DefectException {
// 
//     private static final long serialVersionUID = 1L;
// 
//     public FilterNotFoundDefect(PFile pFile) {
//         super(pFile);
//     }
// 
//     @Override
//     public String getDefectMessage() {
//         return super.getDefectMessage() + String.format("\n\t[Filter=%s]", getPFile().getFilterClass())
//                 + String.format("\n\t[Message=%s]", "Couldn't find filter class or couldn't initialize it. Have a look at the debug output.");
//     }
// }


import com.geewhiz.pacify.defect.FilterNotFoundDefect;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.List;
import org.junit.Assert;
import org.junit.Test;
import com.geewhiz.pacify.checks.impl.CheckCorrectPacifyFilter;
import com.geewhiz.pacify.defect.Defect;
/*-
 * ========================LICENSE_START=================================
 * com.geewhiz.pacify.impl
 * %%
 * Copyright (C) 2011 - 2017 Sven Oppermann
 * %%
 * Licensed 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.
 * =========================LICENSE_END==================================
 */

package com.geewhiz.pacify;




public class TestWrongFilter extends TestBase {

    @Test
    public void test() throws Exception {
        String testFolder = "testWrongFilter";

        LinkedHashSet<Defect> result = createPrepareAndExecuteValidator(testFolder, createPropertyResolveManager(Collections.<String, String> emptyMap()),
                new CheckCorrectPacifyFilter());

        List<Defect> defects = new ArrayList<Defect>(result);

// Path: impl/src/main/java/com/geewhiz/pacify/checks/impl/CheckCorrectPacifyFilter.java
// public class CheckCorrectPacifyFilter implements PMarkerCheck {
// 
//     public LinkedHashSet<Defect> checkForErrors(EntityManager entityManager, PMarker pMarker) {
//         LinkedHashSet<Defect> defects = new LinkedHashSet<Defect>();
// 
//         for (PFile pFile : entityManager.getPFilesFrom(pMarker)) {
//             try {
//                 Utils.getPacifyFilter(pFile);
//             } catch (DefectException e) {
//                 defects.add(new FilterNotFoundDefect(pFile));
//             }
// 
//         }
//         return defects;
//     }
// }
// 
// Path: api/src/main/java/com/geewhiz/pacify/defect/Defect.java
// public interface Defect {
// 
//     String getDefectMessage();
// 
// }
// 
// Path: api/src/main/java/com/geewhiz/pacify/defect/FilterNotFoundDefect.java
// public class FilterNotFoundDefect extends DefectException {
// 
//     private static final long serialVersionUID = 1L;
// 
//     public FilterNotFoundDefect(PFile pFile) {
//         super(pFile);
//     }
// 
//     @Override
//     public String getDefectMessage() {
//         return super.getDefectMessage() + String.format("\n\t[Filter=%s]", getPFile().getFilterClass())
//                 + String.format("\n\t[Message=%s]", "Couldn't find filter class or couldn't initialize it. Have a look at the debug output.");
//     }
// }


// Path: impl/src/test/java/com/geewhiz/pacify/TestWrongFilter.java
import com.geewhiz.pacify.defect.FilterNotFoundDefect;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.List;
import org.junit.Assert;
import org.junit.Test;
import com.geewhiz.pacify.checks.impl.CheckCorrectPacifyFilter;
import com.geewhiz.pacify.defect.Defect;

/*-
 * ========================LICENSE_START=================================
 * com.geewhiz.pacify.impl
 * %%
 * Copyright (C) 2011 - 2017 Sven Oppermann
 * %%
 * Licensed 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.
 * =========================LICENSE_END==================================
 */

package com.geewhiz.pacify;




public class TestWrongFilter extends TestBase {

    @Test
    public void test() throws Exception {
        String testFolder = "testWrongFilter";

        LinkedHashSet<Defect> result = createPrepareAndExecuteValidator(testFolder, createPropertyResolveManager(Collections.<String, String> emptyMap()),
                new CheckCorrectPacifyFilter());

        List<Defect> defects = new ArrayList<Defect>(result);

        Assert.assertEquals(2, defects.size());