@@ -0,0 +1,2060 @@
+/*-%0A * Copyright (c) 2013 Red Hat, Inc.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.fedoraproject.maven.installer;%0A%0Aimport java.io.FileReader;%0Aimport java.nio.file.Files;%0Aimport java.nio.file.Path;%0A%0Aimport org.codehaus.plexus.PlexusTestCase;%0Aimport org.codehaus.plexus.util.xml.pull.MXParser;%0Aimport org.codehaus.plexus.util.xml.pull.XmlPullParser;%0Aimport org.fedoraproject.maven.config.Configuration;%0Aimport org.fedoraproject.maven.config.Configurator;%0Aimport org.fedoraproject.maven.config.InstallerSettings;%0A%0A/**%0A * @author Mikolaj Izdebski%0A */%0Apublic class MetadataTest%0A    extends PlexusTestCase%0A%7B%0A    /**%0A     * Test if generated metadata file is parseable as XML document.%0A     * %0A     * @throws Exception%0A     */%0A    public void testXmlStntax()%0A        throws Exception%0A    %7B%0A        Configuration configuration = lookup( Configurator.class ).getDefaultConfiguration();%0A        InstallerSettings installerSettings = configuration.getInstallerSettings();%0A%0A        Path depmapFile = Files.createTempFile( %22xmvn-test-%22, %22.xml%22 );%0A%0A        FragmentFile fragmentFile = new FragmentFile();%0A        fragmentFile.write( depmapFile, false, installerSettings );%0A%0A        assertTrue( Files.exists( depmapFile ) );%0A        assertTrue( Files.isRegularFile( depmapFile ) );%0A        assertTrue( Files.isReadable( depmapFile ) );%0A%0A        XmlPullParser xpp = new MXParser();%0A        xpp.setInput( new FileReader( depmapFile.toFile() ) );%0A%0A        while ( xpp.getEventType() != XmlPullParser.END_DOCUMENT )%0A            xpp.next();%0A    %7D%0A%7D%0A

Implement MetadataTest