/*
 * Copyright (C) 2010-2014 Hamburg Sud and the contributors.
 *
 * 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.
 */
package org.aludratest.service.edifactfile;

import static org.junit.Assert.assertEquals;

import org.aludratest.service.AbstractAludraServiceTest;
import org.aludratest.service.edifactfile.EdifactFileService;
import org.aludratest.service.edifactfile.EdifactFileVerifier;
import org.aludratest.testcase.TestStatus;
import org.aludratest.util.data.StringData;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/** 
 * Tests the {@link EdifactFileService}.
 * @author Volker Bergmann 
 */
@SuppressWarnings("javadoc")
public class EdifactFileServiceIntegrationTest extends AbstractAludraServiceTest {

    private EdifactFileService service;

    @Before
    public void prepare() {
        this.service = getLoggingService(EdifactFileService.class, "localedi");
    }

    @After
    public void tearDown() {
        this.service.close();
    }

    @Test
    public void testVerify_identical() throws Exception {
        EdifactFileVerifier verifier = new EdifactFileVerifier("IFTDGN_1.edi", service) {
        };
        verifier.verifyWith(new StringData("IFTDGN_1.edi"));
        assertEquals(TestStatus.PASSED, testCase.getLastTestStep().getStatus());
    }

    @Test
    public void testVerify_different_negative() throws Exception {
        EdifactFileVerifier verifier = new EdifactFileVerifier("IFTDGN_1.edi", service) {
        };
        verifier.verifyWith(new StringData("IFTDGN_2.edi"));
        assertEquals(TestStatus.FAILED, testCase.getLastTestStep().getStatus());
    }

    // ENHANCE write positive test
}

@@ -787,135 +787,8 @@
 t;%0D%0A
-import org.aludratest.service.edifactfile.EdifactFileService;%0D%0Aimport org.aludratest.service.edifactfile.EdifactFileVerifier;%0D%0A
 impo
@@ -827,16 +827,16 @@
 tatus;%0D%0A
+
 import o
@@ -952,17 +952,16 @@
 ;%0D%0A%0D%0A/**
- 
 %0D%0A * Tes
@@ -996,16 +996,16 @@
 vice%7D.%0D%0A
+
  * @auth
@@ -1022,17 +1022,16 @@
 Bergmann
- 
 %0D%0A */%0D%0A@

remove unused imports