You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by ch...@apache.org on 2005/11/23 07:15:23 UTC

svn commit: r348384 - in /webservices/sandesha/trunk/test: resources/ resources/sandesha2.properties src/org/apache/sandesha2/PorpertyLoaderTest.java

Author: chamikara
Date: Tue Nov 22 22:14:25 2005
New Revision: 348384

URL: http://svn.apache.org/viewcvs?rev=348384&view=rev
Log:
To test PropertyLoaded

Added:
    webservices/sandesha/trunk/test/resources/
    webservices/sandesha/trunk/test/resources/sandesha2.properties
    webservices/sandesha/trunk/test/src/org/apache/sandesha2/PorpertyLoaderTest.java

Added: webservices/sandesha/trunk/test/resources/sandesha2.properties
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/test/resources/sandesha2.properties?rev=348384&view=auto
==============================================================================
--- webservices/sandesha/trunk/test/resources/sandesha2.properties (added)
+++ webservices/sandesha/trunk/test/resources/sandesha2.properties Tue Nov 22 22:14:25 2005
@@ -0,0 +1,15 @@
+#THIS IS A TEST RESOURCE - THE CORRECT PROPERTIES FILE CAN BE FOUND
+#IN THE 'conf' DIRECTORY.
+
+#RM Policy values for the server
+#-------------------------------
+RetransmissionInterval=20000
+AcknowledgementInterval=8000
+ExponentialBackoff=false
+InactivityTimeout=3
+InactivityTimeoutMeasure=hours      
+
+
+#Storage Manager Class
+#----------------------
+StorageManager=org.apache.sandesha2.storage.inmemory.InMemoryStorageManager1
\ No newline at end of file

Added: webservices/sandesha/trunk/test/src/org/apache/sandesha2/PorpertyLoaderTest.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/test/src/org/apache/sandesha2/PorpertyLoaderTest.java?rev=348384&view=auto
==============================================================================
--- webservices/sandesha/trunk/test/src/org/apache/sandesha2/PorpertyLoaderTest.java (added)
+++ webservices/sandesha/trunk/test/src/org/apache/sandesha2/PorpertyLoaderTest.java Tue Nov 22 22:14:25 2005
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed 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.sandesha2;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.apache.sandesha2.util.PropertyManager;
+
+import junit.framework.TestCase;
+
+/**
+ * @author Chamikara Jayalath <ch...@gmail.com>
+ */
+
+public class PorpertyLoaderTest extends TestCase {
+	
+	PropertyManager manager = null;
+	
+	public void setUp () {
+		manager = PropertyManager.getInstance();
+		String fileName = "test/resources/sandesha2.properties";
+		File file= new File (fileName);
+		if (!file.exists()) {
+			fail("'test/resources/sandesha2.prop' not found");
+		}
+		
+		try {
+			InputStream in = new FileInputStream (file);
+			manager.reload(in);
+			in.close();
+		} catch (Exception e) {
+			fail (e.getMessage());
+		}
+		
+	}
+	
+	public void testRetransmissionInterval () {
+		long value = manager.getRetransmissionInterval();
+		assertEquals(value,20000);
+	}
+	
+	public void testExponentialBackOff () {
+		boolean value = manager.isExponentialBackoff();
+		assertEquals(value,false);
+	}
+	
+	public void testAcknowledgementInterval () {
+		long value = manager.getAcknowledgementInterval();
+		assertEquals(value,8000);
+	}
+	
+	public void testInactivityTImeout () {
+		long value = manager.getInactivityTimeout();
+		assertEquals(value,(60*60*3*1000));
+	}
+	
+	
+	public void testStorageManager () {
+		String storageMgr = manager.getStorageManagerClass();
+		assertEquals(storageMgr,"org.apache.sandesha2.storage.inmemory.InMemoryStorageManager1");
+	}
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org