Permalink
Browse files

jpcasclient

  • Loading branch information...
g.cocco
g.cocco committed Nov 28, 2011
1 parent c340308 commit 0f68e3440ab0bc124f8fbafacd4e55c1a0e26111
@@ -4,7 +4,7 @@
<parent>
<artifactId>entando-plugins-parent</artifactId>
<groupId>org.entando.entando.plugins</groupId>
- <version>2.4.0.2-SNAPSHOT</version>
+ <version>2.4.0.1</version>
</parent>
<artifactId>entando-plugin-jpcasclient</artifactId>
<groupId>org.entando.entando.plugins</groupId>
@@ -0,0 +1,37 @@
+/*
+ *
+ * Copyright 2005 AgileTec s.r.l. (http://www.agiletec.it) All rights reserved.
+ *
+ * This file is part of jAPS software.
+ * jAPS is a free software;
+ * you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License (GPL) as published by the Free Software Foundation; version 2.
+ *
+ * See the file License for the specific language governing permissions
+ * and limitations under the License
+ *
+ *
+ *
+ * Copyright 2005 AgileTec s.r.l. (http://www.agiletec.it) All rights reserved.
+ *
+ */
+package com.agiletec.plugins.jpcasclient;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import com.agiletec.plugins.jpcasclient.aps.system.services.auth.TestCasClientUtils;
+
+public class AllTests {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite("Test for jpcasclient");
+ System.out.println("Test for jpcasclient");
+
+ suite.addTestSuite(TestCasClientUtils.class);
+
+
+ return suite;
+ }
+
+}
@@ -0,0 +1,38 @@
+/*
+*
+* Copyright 2005 AgileTec s.r.l. (http://www.agiletec.it) All rights reserved.
+*
+* This file is part of jAPS software.
+* jAPS is a free software;
+* you can redistribute it and/or modify it
+* under the terms of the GNU General Public License (GPL) as published by the Free Software Foundation; version 2.
+*
+* See the file License for the specific language governing permissions
+* and limitations under the License
+*
+*
+*
+* Copyright 2005 AgileTec s.r.l. (http://www.agiletec.it) All rights reserved.
+*
+*/
+package com.agiletec.plugins.jpcasclient;
+
+import com.agiletec.ConfigTestUtils;
+
+/**
+ * @author E.Santoboni
+ */
+public class PluginConfigTestUtils extends ConfigTestUtils {
+
+ @Override
+ protected String[] getSpringConfigFilePaths() {
+ String[] filePaths = new String[5];
+ filePaths[0] = "classpath:spring/systemConfig.xml";
+ filePaths[1] = "classpath:spring/aps/managers/**/**.xml";
+ filePaths[2] = "classpath:spring/apsadmin/**/**.xml";
+ filePaths[3] = "classpath*:spring/plugins/**/aps/managers/**/**.xml";
+ filePaths[4] = "classpath*:spring/plugins/**/apsadmin/**/**.xml";
+ return filePaths;
+ }
+
+}
@@ -0,0 +1,31 @@
+/*
+*
+* Copyright 2005 AgileTec s.r.l. (http://www.agiletec.it) All rights reserved.
+*
+* This file is part of jAPS software.
+* jAPS is a free software;
+* you can redistribute it and/or modify it
+* under the terms of the GNU General Public License (GPL) as published by the Free Software Foundation; version 2.
+*
+* See the file License for the specific language governing permissions
+* and limitations under the License
+*
+*
+*
+* Copyright 2005 AgileTec s.r.l. (http://www.agiletec.it) All rights reserved.
+*
+*/
+package com.agiletec.plugins.jpcasclient.aps;
+
+import com.agiletec.ConfigTestUtils;
+import com.agiletec.aps.BaseTestCase;
+import com.agiletec.plugins.jpcasclient.PluginConfigTestUtils;
+
+public class ApsPluginBaseTestCase extends BaseTestCase {
+
+ @Override
+ protected ConfigTestUtils getConfigUtils() {
+ return new PluginConfigTestUtils();
+ }
+
+}
@@ -0,0 +1,37 @@
+package com.agiletec.plugins.jpcasclient.aps.system.services.auth;
+
+import com.agiletec.aps.system.RequestContext;
+import com.agiletec.aps.system.SystemConstants;
+import com.agiletec.aps.system.services.url.IURLManager;
+import com.agiletec.aps.system.services.url.PageURL;
+import com.agiletec.plugins.jpcasclient.apsadmin.ApsAdminPluginBaseTestCase;
+
+public class TestCasClientUtils extends ApsAdminPluginBaseTestCase {
+
+ @Override
+ protected void setUp() throws Exception {
+ // TODO?
+ super.setUp();
+ _urlManager = (IURLManager) this.getApplicationContext().getBean(SystemConstants.URL_MANAGER);
+ }
+
+
+
+ public void test () {
+ RequestContext reqCtx = new RequestContext();
+ PageURL pageUrl = new PageURL(_urlManager, reqCtx);
+
+ String urlWithoutParam = _casClientUtils.getURLStringWithoutTicketParam(pageUrl, reqCtx);
+ assertNotNull(urlWithoutParam);
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ // TODO Auto-generated method stub
+ super.tearDown();
+ }
+
+
+ private CasClientUtils _casClientUtils;
+ private IURLManager _urlManager;
+}
@@ -0,0 +1,36 @@
+/*
+*
+* Copyright 2005 AgileTec s.r.l. (http://www.agiletec.it) All rights reserved.
+*
+* This file is part of jAPS software.
+* jAPS is a free software;
+* you can redistribute it and/or modify it
+* under the terms of the GNU General Public License (GPL) as published by the Free Software Foundation; version 2.
+*
+* See the file License for the specific language governing permissions
+* and limitations under the License
+*
+*
+*
+* Copyright 2005 AgileTec s.r.l. (http://www.agiletec.it) All rights reserved.
+*
+*/
+package com.agiletec.plugins.jpcasclient.apsadmin;
+
+import com.agiletec.ConfigTestUtils;
+import com.agiletec.apsadmin.ApsAdminBaseTestCase;
+import com.agiletec.plugins.jpcasclient.PluginConfigTestUtils;
+
+/**
+ * BaseTestCase Class for jpuserprofile apsadmin tests.
+ * You have to comment "getConfigUtils()"
+ * Methods for testing plugin into custom jAPS 2.0 project.
+ */
+public class ApsAdminPluginBaseTestCase extends ApsAdminBaseTestCase {
+
+ @Override
+ protected ConfigTestUtils getConfigUtils() {
+ return new PluginConfigTestUtils();
+ }
+
+}
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:jee="http://www.springframework.org/schema/jee"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
+ http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd">
+
+ <context:property-placeholder location="target/test/conf/systemParams.properties"/>
+
+ <jee:jndi-lookup id="portDataSource" jndi-name="java:comp/env/jdbc/portDataSource"/>
+
+ <jee:jndi-lookup id="servDataSource" jndi-name="java:comp/env/jdbc/servDataSource"/>
+
+ <bean id="ApsSystemUtils" class="com.agiletec.aps.system.ApsSystemUtils" init-method="init" >
+ <property name="systemParams">
+ <map>
+ <entry key="logName"><jee:jndi-lookup jndi-name="java:comp/env/logName" /></entry>
+ <entry key="logFilePrefix"><jee:jndi-lookup jndi-name="java:comp/env/logFilePrefix" /></entry>
+ <entry key="logLevel"><jee:jndi-lookup jndi-name="java:comp/env/logLevel" /></entry>
+ <entry key="logFileSize"><jee:jndi-lookup jndi-name="java:comp/env/logFileSize" /></entry>
+ <entry key="logFilesCount"><jee:jndi-lookup jndi-name="java:comp/env/logFilesCount" /></entry>
+ </map>
+ </property>
+ </bean>
+
+</beans>

0 comments on commit 0f68e34

Please sign in to comment.