// Path: src/main/java/hudson/plugins/promoted_builds/PromotionCondition.java
// public abstract class PromotionCondition implements ExtensionPoint, Describable<PromotionCondition> {
//     /**
//      * Checks if the promotion criteria is met.
//      *
//      * @param build
//      *      The build for which the promotion is considered.
//      * @return
//      *      non-null if the promotion condition is met. This object is then recorded so that
//      *      we know how a build was promoted.
//      *      Null if otherwise, meaning it shouldn't be promoted.
//      * @deprecated
//      */
//     @CheckForNull
//     public PromotionBadge isMet(AbstractBuild<?,?> build) {
//         return null;
//     }
// 
//     /**
//      * Checks if the promotion criteria is met.
//      *
//      * @param promotionProcess
//      *      The promotion process being evaluated for qualification
//      * @param build
//      *      The build for which the promotion is considered.
//      * @return
//      *      non-null if the promotion condition is met. This object is then recorded so that
//      *      we know how a build was promoted.
//      *      Null if otherwise, meaning it shouldn't be promoted.
//      */
//     public PromotionBadge isMet(PromotionProcess promotionProcess, AbstractBuild<?,?> build) {
//         // just call the deprecated version to support legacy conditions
//         return isMet(build);
//     }
// 
//     public PromotionConditionDescriptor getDescriptor() {
//         return (PromotionConditionDescriptor)Jenkins.get().getDescriptor(getClass());
//     }
// 
//     /**
//      * Returns all the registered {@link PromotionConditionDescriptor}s.
//      */
//     public static DescriptorExtensionList<PromotionCondition,PromotionConditionDescriptor> all() {
//         return Jenkins.get().<PromotionCondition,PromotionConditionDescriptor>getDescriptorList(PromotionCondition.class);
//     }
// 
//     /**
//      * Returns a subset of {@link PromotionConditionDescriptor}s that applys to the given project.
//      */
//     public static List<PromotionConditionDescriptor> getApplicableTriggers(AbstractProject<?,?> p) {
//         List<PromotionConditionDescriptor> r = new ArrayList<PromotionConditionDescriptor>();
//         for (PromotionConditionDescriptor t : all()) {
//             if(t.isApplicable(p))
//                 r.add(t);
//         }
//         return r;
//     }
// }


import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import com.thoughtworks.xstream.XStream;
import groovy.util.Node;
import hudson.plugins.promoted_builds.PromotionCondition;
import hudson.plugins.promoted_builds.conditions.SelfPromotionCondition;
import hudson.util.XStream2;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.matchesPattern;
import static org.hamcrest.Matchers.notNullValue;
package hudson.plugins.promoted_builds.integrations.jobdsl;






public class JobDslPromotionProcessConverterTest  {

    private static final XStream XSTREAM = new XStream2();
    
    @Test
    public void testShouldGenerateValidXml() throws Exception {
        // Given
        JobDslPromotionProcess pp = new JobDslPromotionProcess();
        //Conditions
// Path: src/main/java/hudson/plugins/promoted_builds/PromotionCondition.java
// public abstract class PromotionCondition implements ExtensionPoint, Describable<PromotionCondition> {
//     /**
//      * Checks if the promotion criteria is met.
//      *
//      * @param build
//      *      The build for which the promotion is considered.
//      * @return
//      *      non-null if the promotion condition is met. This object is then recorded so that
//      *      we know how a build was promoted.
//      *      Null if otherwise, meaning it shouldn't be promoted.
//      * @deprecated
//      */
//     @CheckForNull
//     public PromotionBadge isMet(AbstractBuild<?,?> build) {
//         return null;
//     }
// 
//     /**
//      * Checks if the promotion criteria is met.
//      *
//      * @param promotionProcess
//      *      The promotion process being evaluated for qualification
//      * @param build
//      *      The build for which the promotion is considered.
//      * @return
//      *      non-null if the promotion condition is met. This object is then recorded so that
//      *      we know how a build was promoted.
//      *      Null if otherwise, meaning it shouldn't be promoted.
//      */
//     public PromotionBadge isMet(PromotionProcess promotionProcess, AbstractBuild<?,?> build) {
//         // just call the deprecated version to support legacy conditions
//         return isMet(build);
//     }
// 
//     public PromotionConditionDescriptor getDescriptor() {
//         return (PromotionConditionDescriptor)Jenkins.get().getDescriptor(getClass());
//     }
// 
//     /**
//      * Returns all the registered {@link PromotionConditionDescriptor}s.
//      */
//     public static DescriptorExtensionList<PromotionCondition,PromotionConditionDescriptor> all() {
//         return Jenkins.get().<PromotionCondition,PromotionConditionDescriptor>getDescriptorList(PromotionCondition.class);
//     }
// 
//     /**
//      * Returns a subset of {@link PromotionConditionDescriptor}s that applys to the given project.
//      */
//     public static List<PromotionConditionDescriptor> getApplicableTriggers(AbstractProject<?,?> p) {
//         List<PromotionConditionDescriptor> r = new ArrayList<PromotionConditionDescriptor>();
//         for (PromotionConditionDescriptor t : all()) {
//             if(t.isApplicable(p))
//                 r.add(t);
//         }
//         return r;
//     }
// }


// Path: src/test/java/hudson/plugins/promoted_builds/integrations/jobdsl/JobDslPromotionProcessConverterTest.java
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import com.thoughtworks.xstream.XStream;
import groovy.util.Node;
import hudson.plugins.promoted_builds.PromotionCondition;
import hudson.plugins.promoted_builds.conditions.SelfPromotionCondition;
import hudson.util.XStream2;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.matchesPattern;
import static org.hamcrest.Matchers.notNullValue;

package hudson.plugins.promoted_builds.integrations.jobdsl;






public class JobDslPromotionProcessConverterTest  {

    private static final XStream XSTREAM = new XStream2();
    
    @Test
    public void testShouldGenerateValidXml() throws Exception {
        // Given
        JobDslPromotionProcess pp = new JobDslPromotionProcess();
        //Conditions
        List<PromotionCondition> conditions = new ArrayList<PromotionCondition>();