1 /*
   2  * Copyright (c) 2014, 2016 Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  */
   5 
   6 package com.oracle.appbundlers.tests;
   7 
   8 import java.util.ArrayList;
   9 import java.util.Iterator;
  10 import java.util.List;
  11 
  12 import com.oracle.appbundlers.utils.BundlingManager;
  13 import com.oracle.appbundlers.utils.BundlingManagers;
  14 import com.oracle.appbundlers.utils.ExtensionType;
  15 import com.oracle.appbundlers.utils.installers.AbstractBundlerUtils;
  16 
  17 /**
  18  *
  19  * @author Dmitry Zinkevich <dmitry.zinkevich@oracle.com>
  20  * @author Dmitry Ginzburg <dmitry.x.ginzburg@oracle.com>
  21  * @author Andrei Eremeev <andrei.eremeev@oracle.com>
  22  */
  23 public class BundlerProvider {
  24     public static Iterator<Object[]> createBundlingManagers(
  25             List<AbstractBundlerUtils> systemExtFormatList,
  26             List<BundlingManagers> bundlingMgrList,
  27             List<ExtensionType> javaExtFormatList) {
  28         List<Object[]> list = new ArrayList<Object[]>();
  29         for (BundlingManagers eachBundlingMgr : bundlingMgrList) {
  30             for (ExtensionType eachJavaExtension : javaExtFormatList) {
  31                 for (AbstractBundlerUtils eachSystemExtension : systemExtFormatList) {
  32                     BundlingManager bundlingMgr = eachBundlingMgr.getFactory()
  33                             .createInstance(eachSystemExtension);
  34                     bundlingMgr.setExtensionType(eachJavaExtension);
  35                     Object[] object = new Object[] { bundlingMgr };
  36                     list.add(object);
  37                 }
  38             }
  39         }
  40         return list.iterator();
  41     }
  42 }