You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sirona.apache.org by ol...@apache.org on 2014/01/28 00:39:35 UTC

svn commit: r1561906 - in /incubator/sirona/trunk/agent/javaagent/src/test/java/org/apache/sirona/javaagent: AgentArgs.java SironaAgentTest.java

Author: olamy
Date: Mon Jan 27 23:39:35 2014
New Revision: 1561906

URL: http://svn.apache.org/r1561906
Log:
missed to add new classes

Added:
    incubator/sirona/trunk/agent/javaagent/src/test/java/org/apache/sirona/javaagent/AgentArgs.java   (with props)
    incubator/sirona/trunk/agent/javaagent/src/test/java/org/apache/sirona/javaagent/SironaAgentTest.java   (with props)

Added: incubator/sirona/trunk/agent/javaagent/src/test/java/org/apache/sirona/javaagent/AgentArgs.java
URL: http://svn.apache.org/viewvc/incubator/sirona/trunk/agent/javaagent/src/test/java/org/apache/sirona/javaagent/AgentArgs.java?rev=1561906&view=auto
==============================================================================
--- incubator/sirona/trunk/agent/javaagent/src/test/java/org/apache/sirona/javaagent/AgentArgs.java (added)
+++ incubator/sirona/trunk/agent/javaagent/src/test/java/org/apache/sirona/javaagent/AgentArgs.java Mon Jan 27 23:39:35 2014
@@ -0,0 +1,38 @@
+/*
+ * 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.sirona.javaagent;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * @author Olivier Lamy
+ */
+@Target( ElementType.METHOD)
+@Retention ( RetentionPolicy.RUNTIME )
+public @interface AgentArgs
+{
+    String value();
+
+    String maxMem() default "";
+
+    String minMem() default "";
+
+    boolean noVerify() default false;
+}

Propchange: incubator/sirona/trunk/agent/javaagent/src/test/java/org/apache/sirona/javaagent/AgentArgs.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/sirona/trunk/agent/javaagent/src/test/java/org/apache/sirona/javaagent/AgentArgs.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: incubator/sirona/trunk/agent/javaagent/src/test/java/org/apache/sirona/javaagent/SironaAgentTest.java
URL: http://svn.apache.org/viewvc/incubator/sirona/trunk/agent/javaagent/src/test/java/org/apache/sirona/javaagent/SironaAgentTest.java?rev=1561906&view=auto
==============================================================================
--- incubator/sirona/trunk/agent/javaagent/src/test/java/org/apache/sirona/javaagent/SironaAgentTest.java (added)
+++ incubator/sirona/trunk/agent/javaagent/src/test/java/org/apache/sirona/javaagent/SironaAgentTest.java Mon Jan 27 23:39:35 2014
@@ -0,0 +1,59 @@
+/*
+ * 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.sirona.javaagent;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.Map;
+
+/**
+ * @author Olivier Lamy
+ */
+public class SironaAgentTest
+{
+    @Test
+    public void testArgsExtract()
+        throws Exception
+    {
+        Map<String, String> parameters = SironaAgent.extractParameters( "foo=bar|beer=pale ale" );
+
+        Assert.assertEquals(2, parameters.size());
+
+        Assert.assertEquals("bar", parameters.get( "foo" ) );
+        Assert.assertEquals("pale ale", parameters.get( "beer" ) );
+    }
+
+    @Test
+    public void testArgsExtractMissingSeparator()
+        throws Exception
+    {
+        Map<String, String> parameters = SironaAgent.extractParameters( "foo=barbeer=pale ale" );
+
+        Assert.assertEquals(1, parameters.size());
+    }
+
+    @Test
+    public void testArgsExtractMissingEquals()
+        throws Exception
+    {
+        Map<String, String> parameters = SironaAgent.extractParameters( "foo=bar|beerpale ale" );
+
+        Assert.assertEquals("bar", parameters.get( "foo" ) );
+        Assert.assertEquals("", parameters.get( "beerpale ale" ) );
+    }
+}

Propchange: incubator/sirona/trunk/agent/javaagent/src/test/java/org/apache/sirona/javaagent/SironaAgentTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/sirona/trunk/agent/javaagent/src/test/java/org/apache/sirona/javaagent/SironaAgentTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision