/*
 * Copyright 2010 James Pether Sörling
 *
 * Licensed 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.
 *
 *	$Id$
 *  $HeadURL$
*/
package com.hack23.cia.service.external.vdem.impl;

import org.databene.contiperf.PerfTest;
import org.databene.contiperf.Required;
import org.databene.contiperf.junit.ContiPerfRule;
import org.junit.Rule;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import com.hack23.cia.service.external.vdem.impl.VdemServiceImpl;

/**
 * The Class VdemServiceITest.
 */
@PerfTest(threads = 1, duration = 3000, warmUp = 1500)
@Required(max = 4000,average = 2500,percentile95=3000,throughput=2)
public class VdemServiceITest extends AbstractVdemFunctionalIntegrationTest {

	/** The i. */
	@Rule
	public ContiPerfRule i = new ContiPerfRule();

	/** The vdem service. */
	@Autowired
	private VdemServiceImpl vdemService;

	/**
	 * Test get questions.
	 *
	 * @throws Exception
	 *             the exception
	 */
	@Test
	@PerfTest(threads = 1, duration = 15000, warmUp = 1500)
	@Required(max = 15000,average = 15000,percentile95=15000)
	public void testGetQuestions() throws Exception {

		assertEquals(510,vdemService.getQuestions().size());
	}

	/**
	 * Test get country question data.
	 *
	 * @throws Exception
	 *             the exception
	 */
	@Test
	@PerfTest(threads = 1, duration = 60000, warmUp = 1500)
	@Required(max = 60000,average = 60000,percentile95=60000)

	public void testGetCountryQuestionData() throws Exception {

		assertNotNull(vdemService.getCountryQuestionData());
	}

}

@@ -1507,33 +1507,33 @@
 15000, warmUp = 
-1
+4
 500)%0A%09@Required(
@@ -1538,17 +1538,17 @@
 d(max = 
-1
+2
 5000,ave
@@ -1554,17 +1554,17 @@
 erage = 
-1
+2
 5000,per
@@ -1573,17 +1573,17 @@
 ntile95=
-1
+2
 5000)%0A%09p
@@ -1835,17 +1835,17 @@
 ation = 
-6
+9
 0000, wa
@@ -1847,25 +1847,25 @@
 0, warmUp = 
-1
+4
 500)%0A%09@Requi
@@ -1874,17 +1874,17 @@
 d(max = 
-6
+9
 0000,ave
@@ -1890,17 +1890,17 @@
 erage = 
-6
+9
 0000,per
@@ -1913,9 +1913,9 @@
 e95=
-6
+9
 0000

increase timeout