@@ -0,0 +1,1157 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public%0D%0A * License, v. 2.0. If a copy of the MPL was not distributed with this%0D%0A * file, You can obtain one at http://mozilla.org/MPL/2.0/. */%0D%0Apackage fr.hhdev.test;%0D%0A%0D%0Aimport fr.hhdev.ocelot.security.TopicAccessControl;%0D%0Aimport fr.hhdev.ocelot.security.TopicControl;%0D%0Aimport javax.inject.Singleton;%0D%0Aimport javax.websocket.Session;%0D%0Aimport org.slf4j.Logger;%0D%0Aimport org.slf4j.LoggerFactory;%0D%0A%0D%0A/**%0D%0A *%0D%0A * @author hhfrancois%0D%0A */%0D%0A@Singleton%0D%0A@TopicControl(%22mytopic%22)%0D%0Apublic class TestMyTopicAccessControl implements TopicAccessControl %7B%0D%0A%09%0D%0A%09private final static Logger logger = LoggerFactory.getLogger(TestMyTopicAccessControl.class);%0D%0A%0D%0A%09private boolean access = true; %0D%0A%0D%0A%09public boolean isAccess() %7B%0D%0A%09%09return access;%0D%0A%09%7D%0D%0A%0D%0A%09public void setAccess(boolean access) %7B%0D%0A%09%09this.access = access;%0D%0A%09%7D%0D%0A%0D%0A%09@Override%0D%0A%09public void checkAccess(Session session, String topic) throws IllegalAccessException %7B%0D%0A%09%09logger.debug(%22Check mytopic access to topic %7B%7D : access = %7B%7D%22, topic, access);%0D%0A%09%09if(!access) %7B%0D%0A%09%09%09throw new IllegalAccessException(%22mytopic access is set to false%22);%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A%09%0D%0A%7D%0D%0A

test class for test Qualifier of SecurityChecker of Topic