Commits

Ruwan Linton committed e41d8cd

Merging Asankha's commit and minor sample fix

Comments (0)

Files changed (4)

modules/sample/src/test/java/org/adroitlogic/ultraesb/rest/MockRestService2Test.java

+/*
+ * Copyright (c) 2010-2014 AdroitLogic Private Ltd. (http://adroitlogic.org). All Rights Reserved.
+ */
+
+package org.adroitlogic.ultraesb.rest;
+
+import junit.framework.Assert;
+import junit.framework.Test;
+import org.adroitlogic.ultraesb.UTestCase;
+import org.adroitlogic.ultraesb.UTestSetup;
+import org.apache.http.HttpResponse;
+import org.apache.http.HttpStatus;
+import org.apache.http.auth.AuthScope;
+import org.apache.http.auth.UsernamePasswordCredentials;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.util.EntityUtils;
+
+/**
+ * @author asankha
+ */
+public class MockRestService2Test extends UTestCase {
+
+    private static final String urlPrefix = "http://localhost:8280/service/rest-mock?x=5&y=6";
+
+    public static Test suite() {
+        return new UTestSetup(MockRestService2Test.class, 104);
+    }
+
+    public void testMockResponseAndAuth() throws Exception {
+
+        client.getCredentialsProvider().setCredentials(
+            new AuthScope("localhost", 8280),
+            new UsernamePasswordCredentials("asankha", "adroitlogic"));
+
+        HttpGet httpget = new HttpGet(urlPrefix);
+        HttpResponse response = client.execute(httpget);
+        Assert.assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode());
+        String resp = EntityUtils.toString(response.getEntity());
+        System.out.println("Response : " + resp);
+        Assert.assertEquals(resp, "<response><user>asankha</user><roles>[ROLE_ADMIN, ROLE_USER]</roles><method>GET</method><uri>/service/rest-mock?x=5&y=6</uri><query>?x=5&y=6</query></response>");
+    }
+}

modules/sample/src/test/java/org/adroitlogic/ultraesb/rest/MockRestServiceTest2.java

-/*
- * Copyright (c) 2010-2014 AdroitLogic Private Ltd. (http://adroitlogic.org). All Rights Reserved.
- */
-
-package org.adroitlogic.ultraesb.rest;
-
-import junit.framework.Assert;
-import junit.framework.Test;
-import org.adroitlogic.ultraesb.UTestCase;
-import org.adroitlogic.ultraesb.UTestSetup;
-import org.apache.http.HttpResponse;
-import org.apache.http.HttpStatus;
-import org.apache.http.auth.AuthScope;
-import org.apache.http.auth.UsernamePasswordCredentials;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.util.EntityUtils;
-
-/**
- * @author asankha
- */
-public class MockRestServiceTest2 extends UTestCase {
-
-    private static final String urlPrefix = "http://localhost:8280/service/rest-mock?x=5&y=6";
-
-    public static Test suite() {
-        return new UTestSetup(MockRestServiceTest2.class, 104);
-    }
-
-    public void testMockResponseAndAuth() throws Exception {
-
-        client.getCredentialsProvider().setCredentials(
-            new AuthScope("localhost", 8280),
-            new UsernamePasswordCredentials("asankha", "adroitlogic"));
-
-        HttpGet httpget = new HttpGet(urlPrefix);
-        HttpResponse response = client.execute(httpget);
-        Assert.assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode());
-        String resp = EntityUtils.toString(response.getEntity());
-        System.out.println("Response : " + resp);
-        Assert.assertEquals(resp, "<response><user>asankha</user><roles>[ROLE_ADMIN, ROLE_USER]</roles><method>GET</method><uri>/service/rest-mock?x=5&y=6</uri><query>?x=5&y=6</query></response>");
-    }
-}

resources/samples/conf/ultra-sample-104.xml

             <list>
                 <bean class="org.adroitlogic.ultraesb.transport.http.auth.BasicAuthenticationFilter">
                     <property name="realmName" value="adroitlogic"/>
+                    <property name="userDetailsService" ref="plain-user-service"/>
                 </bean>
             </list>
         </property>
     <s:authentication-manager alias="authenticationManager">
     <s:authentication-provider>
         <s:password-encoder hash="md5"/>
-        <s:user-service>
+        <s:user-service id="plain-user-service">
             <s:user name="asankha" password="abac6d7582d9ab52c629f7490fd3eb2f" authorities="ROLE_ADMIN, ROLE_USER"/>
 	    </s:user-service>
     </s:authentication-provider>

resources/samples/conf/ultra-sample-950.xml

 <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:u="http://www.adroitlogic.org/ultraesb"
-       xmlns:s="http://www.springframework.org/schema/security"
 xsi:schemaLocation="
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
-http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd
 http://www.adroitlogic.org/ultraesb http://schemas.ultraesb.org/ultraesb-2.0.xsd">
 
     <bean id="ultra-config" class="org.adroitlogic.ultraesb.core.ConfigurationImpl">