http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/ab15d45b/juneau-core-test/src/test/java/org/apache/juneau/svl/vars/IfVarTest.java ---------------------------------------------------------------------- diff --git a/juneau-core-test/src/test/java/org/apache/juneau/svl/vars/IfVarTest.java b/juneau-core-test/src/test/java/org/apache/juneau/svl/vars/IfVarTest.java deleted file mode 100755 index 41f67b7..0000000 --- a/juneau-core-test/src/test/java/org/apache/juneau/svl/vars/IfVarTest.java +++ /dev/null @@ -1,46 +0,0 @@ -// *************************************************************************************************************************** -// * 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.juneau.svl.vars; - -import static org.junit.Assert.*; - -import org.apache.juneau.svl.*; -import org.junit.*; - -@SuppressWarnings("javadoc") -public class IfVarTest { - - //==================================================================================================== - // test - Basic tests - //==================================================================================================== - @Test - public void test() throws Exception { - VarResolver vr = new VarResolverBuilder().vars(IfVar.class, SystemPropertiesVar.class).build(); - - for (String test : new String[]{"","0","false","FALSE","f","F","foobar"}) { - System.setProperty("IfVarTest.test", test); - assertEquals("NO", vr.resolve("$IF{$S{IfVarTest.test},YES,NO}")); - assertEquals("x NO x", vr.resolve("x $IF{ $S{ IfVarTest.test } , YES , NO } x")); - assertEquals("", vr.resolve("$IF{$S{IfVarTest.test},YES}")); - assertEquals("x x", vr.resolve("x $IF{ $S{ IfVarTest.test } , YES } x")); - } - - for (String test : new String[]{"1","true","TRUE","t","T"}) { - System.setProperty("IfVarTest.test", test); - assertEquals("YES", vr.resolve("$IF{$S{IfVarTest.test},YES,NO}")); - assertEquals("YES", vr.resolve("$IF{$S{IfVarTest.test},YES}")); - assertEquals("x YES x", vr.resolve("x $IF{ $S{ IfVarTest.test } , YES , NO } x")); - assertEquals("x YES x", vr.resolve("x $IF{ $S{ IfVarTest.test } , YES } x")); - } - } -}
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/ab15d45b/juneau-core-test/src/test/java/org/apache/juneau/svl/vars/SwitchVarTest.java ---------------------------------------------------------------------- diff --git a/juneau-core-test/src/test/java/org/apache/juneau/svl/vars/SwitchVarTest.java b/juneau-core-test/src/test/java/org/apache/juneau/svl/vars/SwitchVarTest.java deleted file mode 100644 index 62167dc..0000000 --- a/juneau-core-test/src/test/java/org/apache/juneau/svl/vars/SwitchVarTest.java +++ /dev/null @@ -1,53 +0,0 @@ -// *************************************************************************************************************************** -// * 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.juneau.svl.vars; - -import static org.junit.Assert.*; - -import org.apache.juneau.svl.*; -import org.junit.*; - -@SuppressWarnings("javadoc") -public class SwitchVarTest { - - //==================================================================================================== - // test - Basic tests - //==================================================================================================== - @Test - public void test() throws Exception { - VarResolver vr = new VarResolverBuilder().vars(SwitchVar.class, SystemPropertiesVar.class).build(); - - System.setProperty("SwitchVarTest.test", "foobar"); - - assertEquals("YES", vr.resolve("$SW{$S{SwitchVarTest.test},foobar,YES}")); - assertEquals("YES", vr.resolve("$SW{ $S{ SwitchVarTest.test } , foobar , YES }")); - assertEquals("", vr.resolve("$SW{$S{SwitchVarTest.test},foobar2,YES}")); - assertEquals("NO", vr.resolve("$SW{$S{SwitchVarTest.test},foobar2,YES,NO}")); - assertEquals("NO", vr.resolve("$SW{ $S{ SwitchVarTest.test } , foobar2 , YES , NO }")); - - assertEquals("YES", vr.resolve("$SW{$S{SwitchVarTest.test},foo*,YES,NO}")); - assertEquals("YES", vr.resolve("$SW{$S{SwitchVarTest.test},*bar,YES,NO}")); - assertEquals("YES", vr.resolve("$SW{$S{SwitchVarTest.test},*,YES,NO}")); - assertEquals("YES", vr.resolve("$SW{$S{SwitchVarTest.test},??????,YES,NO}")); - - assertEquals("NO", vr.resolve("$SW{$S{SwitchVarTest.test},foox*,YES,NO}")); - assertEquals("NO", vr.resolve("$SW{$S{SwitchVarTest.test},*xbar,YES,NO}")); - assertEquals("NO", vr.resolve("$SW{$S{SwitchVarTest.test},?????,YES,NO}")); - assertEquals("NO", vr.resolve("$SW{$S{SwitchVarTest.test},???????,YES,NO}")); - - assertEquals("YES2", vr.resolve("$SW{$S{SwitchVarTest.test},foox*,YES1,foo*,YES2}")); - assertEquals("YES2", vr.resolve("$SW{$S{SwitchVarTest.test},foox*,YES1,foo*,YES2,NO}")); - - assertEquals("NO", vr.resolve("$SW{$S{SwitchVarTest.test},foox*,YES1,fooy*,YES2,NO}")); - } -} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/ab15d45b/juneau-core-test/src/test/java/org/apache/juneau/test/pojos/ABean.java ---------------------------------------------------------------------- diff --git a/juneau-core-test/src/test/java/org/apache/juneau/test/pojos/ABean.java b/juneau-core-test/src/test/java/org/apache/juneau/test/pojos/ABean.java deleted file mode 100644 index aa6a724..0000000 --- a/juneau-core-test/src/test/java/org/apache/juneau/test/pojos/ABean.java +++ /dev/null @@ -1,24 +0,0 @@ -// *************************************************************************************************************************** -// * 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.juneau.test.pojos; - -public class ABean { - public int a; - public String b; - - public ABean init() { - this.a = 1; - this.b = "foo"; - return this; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/ab15d45b/juneau-core-test/src/test/java/org/apache/juneau/test/pojos/Constants.java ---------------------------------------------------------------------- diff --git a/juneau-core-test/src/test/java/org/apache/juneau/test/pojos/Constants.java b/juneau-core-test/src/test/java/org/apache/juneau/test/pojos/Constants.java deleted file mode 100644 index ccfef31..0000000 --- a/juneau-core-test/src/test/java/org/apache/juneau/test/pojos/Constants.java +++ /dev/null @@ -1,25 +0,0 @@ -// *************************************************************************************************************************** -// * 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.juneau.test.pojos; - -/** - * Description. - * <p> - * - * @author James Bognar (james.bog...@salesforce.com) - */ -public class Constants { - - public static final String SWAP = "swap-~!@#$%^&*()_+`-={}[]|:;\"<,>.?/"; - -} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/ab15d45b/juneau-core-test/src/test/java/org/apache/juneau/test/pojos/ImplicitSwappedPojo.java ---------------------------------------------------------------------- diff --git a/juneau-core-test/src/test/java/org/apache/juneau/test/pojos/ImplicitSwappedPojo.java b/juneau-core-test/src/test/java/org/apache/juneau/test/pojos/ImplicitSwappedPojo.java deleted file mode 100644 index cd1bc0d..0000000 --- a/juneau-core-test/src/test/java/org/apache/juneau/test/pojos/ImplicitSwappedPojo.java +++ /dev/null @@ -1,35 +0,0 @@ -// *************************************************************************************************************************** -// * 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.juneau.test.pojos; - -import static org.apache.juneau.test.pojos.Constants.*; - -import org.apache.juneau.annotation.*; - -@BeanIgnore -public class ImplicitSwappedPojo { - public boolean wasUnswapped; - - @Override - public String toString() { - return SWAP; - } - - public ImplicitSwappedPojo() {} - - - public ImplicitSwappedPojo(String fromString) { - if (fromString.equals(SWAP)) - wasUnswapped = true; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/ab15d45b/juneau-core-test/src/test/java/org/apache/juneau/test/pojos/SwappedPojo.java ---------------------------------------------------------------------- diff --git a/juneau-core-test/src/test/java/org/apache/juneau/test/pojos/SwappedPojo.java b/juneau-core-test/src/test/java/org/apache/juneau/test/pojos/SwappedPojo.java deleted file mode 100644 index 605fd25..0000000 --- a/juneau-core-test/src/test/java/org/apache/juneau/test/pojos/SwappedPojo.java +++ /dev/null @@ -1,20 +0,0 @@ -// *************************************************************************************************************************** -// * 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.juneau.test.pojos; - -import org.apache.juneau.annotation.*; - -@Pojo(swap=SwappedPojoSwap.class) -public class SwappedPojo { - public boolean wasUnswapped; -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/ab15d45b/juneau-core-test/src/test/java/org/apache/juneau/test/pojos/SwappedPojoSwap.java ---------------------------------------------------------------------- diff --git a/juneau-core-test/src/test/java/org/apache/juneau/test/pojos/SwappedPojoSwap.java b/juneau-core-test/src/test/java/org/apache/juneau/test/pojos/SwappedPojoSwap.java deleted file mode 100644 index 950b754..0000000 --- a/juneau-core-test/src/test/java/org/apache/juneau/test/pojos/SwappedPojoSwap.java +++ /dev/null @@ -1,35 +0,0 @@ -// *************************************************************************************************************************** -// * 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.juneau.test.pojos; - -import static org.apache.juneau.test.pojos.Constants.*; - -import org.apache.juneau.*; -import org.apache.juneau.parser.*; -import org.apache.juneau.serializer.*; -import org.apache.juneau.transform.*; - -public class SwappedPojoSwap extends PojoSwap<SwappedPojo,String> { - @Override - public String swap(BeanSession session, SwappedPojo c) throws SerializeException { - return SWAP; - } - - @Override - public SwappedPojo unswap(BeanSession session, String f, ClassMeta<?> hint) throws ParseException { - SwappedPojo c = new SwappedPojo(); - if (f.equals(SWAP)) - c.wasUnswapped = true; - return c; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/ab15d45b/juneau-core-test/src/test/java/org/apache/juneau/test/pojos/TestEnum.java ---------------------------------------------------------------------- diff --git a/juneau-core-test/src/test/java/org/apache/juneau/test/pojos/TestEnum.java b/juneau-core-test/src/test/java/org/apache/juneau/test/pojos/TestEnum.java deleted file mode 100644 index 63368a4..0000000 --- a/juneau-core-test/src/test/java/org/apache/juneau/test/pojos/TestEnum.java +++ /dev/null @@ -1,17 +0,0 @@ -// *************************************************************************************************************************** -// * 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.juneau.test.pojos; - -public enum TestEnum { - ONE,TWO,THREE -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/ab15d45b/juneau-core-test/src/test/java/org/apache/juneau/test/pojos/TypedBean.java ---------------------------------------------------------------------- diff --git a/juneau-core-test/src/test/java/org/apache/juneau/test/pojos/TypedBean.java b/juneau-core-test/src/test/java/org/apache/juneau/test/pojos/TypedBean.java deleted file mode 100644 index 2a50d98..0000000 --- a/juneau-core-test/src/test/java/org/apache/juneau/test/pojos/TypedBean.java +++ /dev/null @@ -1,17 +0,0 @@ -// *************************************************************************************************************************** -// * 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.juneau.test.pojos; - -@org.apache.juneau.annotation.Bean(beanDictionary={TypedBeanImpl.class}) -public interface TypedBean { -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/ab15d45b/juneau-core-test/src/test/java/org/apache/juneau/test/pojos/TypedBeanImpl.java ---------------------------------------------------------------------- diff --git a/juneau-core-test/src/test/java/org/apache/juneau/test/pojos/TypedBeanImpl.java b/juneau-core-test/src/test/java/org/apache/juneau/test/pojos/TypedBeanImpl.java deleted file mode 100644 index 7b00644..0000000 --- a/juneau-core-test/src/test/java/org/apache/juneau/test/pojos/TypedBeanImpl.java +++ /dev/null @@ -1,25 +0,0 @@ -// *************************************************************************************************************************** -// * 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.juneau.test.pojos; - -@org.apache.juneau.annotation.Bean(typeName="TypedBeanImpl", sort=true) -public class TypedBeanImpl implements TypedBean { - public int a; - public String b; - - public TypedBeanImpl init() { - this.a = 1; - this.b = "foo"; - return this; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/ab15d45b/juneau-core-test/src/test/java/org/apache/juneau/testbeans/PrimitiveAtomicObjectsBean.java ---------------------------------------------------------------------- diff --git a/juneau-core-test/src/test/java/org/apache/juneau/testbeans/PrimitiveAtomicObjectsBean.java b/juneau-core-test/src/test/java/org/apache/juneau/testbeans/PrimitiveAtomicObjectsBean.java deleted file mode 100755 index 324a44f..0000000 --- a/juneau-core-test/src/test/java/org/apache/juneau/testbeans/PrimitiveAtomicObjectsBean.java +++ /dev/null @@ -1,74 +0,0 @@ -// *************************************************************************************************************************** -// * 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.juneau.testbeans; - -import java.util.*; -import java.util.concurrent.atomic.*; - -import org.apache.juneau.utils.*; - -/** - * Test bean fields of type AtomicInteger and AtomicLong. - * Note that Jena parsers cannot handle these types, so we only test non-Jena parsers. - */ -@SuppressWarnings({"javadoc"}) -public class PrimitiveAtomicObjectsBean { - - // primitive objects - public AtomicInteger poAtomicInteger; - public AtomicLong poAtomicLong; - - // uninitialized primitive objects - public AtomicInteger pouAtomicInteger; - public AtomicLong pouAtomicLong; - - // primitive object arrays - public AtomicInteger[][] poaAtomicInteger; - public AtomicLong[][] poaAtomicLong; - - // primitive object arrays - public AtomicInteger[][] poauAtomicInteger; - public AtomicLong[][] poauAtomicLong; - - // Anonymous list of primitives (types not erased on objects - public List<AtomicInteger[]> poalAtomicInteger; - public List<AtomicLong[]> poalAtomicLong; - - // Regular list of primitives (types erased on objects) - public List<AtomicInteger[]> polAtomicInteger; - public List<AtomicLong[]> polAtomicLong; - - public PrimitiveAtomicObjectsBean init() { - // primitive objects - poAtomicInteger = new AtomicInteger(1); - poAtomicLong = new AtomicLong(2); - - // primitive object arrays - poaAtomicInteger = new AtomicInteger[][]{{new AtomicInteger(1)}, {new AtomicInteger(2)}, null}; - poaAtomicLong = new AtomicLong[][]{{new AtomicLong(1)}, {new AtomicLong(2)}, null}; - - // Anonymous list of primitives - poalAtomicInteger = new AList<AtomicInteger[]>().append(new AtomicInteger[]{new AtomicInteger(1)}).append(null); - poalAtomicLong = new AList<AtomicLong[]>().append(new AtomicLong[]{new AtomicLong(1)}).append(null); - - // Regular list of primitives - polAtomicInteger = new ArrayList<AtomicInteger[]>(); - polAtomicInteger.add(new AtomicInteger[]{new AtomicInteger(1)}); - polAtomicInteger.add(null); - polAtomicLong = new ArrayList<AtomicLong[]>(); - polAtomicLong.add(new AtomicLong[]{new AtomicLong(1)}); - polAtomicLong.add(null); - - return this; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/ab15d45b/juneau-core-test/src/test/java/org/apache/juneau/testbeans/PrimitiveObjectsBean.java ---------------------------------------------------------------------- diff --git a/juneau-core-test/src/test/java/org/apache/juneau/testbeans/PrimitiveObjectsBean.java b/juneau-core-test/src/test/java/org/apache/juneau/testbeans/PrimitiveObjectsBean.java deleted file mode 100755 index 9eacaa6..0000000 --- a/juneau-core-test/src/test/java/org/apache/juneau/testbeans/PrimitiveObjectsBean.java +++ /dev/null @@ -1,178 +0,0 @@ -// *************************************************************************************************************************** -// * 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.juneau.testbeans; - -import java.math.*; -import java.util.*; - -import org.apache.juneau.utils.*; - -@SuppressWarnings({"javadoc"}) -public class PrimitiveObjectsBean { - - // primitive objects - public Boolean poBoolean; - public Byte poByte; - public Character poChar; - public Short poShort; - public Integer poInt; - public Long poLong; - public Float poFloat; - public Double poDouble; - public Number poNumber; - public BigInteger poBigInteger; - public BigDecimal poBigDecimal; - - // uninitialized primitive objects - public Boolean pouBoolean; - public Byte pouByte; - public Character pouChar; - public Short pouShort; - public Integer pouInt; - public Long pouLong; - public Float pouFloat; - public Double pouDouble; - public Number pouNumber; - public BigInteger pouBigInteger; - public BigDecimal pouBigDecimal; - - // primitive object arrays - public Boolean[][] poaBoolean; - public Byte[][] poaByte; - public Character[][] poaChar; - public Short[][] poaShort; - public Integer[][] poaInt; - public Long[][] poaLong; - public Float[][] poaFloat; - public Double[][] poaDouble; - public Number[][] poaNumber; - public BigInteger[][] poaBigInteger; - public BigDecimal[][] poaBigDecimal; - - // primitive object arrays - public Boolean[][] poauBoolean; - public Byte[][] poauByte; - public Character[][] poauChar; - public Short[][] poauShort; - public Integer[][] poauInt; - public Long[][] poauLong; - public Float[][] poauFloat; - public Double[][] poauDouble; - public Number[][] poauNumber; - public BigInteger[][] poauBigInteger; - public BigDecimal[][] poauBigDecimal; - - // Anonymous list of primitives (types not erased on objects - public List<Boolean[]> poalBoolean; - public List<Byte[]> poalByte; - public List<Character[]> poalChar; - public List<Short[]> poalShort; - public List<Integer[]> poalInt; - public List<Long[]> poalLong; - public List<Float[]> poalFloat; - public List<Double[]> poalDouble; - public List<Number[]> poalNumber; - public List<BigInteger[]> poalBigInteger; - public List<BigDecimal[]> poalBigDecimal; - - // Regular list of primitives (types erased on objects) - public List<Boolean[]> polBoolean; - public List<Byte[]> polByte; - public List<Character[]> polChar; - public List<Short[]> polShort; - public List<Integer[]> polInt; - public List<Long[]> polLong; - public List<Float[]> polFloat; - public List<Double[]> polDouble; - public List<Number[]> polNumber; - public List<BigInteger[]> polBigInteger; - public List<BigDecimal[]> polBigDecimal; - - public PrimitiveObjectsBean init() { - // primitive objects - poBoolean = true; - poByte = 1; - poChar = 'a'; - poShort = 2; - poInt = 3; - poLong = 4l; - poFloat = 5f; - poDouble = 6d; - poNumber = 7; - poBigInteger = new BigInteger("8"); - poBigDecimal = new BigDecimal("9"); - - // primitive object arrays - poaBoolean = new Boolean[][]{{true},{false},null}; - poaByte = new Byte[][]{{1},{2},null}; - poaChar = new Character[][]{{'a'},{'b'},null}; - poaShort = new Short[][]{{1},{2},null}; - poaInt = new Integer[][]{{1},{2},null}; - poaLong = new Long[][]{{1l},{2l},null}; - poaFloat = new Float[][]{{1f},{2f},null}; - poaDouble = new Double[][]{{1d},{2d},null}; - poaNumber = new Number[][]{{1},{2},null}; - poaBigInteger = new BigInteger[][]{{new BigInteger("1")}, {new BigInteger("2")}, null}; - poaBigDecimal = new BigDecimal[][]{{new BigDecimal("1")}, {new BigDecimal("2")}, null}; - - // Anonymous list of primitives - poalBoolean = new AList<Boolean[]>().append(new Boolean[]{Boolean.TRUE}).append(null); - poalByte = new AList<Byte[]>().append(new Byte[]{1}).append(null); - poalChar = new AList<Character[]>().append(new Character[]{'a'}).append(null); - poalShort = new AList<Short[]>().append(new Short[]{1}).append(null); - poalInt = new AList<Integer[]>().append(new Integer[]{1}).append(null); - poalLong = new AList<Long[]>().append(new Long[]{1l}).append(null); - poalFloat = new AList<Float[]>().append(new Float[]{1f}).append(null); - poalDouble = new AList<Double[]>().append(new Double[]{1d}).append(null); - poalNumber = new AList<Number[]>().append(new Integer[]{1}).append(null); - poalBigInteger = new AList<BigInteger[]>().append(new BigInteger[]{new BigInteger("1")}).append(null); - poalBigDecimal = new AList<BigDecimal[]>().append(new BigDecimal[]{new BigDecimal("1")}).append(null); - - // Regular list of primitives - polBoolean = new ArrayList<Boolean[]>(); - polBoolean.add(new Boolean[]{Boolean.TRUE}); - polBoolean.add(null); - polByte = new ArrayList<Byte[]>(); - polByte.add(new Byte[]{1}); - polByte.add(null); - polChar = new ArrayList<Character[]>(); - polChar.add(new Character[]{'a'}); - polChar.add(null); - polShort = new ArrayList<Short[]>(); - polShort.add(new Short[]{1}); - polShort.add(null); - polInt = new ArrayList<Integer[]>(); - polInt.add(new Integer[]{1}); - polInt.add(null); - polLong = new ArrayList<Long[]>(); - polLong.add(new Long[]{1l}); - polLong.add(null); - polFloat = new ArrayList<Float[]>(); - polFloat.add(new Float[]{1f}); - polFloat.add(null); - polDouble = new ArrayList<Double[]>(); - polDouble.add(new Double[]{1d}); - polDouble.add(null); - polNumber = new ArrayList<Number[]>(); - polNumber.add(new Number[]{1}); - polNumber.add(null); - polBigInteger = new ArrayList<BigInteger[]>(); - polBigInteger.add(new BigInteger[]{new BigInteger("1")}); - polBigInteger.add(null); - polBigDecimal = new ArrayList<BigDecimal[]>(); - polBigDecimal.add(new BigDecimal[]{new BigDecimal("1")}); - polBigDecimal.add(null); - - return this; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/ab15d45b/juneau-core-test/src/test/java/org/apache/juneau/testbeans/TestURI.java ---------------------------------------------------------------------- diff --git a/juneau-core-test/src/test/java/org/apache/juneau/testbeans/TestURI.java b/juneau-core-test/src/test/java/org/apache/juneau/testbeans/TestURI.java deleted file mode 100755 index b257cb5..0000000 --- a/juneau-core-test/src/test/java/org/apache/juneau/testbeans/TestURI.java +++ /dev/null @@ -1,70 +0,0 @@ -// *************************************************************************************************************************** -// * 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.juneau.testbeans; - -import java.net.*; -import java.net.URI; - -import org.apache.juneau.annotation.*; -import org.apache.juneau.jena.annotation.*; -import org.apache.juneau.xml.annotation.*; - -@SuppressWarnings("javadoc") -@Bean(sort=true) -public class TestURI { - @org.apache.juneau.annotation.URI - @Rdf(beanUri=true) - @Xml(format=XmlFormat.ATTR) - public String f0 = "f0/x0"; - - public URI f1, f2, f3; - - @org.apache.juneau.annotation.URI - public String f4, f5, f6; - - public URL f7; - - public TestURIb f8; - - public String fa, fb, fc, fd, fe; - - @org.apache.juneau.annotation.URI - public String getF9() { - return "f9/x9"; - } - - public TestURI() throws Exception { - f1 = new URI("f1/x1"); - f2 = new URI("/f2/x2"); - f3 = new URI("http://www.apache.org/f3/x3"); - f4 = "f4/x4"; - f5 = "/f5/x5"; - f6 = "http://www.apache.org/f6/x6"; - f7 = new URL("http://www.apache.org/f7/x7"); - f8 = new TestURIb(); - fa = "http://www.apache.org/fa/xa#MY_LABEL"; - fb = "http://www.apache.org/fb/xb?label=MY_LABEL&foo=bar"; - fc = "http://www.apache.org/fc/xc?foo=bar&label=MY_LABEL"; - fd = "http://www.apache.org/fd/xd?label2=MY_LABEL&foo=bar"; - fe = "http://www.apache.org/fe/xe?foo=bar&label2=MY_LABEL"; - } - - @org.apache.juneau.annotation.URI - public static class TestURIb { - @Override /* Object */ - public String toString() { - return "f8/x8"; - } - } -} -