<commit_before>package com.vmware.qe.framework.datadriven.demo.app;

import static com.vmware.qe.framework.datadriven.core.DDConstants.TAG_TESTID_ATTR;

import java.util.List;
import java.util.Random;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import com.vmware.qe.framework.datadriven.config.DDConfig;

public class TestLaunchBirds extends AbstractTest {
    private final Logger log = LoggerFactory.getLogger(TestLaunchBirds.class);
    private AngryBirds ab;
    private List<?> birds;
    private List<?> hits;
    private List<?> expectedHits;
    private int version;
    private Random random = new Random();
    @BeforeClass(alwaysRun = true)
    public void setup() {
        version = DDConfig.getSingleton().getData().getInt("prod.version", 0);
        Assert.assertTrue(version > 0, "Version should be a greaterthan zero.");
        log.info("############################");
        birds = data.getList("birds");
        hits = data.getList("hit");
        expectedHits = data.getList("expectedHits");
        log.info("Given birds: {}", birds);
        log.info("Given hits: {}", hits);
        log.info("Given expectedHits: {}", expectedHits);
        Assert.assertEquals(birds.size(), hits.size());
        Assert.assertEquals(birds.size(), expectedHits.size());
        ab = new AngryBirds(version);
    }

    @Test
    public void test() {
        log.info(">>>>>>>>>>>>");
        for (int i = 0; i < birds.size(); i++) {
            String bird = (String) birds.get(i);
            final boolean hit = Boolean.parseBoolean((String) hits.get(i));
            final int expHits = Integer.parseInt((String) expectedHits.get(i));
            log.info("Launching {} {} Exp hits= {}", bird, hit, expHits);
            ab.launch(bird, hit);
            int pigHits = ab.getPigsHit();
            log.info("Actual hits: {}", pigHits);
            Assert.assertEquals(pigHits, expHits);
        }
    }

    @AfterClass(alwaysRun = true)
    public void cleanup() {
        log.info("Cleanup");
    }

    @Override
    public String getTestName() {
        return data != null ? data.getString(TAG_TESTID_ATTR) : getClass().getName()
                + random.nextInt();
    }
}<commit_msg>By default run this test for version 1.<commit_after>package com.vmware.qe.framework.datadriven.demo.app;

import static com.vmware.qe.framework.datadriven.core.DDConstants.TAG_TESTID_ATTR;

import java.util.List;
import java.util.Random;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import com.vmware.qe.framework.datadriven.config.DDConfig;

public class TestLaunchBirds extends AbstractTest {
	private final Logger log = LoggerFactory.getLogger(TestLaunchBirds.class);
	private AngryBirds ab;
	private List<?> birds;
	private List<?> hits;
	private List<?> expectedHits;
	private int version;
	private Random random = new Random();

	@BeforeClass(alwaysRun = true)
	public void setup() {
		version = DDConfig.getSingleton().getData().getInt("prod.version", 1);
		// Assert.assertTrue(version > 0,
		// "Version should be a greaterthan zero.");
		log.info("############################");
		birds = data.getList("birds");
		hits = data.getList("hit");
		expectedHits = data.getList("expectedHits");
		log.info("Given birds: {}", birds);
		log.info("Given hits: {}", hits);
		log.info("Given expectedHits: {}", expectedHits);
		Assert.assertEquals(birds.size(), hits.size());
		Assert.assertEquals(birds.size(), expectedHits.size());
		ab = new AngryBirds(version);
	}

	@Test
	public void test() {
		for (int i = 0; i < birds.size(); i++) {
			String bird = (String) birds.get(i);
			final boolean hit = Boolean.parseBoolean((String) hits.get(i));
			final int expHits = Integer.parseInt((String) expectedHits.get(i));
			log.info("Launching {} {} Exp hits= {}", bird, hit, expHits);
			ab.launch(bird, hit);
			int pigHits = ab.getPigsHit();
			log.info("Actual hits: {}", pigHits);
			Assert.assertEquals(pigHits, expHits);
		}
	}

	@Override
	public String getTestName() {
		return data != null ? data.getString(TAG_TESTID_ATTR) : getClass()
				.getName() + random.nextInt();
	}
}
{'fraction_non_alphanumeric': 0.15812356979405034, 'fraction_numerical': 0.002517162471395881, 'mean_word_length': 3.645058448459086, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6443031', 'n_tokens_mistral': 1417, 'n_tokens_neox': 1370, 'n_words': 299}