Author: vsiveton
Date: Tue Feb 17 14:38:36 2009
New Revision: 745104
URL: http://svn.apache.org/viewvc?rev=745104&view=rev
Log:
o fixed license header
o replaced tab by space
Modified:
incubator/shindig/sandbox/trunk/shindig-spring-example/pom.xml
incubator/shindig/sandbox/trunk/shindig-spring-example/src/main/java/org/apache/shindig/samples/springexample/config/ApplicationContextFactory.java
incubator/shindig/sandbox/trunk/shindig-spring-example/src/main/java/org/apache/shindig/samples/springexample/config/GuiceModule.java
incubator/shindig/sandbox/trunk/shindig-spring-example/src/main/java/org/apache/shindig/samples/springexample/servlet/ApplicationServletContextListener.java
incubator/shindig/sandbox/trunk/shindig-spring-example/src/main/java/org/apache/shindig/samples/springexample/spi/MockPersonSpi.java
incubator/shindig/sandbox/trunk/shindig-spring-example/src/main/resources/application-context.xml
incubator/shindig/sandbox/trunk/shindig-spring-example/src/main/resources/log4j.xml
incubator/shindig/sandbox/trunk/shindig-spring-example/src/test/java/org/apache/shindig/samples/springexample/spi/PersonSpiTest.java
Modified: incubator/shindig/sandbox/trunk/shindig-spring-example/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/shindig/sandbox/trunk/shindig-spring-example/pom.xml?rev=745104&r1=745103&r2=745104&view=diff
==============================================================================
--- incubator/shindig/sandbox/trunk/shindig-spring-example/pom.xml (original)
+++ incubator/shindig/sandbox/trunk/shindig-spring-example/pom.xml Tue Feb 17
14:38:36 2009
@@ -1,4 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.shindig.samples</groupId>
@@ -7,22 +25,22 @@
<version>1.0-SNAPSHOT</version>
<name>shindig-spring-example</name>
<url/>
-
+
<prerequisites>
<maven>2.0.8</maven>
</prerequisites>
-
+
<build>
- <finalName>${project.artifactId}</finalName>
- <defaultGoal>install</defaultGoal>
+ <finalName>${project.artifactId}</finalName>
+ <defaultGoal>install</defaultGoal>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
- <plugins>
- <plugin>
+ <plugins>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
@@ -32,8 +50,8 @@
<showDeprecation>true</showDeprecation>
<compilerArgument>-Xlint:unchecked,deprecation,fallthrough,finally</compilerArgument>
</configuration>
- </plugin>
- <plugin>
+ </plugin>
+ <plugin>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
@@ -48,20 +66,20 @@
<excludeResources>false</excludeResources>
<attach>true</attach>
</configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-eclipse-plugin</artifactId>
- <version>2.3</version>
- <configuration>
- <wtpversion>1.5</wtpversion>
- </configuration>
- </plugin>
- <plugin>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <version>2.3</version>
+ <configuration>
+ <wtpversion>1.5</wtpversion>
+ </configuration>
+ </plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
</plugin>
- <plugin>
+ <plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<configuration>
@@ -70,117 +88,117 @@
<webXml>${basedir}/target/shindig-spring-example/WEB-INF/web.xml</webXml>
</configuration>
</plugin>
- <plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.2</version>
</plugin>
<plugin>
- <artifactId>maven-resources-plugin</artifactId>
- <version>2.3</version>
- </plugin>
- </plugins>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.3</version>
+ </plugin>
+ </plugins>
</build>
-
- <dependencies>
+
+ <dependencies>
<!-- shindig dependencies -->
<dependency>
<groupId>org.apache.shindig</groupId>
<artifactId>shindig-social-api</artifactId>
<version>${shindig.version}</version>
- </dependency>
-
+ </dependency>
+
<!-- shindig test dependencies -->
<dependency>
<groupId>org.apache.shindig</groupId>
<artifactId>shindig-common</artifactId>
<version>${shindig.version}</version>
<classifier>tests</classifier>
- <scope>test</scope>
+ <scope>test</scope>
</dependency>
-
- <!-- Spring dependencies -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring</artifactId>
- <version>${spring.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- <version>${spring.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context-support</artifactId>
- <version>${spring.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- <version>${spring.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-beans</artifactId>
- <version>${spring.version}</version>
- </dependency>
-
- <!-- Spring test dependencies -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-test</artifactId>
- <version>${spring.version}</version>
- <scope>test</scope>
- </dependency>
-
- <!-- Apache commons logging -->
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>${logging.version}</version>
- </dependency>
-
- <!-- Apache commons dependencies -->
- <dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- <version>${collections.version}</version>
- </dependency>
-
- <!-- JUnit 4 -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${junit.version}</version>
- <scope>test</scope>
- </dependency>
-
+
+ <!-- Spring dependencies -->
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context-support</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+
+ <!-- Spring test dependencies -->
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test</artifactId>
+ <version>${spring.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- Apache commons logging -->
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>${logging.version}</version>
+ </dependency>
+
+ <!-- Apache commons dependencies -->
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>${collections.version}</version>
+ </dependency>
+
+ <!-- JUnit 4 -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit.version}</version>
+ <scope>test</scope>
+ </dependency>
+
<!-- Servlet and JSP dependencies -->
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>${servlet.version}</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jstl</artifactId>
- <version>${jstl.version}</version>
- <scope>runtime</scope>
- </dependency>
-
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>${servlet.version}</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ <version>${jstl.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
</dependencies>
-
+
<!-- dependency versions -->
<properties>
- <shindig.version>1.1-SNAPSHOT</shindig.version>
- <spring.version>2.5.2</spring.version>
- <logging.version>1.1</logging.version>
- <collections.version>3.2</collections.version>
- <junit.version>4.4</junit.version>
- <servlet.version>2.4</servlet.version>
- <jstl.version>1.1.2</jstl.version>
+ <shindig.version>1.1-SNAPSHOT</shindig.version>
+ <spring.version>2.5.2</spring.version>
+ <logging.version>1.1</logging.version>
+ <collections.version>3.2</collections.version>
+ <junit.version>4.4</junit.version>
+ <servlet.version>2.4</servlet.version>
+ <jstl.version>1.1.2</jstl.version>
</properties>
-
+
</project>
Modified:
incubator/shindig/sandbox/trunk/shindig-spring-example/src/main/java/org/apache/shindig/samples/springexample/config/ApplicationContextFactory.java
URL:
http://svn.apache.org/viewvc/incubator/shindig/sandbox/trunk/shindig-spring-example/src/main/java/org/apache/shindig/samples/springexample/config/ApplicationContextFactory.java?rev=745104&r1=745103&r2=745104&view=diff
==============================================================================
---
incubator/shindig/sandbox/trunk/shindig-spring-example/src/main/java/org/apache/shindig/samples/springexample/config/ApplicationContextFactory.java
(original)
+++
incubator/shindig/sandbox/trunk/shindig-spring-example/src/main/java/org/apache/shindig/samples/springexample/config/ApplicationContextFactory.java
Tue Feb 17 14:38:36 2009
@@ -1,3 +1,21 @@
+/*
+ * 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.shindig.samples.springexample.config;
import org.springframework.context.support.AbstractApplicationContext;
@@ -5,29 +23,29 @@
/**
* A factory for managing the ApplicationContext instance.
- *
+ *
*/
public class ApplicationContextFactory {
/** The Constant LOCATIONS. */
private static final String[] LOCATIONS = {"application-context.xml"};
-
+
/** The Constant CONTEXT. */
private static final AbstractApplicationContext CONTEXT = new
ClassPathXmlApplicationContext(LOCATIONS);
-
+
/**
* Instantiates a new application context factory.
*/
private ApplicationContextFactory() {
}
-
+
/**
* Gets the application context.
- *
+ *
* @return the application context
*/
public static AbstractApplicationContext getApplicationContext() {
return CONTEXT;
}
-
+
}
Modified:
incubator/shindig/sandbox/trunk/shindig-spring-example/src/main/java/org/apache/shindig/samples/springexample/config/GuiceModule.java
URL:
http://svn.apache.org/viewvc/incubator/shindig/sandbox/trunk/shindig-spring-example/src/main/java/org/apache/shindig/samples/springexample/config/GuiceModule.java?rev=745104&r1=745103&r2=745104&view=diff
==============================================================================
---
incubator/shindig/sandbox/trunk/shindig-spring-example/src/main/java/org/apache/shindig/samples/springexample/config/GuiceModule.java
(original)
+++
incubator/shindig/sandbox/trunk/shindig-spring-example/src/main/java/org/apache/shindig/samples/springexample/config/GuiceModule.java
Tue Feb 17 14:38:36 2009
@@ -1,3 +1,21 @@
+/*
+ * 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.shindig.samples.springexample.config;
import org.apache.shindig.social.core.config.SocialApiGuiceModule;
@@ -7,10 +25,10 @@
/**
* Guice configuration module that binds required shindig bindings
- *
+ *
*/
public class GuiceModule extends SocialApiGuiceModule {
-
+
/** The Constant PERSON_SPI_BEAN_NAME. */
private static final String PERSON_SPI_BEAN_NAME = "personSpi";
@@ -18,13 +36,13 @@
* @see
org.apache.shindig.social.core.config.SocialApiGuiceModule#configure()
*/
@Override
- protected void configure() {
+ protected void configure() {
// Get spring application context
ApplicationContext applicationContext =
ApplicationContextFactory.getApplicationContext();
-
+
// Bind Mock Person Spi
this.bind(PersonService.class).toInstance((PersonService)
applicationContext.getBean(PERSON_SPI_BEAN_NAME));
-
+
// Use SocialApiGuiceModule to configure shindig
super.configure();
}
Modified:
incubator/shindig/sandbox/trunk/shindig-spring-example/src/main/java/org/apache/shindig/samples/springexample/servlet/ApplicationServletContextListener.java
URL:
http://svn.apache.org/viewvc/incubator/shindig/sandbox/trunk/shindig-spring-example/src/main/java/org/apache/shindig/samples/springexample/servlet/ApplicationServletContextListener.java?rev=745104&r1=745103&r2=745104&view=diff
==============================================================================
---
incubator/shindig/sandbox/trunk/shindig-spring-example/src/main/java/org/apache/shindig/samples/springexample/servlet/ApplicationServletContextListener.java
(original)
+++
incubator/shindig/sandbox/trunk/shindig-spring-example/src/main/java/org/apache/shindig/samples/springexample/servlet/ApplicationServletContextListener.java
Tue Feb 17 14:38:36 2009
@@ -1,4 +1,21 @@
-
+/*
+ * 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.shindig.samples.springexample.servlet;
import
org.apache.shindig.samples.springexample.config.ApplicationContextFactory;
@@ -9,14 +26,14 @@
/**
* Destroys Spring's ApplicationContext that is managed by {...@link
ApplicationContextFactory} at shutdown,
* forcing bean defined destroy-methods to be invoked.
- *
+ *
*/
public class ApplicationServletContextListener implements
ServletContextListener {
public void contextInitialized(ServletContextEvent event) {}
- public void contextDestroyed(ServletContextEvent event) {
- ApplicationContextFactory.getApplicationContext().destroy();
- }
+ public void contextDestroyed(ServletContextEvent event) {
+ ApplicationContextFactory.getApplicationContext().destroy();
+ }
}
Modified:
incubator/shindig/sandbox/trunk/shindig-spring-example/src/main/java/org/apache/shindig/samples/springexample/spi/MockPersonSpi.java
URL:
http://svn.apache.org/viewvc/incubator/shindig/sandbox/trunk/shindig-spring-example/src/main/java/org/apache/shindig/samples/springexample/spi/MockPersonSpi.java?rev=745104&r1=745103&r2=745104&view=diff
==============================================================================
---
incubator/shindig/sandbox/trunk/shindig-spring-example/src/main/java/org/apache/shindig/samples/springexample/spi/MockPersonSpi.java
(original)
+++
incubator/shindig/sandbox/trunk/shindig-spring-example/src/main/java/org/apache/shindig/samples/springexample/spi/MockPersonSpi.java
Tue Feb 17 14:38:36 2009
@@ -1,3 +1,21 @@
+/*
+ * 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.shindig.samples.springexample.spi;
import org.apache.shindig.auth.SecurityToken;
@@ -19,19 +37,19 @@
/**
* Mock implementation of {...@link PersonService}.
- *
+ *
*/
public class MockPersonSpi implements PersonService {
-
+
/** The Constant JOHN. */
private static final UserId JOHN = new UserId(UserId.Type.userId,
"john.doe");
-
+
/** The Constant JANE. */
- private static final UserId JANE = new UserId(UserId.Type.userId,
"jane.doe");
-
+ private static final UserId JANE = new UserId(UserId.Type.userId,
"jane.doe");
+
/** The Constant FRIENDS. */
private static final UserId[] FRIENDS = {JOHN, JANE};
-
+
/* (non-Javadoc)
* @see
org.apache.shindig.social.opensocial.spi.PersonService#getPerson(org.apache.shindig.social.opensocial.spi.UserId,
java.util.Set, org.apache.shindig.auth.SecurityToken)
*/
@@ -41,7 +59,7 @@
person.setId(userId.getUserId());
return ImmediateFuture.newInstance(person);
}
-
+
/* (non-Javadoc)
* @see
org.apache.shindig.social.opensocial.spi.PersonService#getPeople(java.util.Set,
org.apache.shindig.social.opensocial.spi.GroupId,
org.apache.shindig.social.opensocial.spi.CollectionOptions, java.util.Set,
org.apache.shindig.auth.SecurityToken)
*/
@@ -51,7 +69,7 @@
try {
List<Person> people = new ArrayList<Person>();
switch (groupId.getType()) {
- case self:
+ case self:
for (UserId userId: userIds) {
Person person = new PersonImpl();
person.setId(userId.getUserId());
@@ -66,17 +84,17 @@
}
break;
case all:
- throw new SocialSpiException(ResponseError.NOT_IMPLEMENTED, "Not yet
implemented",null);
+ throw new SocialSpiException(ResponseError.NOT_IMPLEMENTED, "Not yet
implemented",null);
case groupId:
throw new SocialSpiException(ResponseError.NOT_IMPLEMENTED, "Not yet
implemented",null);
- case deleted:
+ case deleted:
throw new SocialSpiException(ResponseError.NOT_IMPLEMENTED, "Not yet
implemented",null);
default:
throw new SocialSpiException(ResponseError.BAD_REQUEST, "Group ID not
recognized",null);
}
return ImmediateFuture.newInstance(new RestfulCollection<Person>(people,
0, people.size()));
- } catch (Exception e) {
- throw new SocialSpiException(ResponseError.INTERNAL_ERROR, "Exception
occurred", e);
+ } catch (Exception e) {
+ throw new SocialSpiException(ResponseError.INTERNAL_ERROR, "Exception
occurred", e);
}
}
Modified:
incubator/shindig/sandbox/trunk/shindig-spring-example/src/main/resources/application-context.xml
URL:
http://svn.apache.org/viewvc/incubator/shindig/sandbox/trunk/shindig-spring-example/src/main/resources/application-context.xml?rev=745104&r1=745103&r2=745104&view=diff
==============================================================================
---
incubator/shindig/sandbox/trunk/shindig-spring-example/src/main/resources/application-context.xml
(original)
+++
incubator/shindig/sandbox/trunk/shindig-spring-example/src/main/resources/application-context.xml
Tue Feb 17 14:38:36 2009
@@ -1,8 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
- <!-- Mock Person SPI -->
- <bean id="personSpi"
class="org.apache.shindig.samples.springexample.spi.MockPersonSpi"/>
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+ <!-- Mock Person SPI -->
+ <bean id="personSpi"
class="org.apache.shindig.samples.springexample.spi.MockPersonSpi"/>
</beans>
\ No newline at end of file
Modified:
incubator/shindig/sandbox/trunk/shindig-spring-example/src/main/resources/log4j.xml
URL:
http://svn.apache.org/viewvc/incubator/shindig/sandbox/trunk/shindig-spring-example/src/main/resources/log4j.xml?rev=745104&r1=745103&r2=745104&view=diff
==============================================================================
---
incubator/shindig/sandbox/trunk/shindig-spring-example/src/main/resources/log4j.xml
(original)
+++
incubator/shindig/sandbox/trunk/shindig-spring-example/src/main/resources/log4j.xml
Tue Feb 17 14:38:36 2009
@@ -1,13 +1,32 @@
<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ * 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.
+-->
+
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="ConsoleAppender" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d{dd MM HH:mm:ss} [%t] %-5p %c
%M %x - %m\n"/>
- </layout>
- </appender>
+ <param name="ConversionPattern" value="%d{dd MM HH:mm:ss} [%t] %-5p %c
%M %x - %m\n"/>
+ </layout>
+ </appender>
<root>
- <priority value="warn"/>
+ <priority value="warn"/>
<appender-ref ref="ConsoleAppender"/>
</root>
</log4j:configuration>
\ No newline at end of file
Modified:
incubator/shindig/sandbox/trunk/shindig-spring-example/src/test/java/org/apache/shindig/samples/springexample/spi/PersonSpiTest.java
URL:
http://svn.apache.org/viewvc/incubator/shindig/sandbox/trunk/shindig-spring-example/src/test/java/org/apache/shindig/samples/springexample/spi/PersonSpiTest.java?rev=745104&r1=745103&r2=745104&view=diff
==============================================================================
---
incubator/shindig/sandbox/trunk/shindig-spring-example/src/test/java/org/apache/shindig/samples/springexample/spi/PersonSpiTest.java
(original)
+++
incubator/shindig/sandbox/trunk/shindig-spring-example/src/test/java/org/apache/shindig/samples/springexample/spi/PersonSpiTest.java
Tue Feb 17 14:38:36 2009
@@ -1,3 +1,21 @@
+/*
+ * 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.shindig.samples.springexample.spi;
import static org.junit.Assert.assertEquals;
@@ -26,7 +44,7 @@
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"/application-context.xml"})
public class PersonSpiTest {
-
+
// What's being tested
/** The person spi. */
@Autowired
@@ -34,26 +52,26 @@
/** The Constant CANONICAL_USERNAME. */
private static final String CANONICAL_USERNAME = "canonical";
-
+
/** The Constant JOHN_USERNAME. */
private static final String JOHN_USERNAME = "john.doe";
-
+
/** The Constant JANE_USERNAME. */
private static final String JANE_USERNAME = "jane.doe";
-
+
/** The CANONICA l_ user. */
private final UserId CANONICAL_USER = new UserId(UserId.Type.userId,
CANONICAL_USERNAME);
-
+
/** The token. */
private final SecurityToken token = new FakeGadgetToken();
-
+
/**
* Should return expected canonical person.
- *
+ *
* @throws Exception the exception
*/
@Test
- public void shouldReturnCanonicalPerson() throws Exception {
+ public void shouldReturnCanonicalPerson() throws Exception {
Future<Person> person = personSpi.getPerson(CANONICAL_USER,
Person.Field.DEFAULT_FIELDS, token);
assertNotNull(person);
assertNotNull(person.get());
@@ -62,31 +80,31 @@
/**
* Should return expected canonical person.
- *
+ *
* @throws Exception the exception
*/
@Test
public void shouldReturnSelf() throws Exception {
Set<UserId> userIds = new HashSet<UserId>();
userIds.add(CANONICAL_USER);
- Future<RestfulCollection<Person>> people = personSpi.getPeople(userIds,
+ Future<RestfulCollection<Person>> people = personSpi.getPeople(userIds,
new GroupId(GroupId.Type.self, null), null,
Person.Field.DEFAULT_FIELDS, token);
assertNotNull(people);
assertNotNull(people.get());
assertEquals(1, people.get().getTotalResults());
assertEquals(CANONICAL_USERNAME, people.get().getEntry().get(0).getId());
}
-
+
/**
* Should return expected friends.
- *
+ *
* @throws Exception the exception
*/
@Test
public void shouldReturnFriends() throws Exception {
Set<UserId> userIds = new HashSet<UserId>();
userIds.add(CANONICAL_USER);
- Future<RestfulCollection<Person>> people = personSpi.getPeople(userIds,
+ Future<RestfulCollection<Person>> people = personSpi.getPeople(userIds,
new GroupId(GroupId.Type.friends, null), null,
Person.Field.DEFAULT_FIELDS, token);
assertNotNull(people);
assertNotNull(people.get());
@@ -94,5 +112,5 @@
assertEquals(JOHN_USERNAME, people.get().getEntry().get(0).getId());
assertEquals(JANE_USERNAME, people.get().getEntry().get(1).getId());
}
-
+
}