You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by tv...@apache.org on 2007/05/05 08:58:51 UTC
svn commit: r535465 [34/49] - in /jakarta/turbine/fulcrum/trunk: ./ bsf/
bsf/src/java/org/apache/fulcrum/bsf/ bsf/src/test/ bsf/xdocs/ cache/
cache/src/java/org/apache/fulcrum/cache/
cache/src/java/org/apache/fulcrum/cache/impl/ cache/src/test/ cache/s...
Modified: jakarta/turbine/fulcrum/trunk/security/torque/src/test/fulcrum-dynamic-schema.sql
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/security/torque/src/test/fulcrum-dynamic-schema.sql?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/security/torque/src/test/fulcrum-dynamic-schema.sql (original)
+++ jakarta/turbine/fulcrum/trunk/security/torque/src/test/fulcrum-dynamic-schema.sql Fri May 4 23:58:06 2007
@@ -1,157 +1,173 @@
-
------------------------------------------------------------------------------
--- FULCRUM_DYNAMIC_PERMISSION
------------------------------------------------------------------------------
-drop table FULCRUM_DYNAMIC_PERMISSION if exists CASCADE;
-
-CREATE TABLE FULCRUM_DYNAMIC_PERMISSION
-(
- PERMISSION_ID INTEGER NOT NULL,
- PERMISSION_NAME VARCHAR(64) NOT NULL,
- PRIMARY KEY(PERMISSION_ID),
- UNIQUE (PERMISSION_NAME)
-);
-
-
------------------------------------------------------------------------------
--- FULCRUM_DYNAMIC_ROLE
------------------------------------------------------------------------------
-drop table FULCRUM_DYNAMIC_ROLE if exists CASCADE;
-
-CREATE TABLE FULCRUM_DYNAMIC_ROLE
-(
- ROLE_ID INTEGER NOT NULL,
- ROLE_NAME VARCHAR(64) NOT NULL,
- PRIMARY KEY(ROLE_ID),
- UNIQUE (ROLE_NAME)
-);
-
-
------------------------------------------------------------------------------
--- FULCRUM_DYNAMIC_GROUP
------------------------------------------------------------------------------
-drop table FULCRUM_DYNAMIC_GROUP if exists CASCADE;
-
-CREATE TABLE FULCRUM_DYNAMIC_GROUP
-(
- GROUP_ID INTEGER NOT NULL,
- GROUP_NAME VARCHAR(64) NOT NULL,
- PRIMARY KEY(GROUP_ID),
- UNIQUE (GROUP_NAME)
-);
-
-
------------------------------------------------------------------------------
--- FULCRUM_DYNAMIC_USER
------------------------------------------------------------------------------
-drop table FULCRUM_DYNAMIC_USER if exists CASCADE;
-
-CREATE TABLE FULCRUM_DYNAMIC_USER
-(
- USER_ID INTEGER NOT NULL,
- LOGIN_NAME VARCHAR(64) NOT NULL,
- PASSWORD_VALUE VARCHAR(16) NOT NULL,
- PRIMARY KEY(USER_ID),
- UNIQUE (LOGIN_NAME)
-);
-
-
------------------------------------------------------------------------------
--- DYNAMIC_ROLE_PERMISSION
------------------------------------------------------------------------------
-drop table DYNAMIC_ROLE_PERMISSION if exists CASCADE;
-
-CREATE TABLE DYNAMIC_ROLE_PERMISSION
-(
- ROLE_ID INTEGER NOT NULL,
- PERMISSION_ID INTEGER NOT NULL,
- PRIMARY KEY(ROLE_ID,PERMISSION_ID)
-);
-
-
------------------------------------------------------------------------------
--- DYNAMIC_USER_GROUP
------------------------------------------------------------------------------
-drop table DYNAMIC_USER_GROUP if exists CASCADE;
-
-CREATE TABLE DYNAMIC_USER_GROUP
-(
- USER_ID INTEGER NOT NULL,
- GROUP_ID INTEGER NOT NULL,
- PRIMARY KEY(USER_ID,GROUP_ID)
-);
-
-
------------------------------------------------------------------------------
--- DYNAMIC_GROUP_ROLE
------------------------------------------------------------------------------
-drop table DYNAMIC_GROUP_ROLE if exists CASCADE;
-
-CREATE TABLE DYNAMIC_GROUP_ROLE
-(
- GROUP_ID INTEGER NOT NULL,
- ROLE_ID INTEGER NOT NULL,
- PRIMARY KEY(GROUP_ID,ROLE_ID)
-);
-
-
------------------------------------------------------------------------------
--- DYNAMIC_USER_DELEGATES
------------------------------------------------------------------------------
-drop table DYNAMIC_USER_DELEGATES if exists CASCADE;
-
-CREATE TABLE DYNAMIC_USER_DELEGATES
-(
- DELEGATOR_USER_ID INTEGER NOT NULL,
- DELEGATEE_USER_ID INTEGER NOT NULL,
- PRIMARY KEY(DELEGATOR_USER_ID,DELEGATEE_USER_ID)
-);
-
-
-
-
-
-
-
-
-
- ALTER TABLE DYNAMIC_ROLE_PERMISSION
- ADD CONSTRAINT DYNAMIC_ROLE_PERMISSION_FK_1 FOREIGN KEY (ROLE_ID)
- REFERENCES FULCRUM_DYNAMIC_ROLE (ROLE_ID)
-;
- ALTER TABLE DYNAMIC_ROLE_PERMISSION
- ADD CONSTRAINT DYNAMIC_ROLE_PERMISSION_FK_2 FOREIGN KEY (PERMISSION_ID)
- REFERENCES FULCRUM_DYNAMIC_PERMISSION (PERMISSION_ID)
-;
-
-
- ALTER TABLE DYNAMIC_USER_GROUP
- ADD CONSTRAINT DYNAMIC_USER_GROUP_FK_1 FOREIGN KEY (USER_ID)
- REFERENCES FULCRUM_DYNAMIC_USER (USER_ID)
-;
- ALTER TABLE DYNAMIC_USER_GROUP
- ADD CONSTRAINT DYNAMIC_USER_GROUP_FK_2 FOREIGN KEY (GROUP_ID)
- REFERENCES FULCRUM_DYNAMIC_GROUP (GROUP_ID)
-;
-
-
- ALTER TABLE DYNAMIC_GROUP_ROLE
- ADD CONSTRAINT DYNAMIC_GROUP_ROLE_FK_1 FOREIGN KEY (GROUP_ID)
- REFERENCES FULCRUM_DYNAMIC_GROUP (GROUP_ID)
-;
- ALTER TABLE DYNAMIC_GROUP_ROLE
- ADD CONSTRAINT DYNAMIC_GROUP_ROLE_FK_2 FOREIGN KEY (ROLE_ID)
- REFERENCES FULCRUM_DYNAMIC_ROLE (ROLE_ID)
-;
-
-
- ALTER TABLE DYNAMIC_USER_DELEGATES
- ADD CONSTRAINT DYNAMIC_USER_DELEGATES_FK_1 FOREIGN KEY (DELEGATOR_USER_ID)
- REFERENCES FULCRUM_DYNAMIC_USER (USER_ID)
-;
- ALTER TABLE DYNAMIC_USER_DELEGATES
- ADD CONSTRAINT DYNAMIC_USER_DELEGATES_FK_2 FOREIGN KEY (DELEGATEE_USER_ID)
- REFERENCES FULCRUM_DYNAMIC_USER (USER_ID)
-;
-
-
+-- 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.
+
+-- ---------------------------------------------------------------------------
+-- FULCRUM_DYNAMIC_PERMISSION
+-- ---------------------------------------------------------------------------
+drop table FULCRUM_DYNAMIC_PERMISSION if exists CASCADE;
+
+CREATE TABLE FULCRUM_DYNAMIC_PERMISSION
+(
+ PERMISSION_ID INTEGER NOT NULL,
+ PERMISSION_NAME VARCHAR(64) NOT NULL,
+ PRIMARY KEY(PERMISSION_ID),
+ UNIQUE (PERMISSION_NAME)
+);
+
+
+-- ---------------------------------------------------------------------------
+-- FULCRUM_DYNAMIC_ROLE
+-- ---------------------------------------------------------------------------
+drop table FULCRUM_DYNAMIC_ROLE if exists CASCADE;
+
+CREATE TABLE FULCRUM_DYNAMIC_ROLE
+(
+ ROLE_ID INTEGER NOT NULL,
+ ROLE_NAME VARCHAR(64) NOT NULL,
+ PRIMARY KEY(ROLE_ID),
+ UNIQUE (ROLE_NAME)
+);
+
+
+-- ---------------------------------------------------------------------------
+-- FULCRUM_DYNAMIC_GROUP
+-- ---------------------------------------------------------------------------
+drop table FULCRUM_DYNAMIC_GROUP if exists CASCADE;
+
+CREATE TABLE FULCRUM_DYNAMIC_GROUP
+(
+ GROUP_ID INTEGER NOT NULL,
+ GROUP_NAME VARCHAR(64) NOT NULL,
+ PRIMARY KEY(GROUP_ID),
+ UNIQUE (GROUP_NAME)
+);
+
+
+-- ---------------------------------------------------------------------------
+-- FULCRUM_DYNAMIC_USER
+-- ---------------------------------------------------------------------------
+drop table FULCRUM_DYNAMIC_USER if exists CASCADE;
+
+CREATE TABLE FULCRUM_DYNAMIC_USER
+(
+ USER_ID INTEGER NOT NULL,
+ LOGIN_NAME VARCHAR(64) NOT NULL,
+ PASSWORD_VALUE VARCHAR(16) NOT NULL,
+ PRIMARY KEY(USER_ID),
+ UNIQUE (LOGIN_NAME)
+);
+
+
+-- ---------------------------------------------------------------------------
+-- DYNAMIC_ROLE_PERMISSION
+-- ---------------------------------------------------------------------------
+drop table DYNAMIC_ROLE_PERMISSION if exists CASCADE;
+
+CREATE TABLE DYNAMIC_ROLE_PERMISSION
+(
+ ROLE_ID INTEGER NOT NULL,
+ PERMISSION_ID INTEGER NOT NULL,
+ PRIMARY KEY(ROLE_ID,PERMISSION_ID)
+);
+
+
+-- ---------------------------------------------------------------------------
+-- DYNAMIC_USER_GROUP
+-- ---------------------------------------------------------------------------
+drop table DYNAMIC_USER_GROUP if exists CASCADE;
+
+CREATE TABLE DYNAMIC_USER_GROUP
+(
+ USER_ID INTEGER NOT NULL,
+ GROUP_ID INTEGER NOT NULL,
+ PRIMARY KEY(USER_ID,GROUP_ID)
+);
+
+
+-- ---------------------------------------------------------------------------
+-- DYNAMIC_GROUP_ROLE
+-- ---------------------------------------------------------------------------
+drop table DYNAMIC_GROUP_ROLE if exists CASCADE;
+
+CREATE TABLE DYNAMIC_GROUP_ROLE
+(
+ GROUP_ID INTEGER NOT NULL,
+ ROLE_ID INTEGER NOT NULL,
+ PRIMARY KEY(GROUP_ID,ROLE_ID)
+);
+
+
+-- ---------------------------------------------------------------------------
+-- DYNAMIC_USER_DELEGATES
+-- ---------------------------------------------------------------------------
+drop table DYNAMIC_USER_DELEGATES if exists CASCADE;
+
+CREATE TABLE DYNAMIC_USER_DELEGATES
+(
+ DELEGATOR_USER_ID INTEGER NOT NULL,
+ DELEGATEE_USER_ID INTEGER NOT NULL,
+ PRIMARY KEY(DELEGATOR_USER_ID,DELEGATEE_USER_ID)
+);
+
+
+
+
+
+
+
+
+
+ ALTER TABLE DYNAMIC_ROLE_PERMISSION
+ ADD CONSTRAINT DYNAMIC_ROLE_PERMISSION_FK_1 FOREIGN KEY (ROLE_ID)
+ REFERENCES FULCRUM_DYNAMIC_ROLE (ROLE_ID)
+;
+ ALTER TABLE DYNAMIC_ROLE_PERMISSION
+ ADD CONSTRAINT DYNAMIC_ROLE_PERMISSION_FK_2 FOREIGN KEY (PERMISSION_ID)
+ REFERENCES FULCRUM_DYNAMIC_PERMISSION (PERMISSION_ID)
+;
+
+
+ ALTER TABLE DYNAMIC_USER_GROUP
+ ADD CONSTRAINT DYNAMIC_USER_GROUP_FK_1 FOREIGN KEY (USER_ID)
+ REFERENCES FULCRUM_DYNAMIC_USER (USER_ID)
+;
+ ALTER TABLE DYNAMIC_USER_GROUP
+ ADD CONSTRAINT DYNAMIC_USER_GROUP_FK_2 FOREIGN KEY (GROUP_ID)
+ REFERENCES FULCRUM_DYNAMIC_GROUP (GROUP_ID)
+;
+
+
+ ALTER TABLE DYNAMIC_GROUP_ROLE
+ ADD CONSTRAINT DYNAMIC_GROUP_ROLE_FK_1 FOREIGN KEY (GROUP_ID)
+ REFERENCES FULCRUM_DYNAMIC_GROUP (GROUP_ID)
+;
+ ALTER TABLE DYNAMIC_GROUP_ROLE
+ ADD CONSTRAINT DYNAMIC_GROUP_ROLE_FK_2 FOREIGN KEY (ROLE_ID)
+ REFERENCES FULCRUM_DYNAMIC_ROLE (ROLE_ID)
+;
+
+
+ ALTER TABLE DYNAMIC_USER_DELEGATES
+ ADD CONSTRAINT DYNAMIC_USER_DELEGATES_FK_1 FOREIGN KEY (DELEGATOR_USER_ID)
+ REFERENCES FULCRUM_DYNAMIC_USER (USER_ID)
+;
+ ALTER TABLE DYNAMIC_USER_DELEGATES
+ ADD CONSTRAINT DYNAMIC_USER_DELEGATES_FK_2 FOREIGN KEY (DELEGATEE_USER_ID)
+ REFERENCES FULCRUM_DYNAMIC_USER (USER_ID)
+;
+
+
Modified: jakarta/turbine/fulcrum/trunk/security/torque/src/test/fulcrum-turbine-schema-idtable-init.sql
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/security/torque/src/test/fulcrum-turbine-schema-idtable-init.sql?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/security/torque/src/test/fulcrum-turbine-schema-idtable-init.sql (original)
+++ jakarta/turbine/fulcrum/trunk/security/torque/src/test/fulcrum-turbine-schema-idtable-init.sql Fri May 4 23:58:06 2007
@@ -1,6 +1,22 @@
-insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES (2101, 'FULCRUM_TURBINE_PERMISSION', 1000, 10);
-insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES (2102, 'FULCRUM_TURBINE_ROLE', 1000, 10);
-insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES (2103, 'FULCRUM_TURBINE_GROUP', 1000, 10);
-insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES (2104, 'FULCRUM_TURBINE_USER', 1000, 10);
-insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES (2105, 'TURBINE_ROLE_PERMISSION', 1000, 10);
-insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES (2106, 'TURBINE_USER_GROUP_ROLE', 1000, 10);
+-- 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.
+insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES (2101, 'FULCRUM_TURBINE_PERMISSION', 1000, 10);
+insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES (2102, 'FULCRUM_TURBINE_ROLE', 1000, 10);
+insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES (2103, 'FULCRUM_TURBINE_GROUP', 1000, 10);
+insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES (2104, 'FULCRUM_TURBINE_USER', 1000, 10);
+insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES (2105, 'TURBINE_ROLE_PERMISSION', 1000, 10);
+insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES (2106, 'TURBINE_USER_GROUP_ROLE', 1000, 10);
Modified: jakarta/turbine/fulcrum/trunk/security/torque/src/test/fulcrum-turbine-schema.sql
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/security/torque/src/test/fulcrum-turbine-schema.sql?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/security/torque/src/test/fulcrum-turbine-schema.sql (original)
+++ jakarta/turbine/fulcrum/trunk/security/torque/src/test/fulcrum-turbine-schema.sql Fri May 4 23:58:06 2007
@@ -1,116 +1,132 @@
-
------------------------------------------------------------------------------
--- FULCRUM_TURBINE_PERMISSION
------------------------------------------------------------------------------
-drop table FULCRUM_TURBINE_PERMISSION if exists CASCADE;
-
-CREATE TABLE FULCRUM_TURBINE_PERMISSION
-(
- PERMISSION_ID INTEGER NOT NULL,
- PERMISSION_NAME VARCHAR(64) NOT NULL,
- PRIMARY KEY(PERMISSION_ID),
- UNIQUE (PERMISSION_NAME)
-);
-
-
------------------------------------------------------------------------------
--- FULCRUM_TURBINE_ROLE
------------------------------------------------------------------------------
-drop table FULCRUM_TURBINE_ROLE if exists CASCADE;
-
-CREATE TABLE FULCRUM_TURBINE_ROLE
-(
- ROLE_ID INTEGER NOT NULL,
- ROLE_NAME VARCHAR(64) NOT NULL,
- PRIMARY KEY(ROLE_ID),
- UNIQUE (ROLE_NAME)
-);
-
-
------------------------------------------------------------------------------
--- FULCRUM_TURBINE_GROUP
------------------------------------------------------------------------------
-drop table FULCRUM_TURBINE_GROUP if exists CASCADE;
-
-CREATE TABLE FULCRUM_TURBINE_GROUP
-(
- GROUP_ID INTEGER NOT NULL,
- GROUP_NAME VARCHAR(64) NOT NULL,
- PRIMARY KEY(GROUP_ID),
- UNIQUE (GROUP_NAME)
-);
-
-
------------------------------------------------------------------------------
--- FULCRUM_TURBINE_USER
------------------------------------------------------------------------------
-drop table FULCRUM_TURBINE_USER if exists CASCADE;
-
-CREATE TABLE FULCRUM_TURBINE_USER
-(
- USER_ID INTEGER NOT NULL,
- LOGIN_NAME VARCHAR(64) NOT NULL,
- PASSWORD_VALUE VARCHAR(16) NOT NULL,
- PRIMARY KEY(USER_ID),
- UNIQUE (LOGIN_NAME)
-);
-
-
------------------------------------------------------------------------------
--- TURBINE_ROLE_PERMISSION
------------------------------------------------------------------------------
-drop table TURBINE_ROLE_PERMISSION if exists CASCADE;
-
-CREATE TABLE TURBINE_ROLE_PERMISSION
-(
- ROLE_ID INTEGER NOT NULL,
- PERMISSION_ID INTEGER NOT NULL,
- PRIMARY KEY(ROLE_ID,PERMISSION_ID)
-);
-
-
------------------------------------------------------------------------------
--- TURBINE_USER_GROUP_ROLE
------------------------------------------------------------------------------
-drop table TURBINE_USER_GROUP_ROLE if exists CASCADE;
-
-CREATE TABLE TURBINE_USER_GROUP_ROLE
-(
- USER_ID INTEGER NOT NULL,
- GROUP_ID INTEGER NOT NULL,
- ROLE_ID INTEGER NOT NULL,
- PRIMARY KEY(USER_ID,GROUP_ID,ROLE_ID)
-);
-
-
-
-
-
-
-
-
-
- ALTER TABLE TURBINE_ROLE_PERMISSION
- ADD CONSTRAINT TURBINE_ROLE_PERMISSION_FK_1 FOREIGN KEY (ROLE_ID)
- REFERENCES FULCRUM_TURBINE_ROLE (ROLE_ID)
-;
- ALTER TABLE TURBINE_ROLE_PERMISSION
- ADD CONSTRAINT TURBINE_ROLE_PERMISSION_FK_2 FOREIGN KEY (PERMISSION_ID)
- REFERENCES FULCRUM_TURBINE_PERMISSION (PERMISSION_ID)
-;
-
-
- ALTER TABLE TURBINE_USER_GROUP_ROLE
- ADD CONSTRAINT TURBINE_USER_GROUP_ROLE_FK_1 FOREIGN KEY (USER_ID)
- REFERENCES FULCRUM_TURBINE_USER (USER_ID)
-;
- ALTER TABLE TURBINE_USER_GROUP_ROLE
- ADD CONSTRAINT TURBINE_USER_GROUP_ROLE_FK_2 FOREIGN KEY (GROUP_ID)
- REFERENCES FULCRUM_TURBINE_GROUP (GROUP_ID)
-;
- ALTER TABLE TURBINE_USER_GROUP_ROLE
- ADD CONSTRAINT TURBINE_USER_GROUP_ROLE_FK_3 FOREIGN KEY (ROLE_ID)
- REFERENCES FULCRUM_TURBINE_ROLE (ROLE_ID)
-;
-
-
+-- 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.
+
+-- ---------------------------------------------------------------------------
+-- FULCRUM_TURBINE_PERMISSION
+-- ---------------------------------------------------------------------------
+drop table FULCRUM_TURBINE_PERMISSION if exists CASCADE;
+
+CREATE TABLE FULCRUM_TURBINE_PERMISSION
+(
+ PERMISSION_ID INTEGER NOT NULL,
+ PERMISSION_NAME VARCHAR(64) NOT NULL,
+ PRIMARY KEY(PERMISSION_ID),
+ UNIQUE (PERMISSION_NAME)
+);
+
+
+-- ---------------------------------------------------------------------------
+-- FULCRUM_TURBINE_ROLE
+-- ---------------------------------------------------------------------------
+drop table FULCRUM_TURBINE_ROLE if exists CASCADE;
+
+CREATE TABLE FULCRUM_TURBINE_ROLE
+(
+ ROLE_ID INTEGER NOT NULL,
+ ROLE_NAME VARCHAR(64) NOT NULL,
+ PRIMARY KEY(ROLE_ID),
+ UNIQUE (ROLE_NAME)
+);
+
+
+-- ---------------------------------------------------------------------------
+-- FULCRUM_TURBINE_GROUP
+-- ---------------------------------------------------------------------------
+drop table FULCRUM_TURBINE_GROUP if exists CASCADE;
+
+CREATE TABLE FULCRUM_TURBINE_GROUP
+(
+ GROUP_ID INTEGER NOT NULL,
+ GROUP_NAME VARCHAR(64) NOT NULL,
+ PRIMARY KEY(GROUP_ID),
+ UNIQUE (GROUP_NAME)
+);
+
+
+-- ---------------------------------------------------------------------------
+-- FULCRUM_TURBINE_USER
+-- ---------------------------------------------------------------------------
+drop table FULCRUM_TURBINE_USER if exists CASCADE;
+
+CREATE TABLE FULCRUM_TURBINE_USER
+(
+ USER_ID INTEGER NOT NULL,
+ LOGIN_NAME VARCHAR(64) NOT NULL,
+ PASSWORD_VALUE VARCHAR(16) NOT NULL,
+ PRIMARY KEY(USER_ID),
+ UNIQUE (LOGIN_NAME)
+);
+
+
+-- ---------------------------------------------------------------------------
+-- TURBINE_ROLE_PERMISSION
+-- ---------------------------------------------------------------------------
+drop table TURBINE_ROLE_PERMISSION if exists CASCADE;
+
+CREATE TABLE TURBINE_ROLE_PERMISSION
+(
+ ROLE_ID INTEGER NOT NULL,
+ PERMISSION_ID INTEGER NOT NULL,
+ PRIMARY KEY(ROLE_ID,PERMISSION_ID)
+);
+
+
+-- ---------------------------------------------------------------------------
+-- TURBINE_USER_GROUP_ROLE
+-- ---------------------------------------------------------------------------
+drop table TURBINE_USER_GROUP_ROLE if exists CASCADE;
+
+CREATE TABLE TURBINE_USER_GROUP_ROLE
+(
+ USER_ID INTEGER NOT NULL,
+ GROUP_ID INTEGER NOT NULL,
+ ROLE_ID INTEGER NOT NULL,
+ PRIMARY KEY(USER_ID,GROUP_ID,ROLE_ID)
+);
+
+
+
+
+
+
+
+
+
+ ALTER TABLE TURBINE_ROLE_PERMISSION
+ ADD CONSTRAINT TURBINE_ROLE_PERMISSION_FK_1 FOREIGN KEY (ROLE_ID)
+ REFERENCES FULCRUM_TURBINE_ROLE (ROLE_ID)
+;
+ ALTER TABLE TURBINE_ROLE_PERMISSION
+ ADD CONSTRAINT TURBINE_ROLE_PERMISSION_FK_2 FOREIGN KEY (PERMISSION_ID)
+ REFERENCES FULCRUM_TURBINE_PERMISSION (PERMISSION_ID)
+;
+
+
+ ALTER TABLE TURBINE_USER_GROUP_ROLE
+ ADD CONSTRAINT TURBINE_USER_GROUP_ROLE_FK_1 FOREIGN KEY (USER_ID)
+ REFERENCES FULCRUM_TURBINE_USER (USER_ID)
+;
+ ALTER TABLE TURBINE_USER_GROUP_ROLE
+ ADD CONSTRAINT TURBINE_USER_GROUP_ROLE_FK_2 FOREIGN KEY (GROUP_ID)
+ REFERENCES FULCRUM_TURBINE_GROUP (GROUP_ID)
+;
+ ALTER TABLE TURBINE_USER_GROUP_ROLE
+ ADD CONSTRAINT TURBINE_USER_GROUP_ROLE_FK_3 FOREIGN KEY (ROLE_ID)
+ REFERENCES FULCRUM_TURBINE_ROLE (ROLE_ID)
+;
+
+
Modified: jakarta/turbine/fulcrum/trunk/security/torque/src/test/id-table-schema.sql
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/security/torque/src/test/id-table-schema.sql?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/security/torque/src/test/id-table-schema.sql (original)
+++ jakarta/turbine/fulcrum/trunk/security/torque/src/test/id-table-schema.sql Fri May 4 23:58:06 2007
@@ -1,18 +1,34 @@
-
------------------------------------------------------------------------------
--- ID_TABLE
------------------------------------------------------------------------------
-drop table ID_TABLE if exists CASCADE;
-
-CREATE TABLE ID_TABLE
-(
- ID_TABLE_ID INTEGER NOT NULL,
- TABLE_NAME VARCHAR(255) NOT NULL,
- NEXT_ID INTEGER,
- QUANTITY INTEGER,
- PRIMARY KEY(ID_TABLE_ID),
- UNIQUE (TABLE_NAME)
-);
-
-
-
+-- 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.
+
+-- ---------------------------------------------------------------------------
+-- ID_TABLE
+-- ---------------------------------------------------------------------------
+drop table ID_TABLE if exists CASCADE;
+
+CREATE TABLE ID_TABLE
+(
+ ID_TABLE_ID INTEGER NOT NULL,
+ TABLE_NAME VARCHAR(255) NOT NULL,
+ NEXT_ID INTEGER,
+ QUANTITY INTEGER,
+ PRIMARY KEY(ID_TABLE_ID),
+ UNIQUE (TABLE_NAME)
+);
+
+
+
Modified: jakarta/turbine/fulcrum/trunk/security/torque/src/test/log4j.properties
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/security/torque/src/test/log4j.properties?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/security/torque/src/test/log4j.properties (original)
+++ jakarta/turbine/fulcrum/trunk/security/torque/src/test/log4j.properties Fri May 4 23:58:06 2007
@@ -1,70 +1,86 @@
-# ------------------------------------------------------------------------
-#
-# Logging Configuration
-#
-# Mix of Turbine logging configuration and Hibernate configuration
-#
-# ------------------------------------------------------------------------
-
-#
-# If we don't know the logging facility, put it into the
-# turbine.log
-#
-log4j.rootLogger = DEBUG, turbine
-
-#
-# Turbine goes into Turbine Log
-#
-log4j.category.org.apache.turbine = INFO, turbine
-log4j.additivity.org.apache.turbine = false
-
-#
-# Torque Logfile
-#
-log4j.category.org.apache.torque = DEBUG, torque
-log4j.additivity.org.apache.torque = false
-
-#
-# Avalon Logfile
-#
-log4j.category.avalon = INFO, avalon
-log4j.additivity.avalon = false
-
-########################################################################
-#
-# Logfile definitions
-#
-########################################################################
-
-#
-# turbine.log
-#
-log4j.appender.turbine = org.apache.log4j.FileAppender
-log4j.appender.turbine.file = turbine.log
-log4j.appender.turbine.layout = org.apache.log4j.PatternLayout
-log4j.appender.turbine.layout.conversionPattern = %d [%t] %-5p %c - %m%n
-log4j.appender.turbine.append = false
-
-#
-# torque.log
-#
-log4j.appender.torque = org.apache.log4j.FileAppender
-log4j.appender.torque.file = target/torque.log
-log4j.appender.torque.layout = org.apache.log4j.PatternLayout
-log4j.appender.torque.layout.conversionPattern = %d [%t] %-5p %c - %m%n
-log4j.appender.torque.append = false
-
-#
-# Avalon gets configured to write its output onto the avalon
-# category.
-#
-log4j.appender.avalon = org.apache.log4j.FileAppender
-log4j.appender.avalon.file = target/avalon.log
-log4j.appender.avalon.layout = org.apache.log4j.PatternLayout
-log4j.appender.avalon.layout.conversionPattern = %d [%t] %-5p %c - %m%n
-log4j.appender.avalon.append = false
-
-
-### set log levels - for more verbose logging change 'info' to 'debug' ##
-
-#log4j.rootLogger=debug, stdout
+# 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.
+# ------------------------------------------------------------------------
+#
+# Logging Configuration
+#
+# Mix of Turbine logging configuration and Hibernate configuration
+#
+# ------------------------------------------------------------------------
+
+#
+# If we don't know the logging facility, put it into the
+# turbine.log
+#
+log4j.rootLogger = DEBUG, turbine
+
+#
+# Turbine goes into Turbine Log
+#
+log4j.category.org.apache.turbine = INFO, turbine
+log4j.additivity.org.apache.turbine = false
+
+#
+# Torque Logfile
+#
+log4j.category.org.apache.torque = DEBUG, torque
+log4j.additivity.org.apache.torque = false
+
+#
+# Avalon Logfile
+#
+log4j.category.avalon = INFO, avalon
+log4j.additivity.avalon = false
+
+# #######################################################################
+#
+# Logfile definitions
+#
+# #######################################################################
+
+#
+# turbine.log
+#
+log4j.appender.turbine = org.apache.log4j.FileAppender
+log4j.appender.turbine.file = turbine.log
+log4j.appender.turbine.layout = org.apache.log4j.PatternLayout
+log4j.appender.turbine.layout.conversionPattern = %d [%t] %-5p %c - %m%n
+log4j.appender.turbine.append = false
+
+#
+# torque.log
+#
+log4j.appender.torque = org.apache.log4j.FileAppender
+log4j.appender.torque.file = target/torque.log
+log4j.appender.torque.layout = org.apache.log4j.PatternLayout
+log4j.appender.torque.layout.conversionPattern = %d [%t] %-5p %c - %m%n
+log4j.appender.torque.append = false
+
+#
+# Avalon gets configured to write its output onto the avalon
+# category.
+#
+log4j.appender.avalon = org.apache.log4j.FileAppender
+log4j.appender.avalon.file = target/avalon.log
+log4j.appender.avalon.layout = org.apache.log4j.PatternLayout
+log4j.appender.avalon.layout.conversionPattern = %d [%t] %-5p %c - %m%n
+log4j.appender.avalon.append = false
+
+
+# ## set log levels - for more verbose logging change 'info' to 'debug' ##
+
+# log4j.rootLogger=debug, stdout
Modified: jakarta/turbine/fulcrum/trunk/security/torque/src/test/org/apache/fulcrum/security/torque/HsqlDB.java
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/security/torque/src/test/org/apache/fulcrum/security/torque/HsqlDB.java?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/security/torque/src/test/org/apache/fulcrum/security/torque/HsqlDB.java (original)
+++ jakarta/turbine/fulcrum/trunk/security/torque/src/test/org/apache/fulcrum/security/torque/HsqlDB.java Fri May 4 23:58:06 2007
@@ -1,152 +1,155 @@
-package org.apache.fulcrum.security.torque;
-
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * 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.
- */
-
-import java.io.File;
-import java.io.FileReader;
-import java.net.URL;
-
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.SQLException;
-import java.sql.Statement;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.hsqldb.jdbcDriver;
-
-/**
- * This Class provides a nice Setup for a Hypersonic SQL Server,
- * which will only be held in Memory.
- *
- * It allows loading of .sql Files, to setup Tests easily.
- *
- * @author <a href="jh@byteaction.de">Jürgen Hoffmann</a>
- */
-public class HsqlDB
-{
- private Connection connection = null;
-
- private static Log log = LogFactory.getLog(HsqlDB.class);
-
- public HsqlDB(String uri, String loadFile) throws Exception
- {
- Class.forName(jdbcDriver.class.getName());
-
- this.connection = DriverManager.getConnection(uri, "sa", "");
-
- if(StringUtils.isNotEmpty(loadFile))
- {
- loadSqlFile(loadFile);
- }
- }
-
- public HsqlDB(String uri, URL loadFile) throws Exception
- {
- this(uri, new File(loadFile.toURI()));
- }
-
- public HsqlDB(String uri, File loadFile) throws Exception
- {
- this(uri, loadFile.getAbsolutePath());
- }
-
- public Connection getConnection()
- {
- return connection;
- }
-
- public void close()
- {
- try
- {
- connection.close();
- }
- catch (Exception e)
- {
- }
- }
-
- private void loadSqlFile(String fileName) throws Exception
- {
- Statement statement = null;
- try
- {
- statement = connection.createStatement();
- String commands = getFileContents(fileName);
-
- for (int targetPos = commands.indexOf(';'); targetPos > -1; targetPos = commands.indexOf(';'))
- {
- String cmd = commands.substring(0, targetPos + 1);
- try
- {
- statement.execute(cmd);
- }
- catch (SQLException sqle)
- {
- log.warn("Statement: " + cmd + ": " + sqle.getMessage());
- }
-
- commands = commands.substring(targetPos + 2);
- }
- }
- finally
- {
- if(statement != null)
- {
- statement.close();
- }
- }
- }
-
- private String getFileContents(String fileName) throws Exception
- {
- System.out.println(fileName);
- FileReader fr = new FileReader(fileName);
-
- char fileBuf[] = new char[1024];
- StringBuffer sb = new StringBuffer(1000);
- int res = -1;
-
- while ((res = fr.read(fileBuf, 0, 1024)) > -1)
- {
- sb.append(fileBuf, 0, res);
- }
- fr.close();
- return sb.toString();
- }
-
- public void addSQL(String sqlFile) throws Exception
- {
- if(StringUtils.isNotEmpty(sqlFile))
- {
- loadSqlFile(sqlFile);
- }
- }
-
- public void addSQL(URL sqlFile) throws Exception
- {
- this.addSQL(new File(sqlFile.toURI()));
- }
-
- public void addSQL(File sqlFile) throws Exception
- {
- this.addSQL(sqlFile.getAbsolutePath());
- }
-}
+package org.apache.fulcrum.security.torque;
+
+/*
+ * 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.
+ */
+
+import java.io.File;
+import java.io.FileReader;
+import java.net.URL;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.hsqldb.jdbcDriver;
+
+/**
+ * This Class provides a nice Setup for a Hypersonic SQL Server,
+ * which will only be held in Memory.
+ *
+ * It allows loading of .sql Files, to setup Tests easily.
+ *
+ * @author <a href="jh@byteaction.de">Jürgen Hoffmann</a>
+ */
+public class HsqlDB
+{
+ private Connection connection = null;
+
+ private static Log log = LogFactory.getLog(HsqlDB.class);
+
+ public HsqlDB(String uri, String loadFile) throws Exception
+ {
+ Class.forName(jdbcDriver.class.getName());
+
+ this.connection = DriverManager.getConnection(uri, "sa", "");
+
+ if(StringUtils.isNotEmpty(loadFile))
+ {
+ loadSqlFile(loadFile);
+ }
+ }
+
+ public HsqlDB(String uri, URL loadFile) throws Exception
+ {
+ this(uri, new File(loadFile.toURI()));
+ }
+
+ public HsqlDB(String uri, File loadFile) throws Exception
+ {
+ this(uri, loadFile.getAbsolutePath());
+ }
+
+ public Connection getConnection()
+ {
+ return connection;
+ }
+
+ public void close()
+ {
+ try
+ {
+ connection.close();
+ }
+ catch (Exception e)
+ {
+ }
+ }
+
+ private void loadSqlFile(String fileName) throws Exception
+ {
+ Statement statement = null;
+ try
+ {
+ statement = connection.createStatement();
+ String commands = getFileContents(fileName);
+
+ for (int targetPos = commands.indexOf(';'); targetPos > -1; targetPos = commands.indexOf(';'))
+ {
+ String cmd = commands.substring(0, targetPos + 1);
+ try
+ {
+ statement.execute(cmd);
+ }
+ catch (SQLException sqle)
+ {
+ log.warn("Statement: " + cmd + ": " + sqle.getMessage());
+ }
+
+ commands = commands.substring(targetPos + 2);
+ }
+ }
+ finally
+ {
+ if(statement != null)
+ {
+ statement.close();
+ }
+ }
+ }
+
+ private String getFileContents(String fileName) throws Exception
+ {
+ System.out.println(fileName);
+ FileReader fr = new FileReader(fileName);
+
+ char fileBuf[] = new char[1024];
+ StringBuffer sb = new StringBuffer(1000);
+ int res = -1;
+
+ while ((res = fr.read(fileBuf, 0, 1024)) > -1)
+ {
+ sb.append(fileBuf, 0, res);
+ }
+ fr.close();
+ return sb.toString();
+ }
+
+ public void addSQL(String sqlFile) throws Exception
+ {
+ if(StringUtils.isNotEmpty(sqlFile))
+ {
+ loadSqlFile(sqlFile);
+ }
+ }
+
+ public void addSQL(URL sqlFile) throws Exception
+ {
+ this.addSQL(new File(sqlFile.toURI()));
+ }
+
+ public void addSQL(File sqlFile) throws Exception
+ {
+ this.addSQL(sqlFile.getAbsolutePath());
+ }
+}
Modified: jakarta/turbine/fulcrum/trunk/security/torque/src/test/org/apache/fulcrum/security/torque/StartingSecurityServicesTest.java
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/security/torque/src/test/org/apache/fulcrum/security/torque/StartingSecurityServicesTest.java?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/security/torque/src/test/org/apache/fulcrum/security/torque/StartingSecurityServicesTest.java (original)
+++ jakarta/turbine/fulcrum/trunk/security/torque/src/test/org/apache/fulcrum/security/torque/StartingSecurityServicesTest.java Fri May 4 23:58:06 2007
@@ -1,55 +1,58 @@
-package org.apache.fulcrum.security.torque;
-/*
- * Copyright 2001-2004 The Apache Software Foundation
- *
- * 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.
- */
-
-import org.apache.fulcrum.security.SecurityService;
-import org.apache.fulcrum.security.model.dynamic.DynamicModelManager;
-import org.apache.fulcrum.security.torque.dynamic.TorqueDynamicGroupManagerImpl;
-import org.apache.fulcrum.security.torque.dynamic.TorqueDynamicPermissionManagerImpl;
-import org.apache.fulcrum.security.torque.dynamic.TorqueDynamicRoleManagerImpl;
-import org.apache.fulcrum.security.torque.dynamic.TorqueDynamicUserManagerImpl;
-import org.apache.fulcrum.testcontainer.BaseUnitTest;
-
-/**
- * @author <a href="mailto:marco@intermeta.de">Marco Knüttel</a>
- * @version $Id: StartingSecurityServicesTest.java 223140 2004-11-01 13:29:25Z epugh $
- */
-
-public class StartingSecurityServicesTest extends BaseUnitTest
-{
- private SecurityService securityService = null;
- public StartingSecurityServicesTest(String name)
- {
- super(name);
- }
-
-
- public void testStartingTorqueSecurity() throws Exception
- {
- this.setRoleFileName("src/test/DynamicTorqueRoleConfig.xml");
- this.setConfigurationFileName("src/test/DynamicTorqueComponentConfig.xml");
- securityService = (SecurityService) lookup(SecurityService.ROLE);
- assertTrue(securityService.getUserManager() instanceof TorqueDynamicUserManagerImpl);
- assertTrue(securityService.getRoleManager() instanceof TorqueDynamicRoleManagerImpl);
- assertTrue(
- securityService.getPermissionManager() instanceof TorqueDynamicPermissionManagerImpl);
- assertTrue(securityService.getGroupManager() instanceof TorqueDynamicGroupManagerImpl);
- assertTrue(securityService.getModelManager() instanceof DynamicModelManager);
- }
-
-
-
-}
+package org.apache.fulcrum.security.torque;
+/*
+ * 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.
+ */
+
+import org.apache.fulcrum.security.SecurityService;
+import org.apache.fulcrum.security.model.dynamic.DynamicModelManager;
+import org.apache.fulcrum.security.torque.dynamic.TorqueDynamicGroupManagerImpl;
+import org.apache.fulcrum.security.torque.dynamic.TorqueDynamicPermissionManagerImpl;
+import org.apache.fulcrum.security.torque.dynamic.TorqueDynamicRoleManagerImpl;
+import org.apache.fulcrum.security.torque.dynamic.TorqueDynamicUserManagerImpl;
+import org.apache.fulcrum.testcontainer.BaseUnitTest;
+
+/**
+ * @author <a href="mailto:marco@intermeta.de">Marco Knüttel</a>
+ * @version $Id: StartingSecurityServicesTest.java 223140 2004-11-01 13:29:25Z epugh $
+ */
+
+public class StartingSecurityServicesTest extends BaseUnitTest
+{
+ private SecurityService securityService = null;
+ public StartingSecurityServicesTest(String name)
+ {
+ super(name);
+ }
+
+
+ public void testStartingTorqueSecurity() throws Exception
+ {
+ this.setRoleFileName("src/test/DynamicTorqueRoleConfig.xml");
+ this.setConfigurationFileName("src/test/DynamicTorqueComponentConfig.xml");
+ securityService = (SecurityService) lookup(SecurityService.ROLE);
+ assertTrue(securityService.getUserManager() instanceof TorqueDynamicUserManagerImpl);
+ assertTrue(securityService.getRoleManager() instanceof TorqueDynamicRoleManagerImpl);
+ assertTrue(
+ securityService.getPermissionManager() instanceof TorqueDynamicPermissionManagerImpl);
+ assertTrue(securityService.getGroupManager() instanceof TorqueDynamicGroupManagerImpl);
+ assertTrue(securityService.getModelManager() instanceof DynamicModelManager);
+ }
+
+
+
+}
Modified: jakarta/turbine/fulcrum/trunk/security/torque/src/test/org/apache/fulcrum/security/torque/TorqueGroupManagerTest.java
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/security/torque/src/test/org/apache/fulcrum/security/torque/TorqueGroupManagerTest.java?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/security/torque/src/test/org/apache/fulcrum/security/torque/TorqueGroupManagerTest.java (original)
+++ jakarta/turbine/fulcrum/trunk/security/torque/src/test/org/apache/fulcrum/security/torque/TorqueGroupManagerTest.java Fri May 4 23:58:06 2007
@@ -1,107 +1,110 @@
-package org.apache.fulcrum.security.torque;
-/*
- * Copyright 2001-2004 The Apache Software Foundation
- *
- * 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.
- */
-
-import org.apache.fulcrum.security.SecurityService;
-import org.apache.fulcrum.security.model.test.AbstractGroupManagerTest;
-
-/**
- * @author <a href="mailto:tv@apache.org">Thomas Vandahl</a>
- * @version $Id:$
- */
-public class TorqueGroupManagerTest extends AbstractGroupManagerTest
-{
- protected static HsqlDB hsqlDB = null;
-
- public void setUp()
- {
- try
- {
- hsqlDB = new HsqlDB("jdbc:hsqldb:.", "src/test/fulcrum-basic-schema.sql");
- hsqlDB.addSQL("src/test/fulcrum-dynamic-schema.sql");
- hsqlDB.addSQL("src/test/fulcrum-turbine-schema.sql");
- hsqlDB.addSQL("src/test/id-table-schema.sql");
- hsqlDB.addSQL("src/test/fulcrum-basic-schema-idtable-init.sql");
- hsqlDB.addSQL("src/test/fulcrum-dynamic-schema-idtable-init.sql");
- hsqlDB.addSQL("src/test/fulcrum-turbine-schema-idtable-init.sql");
-
- this.setRoleFileName("src/test/DynamicTorqueRoleConfig.xml");
- this.setConfigurationFileName("src/test/DynamicTorqueComponentConfig.xml");
- securityService = (SecurityService) lookup(SecurityService.ROLE);
- groupManager = securityService.getGroupManager();
- }
- catch (Exception e)
- {
- fail(e.toString());
- }
- }
-
- public void tearDown()
- {
-/* // cleanup tables
- try
- {
- Criteria criteria = new Criteria();
- criteria.add(TorqueDynamicUserGroupPeer.USER_ID, 0, Criteria.GREATER_THAN);
- TorqueDynamicUserGroupPeer.doDelete(criteria);
-
- criteria.clear();
- criteria.add(TorqueDynamicGroupRolePeer.GROUP_ID, 0, Criteria.GREATER_THAN);
- TorqueDynamicGroupRolePeer.doDelete(criteria);
-
- criteria.clear();
- criteria.add(TorqueDynamicRolePermissionPeer.ROLE_ID, 0, Criteria.GREATER_THAN);
- TorqueDynamicRolePermissionPeer.doDelete(criteria);
-
- criteria.clear();
- criteria.add(TorqueDynamicUserDelegatesPeer.DELEGATEE_USER_ID, 0, Criteria.GREATER_THAN);
- TorqueDynamicUserDelegatesPeer.doDelete(criteria);
-
- criteria.clear();
- criteria.add(TorqueUserPeer.USER_ID, 0, Criteria.GREATER_THAN);
- TorqueUserPeer.doDelete(criteria);
-
- criteria.clear();
- criteria.add(TorqueGroupPeer.GROUP_ID, 0, Criteria.GREATER_THAN);
- TorqueGroupPeer.doDelete(criteria);
-
- criteria.clear();
- criteria.add(TorqueRolePeer.ROLE_ID, 0, Criteria.GREATER_THAN);
- TorqueRolePeer.doDelete(criteria);
-
- criteria.clear();
- criteria.add(TorquePermissionPeer.PERMISSION_ID, 0, Criteria.GREATER_THAN);
- TorquePermissionPeer.doDelete(criteria);
- }
- catch (TorqueException e)
- {
- fail(e.toString());
- }
-*/
- group = null;
- groupManager = null;
- securityService = null;
- }
-
- /**
- * Constructor for TorqueGroupManagerTest.
- * @param arg0
- */
- public TorqueGroupManagerTest(String arg0)
- {
- super(arg0);
- }
-}
+package org.apache.fulcrum.security.torque;
+/*
+ * 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.
+ */
+
+import org.apache.fulcrum.security.SecurityService;
+import org.apache.fulcrum.security.model.test.AbstractGroupManagerTest;
+
+/**
+ * @author <a href="mailto:tv@apache.org">Thomas Vandahl</a>
+ * @version $Id:$
+ */
+public class TorqueGroupManagerTest extends AbstractGroupManagerTest
+{
+ protected static HsqlDB hsqlDB = null;
+
+ public void setUp()
+ {
+ try
+ {
+ hsqlDB = new HsqlDB("jdbc:hsqldb:.", "src/test/fulcrum-basic-schema.sql");
+ hsqlDB.addSQL("src/test/fulcrum-dynamic-schema.sql");
+ hsqlDB.addSQL("src/test/fulcrum-turbine-schema.sql");
+ hsqlDB.addSQL("src/test/id-table-schema.sql");
+ hsqlDB.addSQL("src/test/fulcrum-basic-schema-idtable-init.sql");
+ hsqlDB.addSQL("src/test/fulcrum-dynamic-schema-idtable-init.sql");
+ hsqlDB.addSQL("src/test/fulcrum-turbine-schema-idtable-init.sql");
+
+ this.setRoleFileName("src/test/DynamicTorqueRoleConfig.xml");
+ this.setConfigurationFileName("src/test/DynamicTorqueComponentConfig.xml");
+ securityService = (SecurityService) lookup(SecurityService.ROLE);
+ groupManager = securityService.getGroupManager();
+ }
+ catch (Exception e)
+ {
+ fail(e.toString());
+ }
+ }
+
+ public void tearDown()
+ {
+/* // cleanup tables
+ try
+ {
+ Criteria criteria = new Criteria();
+ criteria.add(TorqueDynamicUserGroupPeer.USER_ID, 0, Criteria.GREATER_THAN);
+ TorqueDynamicUserGroupPeer.doDelete(criteria);
+
+ criteria.clear();
+ criteria.add(TorqueDynamicGroupRolePeer.GROUP_ID, 0, Criteria.GREATER_THAN);
+ TorqueDynamicGroupRolePeer.doDelete(criteria);
+
+ criteria.clear();
+ criteria.add(TorqueDynamicRolePermissionPeer.ROLE_ID, 0, Criteria.GREATER_THAN);
+ TorqueDynamicRolePermissionPeer.doDelete(criteria);
+
+ criteria.clear();
+ criteria.add(TorqueDynamicUserDelegatesPeer.DELEGATEE_USER_ID, 0, Criteria.GREATER_THAN);
+ TorqueDynamicUserDelegatesPeer.doDelete(criteria);
+
+ criteria.clear();
+ criteria.add(TorqueUserPeer.USER_ID, 0, Criteria.GREATER_THAN);
+ TorqueUserPeer.doDelete(criteria);
+
+ criteria.clear();
+ criteria.add(TorqueGroupPeer.GROUP_ID, 0, Criteria.GREATER_THAN);
+ TorqueGroupPeer.doDelete(criteria);
+
+ criteria.clear();
+ criteria.add(TorqueRolePeer.ROLE_ID, 0, Criteria.GREATER_THAN);
+ TorqueRolePeer.doDelete(criteria);
+
+ criteria.clear();
+ criteria.add(TorquePermissionPeer.PERMISSION_ID, 0, Criteria.GREATER_THAN);
+ TorquePermissionPeer.doDelete(criteria);
+ }
+ catch (TorqueException e)
+ {
+ fail(e.toString());
+ }
+*/
+ group = null;
+ groupManager = null;
+ securityService = null;
+ }
+
+ /**
+ * Constructor for TorqueGroupManagerTest.
+ * @param arg0
+ */
+ public TorqueGroupManagerTest(String arg0)
+ {
+ super(arg0);
+ }
+}
Modified: jakarta/turbine/fulcrum/trunk/security/torque/src/test/org/apache/fulcrum/security/torque/TorquePermissionManagerTest.java
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/security/torque/src/test/org/apache/fulcrum/security/torque/TorquePermissionManagerTest.java?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/security/torque/src/test/org/apache/fulcrum/security/torque/TorquePermissionManagerTest.java (original)
+++ jakarta/turbine/fulcrum/trunk/security/torque/src/test/org/apache/fulcrum/security/torque/TorquePermissionManagerTest.java Fri May 4 23:58:06 2007
@@ -1,101 +1,104 @@
-package org.apache.fulcrum.security.torque;
-/*
- * Copyright 2001-2004 The Apache Software Foundation
- *
- * 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.
- */
-
-import org.apache.fulcrum.security.SecurityService;
-import org.apache.fulcrum.security.model.test.AbstractPermissionManagerTest;
-
-/**
- * @author <a href="mailto:tv@apache.org">Thomas Vandahl</a>
- * @author <a href="jh@byteaction.de">Jürgen Hoffmann</a>
- * @version $Id:$
- */
-public class TorquePermissionManagerTest extends AbstractPermissionManagerTest
-{
- protected static HsqlDB hsqlDB = null;
-
- public void setUp() throws Exception
- {
- hsqlDB = new HsqlDB("jdbc:hsqldb:.", "src/test/fulcrum-dynamic-schema.sql");
- hsqlDB.addSQL("src/test/fulcrum-turbine-schema.sql");
- hsqlDB.addSQL("src/test/id-table-schema.sql");
- hsqlDB.addSQL("src/test/fulcrum-dynamic-schema-idtable-init.sql");
- hsqlDB.addSQL("src/test/fulcrum-turbine-schema-idtable-init.sql");
-
- this.setRoleFileName("src/test/DynamicTorqueRoleConfig.xml");
- this.setConfigurationFileName("src/test/DynamicTorqueComponentConfig.xml");
- securityService = (SecurityService) lookup(SecurityService.ROLE);
- permissionManager = securityService.getPermissionManager();
-
- }
-
- public void tearDown()
- {
-/*
- // cleanup tables
- try
- {
- Criteria criteria = new Criteria();
- criteria.add(TorqueDynamicUserGroupPeer.USER_ID, 0, Criteria.GREATER_THAN);
- TorqueDynamicUserGroupPeer.doDelete(criteria);
-
- criteria.clear();
- criteria.add(TorqueDynamicGroupRolePeer.GROUP_ID, 0, Criteria.GREATER_THAN);
- TorqueDynamicGroupRolePeer.doDelete(criteria);
-
- criteria.clear();
- criteria.add(TorqueDynamicRolePermissionPeer.ROLE_ID, 0, Criteria.GREATER_THAN);
- TorqueDynamicRolePermissionPeer.doDelete(criteria);
-
- criteria.clear();
- criteria.add(TorqueDynamicUserDelegatesPeer.DELEGATEE_USER_ID, 0, Criteria.GREATER_THAN);
- TorqueDynamicUserDelegatesPeer.doDelete(criteria);
-
- criteria.clear();
- criteria.add(TorqueUserPeer.USER_ID, 0, Criteria.GREATER_THAN);
- TorqueUserPeer.doDelete(criteria);
-
- criteria.clear();
- criteria.add(TorqueGroupPeer.GROUP_ID, 0, Criteria.GREATER_THAN);
- TorqueGroupPeer.doDelete(criteria);
-
- criteria.clear();
- criteria.add(TorqueRolePeer.ROLE_ID, 0, Criteria.GREATER_THAN);
- TorqueRolePeer.doDelete(criteria);
-
- criteria.clear();
- criteria.add(TorquePermissionPeer.PERMISSION_ID, 0, Criteria.GREATER_THAN);
- TorquePermissionPeer.doDelete(criteria);
- }
- catch (TorqueException e)
- {
- fail(e.toString());
- }
-*/
- permission = null;
- permissionManager = null;
- securityService = null;
- }
-
- /**
- * Constructor for TorquePermissionManagerTest.
- * @param arg0
- */
- public TorquePermissionManagerTest(String arg0)
- {
- super(arg0);
- }
-}
+package org.apache.fulcrum.security.torque;
+/*
+ * 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.
+ */
+
+import org.apache.fulcrum.security.SecurityService;
+import org.apache.fulcrum.security.model.test.AbstractPermissionManagerTest;
+
+/**
+ * @author <a href="mailto:tv@apache.org">Thomas Vandahl</a>
+ * @author <a href="jh@byteaction.de">Jürgen Hoffmann</a>
+ * @version $Id:$
+ */
+public class TorquePermissionManagerTest extends AbstractPermissionManagerTest
+{
+ protected static HsqlDB hsqlDB = null;
+
+ public void setUp() throws Exception
+ {
+ hsqlDB = new HsqlDB("jdbc:hsqldb:.", "src/test/fulcrum-dynamic-schema.sql");
+ hsqlDB.addSQL("src/test/fulcrum-turbine-schema.sql");
+ hsqlDB.addSQL("src/test/id-table-schema.sql");
+ hsqlDB.addSQL("src/test/fulcrum-dynamic-schema-idtable-init.sql");
+ hsqlDB.addSQL("src/test/fulcrum-turbine-schema-idtable-init.sql");
+
+ this.setRoleFileName("src/test/DynamicTorqueRoleConfig.xml");
+ this.setConfigurationFileName("src/test/DynamicTorqueComponentConfig.xml");
+ securityService = (SecurityService) lookup(SecurityService.ROLE);
+ permissionManager = securityService.getPermissionManager();
+
+ }
+
+ public void tearDown()
+ {
+/*
+ * // cleanup tables
+ * try
+ * {
+ * Criteria criteria = new Criteria();
+ * criteria.add(TorqueDynamicUserGroupPeer.USER_ID, 0, Criteria.GREATER_THAN);
+ * TorqueDynamicUserGroupPeer.doDelete(criteria);
+ *
+ * criteria.clear();
+ * criteria.add(TorqueDynamicGroupRolePeer.GROUP_ID, 0, Criteria.GREATER_THAN);
+ * TorqueDynamicGroupRolePeer.doDelete(criteria);
+ *
+ * criteria.clear();
+ * criteria.add(TorqueDynamicRolePermissionPeer.ROLE_ID, 0, Criteria.GREATER_THAN);
+ * TorqueDynamicRolePermissionPeer.doDelete(criteria);
+ *
+ * criteria.clear();
+ * criteria.add(TorqueDynamicUserDelegatesPeer.DELEGATEE_USER_ID, 0, Criteria.GREATER_THAN);
+ * TorqueDynamicUserDelegatesPeer.doDelete(criteria);
+ *
+ * criteria.clear();
+ * criteria.add(TorqueUserPeer.USER_ID, 0, Criteria.GREATER_THAN);
+ * TorqueUserPeer.doDelete(criteria);
+ *
+ * criteria.clear();
+ * criteria.add(TorqueGroupPeer.GROUP_ID, 0, Criteria.GREATER_THAN);
+ * TorqueGroupPeer.doDelete(criteria);
+ *
+ * criteria.clear();
+ * criteria.add(TorqueRolePeer.ROLE_ID, 0, Criteria.GREATER_THAN);
+ * TorqueRolePeer.doDelete(criteria);
+ *
+ * criteria.clear();
+ * criteria.add(TorquePermissionPeer.PERMISSION_ID, 0, Criteria.GREATER_THAN);
+ * TorquePermissionPeer.doDelete(criteria);
+ * }
+ * catch (TorqueException e)
+ * {
+ * fail(e.toString());
+ * }
+ */
+ permission = null;
+ permissionManager = null;
+ securityService = null;
+ }
+
+ /**
+ * Constructor for TorquePermissionManagerTest.
+ * @param arg0
+ */
+ public TorquePermissionManagerTest(String arg0)
+ {
+ super(arg0);
+ }
+}
Modified: jakarta/turbine/fulcrum/trunk/security/torque/src/test/org/apache/fulcrum/security/torque/TorqueRoleManagerTest.java
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/security/torque/src/test/org/apache/fulcrum/security/torque/TorqueRoleManagerTest.java?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/security/torque/src/test/org/apache/fulcrum/security/torque/TorqueRoleManagerTest.java (original)
+++ jakarta/turbine/fulcrum/trunk/security/torque/src/test/org/apache/fulcrum/security/torque/TorqueRoleManagerTest.java Fri May 4 23:58:06 2007
@@ -1,108 +1,111 @@
-package org.apache.fulcrum.security.torque;
-/*
- * Copyright 2001-2004 The Apache Software Foundation
- *
- * 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.
- */
-
-import org.apache.fulcrum.security.RoleManager;
-import org.apache.fulcrum.security.SecurityService;
-import org.apache.fulcrum.security.model.test.AbstractRoleManagerTest;
-
-/**
- * @author <a href="mailto:tv@apache.org">Thomas Vandahl</a>
- * @author <a href="jh@byteaction.de">Jürgen Hoffmann</a>
- * @version $Id:$
- */
-public class TorqueRoleManagerTest extends AbstractRoleManagerTest
-{
- protected static HsqlDB hsqlDB = null;
-
- public void setUp()
- {
- try
- {
- hsqlDB = new HsqlDB("jdbc:hsqldb:.", "src/test/fulcrum-dynamic-schema.sql");
- hsqlDB.addSQL("src/test/fulcrum-turbine-schema.sql");
- hsqlDB.addSQL("src/test/id-table-schema.sql");
- hsqlDB.addSQL("src/test/fulcrum-dynamic-schema-idtable-init.sql");
- hsqlDB.addSQL("src/test/fulcrum-turbine-schema-idtable-init.sql");
-
- this.setRoleFileName("src/test/DynamicTorqueRoleConfig.xml");
- this.setConfigurationFileName("src/test/DynamicTorqueComponentConfig.xml");
- securityService = (SecurityService) lookup(SecurityService.ROLE);
- roleManager = (RoleManager) securityService.getRoleManager();
- }
- catch (Exception e)
- {
- fail(e.toString());
- }
- }
-
- public void tearDown()
- {
-/*
- // cleanup tables
- try
- {
- Criteria criteria = new Criteria();
- criteria.add(TorqueDynamicUserGroupPeer.USER_ID, 0, Criteria.GREATER_THAN);
- TorqueDynamicUserGroupPeer.doDelete(criteria);
-
- criteria.clear();
- criteria.add(TorqueDynamicGroupRolePeer.GROUP_ID, 0, Criteria.GREATER_THAN);
- TorqueDynamicGroupRolePeer.doDelete(criteria);
-
- criteria.clear();
- criteria.add(TorqueDynamicRolePermissionPeer.ROLE_ID, 0, Criteria.GREATER_THAN);
- TorqueDynamicRolePermissionPeer.doDelete(criteria);
-
- criteria.clear();
- criteria.add(TorqueDynamicUserDelegatesPeer.DELEGATEE_USER_ID, 0, Criteria.GREATER_THAN);
- TorqueDynamicUserDelegatesPeer.doDelete(criteria);
-
- criteria.clear();
- criteria.add(TorqueUserPeer.USER_ID, 0, Criteria.GREATER_THAN);
- TorqueUserPeer.doDelete(criteria);
-
- criteria.clear();
- criteria.add(TorqueGroupPeer.GROUP_ID, 0, Criteria.GREATER_THAN);
- TorqueGroupPeer.doDelete(criteria);
-
- criteria.clear();
- criteria.add(TorqueRolePeer.ROLE_ID, 0, Criteria.GREATER_THAN);
- TorqueRolePeer.doDelete(criteria);
-
- criteria.clear();
- criteria.add(TorquePermissionPeer.PERMISSION_ID, 0, Criteria.GREATER_THAN);
- TorquePermissionPeer.doDelete(criteria);
- }
- catch (TorqueException e)
- {
- fail(e.toString());
- }
-*/
- role = null;
- roleManager = null;
- securityService = null;
- }
-
- /**
- * Constructor for TorqueRoleManagerTest.
- * @param arg0
- */
- public TorqueRoleManagerTest(String arg0)
- {
- super(arg0);
- }
-}
+package org.apache.fulcrum.security.torque;
+/*
+ * 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.
+ */
+
+import org.apache.fulcrum.security.RoleManager;
+import org.apache.fulcrum.security.SecurityService;
+import org.apache.fulcrum.security.model.test.AbstractRoleManagerTest;
+
+/**
+ * @author <a href="mailto:tv@apache.org">Thomas Vandahl</a>
+ * @author <a href="jh@byteaction.de">Jürgen Hoffmann</a>
+ * @version $Id:$
+ */
+public class TorqueRoleManagerTest extends AbstractRoleManagerTest
+{
+ protected static HsqlDB hsqlDB = null;
+
+ public void setUp()
+ {
+ try
+ {
+ hsqlDB = new HsqlDB("jdbc:hsqldb:.", "src/test/fulcrum-dynamic-schema.sql");
+ hsqlDB.addSQL("src/test/fulcrum-turbine-schema.sql");
+ hsqlDB.addSQL("src/test/id-table-schema.sql");
+ hsqlDB.addSQL("src/test/fulcrum-dynamic-schema-idtable-init.sql");
+ hsqlDB.addSQL("src/test/fulcrum-turbine-schema-idtable-init.sql");
+
+ this.setRoleFileName("src/test/DynamicTorqueRoleConfig.xml");
+ this.setConfigurationFileName("src/test/DynamicTorqueComponentConfig.xml");
+ securityService = (SecurityService) lookup(SecurityService.ROLE);
+ roleManager = (RoleManager) securityService.getRoleManager();
+ }
+ catch (Exception e)
+ {
+ fail(e.toString());
+ }
+ }
+
+ public void tearDown()
+ {
+/*
+ * // cleanup tables
+ * try
+ * {
+ * Criteria criteria = new Criteria();
+ * criteria.add(TorqueDynamicUserGroupPeer.USER_ID, 0, Criteria.GREATER_THAN);
+ * TorqueDynamicUserGroupPeer.doDelete(criteria);
+ *
+ * criteria.clear();
+ * criteria.add(TorqueDynamicGroupRolePeer.GROUP_ID, 0, Criteria.GREATER_THAN);
+ * TorqueDynamicGroupRolePeer.doDelete(criteria);
+ *
+ * criteria.clear();
+ * criteria.add(TorqueDynamicRolePermissionPeer.ROLE_ID, 0, Criteria.GREATER_THAN);
+ * TorqueDynamicRolePermissionPeer.doDelete(criteria);
+ *
+ * criteria.clear();
+ * criteria.add(TorqueDynamicUserDelegatesPeer.DELEGATEE_USER_ID, 0, Criteria.GREATER_THAN);
+ * TorqueDynamicUserDelegatesPeer.doDelete(criteria);
+ *
+ * criteria.clear();
+ * criteria.add(TorqueUserPeer.USER_ID, 0, Criteria.GREATER_THAN);
+ * TorqueUserPeer.doDelete(criteria);
+ *
+ * criteria.clear();
+ * criteria.add(TorqueGroupPeer.GROUP_ID, 0, Criteria.GREATER_THAN);
+ * TorqueGroupPeer.doDelete(criteria);
+ *
+ * criteria.clear();
+ * criteria.add(TorqueRolePeer.ROLE_ID, 0, Criteria.GREATER_THAN);
+ * TorqueRolePeer.doDelete(criteria);
+ *
+ * criteria.clear();
+ * criteria.add(TorquePermissionPeer.PERMISSION_ID, 0, Criteria.GREATER_THAN);
+ * TorquePermissionPeer.doDelete(criteria);
+ * }
+ * catch (TorqueException e)
+ * {
+ * fail(e.toString());
+ * }
+ */
+ role = null;
+ roleManager = null;
+ securityService = null;
+ }
+
+ /**
+ * Constructor for TorqueRoleManagerTest.
+ * @param arg0
+ */
+ public TorqueRoleManagerTest(String arg0)
+ {
+ super(arg0);
+ }
+}
Modified: jakarta/turbine/fulcrum/trunk/security/torque/src/test/org/apache/fulcrum/security/torque/TorqueUserManagerTest.java
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/security/torque/src/test/org/apache/fulcrum/security/torque/TorqueUserManagerTest.java?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/security/torque/src/test/org/apache/fulcrum/security/torque/TorqueUserManagerTest.java (original)
+++ jakarta/turbine/fulcrum/trunk/security/torque/src/test/org/apache/fulcrum/security/torque/TorqueUserManagerTest.java Fri May 4 23:58:06 2007
@@ -1,110 +1,113 @@
-package org.apache.fulcrum.security.torque;
-/*
- * Copyright 2001-2004 The Apache Software Foundation
- *
- * 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.
- */
-
-import org.apache.fulcrum.security.SecurityService;
-import org.apache.fulcrum.security.model.test.AbstractUserManagerTest;
-
-/**
- * @author <a href="mailto:tv@apache.org">Thomas Vandahl</a>
- * @author <a href="jh@byteaction.de">Jürgen Hoffmann</a>
- *
- * @version $Id:$
- */
-public class TorqueUserManagerTest extends AbstractUserManagerTest
-{
- protected static HsqlDB hsqlDB = null;
-
- public void setUp()
- {
- try
- {
- hsqlDB = new HsqlDB("jdbc:hsqldb:.", "src/test/fulcrum-basic-schema.sql");
- hsqlDB.addSQL("src/test/fulcrum-dynamic-schema.sql");
- hsqlDB.addSQL("src/test/fulcrum-turbine-schema.sql");
- hsqlDB.addSQL("src/test/id-table-schema.sql");
- hsqlDB.addSQL("src/test/fulcrum-basic-schema-idtable-init.sql");
- hsqlDB.addSQL("src/test/fulcrum-dynamic-schema-idtable-init.sql");
- hsqlDB.addSQL("src/test/fulcrum-turbine-schema-idtable-init.sql");
-
- this.setRoleFileName("src/test/DynamicTorqueRoleConfig.xml");
- this.setConfigurationFileName("src/test/DynamicTorqueComponentConfig.xml");
- securityService = (SecurityService) lookup(SecurityService.ROLE);
- userManager = securityService.getUserManager();
- }
- catch (Exception e)
- {
- fail(e.toString());
- }
- }
-
- public void tearDown()
- {
-/*
- // cleanup tables
- try
- {
- Criteria criteria = new Criteria();
- criteria.add(TorqueDynamicUserGroupPeer.USER_ID, 0, Criteria.GREATER_THAN);
- TorqueDynamicUserGroupPeer.doDelete(criteria);
-
- criteria.clear();
- criteria.add(TorqueDynamicGroupRolePeer.GROUP_ID, 0, Criteria.GREATER_THAN);
- TorqueDynamicGroupRolePeer.doDelete(criteria);
-
- criteria.clear();
- criteria.add(TorqueDynamicRolePermissionPeer.ROLE_ID, 0, Criteria.GREATER_THAN);
- TorqueDynamicRolePermissionPeer.doDelete(criteria);
-
- criteria.clear();
- criteria.add(TorqueDynamicUserDelegatesPeer.DELEGATEE_USER_ID, 0, Criteria.GREATER_THAN);
- TorqueDynamicUserDelegatesPeer.doDelete(criteria);
-
- criteria.clear();
- criteria.add(TorqueUserPeer.USER_ID, 0, Criteria.GREATER_THAN);
- TorqueUserPeer.doDelete(criteria);
-
- criteria.clear();
- criteria.add(TorqueGroupPeer.GROUP_ID, 0, Criteria.GREATER_THAN);
- TorqueGroupPeer.doDelete(criteria);
-
- criteria.clear();
- criteria.add(TorqueRolePeer.ROLE_ID, 0, Criteria.GREATER_THAN);
- TorqueRolePeer.doDelete(criteria);
-
- criteria.clear();
- criteria.add(TorquePermissionPeer.PERMISSION_ID, 0, Criteria.GREATER_THAN);
- TorquePermissionPeer.doDelete(criteria);
- }
- catch (TorqueException e)
- {
- fail(e.toString());
- }
-*/
- user = null;
- userManager = null;
- securityService = null;
- }
-
- /**
- * Constructor for TorqueUserManagerTest.
- * @param arg0
- */
- public TorqueUserManagerTest(String arg0)
- {
- super(arg0);
- }
-}
+package org.apache.fulcrum.security.torque;
+/*
+ * 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.
+ */
+
+import org.apache.fulcrum.security.SecurityService;
+import org.apache.fulcrum.security.model.test.AbstractUserManagerTest;
+
+/**
+ * @author <a href="mailto:tv@apache.org">Thomas Vandahl</a>
+ * @author <a href="jh@byteaction.de">Jürgen Hoffmann</a>
+ *
+ * @version $Id:$
+ */
+public class TorqueUserManagerTest extends AbstractUserManagerTest
+{
+ protected static HsqlDB hsqlDB = null;
+
+ public void setUp()
+ {
+ try
+ {
+ hsqlDB = new HsqlDB("jdbc:hsqldb:.", "src/test/fulcrum-basic-schema.sql");
+ hsqlDB.addSQL("src/test/fulcrum-dynamic-schema.sql");
+ hsqlDB.addSQL("src/test/fulcrum-turbine-schema.sql");
+ hsqlDB.addSQL("src/test/id-table-schema.sql");
+ hsqlDB.addSQL("src/test/fulcrum-basic-schema-idtable-init.sql");
+ hsqlDB.addSQL("src/test/fulcrum-dynamic-schema-idtable-init.sql");
+ hsqlDB.addSQL("src/test/fulcrum-turbine-schema-idtable-init.sql");
+
+ this.setRoleFileName("src/test/DynamicTorqueRoleConfig.xml");
+ this.setConfigurationFileName("src/test/DynamicTorqueComponentConfig.xml");
+ securityService = (SecurityService) lookup(SecurityService.ROLE);
+ userManager = securityService.getUserManager();
+ }
+ catch (Exception e)
+ {
+ fail(e.toString());
+ }
+ }
+
+ public void tearDown()
+ {
+/*
+ * // cleanup tables
+ * try
+ * {
+ * Criteria criteria = new Criteria();
+ * criteria.add(TorqueDynamicUserGroupPeer.USER_ID, 0, Criteria.GREATER_THAN);
+ * TorqueDynamicUserGroupPeer.doDelete(criteria);
+ *
+ * criteria.clear();
+ * criteria.add(TorqueDynamicGroupRolePeer.GROUP_ID, 0, Criteria.GREATER_THAN);
+ * TorqueDynamicGroupRolePeer.doDelete(criteria);
+ *
+ * criteria.clear();
+ * criteria.add(TorqueDynamicRolePermissionPeer.ROLE_ID, 0, Criteria.GREATER_THAN);
+ * TorqueDynamicRolePermissionPeer.doDelete(criteria);
+ *
+ * criteria.clear();
+ * criteria.add(TorqueDynamicUserDelegatesPeer.DELEGATEE_USER_ID, 0, Criteria.GREATER_THAN);
+ * TorqueDynamicUserDelegatesPeer.doDelete(criteria);
+ *
+ * criteria.clear();
+ * criteria.add(TorqueUserPeer.USER_ID, 0, Criteria.GREATER_THAN);
+ * TorqueUserPeer.doDelete(criteria);
+ *
+ * criteria.clear();
+ * criteria.add(TorqueGroupPeer.GROUP_ID, 0, Criteria.GREATER_THAN);
+ * TorqueGroupPeer.doDelete(criteria);
+ *
+ * criteria.clear();
+ * criteria.add(TorqueRolePeer.ROLE_ID, 0, Criteria.GREATER_THAN);
+ * TorqueRolePeer.doDelete(criteria);
+ *
+ * criteria.clear();
+ * criteria.add(TorquePermissionPeer.PERMISSION_ID, 0, Criteria.GREATER_THAN);
+ * TorquePermissionPeer.doDelete(criteria);
+ * }
+ * catch (TorqueException e)
+ * {
+ * fail(e.toString());
+ * }
+ */
+ user = null;
+ userManager = null;
+ securityService = null;
+ }
+
+ /**
+ * Constructor for TorqueUserManagerTest.
+ * @param arg0
+ */
+ public TorqueUserManagerTest(String arg0)
+ {
+ super(arg0);
+ }
+}
Modified: jakarta/turbine/fulcrum/trunk/security/torque/src/test/org/apache/fulcrum/security/torque/basic/TorqueBasicModelManagerTest.java
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/security/torque/src/test/org/apache/fulcrum/security/torque/basic/TorqueBasicModelManagerTest.java?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/security/torque/src/test/org/apache/fulcrum/security/torque/basic/TorqueBasicModelManagerTest.java (original)
+++ jakarta/turbine/fulcrum/trunk/security/torque/src/test/org/apache/fulcrum/security/torque/basic/TorqueBasicModelManagerTest.java Fri May 4 23:58:06 2007
@@ -1,96 +1,99 @@
-package org.apache.fulcrum.security.torque.basic;
-
-/*
- * Copyright 2001-2004 The Apache Software Foundation
- *
- * 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.
- */
-
-import org.apache.fulcrum.security.SecurityService;
-import org.apache.fulcrum.security.entity.User;
-import org.apache.fulcrum.security.model.basic.entity.BasicUser;
-import org.apache.fulcrum.security.model.basic.test.AbstractModelManagerTest;
-import org.apache.fulcrum.security.torque.om.TorqueBasicGroupPeer;
-import org.apache.fulcrum.security.torque.HsqlDB;
-import org.apache.fulcrum.security.torque.om.TorqueBasicUserGroupPeer;
-import org.apache.fulcrum.security.torque.om.TorqueBasicUserPeer;
-import org.apache.torque.TorqueException;
-import org.apache.torque.util.Criteria;
-
-/**
- * @author <a href="mailto:tv@apache.org">Thomas Vandahl</a>
- * @author <a href="jh@byteaction.de">Jürgen Hoffmann</a>
- * @version $Id:$
- */
-public class TorqueBasicModelManagerTest extends AbstractModelManagerTest
-{
- protected static HsqlDB hsqlDB = null;
-
- public void setUp() throws Exception
- {
- if(hsqlDB == null)
- {
- hsqlDB = new HsqlDB("jdbc:hsqldb:.", "src/test/fulcrum-basic-schema.sql");
- hsqlDB.addSQL("src/test/id-table-schema.sql");
- hsqlDB.addSQL("src/test/fulcrum-basic-schema-idtable-init.sql");
- }
- this.setRoleFileName("src/test/BasicTorqueRoleConfig.xml");
- this.setConfigurationFileName("src/test/BasicTorqueComponentConfig.xml");
-
- securityService = (SecurityService) lookup(SecurityService.ROLE);
- super.setUp();
- }
-
- public void testRevokeAllUser() throws Exception
- {
- super.testRevokeAllUser();
- User user = userManager.getUserInstance("Clint2");
- assertEquals(0, ((BasicUser) user).getGroups().size());
- }
-
- public void tearDown()
- {
- // cleanup tables
- try
- {
- Criteria criteria = new Criteria();
- criteria.add(TorqueBasicUserGroupPeer.GROUP_ID, 0, Criteria.GREATER_THAN);
- criteria.add(TorqueBasicUserGroupPeer.USER_ID, 0, Criteria.GREATER_THAN);
- TorqueBasicUserGroupPeer.doDelete(criteria);
-
- criteria.clear();
- criteria.add(TorqueBasicUserPeer.USER_ID, 0, Criteria.GREATER_THAN);
- TorqueBasicUserPeer.doDelete(criteria);
-
- criteria.clear();
- criteria.add(TorqueBasicGroupPeer.GROUP_ID, 0, Criteria.GREATER_THAN);
- TorqueBasicGroupPeer.doDelete(criteria);
- }
- catch (TorqueException e)
- {
- fail(e.toString());
- }
-
- securityService = null;
- }
-
- /**
- * Constructor for TorqueBasicModelManagerTest.
- *
- * @param arg0
- */
- public TorqueBasicModelManagerTest(String arg0)
- {
- super(arg0);
- }
-}
+package org.apache.fulcrum.security.torque.basic;
+
+/*
+ * 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.
+ */
+
+import org.apache.fulcrum.security.SecurityService;
+import org.apache.fulcrum.security.entity.User;
+import org.apache.fulcrum.security.model.basic.entity.BasicUser;
+import org.apache.fulcrum.security.model.basic.test.AbstractModelManagerTest;
+import org.apache.fulcrum.security.torque.om.TorqueBasicGroupPeer;
+import org.apache.fulcrum.security.torque.HsqlDB;
+import org.apache.fulcrum.security.torque.om.TorqueBasicUserGroupPeer;
+import org.apache.fulcrum.security.torque.om.TorqueBasicUserPeer;
+import org.apache.torque.TorqueException;
+import org.apache.torque.util.Criteria;
+
+/**
+ * @author <a href="mailto:tv@apache.org">Thomas Vandahl</a>
+ * @author <a href="jh@byteaction.de">Jürgen Hoffmann</a>
+ * @version $Id:$
+ */
+public class TorqueBasicModelManagerTest extends AbstractModelManagerTest
+{
+ protected static HsqlDB hsqlDB = null;
+
+ public void setUp() throws Exception
+ {
+ if(hsqlDB == null)
+ {
+ hsqlDB = new HsqlDB("jdbc:hsqldb:.", "src/test/fulcrum-basic-schema.sql");
+ hsqlDB.addSQL("src/test/id-table-schema.sql");
+ hsqlDB.addSQL("src/test/fulcrum-basic-schema-idtable-init.sql");
+ }
+ this.setRoleFileName("src/test/BasicTorqueRoleConfig.xml");
+ this.setConfigurationFileName("src/test/BasicTorqueComponentConfig.xml");
+
+ securityService = (SecurityService) lookup(SecurityService.ROLE);
+ super.setUp();
+ }
+
+ public void testRevokeAllUser() throws Exception
+ {
+ super.testRevokeAllUser();
+ User user = userManager.getUserInstance("Clint2");
+ assertEquals(0, ((BasicUser) user).getGroups().size());
+ }
+
+ public void tearDown()
+ {
+ // cleanup tables
+ try
+ {
+ Criteria criteria = new Criteria();
+ criteria.add(TorqueBasicUserGroupPeer.GROUP_ID, 0, Criteria.GREATER_THAN);
+ criteria.add(TorqueBasicUserGroupPeer.USER_ID, 0, Criteria.GREATER_THAN);
+ TorqueBasicUserGroupPeer.doDelete(criteria);
+
+ criteria.clear();
+ criteria.add(TorqueBasicUserPeer.USER_ID, 0, Criteria.GREATER_THAN);
+ TorqueBasicUserPeer.doDelete(criteria);
+
+ criteria.clear();
+ criteria.add(TorqueBasicGroupPeer.GROUP_ID, 0, Criteria.GREATER_THAN);
+ TorqueBasicGroupPeer.doDelete(criteria);
+ }
+ catch (TorqueException e)
+ {
+ fail(e.toString());
+ }
+
+ securityService = null;
+ }
+
+ /**
+ * Constructor for TorqueBasicModelManagerTest.
+ *
+ * @param arg0
+ */
+ public TorqueBasicModelManagerTest(String arg0)
+ {
+ super(arg0);
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org