This repository has been archived by the owner on Oct 19, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finish implementations of AX store request and response message
git-svn-id: file:///Users/willnorris/Projects/svn-import/java-openid/trunk@85 eae3f9c0-6542-46b9-8785-326aab784c2f
- Loading branch information
1 parent
39b583c
commit 7098cc3
Showing
15 changed files
with
324 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
src/test/java/edu/internet2/middleware/openid/extensions/ax/StoreRequestTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* | ||
* Copyright 2009 University Corporation for Advanced Internet Development, Inc. | ||
* | ||
* 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 edu.internet2.middleware.openid.extensions.ax; | ||
|
||
import java.net.MalformedURLException; | ||
import java.util.Arrays; | ||
import java.util.LinkedHashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import edu.internet2.middleware.openid.extensions.BaseMessageExtensionTestCase; | ||
|
||
/** | ||
* Test case for creating, marshalling, and unmarshalling {@link FetchRequest}. | ||
*/ | ||
public class StoreRequestTest extends BaseMessageExtensionTestCase { | ||
|
||
/** Expected mode. */ | ||
private String expectedMode; | ||
|
||
/** Expected attributes. */ | ||
private Map<String, List<String>> expectedAttributes; | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @throws MalformedURLException if URL is malformed | ||
*/ | ||
public StoreRequestTest() throws MalformedURLException { | ||
messageFile = "/data/edu/internet2/middleware/openid/extensions/ax/StoreRequest.txt"; | ||
|
||
expectedMode = StoreRequest.MODE; | ||
expectedAttributes = new LinkedHashMap<String, List<String>>(); | ||
expectedAttributes.put("http://example.com/schema/fullname", Arrays.asList(new String[] { "Bob Smith" })); | ||
expectedAttributes.put("http://example.com/schema/favourite_movie", Arrays.asList(new String[] { "Movie1", | ||
"Movie2", })); | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
public void testMessageMarshall() { | ||
StoreRequest request = (StoreRequest) buildMessageExtension(StoreRequest.class); | ||
|
||
request.getAttributes().putAll(expectedAttributes); | ||
|
||
assertEquals(expectedParameters, request); | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
public void testMessageUnmarshall() { | ||
StoreRequest request = (StoreRequest) unmarshallMessageExtension(messageFile); | ||
|
||
String mode = request.getMode(); | ||
assertEquals("StoreRequest mode was " + mode + ", expected " + expectedMode, expectedMode, mode); | ||
|
||
Map<String, List<String>> attributes = request.getAttributes(); | ||
assertEquals("StoreRequest attributes were " + attributes + ", expected " + expectedAttributes, | ||
expectedAttributes, attributes); | ||
} | ||
|
||
} |
Oops, something went wrong.