You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shindig.apache.org by rb...@apache.org on 2012/05/25 04:09:51 UTC
svn commit: r1342488 [2/2] - in /shindig/trunk: config/
content/samplecontainer/examples/ content/sampledata/
java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/spi/
java/samples/src/test/java/org/apache/shindig/social/opensocial/jpa/s...
Added: shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/opensocial/spi/LocalIdTest.java
URL: http://svn.apache.org/viewvc/shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/opensocial/spi/LocalIdTest.java?rev=1342488&view=auto
==============================================================================
--- shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/opensocial/spi/LocalIdTest.java (added)
+++ shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/opensocial/spi/LocalIdTest.java Fri May 25 02:09:50 2012
@@ -0,0 +1,40 @@
+/*
+ * 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.social.opensocial.spi;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+public class LocalIdTest extends Assert {
+
+ @Test
+ public void testLocalId() throws Exception {
+ LocalId l1 = new LocalId("");
+ assertTrue(l1 instanceof LocalId);
+
+ LocalId l2 = new LocalId("195mg90a39v");
+ assertTrue(l2 instanceof LocalId);
+ }
+
+ @Test(expected=IllegalArgumentException.class)
+ public void testLocalIdException() {
+ new LocalId("195mg90a39v/937194");
+ }
+}
\ No newline at end of file
Propchange: shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/opensocial/spi/LocalIdTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/opensocial/spi/ObjectIdTest.java
URL: http://svn.apache.org/viewvc/shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/opensocial/spi/ObjectIdTest.java?rev=1342488&view=auto
==============================================================================
--- shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/opensocial/spi/ObjectIdTest.java (added)
+++ shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/opensocial/spi/ObjectIdTest.java Fri May 25 02:09:50 2012
@@ -0,0 +1,51 @@
+/*
+ * 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.social.opensocial.spi;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+public class ObjectIdTest extends Assert {
+
+ @Test
+ public void testObjectId() throws Exception {
+ LocalId lid = new LocalId("195mg90a39v");
+ GlobalId gid = new GlobalId("example.com:195mg90a39v");
+
+ ObjectId o1 = new ObjectId(lid);
+ assertTrue(o1 instanceof ObjectId);
+
+ ObjectId o2 = new ObjectId(gid);
+ assertTrue(o2 instanceof ObjectId);
+
+ ObjectId o3 = new ObjectId("195mg90a39v");
+ assertTrue(o3 instanceof ObjectId);
+ assertTrue(o3.getObjectId() instanceof LocalId);
+
+ ObjectId o4 = new ObjectId("example.com:195mg90a39v");
+ assertTrue(o4 instanceof ObjectId);
+ assertTrue(o4.getObjectId() instanceof GlobalId);
+ }
+
+ @Test(expected=IllegalArgumentException.class)
+ public void testObjectIdException() {
+ new ObjectId("195mg90a39v/937194");
+ }
+}
\ No newline at end of file
Propchange: shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/opensocial/spi/ObjectIdTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain