You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by br...@apache.org on 2014/12/30 13:08:05 UTC

svn commit: r1648514 - /commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/

Author: britter
Date: Tue Dec 30 12:08:04 2014
New Revision: 1648514

URL: http://svn.apache.org/r1648514
Log:
Make sure color constants are correctly constructed

Added:
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorCieLabTest.java   (with props)
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorCieLchTest.java   (with props)
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorCieLuvTest.java   (with props)
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorCmyTest.java   (with props)
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorCmykTest.java   (with props)
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorHslTest.java   (with props)
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorHsvTest.java   (with props)
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorHunterLabTest.java   (with props)
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorXyzTest.java   (with props)

Added: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorCieLabTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorCieLabTest.java?rev=1648514&view=auto
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorCieLabTest.java (added)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorCieLabTest.java Tue Dec 30 12:08:04 2014
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.commons.imaging.color;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class ColorCieLabTest {
+
+    private ColorCieLab color;
+
+    @Before
+    public void setUp() throws Exception {
+        color = new ColorCieLab(1.0, 2.0, 3.0);
+    }
+
+    @Test
+    public void testLAssignement() throws Exception {
+        assertEquals(1.0, color.L, 0.0);
+    }
+
+    @Test
+    public void testAAssignement() throws Exception {
+        assertEquals(2.0, color.a, 0.0);
+    }
+
+    @Test
+    public void testBAssignement() throws Exception {
+        assertEquals(3.0, color.b, 0.0);
+    }
+
+    @Test
+    public void testToString() throws Exception {
+        assertEquals("{L: 1.0, a: 2.0, b: 3.0}", color.toString());
+    }
+}

Propchange: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorCieLabTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorCieLchTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorCieLchTest.java?rev=1648514&view=auto
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorCieLchTest.java (added)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorCieLchTest.java Tue Dec 30 12:08:04 2014
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.commons.imaging.color;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class ColorCieLchTest {
+
+    private ColorCieLch color;
+
+    @Before
+    public void setUp() throws Exception {
+        color = new ColorCieLch(1.0, 2.0, 3.0);
+    }
+
+    @Test
+    public void testLAssignment() throws Exception {
+        assertEquals(1.0, color.L, 0.0);
+    }
+
+    @Test
+    public void testCAssignment() throws Exception {
+        assertEquals(2.0, color.C, 0.0);
+    }
+
+    @Test
+    public void testHAssignment() throws Exception {
+        assertEquals(3.0, color.H, 0.0);
+    }
+
+    @Test
+    public void testToString() throws Exception {
+        assertEquals("{L: 1.0, C: 2.0, H: 3.0}", color.toString());
+    }
+}

Propchange: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorCieLchTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorCieLuvTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorCieLuvTest.java?rev=1648514&view=auto
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorCieLuvTest.java (added)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorCieLuvTest.java Tue Dec 30 12:08:04 2014
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.commons.imaging.color;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class ColorCieLuvTest {
+
+    private ColorCieLuv color;
+
+    @Before
+    public void setUp() throws Exception {
+        color = new ColorCieLuv(1.0, 2.0, 3.0);
+    }
+
+    @Test
+    public void testLAssignment() throws Exception {
+        assertEquals(1.0, color.L, 0.0);
+    }
+
+    @Test
+    public void testUAssignment() throws Exception {
+        assertEquals(2.0, color.u, 0.0);
+    }
+
+    @Test
+    public void testVAssignment() throws Exception {
+        assertEquals(3.0, color.v, 0.0);
+    }
+
+    @Test
+    public void testToString() throws Exception {
+        assertEquals("{L: 1.0, u: 2.0, v: 3.0}", color.toString());
+    }
+}

Propchange: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorCieLuvTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorCmyTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorCmyTest.java?rev=1648514&view=auto
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorCmyTest.java (added)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorCmyTest.java Tue Dec 30 12:08:04 2014
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.commons.imaging.color;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class ColorCmyTest {
+
+    private ColorCmy color;
+
+    @Before
+    public void setUp() throws Exception {
+        color = new ColorCmy(1.0, 2.0, 3.0);
+    }
+
+    @Test
+    public void testCAssignment() throws Exception {
+        assertEquals(1.0, color.C, 0.0);
+    }
+
+    @Test
+    public void testMAssignment() throws Exception {
+        assertEquals(2.0, color.M, 0.0);
+    }
+
+    @Test
+    public void testYAssignment() throws Exception {
+        assertEquals(3.0, color.Y, 0.0);
+    }
+
+    @Test
+    public void testToString() throws Exception {
+        assertEquals("{C: 1.0, M: 2.0, Y: 3.0}", color.toString());
+    }
+}

