You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mc...@apache.org on 2011/10/22 03:20:55 UTC
svn commit: r1187621 [3/3] - in /commons/proper/ognl/performance-analysis:
./ src/ src/main/ src/main/java/ src/main/java/org/
src/main/java/org/apache/ src/main/java/org/apache/commons/
src/main/java/org/apache/commons/ognl/ src/main/java/org/apache/c...
Added: commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/SecondBean.java
URL: http://svn.apache.org/viewvc/commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/SecondBean.java?rev=1187621&view=auto
==============================================================================
--- commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/SecondBean.java (added)
+++ commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/SecondBean.java Sat Oct 22 01:20:52 2011
@@ -0,0 +1,35 @@
+/*
+ * $Id: SecondBean.java 1103095 2011-05-14 13:18:29Z simonetripodi $
+ * 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.ognl.performance.objects;
+
+/**
+ */
+public class SecondBean
+ extends BaseBean
+{
+ public String getName()
+ {
+ return "SecondBean";
+ }
+
+}
Propchange: commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/SecondBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/SetterReturns.java
URL: http://svn.apache.org/viewvc/commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/SetterReturns.java?rev=1187621&view=auto
==============================================================================
--- commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/SetterReturns.java (added)
+++ commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/SetterReturns.java Sat Oct 22 01:20:52 2011
@@ -0,0 +1,40 @@
+/*
+ * $Id: SetterReturns.java 1103095 2011-05-14 13:18:29Z simonetripodi $
+ * 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.ognl.performance.objects;
+
+/**
+ *
+ */
+public class SetterReturns
+{
+
+ private String _value = "";
+
+ public String getValue()
+ {
+ return _value;
+ }
+
+ public SetterReturns setValue( String value )
+ {
+ _value += value;
+ return this;
+ }
+}
Propchange: commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/SetterReturns.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/Simple.java
URL: http://svn.apache.org/viewvc/commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/Simple.java?rev=1187621&view=auto
==============================================================================
--- commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/Simple.java (added)
+++ commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/Simple.java Sat Oct 22 01:20:52 2011
@@ -0,0 +1,226 @@
+/*
+ * $Id: Simple.java 1103095 2011-05-14 13:18:29Z simonetripodi $
+ * 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.ognl.performance.objects;
+
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.HashMap;
+import java.util.Map;
+
+public class Simple
+ extends Object
+{
+ private String stringValue = "test";
+
+ private float floatValue;
+
+ private int intValue;
+
+ private boolean booleanValue;
+
+ private BigInteger bigIntValue = BigInteger.valueOf( 0 );
+
+ private BigDecimal bigDecValue = new BigDecimal( 0.0 );
+
+ private Root root = new Root();
+
+ private Bean3 _bean;
+
+ private Bean2 _bean2;
+
+ private Object[] _array;
+
+ private Messages _messages;
+
+ public Simple()
+ {
+ Map src = new HashMap();
+ src.put( "test", "This is a test" );
+
+ _messages = new Messages( src );
+ }
+
+ public Simple( Bean3 bean )
+ {
+ _bean = bean;
+ }
+
+ public Simple( Bean2 bean )
+ {
+ _bean2 = bean;
+ }
+
+ public Simple( Object[] values )
+ {
+ super();
+ }
+
+ public Simple( String stringValue, float floatValue, int intValue )
+ {
+ super();
+ this.stringValue = stringValue;
+ this.floatValue = floatValue;
+ this.intValue = intValue;
+ }
+
+ public void setValues( String stringValue, float floatValue, int intValue )
+ {
+ this.stringValue = stringValue;
+ this.floatValue = floatValue;
+ this.intValue = intValue;
+ }
+
+ public String getStringValue()
+ {
+ return stringValue;
+ }
+
+ public void setStringValue( String value )
+ {
+ stringValue = value;
+ }
+
+ public float getFloatValue()
+ {
+ return floatValue;
+ }
+
+ public void setFloatValue( float value )
+ {
+ floatValue = value;
+ }
+
+ public int getIntValue()
+ {
+ return intValue;
+ }
+
+ public void setIntValue( int value )
+ {
+ intValue = value;
+ }
+
+ public boolean getValueIsTrue( Object currValue )
+ {
+ return true;
+ }
+
+ public boolean getBooleanValue()
+ {
+ return booleanValue;
+ }
+
+ public void setBooleanValue( boolean value )
+ {
+ booleanValue = value;
+ }
+
+ public BigInteger getBigIntValue()
+ {
+ return bigIntValue;
+ }
+
+ public void setArray( Object[] values )
+ {
+ _array = values;
+ }
+
+ public Object[] getArray()
+ {
+ return _array;
+ }
+
+ public void setBigIntValue( BigInteger value )
+ {
+ bigIntValue = value;
+ }
+
+ public BigDecimal getBigDecValue()
+ {
+ return bigDecValue;
+ }
+
+ public void setBigDecValue( BigDecimal value )
+ {
+ bigDecValue = value;
+ }
+
+ public Root getRootValue()
+ {
+ return root;
+ }
+
+ public Messages getMessages()
+ {
+ return _messages;
+ }
+
+ public int getOne()
+ {
+ return 1;
+ }
+
+ public int getTwo()
+ {
+ return 2;
+ }
+
+ public int getThree()
+ {
+ return 3;
+ }
+
+ public int getTestValue( int val )
+ {
+ return val + 1;
+ }
+
+ public boolean isEditorDisabled()
+ {
+ return false;
+ }
+
+ public boolean isDisabled()
+ {
+ return true;
+ }
+
+ public GetterMethods getMethodsTest()
+ {
+ return new GetterMethods();
+ }
+
+ public String getDisplayValue( int val )
+ {
+ return "test";
+ }
+
+ public boolean equals( Object other )
+ {
+
+ return false;
+ }
+
+ public boolean isThisVarArgsWorking( Object... arguments )
+ {
+ return true;
+ }
+}
Propchange: commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/Simple.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/SimpleEnum.java
URL: http://svn.apache.org/viewvc/commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/SimpleEnum.java?rev=1187621&view=auto
==============================================================================
--- commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/SimpleEnum.java (added)
+++ commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/SimpleEnum.java Sat Oct 22 01:20:52 2011
@@ -0,0 +1,41 @@
+/*
+ * $Id: SimpleEnum.java 1103095 2011-05-14 13:18:29Z simonetripodi $
+ * 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.ognl.performance.objects;
+
+/**
+ *
+ */
+public enum SimpleEnum
+{
+
+ ONE( 1 );
+
+ private int _value;
+
+ private SimpleEnum( int value )
+ {
+ _value = value;
+ }
+
+ public int getValue()
+ {
+ return _value;
+ }
+}
Propchange: commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/SimpleEnum.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/SimpleNumeric.java
URL: http://svn.apache.org/viewvc/commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/SimpleNumeric.java?rev=1187621&view=auto
==============================================================================
--- commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/SimpleNumeric.java (added)
+++ commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/SimpleNumeric.java Sat Oct 22 01:20:52 2011
@@ -0,0 +1,42 @@
+/*
+ * $Id: SimpleNumeric.java 1103095 2011-05-14 13:18:29Z simonetripodi $
+ * 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.ognl.performance.objects;
+
+/**
+ * Used for {@link org.apache.commons.ognl.test.PropertyArithmeticAndLogicalOperatorsTest}.
+ */
+public class SimpleNumeric
+{
+
+ public double getBudget()
+ {
+ return 140;
+ }
+
+ public double getTimeBilled()
+ {
+ return 24.12;
+ }
+
+ public String getTableSize()
+ {
+ return "10";
+ }
+}
Propchange: commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/SimpleNumeric.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/SubclassSyntheticObject.java
URL: http://svn.apache.org/viewvc/commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/SubclassSyntheticObject.java?rev=1187621&view=auto
==============================================================================
--- commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/SubclassSyntheticObject.java (added)
+++ commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/SubclassSyntheticObject.java Sat Oct 22 01:20:52 2011
@@ -0,0 +1,35 @@
+/*
+ * $Id: SubclassSyntheticObject.java 1103095 2011-05-14 13:18:29Z simonetripodi $
+ * 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.ognl.performance.objects;
+
+import java.util.ArrayList;
+
+/**
+ * Simple subclass.
+ */
+public class SubclassSyntheticObject
+ extends BaseSyntheticObject
+{
+
+ public ArrayList getList()
+ {
+ return new ArrayList();
+ }
+}
Propchange: commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/SubclassSyntheticObject.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/TestClass.java
URL: http://svn.apache.org/viewvc/commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/TestClass.java?rev=1187621&view=auto
==============================================================================
--- commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/TestClass.java (added)
+++ commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/TestClass.java Sat Oct 22 01:20:52 2011
@@ -0,0 +1,28 @@
+/*
+ * $Id: TestClass.java 1103095 2011-05-14 13:18:29Z simonetripodi $
+ * 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.ognl.performance.objects;
+
+/**
+ *
+ */
+public abstract class TestClass
+{
+
+}
Propchange: commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/TestClass.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/TestImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/TestImpl.java?rev=1187621&view=auto
==============================================================================
--- commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/TestImpl.java (added)
+++ commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/TestImpl.java Sat Oct 22 01:20:52 2011
@@ -0,0 +1,38 @@
+/*
+ * $Id: TestImpl.java 1103095 2011-05-14 13:18:29Z simonetripodi $
+ * 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.ognl.performance.objects;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ *
+ */
+public class TestImpl
+ extends TestClass
+{
+
+ public Map<String, String> getTheMap()
+ {
+ Map<String, String> map = new HashMap();
+ map.put( "key", "value" );
+ return map;
+ }
+}
Propchange: commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/TestImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/TestInherited1.java
URL: http://svn.apache.org/viewvc/commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/TestInherited1.java?rev=1187621&view=auto
==============================================================================
--- commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/TestInherited1.java (added)
+++ commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/TestInherited1.java Sat Oct 22 01:20:52 2011
@@ -0,0 +1,33 @@
+/*
+ * $Id: TestInherited1.java 1103095 2011-05-14 13:18:29Z simonetripodi $
+ * 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.ognl.performance.objects;
+
+/**
+ *
+ */
+public class TestInherited1
+ implements Inherited
+{
+
+ public String getMyString()
+ {
+ return "inherited1";
+ }
+}
Propchange: commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/TestInherited1.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/TestInherited2.java
URL: http://svn.apache.org/viewvc/commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/TestInherited2.java?rev=1187621&view=auto
==============================================================================
--- commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/TestInherited2.java (added)
+++ commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/TestInherited2.java Sat Oct 22 01:20:52 2011
@@ -0,0 +1,33 @@
+/*
+ * $Id: TestInherited2.java 1103095 2011-05-14 13:18:29Z simonetripodi $
+ * 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.ognl.performance.objects;
+
+/**
+ *
+ */
+public class TestInherited2
+ implements Inherited
+{
+
+ public String getMyString()
+ {
+ return "inherited2";
+ }
+}
Propchange: commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/TestInherited2.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/TestModel.java
URL: http://svn.apache.org/viewvc/commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/TestModel.java?rev=1187621&view=auto
==============================================================================
--- commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/TestModel.java (added)
+++ commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/TestModel.java Sat Oct 22 01:20:52 2011
@@ -0,0 +1,47 @@
+/*
+ * $Id: TestModel.java 1103095 2011-05-14 13:18:29Z simonetripodi $
+ * 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.ognl.performance.objects;
+
+/**
+ *
+ */
+public class TestModel
+{
+
+ public Copy getCopy()
+ {
+ return new Copy();
+ }
+
+ public Model getUnassignedCopyModel()
+ {
+ return new Model();
+ }
+
+ public boolean isCanApproveCopy()
+ {
+ return true;
+ }
+
+ public Entry getEntry()
+ {
+ return new Entry();
+ }
+}
Propchange: commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/TestModel.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/TreeContentProvider.java
URL: http://svn.apache.org/viewvc/commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/TreeContentProvider.java?rev=1187621&view=auto
==============================================================================
--- commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/TreeContentProvider.java (added)
+++ commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/TreeContentProvider.java Sat Oct 22 01:20:52 2011
@@ -0,0 +1,47 @@
+/*
+ * $Id: TreeContentProvider.java 1103095 2011-05-14 13:18:29Z simonetripodi $
+ * 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.ognl.performance.objects;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ *
+ */
+public class TreeContentProvider
+ implements ITreeContentProvider
+{
+
+ public Collection getChildren( Object parentElement )
+ {
+ return Collections.EMPTY_LIST;
+ }
+
+ public boolean hasChildren( Object parentElement )
+ {
+ return true;
+ }
+
+ public List getElements()
+ {
+ return Collections.EMPTY_LIST;
+ }
+}
Propchange: commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/TreeContentProvider.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/Two.java
URL: http://svn.apache.org/viewvc/commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/Two.java?rev=1187621&view=auto
==============================================================================
--- commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/Two.java (added)
+++ commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/Two.java Sat Oct 22 01:20:52 2011
@@ -0,0 +1,37 @@
+/*
+ * $Id: Two.java 1103095 2011-05-14 13:18:29Z simonetripodi $
+ * 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.ognl.performance.objects;
+
+/**
+ *
+ */
+public class Two
+{
+
+ public String getMessage( String mes )
+ {
+ return "[" + mes + "]";
+ }
+
+ public boolean hasChildren( String name )
+ {
+ return name.length() > 2;
+ }
+}
Propchange: commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/objects/Two.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/runtime/CommonsRuntimeWrapper.java
URL: http://svn.apache.org/viewvc/commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/runtime/CommonsRuntimeWrapper.java?rev=1187621&view=auto
==============================================================================
--- commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/runtime/CommonsRuntimeWrapper.java (added)
+++ commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/runtime/CommonsRuntimeWrapper.java Sat Oct 22 01:20:52 2011
@@ -0,0 +1,97 @@
+package org.apache.commons.ognl.performance.runtime;
+
+import org.apache.commons.ognl.OgnlRuntime;
+import org.apache.commons.ognl.internal.HashMapCacheFactory;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+
+/**
+ * User: Maurizio Cucchiara
+ * Date: 10/22/11
+ * Time: 12:38 AM
+ */
+public class CommonsRuntimeWrapper
+ implements RuntimeWrapper
+{
+ public CommonsRuntimeWrapper( )
+ {
+ OgnlRuntime.setCacheFactory( new HashMapCacheFactory() );
+ }
+
+ @Override
+ public void getFields( Class<?> c )
+ throws Exception
+ {
+ OgnlRuntime.getFields( c );
+ }
+
+ @Override
+ public void findParameterTypes( Class<?> targetClass, Method method )
+ throws Exception
+ {
+ OgnlRuntime.findParameterTypes( targetClass, method );
+ }
+
+ @Override
+ public void getConstructors( Class<?> c )
+ throws Exception
+ {
+ OgnlRuntime.getConstructors( c );
+ }
+
+ @Override
+ public void getMethods( Class<?> c, boolean staticMethods )
+ throws Exception
+ {
+ OgnlRuntime.getMethods( c, staticMethods );
+ }
+
+ @Override
+ public void getDeclaredMethods( Class<?> c, String propertyName, boolean setters )
+ throws Exception
+ {
+ OgnlRuntime.getDeclaredMethods( c, propertyName, setters );
+ }
+
+ @Override
+ public void getParameterTypes( Method method )
+ throws Exception
+ {
+ OgnlRuntime.getParameterTypes( method );
+ }
+
+ @Override
+ public void getParameterTypes( Constructor<?> constructor )
+ throws Exception
+ {
+ OgnlRuntime.getParameterTypes( constructor );
+ }
+
+ @Override
+ public void getPermission( Method method )
+ throws Exception
+ {
+ OgnlRuntime.getPermission( method );
+ }
+
+ @Override
+ public void getPrimitiveDefaultValue( Class<?> type )
+ throws Exception
+ {
+ OgnlRuntime.getPrimitiveDefaultValue( type );
+ }
+
+ @Override
+ public void invokeMethod( Object o, Method method, Object[] args )
+ throws Exception
+ {
+ OgnlRuntime.invokeMethod( o, method, args );
+ }
+
+ @Override
+ public void clearCache( )
+ {
+ OgnlRuntime.clearCache( );
+ }
+}
Propchange: commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/runtime/CommonsRuntimeWrapper.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/runtime/OldOgnlRuntimeWrapper.java
URL: http://svn.apache.org/viewvc/commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/runtime/OldOgnlRuntimeWrapper.java?rev=1187621&view=auto
==============================================================================
--- commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/runtime/OldOgnlRuntimeWrapper.java (added)
+++ commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/runtime/OldOgnlRuntimeWrapper.java Sat Oct 22 01:20:52 2011
@@ -0,0 +1,90 @@
+package org.apache.commons.ognl.performance.runtime;
+
+import ognl.OgnlRuntime;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+
+/**
+ * User: Maurizio Cucchiara
+ * Date: 10/22/11
+ * Time: 12:46 AM
+ */
+public class OldOgnlRuntimeWrapper
+ implements RuntimeWrapper
+{
+ @Override
+ public void getFields( Class<?> c )
+ throws Exception
+ {
+ OgnlRuntime.getFields( c );
+ }
+
+ @Override
+ public void findParameterTypes( Class<?> targetClass, Method method )
+ throws Exception
+ {
+ OgnlRuntime.findParameterTypes( targetClass, method );
+ }
+
+ @Override
+ public void getConstructors( Class<?> c )
+ throws Exception
+ {
+ OgnlRuntime.getConstructors( c );
+ }
+
+ @Override
+ public void getMethods( Class<?> c, boolean staticMethods )
+ throws Exception
+ {
+ OgnlRuntime.getMethods( c, staticMethods );
+ }
+
+ @Override
+ public void getDeclaredMethods( Class<?> c, String propertyName, boolean setters )
+ throws Exception
+ {
+ OgnlRuntime.getDeclaredMethods( c, propertyName, setters );
+ }
+
+ @Override
+ public void getParameterTypes( Method method )
+ throws Exception
+ {
+ OgnlRuntime.getParameterTypes( method );
+ }
+
+ @Override
+ public void getParameterTypes( Constructor<?> constructor )
+ throws Exception
+ {
+ OgnlRuntime.getParameterTypes( constructor );
+ }
+
+ @Override
+ public void getPermission( Method method )
+ throws Exception
+ {
+ OgnlRuntime.getPermission( method );
+ }
+
+ @Override
+ public void getPrimitiveDefaultValue( Class<?> type )
+ throws Exception
+ {
+ OgnlRuntime.getPrimitiveDefaultValue( type );
+ }
+
+ @Override
+ public void invokeMethod( Object o, Method method, Object[] args )
+ throws Exception
+ {
+ OgnlRuntime.invokeMethod( o, method, args );
+ }
+
+ @Override
+ public void clearCache( )
+ {
+ OgnlRuntime.clearCache( );
+ }}
Propchange: commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/runtime/OldOgnlRuntimeWrapper.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/runtime/RuntimeWrapper.java
URL: http://svn.apache.org/viewvc/commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/runtime/RuntimeWrapper.java?rev=1187621&view=auto
==============================================================================
--- commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/runtime/RuntimeWrapper.java (added)
+++ commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/runtime/RuntimeWrapper.java Sat Oct 22 01:20:52 2011
@@ -0,0 +1,33 @@
+package org.apache.commons.ognl.performance.runtime;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+
+/**
+ * User: mcucchiara
+ * Date: 19/10/11
+ * Time: 9.37
+ */
+public interface RuntimeWrapper {
+ void getFields(Class<?> c) throws Exception;
+
+ void findParameterTypes(Class<?> targetClass, Method method) throws Exception;
+
+ void getConstructors(Class<?> c) throws Exception;
+
+ void getMethods(Class<?> c, boolean staticMethods) throws Exception;
+
+ void getDeclaredMethods(Class<?> c, String propertyName, boolean setters) throws Exception;
+
+ void getParameterTypes(Method method) throws Exception;
+
+ void getParameterTypes(Constructor<?> constructor) throws Exception;
+
+ void getPermission(Method method) throws Exception;
+
+ void getPrimitiveDefaultValue(Class<?> type) throws Exception;
+
+ void invokeMethod(Object o, Method method, Object[] args) throws Exception;
+
+ void clearCache();
+}
Propchange: commons/proper/ognl/performance-analysis/src/main/java/org/apache/commons/ognl/performance/runtime/RuntimeWrapper.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/proper/ognl/performance-analysis/src/main/resources/log4j.xml
URL: http://svn.apache.org/viewvc/commons/proper/ognl/performance-analysis/src/main/resources/log4j.xml?rev=1187621&view=auto
==============================================================================
--- commons/proper/ognl/performance-analysis/src/main/resources/log4j.xml (added)
+++ commons/proper/ognl/performance-analysis/src/main/resources/log4j.xml Sat Oct 22 01:20:52 2011
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+ <appender name="console" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p (%l) - %m%n"/>
+ </layout>
+ </appender>
+ <root>
+ <priority value="info"/>
+ <appender-ref ref="console"/>
+ </root>
+
+</log4j:configuration>
Propchange: commons/proper/ognl/performance-analysis/src/main/resources/log4j.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/proper/ognl/performance-analysis/src/test/java/org/apache/commons/ognl/performance/PerformanceCommonsOgnlTest.java
URL: http://svn.apache.org/viewvc/commons/proper/ognl/performance-analysis/src/test/java/org/apache/commons/ognl/performance/PerformanceCommonsOgnlTest.java?rev=1187621&view=auto
==============================================================================
--- commons/proper/ognl/performance-analysis/src/test/java/org/apache/commons/ognl/performance/PerformanceCommonsOgnlTest.java (added)
+++ commons/proper/ognl/performance-analysis/src/test/java/org/apache/commons/ognl/performance/PerformanceCommonsOgnlTest.java Sat Oct 22 01:20:52 2011
@@ -0,0 +1,122 @@
+package org.apache.commons.ognl.performance;
+
+import com.carrotsearch.junitbenchmarks.BenchmarkOptions;
+import com.carrotsearch.junitbenchmarks.BenchmarkRule;
+import com.carrotsearch.junitbenchmarks.annotation.AxisRange;
+import com.carrotsearch.junitbenchmarks.annotation.BenchmarkHistoryChart;
+import com.carrotsearch.junitbenchmarks.annotation.BenchmarkMethodChart;
+import com.carrotsearch.junitbenchmarks.annotation.LabelType;
+import org.apache.commons.ognl.performance.invocation.FieldInvocation;
+import org.apache.commons.ognl.performance.invocation.FindParameterTypesInvocation;
+import org.apache.commons.ognl.performance.invocation.GetConstructorsInvocation;
+import org.apache.commons.ognl.performance.invocation.GetDeclaredMethodsInvocation;
+import org.apache.commons.ognl.performance.invocation.GetMethodsInvocation;
+import org.apache.commons.ognl.performance.invocation.MethodParameterTypesInvocation;
+import org.apache.commons.ognl.performance.invocation.PermissionInvocation;
+import org.apache.commons.ognl.performance.invocation.PrimitiveDefaultInvocation;
+import org.apache.commons.ognl.performance.runtime.CommonsRuntimeWrapper;
+import org.apache.commons.ognl.performance.runtime.OldOgnlRuntimeWrapper;
+import org.apache.commons.ognl.performance.runtime.RuntimeWrapper;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.MethodRule;
+
+/**
+ * User: Maurizio Cucchiara
+ * Date: 10/22/11
+ * Time: 12:49 AM
+ */
+
+@AxisRange( min = 0, max = 1 )
+@BenchmarkMethodChart( filePrefix = "benchmark-commons-ognl" )
+@BenchmarkHistoryChart( labelWith = LabelType.CUSTOM_KEY, maxRuns = 20 )
+public class PerformanceCommonsOgnlTest
+{
+ @Rule
+ public MethodRule benchmarkRun = new BenchmarkRule( );
+
+ public static final RuntimeWrapper COMMONS_RUNTIME_WRAPPER = new CommonsRuntimeWrapper( );
+
+ public static final RuntimeWrapper OLD_RUNTIME_WRAPPER = new OldOgnlRuntimeWrapper( );
+
+ protected static RuntimeWrapper runtimeWrapper;
+
+ @BenchmarkOptions( benchmarkRounds = 50, warmupRounds = 0, concurrency = 1000 )
+ @Test
+ public void constructorCache( )
+ throws Exception
+ {
+ new GetConstructorsInvocation( runtimeWrapper );
+ }
+
+ @BenchmarkOptions( benchmarkRounds = 50, warmupRounds = 0, concurrency = 1000 )
+ @Test
+ public void declaredMethodCache( )
+ throws Exception
+ {
+ new GetDeclaredMethodsInvocation( runtimeWrapper );
+ }
+
+
+ @BenchmarkOptions( benchmarkRounds = 50, warmupRounds = 0, concurrency = 1000 )
+ @Test
+ public void fieldCache( )
+ throws Exception
+ {
+ new FieldInvocation( runtimeWrapper );
+ }
+
+ @BenchmarkOptions( benchmarkRounds = 50, warmupRounds = 0, concurrency = 1000 )
+ @Test
+ public void findParameterTypeCache( )
+ throws Exception
+ {
+ new FindParameterTypesInvocation( runtimeWrapper, 200 );
+ }
+
+ @BenchmarkOptions( benchmarkRounds = 50, warmupRounds = 0, concurrency = 1000 )
+ @Test
+ public void methodCache( )
+ throws Exception
+ {
+ new GetMethodsInvocation( runtimeWrapper );
+ }
+
+ @BenchmarkOptions( benchmarkRounds = 50, warmupRounds = 0, concurrency = 1000 )
+ @Test
+ public void methodParameterTypeCache( )
+ throws Exception
+ {
+ new MethodParameterTypesInvocation( runtimeWrapper );
+ }
+
+ @BenchmarkOptions( benchmarkRounds = 50, warmupRounds = 0, concurrency = 1000 )
+ @Test
+ public void permissionCache( )
+ throws Exception
+ {
+ new PermissionInvocation( runtimeWrapper );
+ }
+
+ @BenchmarkOptions( benchmarkRounds = 50, warmupRounds = 0, concurrency = 1000 )
+ @Test
+ public void primitiveCache( )
+ throws Exception
+ {
+ new PrimitiveDefaultInvocation( runtimeWrapper, 100000 );
+ }
+
+ @BeforeClass
+ public static void before( )
+ {
+ runtimeWrapper = COMMONS_RUNTIME_WRAPPER;
+ }
+
+ @AfterClass
+ public static void after( )
+ {
+ runtimeWrapper.clearCache( );
+ }
+}
Propchange: commons/proper/ognl/performance-analysis/src/test/java/org/apache/commons/ognl/performance/PerformanceCommonsOgnlTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/proper/ognl/performance-analysis/src/test/java/org/apache/commons/ognl/performance/PerformanceOldOgnlTest.java
URL: http://svn.apache.org/viewvc/commons/proper/ognl/performance-analysis/src/test/java/org/apache/commons/ognl/performance/PerformanceOldOgnlTest.java?rev=1187621&view=auto
==============================================================================
--- commons/proper/ognl/performance-analysis/src/test/java/org/apache/commons/ognl/performance/PerformanceOldOgnlTest.java (added)
+++ commons/proper/ognl/performance-analysis/src/test/java/org/apache/commons/ognl/performance/PerformanceOldOgnlTest.java Sat Oct 22 01:20:52 2011
@@ -0,0 +1,31 @@
+package org.apache.commons.ognl.performance;
+
+import com.carrotsearch.junitbenchmarks.annotation.AxisRange;
+import com.carrotsearch.junitbenchmarks.annotation.BenchmarkHistoryChart;
+import com.carrotsearch.junitbenchmarks.annotation.BenchmarkMethodChart;
+import com.carrotsearch.junitbenchmarks.annotation.LabelType;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+
+/**
+ * User: Maurizio Cucchiara
+ * Date: 10/22/11
+ * Time: 12:49 AM
+ */
+
+@AxisRange( min = 0, max = 1 )
+@BenchmarkMethodChart(filePrefix = "benchmark-old-ognl")
+@BenchmarkHistoryChart( labelWith = LabelType.CUSTOM_KEY, maxRuns = 20 )
+public class PerformanceOldOgnlTest extends PerformanceCommonsOgnlTest
+{
+ @BeforeClass
+ public static void before( )
+ {
+ runtimeWrapper = OLD_RUNTIME_WRAPPER;
+ }
+ @AfterClass
+ public static void after( )
+ {
+ runtimeWrapper.clearCache( );
+ }
+}
Propchange: commons/proper/ognl/performance-analysis/src/test/java/org/apache/commons/ognl/performance/PerformanceOldOgnlTest.java
------------------------------------------------------------------------------
svn:eol-style = native