@@ -0,0 +1,3208 @@
+/*%0A * Copyright (c) 2022 jMonkeyEngine%0A * All rights reserved.%0A *%0A * Redistribution and use in source and binary forms, with or without%0A * modification, are permitted provided that the following conditions are%0A * met:%0A *%0A * * Redistributions of source code must retain the above copyright%0A *   notice, this list of conditions and the following disclaimer.%0A *%0A * * Redistributions in binary form must reproduce the above copyright%0A *   notice, this list of conditions and the following disclaimer in the%0A *   documentation and/or other materials provided with the distribution.%0A *%0A * * Neither the name of 'jMonkeyEngine' nor the names of its contributors%0A *   may be used to endorse or promote products derived from this software%0A *   without specific prior written permission.%0A *%0A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS%0A * %22AS IS%22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED%0A * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR%0A * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR%0A * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,%0A * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,%0A * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR%0A * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF%0A * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING%0A * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS%0A * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.%0A */%0Apackage com.jme3.math;%0A%0Aimport java.util.regex.Matcher;%0Aimport java.util.regex.Pattern;%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0A%0A/**%0A * Test the Transform class using JUnit.%0A *%0A * @author Stephen Gold%0A */%0Apublic class TestTransform %7B%0A    /**%0A     * Test the %7B@code toString()%7D method.%0A     */%0A    @Test%0A    public void testTransformToString() %7B%0A        // Test data that's never modified:%0A        final Vector3f t = new Vector3f(12f, -1f, 5f);%0A        final Quaternion r = new Quaternion(0f, 0.6f, -0.8f, 0f);%0A        final Vector3f s = new Vector3f(1.7f, 1f, 1.7f);%0A        final Transform test = new Transform(t, r, s);%0A%0A        // Verify that the method doesn't throw an exception.%0A        String result = test.toString();%0A        /*%0A         * Verify that the result matches the javadoc%0A         * and can be parsed using a regular expression.%0A         */%0A        Pattern pattern = Pattern.compile(%0A                %22%5ETransform%5C%5C%5B (%5C%5CS+), (%5C%5CS+), (%5C%5CS+)%5C%5C%5D%5C%5Cn%22%0A                + %22%5C%5C%5B (%5C%5CS+), (%5C%5CS+), (%5C%5CS+), (%5C%5CS+)%5C%5C%5D%5C%5Cn%22%0A                + %22%5C%5C%5B (%5C%5CS+) , (%5C%5CS+), (%5C%5CS+)%5C%5C%5D$%22%0A        );%0A        Matcher matcher = pattern.matcher(result);%0A        boolean valid = matcher.matches();%0A        Assert.assertTrue(valid);%0A%0A        String txText = matcher.group(1);%0A        float tx = Float.parseFloat(txText);%0A        Assert.assertEquals(12f, tx, 1e-5f);%0A%0A        String rzText = matcher.group(6);%0A        float rz = Float.parseFloat(rzText);%0A        Assert.assertEquals(-0.8f, rz, 1e-6f);%0A%0A        String szText = matcher.group(10);%0A        float sz = Float.parseFloat(szText);%0A        Assert.assertEquals(1.7f, sz, 2e-6f);%0A    %7D%0A%7D%0A

add tests for Transform.toString()