Propchange: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorCmyTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorCmykTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorCmykTest.java?rev=1648514&view=auto
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorCmykTest.java (added)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorCmykTest.java Tue Dec 30 12:08:04 2014
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.commons.imaging.color;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class ColorCmykTest {
+
+    private ColorCmyk color;
+
+    @Before
+    public void setUp() throws Exception {
+        color = new ColorCmyk(1.0, 2.0, 3.0, 4.0);
+    }
+
+    @Test
+    public void testCAssignment() throws Exception {
+        assertEquals(1.0, color.C, 0.0);
+    }
+
+    @Test
+    public void testMAssignment() throws Exception {
+        assertEquals(2.0, color.M, 0.0);
+    }
+
+    @Test
+    public void testYAssignment() throws Exception {
+        assertEquals(3.0, color.Y, 0.0);
+    }
+
+    @Test
+    public void testKAssignment() throws Exception {
+        assertEquals(4.0, color.K, 0.0);
+    }
+
+    @Test
+    public void testToString() throws Exception {
+        assertEquals("{C: 1.0, M: 2.0, Y: 3.0, K: 4.0}", color.toString());
+    }
+}

Propchange: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorCmykTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorHslTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorHslTest.java?rev=1648514&view=auto
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorHslTest.java (added)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorHslTest.java Tue Dec 30 12:08:04 2014
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.commons.imaging.color;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class ColorHslTest {
+
+    private ColorHsl color;
+
+    @Before
+    public void setUp() throws Exception {
+        color = new ColorHsl(1.0, 2.0, 3.0);
+    }
+
+    @Test
+    public void testHAssignment() throws Exception {
+        assertEquals(1.0, color.H, 0.0);
+    }
+
+    @Test
+    public void testSAssignment() throws Exception {
+        assertEquals(2.0, color.S, 0.0);
+    }
+
+    @Test
+    public void testLAssignment() throws Exception {
+        assertEquals(3.0, color.L, 0.0);
+    }
+
+    @Test
+    public void testToString() throws Exception {
+        assertEquals("{H: 1.0, S: 2.0, L: 3.0}", color.toString());
+    }
+}

Propchange: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorHslTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorHsvTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorHsvTest.java?rev=1648514&view=auto
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorHsvTest.java (added)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorHsvTest.java Tue Dec 30 12:08:04 2014
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.commons.imaging.color;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class ColorHsvTest {
+
+    private ColorHsv color;
+
+    @Before
+    public void setUp() throws Exception {
+        color = new ColorHsv(1.0, 2.0, 3.0);
+    }
+
+    @Test
+    public void testHAssignment() throws Exception {
+        assertEquals(1.0, color.H, 0.0);
+    }
+
+    @Test
+    public void testSAssignment() throws Exception {
+        assertEquals(2.0, color.S, 0.0);
+    }
+
+    @Test
+    public void testVAssignment() throws Exception {
+        assertEquals(3.0, color.V, 0.0);
+    }
+
+    @Test
+    public void testToString() throws Exception {
+        assertEquals("{H: 1.0, S: 2.0, V: 3.0}", color.toString());
+    }
+}

Propchange: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorHsvTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorHunterLabTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorHunterLabTest.java?rev=1648514&view=auto
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorHunterLabTest.java (added)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorHunterLabTest.java Tue Dec 30 12:08:04 2014
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.commons.imaging.color;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class ColorHunterLabTest {
+
+    private ColorHunterLab color;
+
+    @Before
+    public void setUp() throws Exception {
+        color = new ColorHunterLab(1.0, 2.0, 3.0);
+    }
+
+    @Test
+    public void testLAssignment() throws Exception {
+        assertEquals(1.0, color.L, 0.0);
+    }
+
+    @Test
+    public void testAAssignment() throws Exception {
+        assertEquals(2.0, color.a, 0.0);
+    }
+
+    @Test
+    public void testBAssignment() throws Exception {
+        assertEquals(3.0, color.b, 0.0);
+    }
+
+    @Test
+    public void testToString() throws Exception {
+        assertEquals("{L: 1.0, a: 2.0, b: 3.0}", color.toString());
+    }
+}

Propchange: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorHunterLabTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorXyzTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorXyzTest.java?rev=1648514&view=auto
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorXyzTest.java (added)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorXyzTest.java Tue Dec 30 12:08:04 2014
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.commons.imaging.color;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class ColorXyzTest {
+
+    private ColorXyz color;
+
+    @Before
+    public void setUp() throws Exception {
+        color = new ColorXyz(1.0, 2.0, 3.0);
+    }
+
+    @Test
+    public void testXAssignment() throws Exception {
+        assertEquals(1.0, color.X, 0.0);
+    }
+
+    @Test
+    public void testYAssignment() throws Exception {
+        assertEquals(2.0, color.Y, 0.0);
+    }
+
+    @Test
+    public void testZAssignment() throws Exception {
+        assertEquals(3.0, color.Z, 0.0);
+    }
+
+    @Test
+    public void testToString() throws Exception {
+        assertEquals("{X: 1.0, Y: 2.0, Z: 3.0}", color.toString());
+    }
+}

Propchange: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/color/ColorXyzTest.java
------------------------------------------------------------------------------
    svn:eol-style = native