package org.jaexcel.framework.JAEX.annotation;

import java.lang.annotation.Annotation;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

import org.jaexcel.framework.JAEX.bean.ObjectWithDefaultConfig;
import org.jaexcel.framework.JAEX.definition.CascadeType;
import org.jaexcel.framework.JAEX.definition.ExtensionFileType;

public class XlsConfigurationTest extends TestCase {
	/**
	 * Create the test case
	 * 
	 * @param testName
	 *            name of the test case
	 */
	public XlsConfigurationTest(String testName) {
		super(testName);
	}

	/**
	 * @return the suite of tests being tested
	 */
	public static Test suite() {
		return new TestSuite(XlsConfigurationTest.class);
	}

	/**
	 * Test default configuration.
	 */
	public void testDefaultConfiguration() {
		Class<ObjectWithDefaultConfig> o = ObjectWithDefaultConfig.class;

		// Process @XlsConfiguration
		if (o.isAnnotationPresent(XlsConfiguration.class)) {

			Annotation annotation = o.getAnnotation(XlsConfiguration.class);
			XlsConfiguration xlsConfig = (XlsConfiguration) annotation;

			// add here the annotations attributes
			assertEquals(xlsConfig.extensionFile(), ExtensionFileType.XLS);
			assertEquals(xlsConfig.cascadeLevel(), CascadeType.CASCADE_BASE);
		}
	}
}

@@ -90,109 +90,8 @@
 %0D%0A%0D%0A
-import junit.framework.Test;%0D%0Aimport junit.framework.TestCase;%0D%0Aimport junit.framework.TestSuite;%0D%0A%0D%0A
 impo
@@ -131,33 +131,28 @@
 n.Object
-WithDefaultConfig
+sBuilderTest
 ;%0D%0Aimpor
@@ -195,22 +195,28 @@
 ion.
-Cascad
+ExtensionFil
 eType;%0D%0A
 impo
@@ -215,69 +215,105 @@
 e;%0D%0A
+%0D%0A
 import 
-org.jaexcel.framework.JAEX.definition.ExtensionFileTyp
+junit.framework.Test;%0D%0Aimport junit.framework.TestCase;%0D%0Aimport junit.framework.TestSuit
 e;%0D%0A
@@ -789,16 +789,35 @@
 %09%09Class%3C
+ObjectsBuilderTest.
 ObjectWi
@@ -837,16 +837,35 @@
 ig%3E o = 
+ObjectsBuilderTest.
 ObjectWi
@@ -1228,39 +1228,286 @@
 LS);%0D%0A%09%09
-%09assertEquals(x
+%7D%0D%0A%09%7D%0D%0A%0D%0A%09/**%0D%0A%09 * Test name file attribute.%0D%0A%09 */%0D%0A%09public void testNameFileAttribute() %7B%0D%0A%09%09Class%3CObjectsBuilderTest.ObjectWithDefaultConfig%3E o = ObjectsBuilderTest.ObjectWithDefaultConfig.class;%0D%0A%0D%0A%09%09// Process @XlsConfiguration%0D%0A%09%09if (o.isAnnotationPresent(X
 lsConfig
 .cascade
@@ -1502,49 +1502,786 @@
 nfig
+uration
 .c
+l
 as
-cadeLevel(), CascadeType.CASCADE_BASE
+s)) %7B%0D%0A%0D%0A%09%09%09Annotation annotation = o.getAnnotation(XlsConfiguration.class);%0D%0A%09%09%09XlsConfiguration xlsConfig = (XlsConfiguration) annotation;%0D%0A%0D%0A%09%09%09// add here the annotations attributes%0D%0A%09%09%09assertEquals(xlsConfig.nameFile(), %22DefaultConfigurationSample%22);%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A%0D%0A%09/**%0D%0A%09 * Test name file attribute.%0D%0A%09 */%0D%0A%09public void testExtensionFileAttribute() %7B%0D%0A%09%09Class%3CObjectsBuilderTest.Cyclops%3E o = ObjectsBuilderTest.Cyclops.class;%0D%0A%0D%0A%09%09// Process @XlsConfiguration%0D%0A%09%09if (o.isAnnotationPresent(XlsConfiguration.class)) %7B%0D%0A%0D%0A%09%09%09Annotation annotation = o.getAnnotation(XlsConfiguration.class);%0D%0A%09%09%09XlsConfiguration xlsConfig = (XlsConfiguration) annotation;%0D%0A%0D%0A%09%09%09// add here the annotations attributes%0D%0A%09%09%09assertEquals(xlsConfig.extensionFile(), ExtensionFileType.XLSX
 );%0D%0A

Add new tests to XlsConfigurationTest