001    package org.andromda.translation.ocl.testsuite;
002    
003    /**
004     * Represents a ExpressionText object loaded into an TranslatorTestConfig object.
005     *
006     * @author Chad Brandon
007     */
008    public class ExpressionTest
009    {
010        private String to;
011        private String from;
012    
013        /**
014         * Gets the from translation.
015         *
016         * @return String
017         */
018        public String getFrom()
019        {
020            final String methodName = "ExpressionTest.getFrom";
021            if (this.to == null)
022            {
023                throw new TranslationTestProcessorException(methodName + " - from can not be null");
024            }
025            return from;
026        }
027    
028        /**
029         * Set the from translation.
030         *
031         * @param from the expression from which translation occurs.
032         */
033        public void setFrom(String from)
034        {
035            this.from = from;
036        }
037    
038        /**
039         * Gets the translation to which the translation should match.
040         *
041         * @return String
042         */
043        public String getTo()
044        {
045            final String methodName = "ExpressionTest.getTo";
046            if (this.to == null)
047            {
048                throw new TranslationTestProcessorException(methodName + " - to can not be null");
049            }
050            return to;
051        }
052    
053        /**
054         * Sets the translation to which the translation should match after the translation of the 'from' property occurs.
055         *
056         * @param to
057         */
058        public void setTo(String to)
059        {
060            this.to = to;
061        }
062    }