persistencetest.java

来自「开源的OpenId的一个java实现」· Java 代码 · 共 67 行

JAVA
67
字号
/* * Copyright 2005-2007 WSO2, Inc. (http://wso2.com) * * 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 org.wso2.solutions.identity.persistence;import org.wso2.solutions.identity.persistence.dataobject.ClaimDO;import org.wso2.solutions.identity.persistence.dataobject.DialectDO;import org.wso2.solutions.identity.persistence.dataobject.RelyingPartyDO;import junit.framework.TestCase;public class PersistenceTest extends TestCase {    public void testDatabase() throws Exception {        IPPersistenceManager ipdb = IPPersistenceManager                .getPersistanceManager();        RelyingPartyDO rp = new RelyingPartyDO();        rp.setHostName("localhost");        ipdb.create(rp);        DialectDO dialect = new DialectDO();        dialect.setDialectUri("http://dialectUri1");        dialect.setDialectInfo("Info is dialect info1");        ipdb.create(dialect);        ClaimDO claim = new ClaimDO();        claim.getAttrId();        claim.setAttrId("test1");        claim.setUri("http://wso2/data/home_address1");        claim.setDescription("description1");        claim.setDisplayTag("display tag1");        claim.setDialect(dialect);        ipdb.create(claim);        // .addClaimValueToUser("dimuthu", "http://wso2/data/home_address", "59        // C Horana");        // ipdb.addPPIDValueToUserAndRP("dimuthu", "http://localhost/8080",        // "23eiiokkasdfolkj");        // String val = ipdb.getClaimValue("dimuthu",        // "http://wso2/data/home_address");        // System.out.println(val);        // assertEquals("", "59 C Horana", val);        // val = ipdb.getPPIDValue("dimuthu", "http://localhost/8080");        // System.out.println(val);        // assertEquals("", "23eiiokkasdfolkj", val);    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?