@@ -0,0 +1,2165 @@
+package edu.northwestern.bioinformatics.studycalendar.domain;%0A%0Aimport edu.northwestern.bioinformatics.studycalendar.testing.StudyCalendarTestCase;%0Aimport org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean;%0Aimport org.hibernate.mapping.PersistentClass;%0Aimport org.hibernate.annotations.GenericGenerator;%0Aimport org.hibernate.annotations.Parameter;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0Aimport java.util.Iterator;%0A%0A/**%0A * @author Rhett Sutphin%0A */%0Apublic class OracleCompatibilityTest extends StudyCalendarTestCase %7B%0A    private final Logger log = LoggerFactory.getLogger(getClass());%0A    %0A    @SuppressWarnings(%7B %22unchecked%22 %7D)%0A    public void testAllConfiguredSequencesLessThan30Characters() throws Exception %7B%0A        AnnotationSessionFactoryBean sessionFactoryBean%0A            = (AnnotationSessionFactoryBean) getDeployedApplicationContext().getBean(%22&sessionFactory%22);%0A        Iterator%3CPersistentClass%3E mappedClasses = sessionFactoryBean.getConfiguration().getClassMappings();%0A        while (mappedClasses.hasNext()) %7B%0A            PersistentClass pc =  mappedClasses.next();%0A            Class%3C?%3E clazz = pc.getMappedClass();%0A            GenericGenerator generator = clazz.getAnnotation(GenericGenerator.class);%0A            if (generator == null) %7B%0A                log.debug(%22%7B%7D has no declared generator%22, clazz.getName());%0A                continue;%0A            %7D%0A            Parameter sequence = null;%0A            for (Parameter parameter : generator.parameters()) %7B%0A                if (%22sequence%22.equals(parameter.name())) %7B%0A                    sequence = parameter; break;%0A                %7D%0A            %7D%0A            if (sequence == null) %7B%0A                fail(%22Generator for %22 + clazz.getName() + %22 has no sequence parameter%22);%0A            %7D%0A            assertTrue(%22Oracle sequence for %22 + clazz.getName() + %22 is too long: %22 + sequence.value() + %22 (%22 + sequence.value().length() + %22 chars). It must be no more than 30 characters. Bering will generate an appropriately named sequence; be sure to configure the same one in the class annotation.%22,%0A                sequence.value().length() %3C= 30);%0A        %7D%0A    %7D%0A%7D%0A

Test for checking that all configured (in the annotations) sequences for oracle are less than 30 characters