/*****************************************************************************
 * 
 * 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.xmpbox;

import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import org.apache.xmpbox.xml.DomXmpParser;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;

@RunWith(Parameterized.class)
public class TestXMPWithDefinedSchemas
{

    @Parameters
    public static Collection<Object[]> initializeParameters() throws Exception
    {
        List<Object[]> data = new ArrayList<>();
        data.add(new Object[] { "/validxmp/override_ns.rdf" });
        data.add(new Object[] { "/validxmp/ghost2.xmp" });
        data.add(new Object[] { "/validxmp/history2.rdf" });
        data.add(new Object[] { "/validxmp/Notepad++_A1b.xmp" });
        data.add(new Object[] { "/validxmp/metadata.rdf" });
        return data;
    }

    private final String path;

    public TestXMPWithDefinedSchemas(String path)
    {
        this.path = path;
    }

    @Test
    public void main() throws Exception
    {

        InputStream is = this.getClass().getResourceAsStream(path);

        DomXmpParser builder = new DomXmpParser();
        XMPMetadata rxmp = builder.parse(is);

    }

}

@@ -1038,69 +1038,21 @@
 til.
-ArrayList;%0Aimport java.util.Collection;%0Aimport java.util.List
+stream.Stream
 ;%0A%0Ai
@@ -1114,70 +1114,21 @@
 nit.
-Test;%0Aimport org.
 ju
-nit.runner.RunWith;%0Aimport org.junit.runner
+piter.param
 s.Pa
@@ -1138,16 +1138,20 @@
 eterized
+Test
 ;%0Aimport
@@ -1165,72 +1165,48 @@
 nit.
-runners.Parameterized.Parameters;%0A%0A@RunWith(Parameterized.class)
+jupiter.params.provider.MethodSource;%0A%0A%0A
 %0Apub
@@ -1246,25 +1246,8 @@
 as%0A%7B
-%0A%0A    @Parameters
 %0A   
@@ -1265,27 +1265,21 @@
 tic 
-Collection%3CObject%5B%5D
+Stream%3CString
 %3E in
@@ -1334,80 +1334,37 @@
     
-List%3CObject%5B%5D%3E data = new ArrayList%3C%3E();%0A        data.add(new Object%5B%5D %7B
+return Stream.of(%0A           
  %22/v
@@ -1383,28 +1383,25 @@
 ride_ns.rdf%22
- %7D);
+,
 %0A        dat
@@ -1397,39 +1397,19 @@
         
-data.add(new Object%5B%5D %7B
+   
  %22/valid
@@ -1419,28 +1419,25 @@
 /ghost2.xmp%22
- %7D);
+,
 %0A        dat
@@ -1433,39 +1433,19 @@
         
-data.add(new Object%5B%5D %7B
+   
  %22/valid
@@ -1461,29 +1461,27 @@
 ry2.rdf%22
- %7D);%0A
+,%0A 
         
 data.add
@@ -1472,39 +1472,18 @@
         
-data.add(new Object%5B%5D %7B
+  
  %22/valid
@@ -1504,20 +1504,17 @@
 A1b.xmp%22
- %7D);
+,
 %0A       
@@ -1518,31 +1518,11 @@
     
-data.add(new Object%5B%5D %7B
+   
  %22/v
@@ -1546,12 +1546,8 @@
 rdf%22
- %7D);
 %0A   
@@ -1555,19 +1555,9 @@
     
-return data
+)
 ;%0A  
@@ -1569,134 +1569,68 @@
     
-private final String path;%0A%0A    public TestXMPWithDefinedSchemas(String path)%0A    %7B%0A        this.path = path;%0A    %7D%0A%0A    @Test
+@ParameterizedTest%0A    @MethodSource(%22initializeParameters%22)
 %0A   
@@ -1647,16 +1647,27 @@
 id main(
+String path
 ) throws
@@ -1683,17 +1683,16 @@
 n%0A    %7B%0A
-%0A
         
@@ -1849,18 +1849,16 @@
 se(is);%0A
-%0A
     %7D%0A
-%0A
 %7D%0A

switch test to junit5; use parameterized test