From b1c8641a63a67e3c64d948f9e8dce5c01e11e2dd Mon Sep 17 00:00:00 2001 From: mcentner Date: Wed, 5 May 2010 15:29:01 +0000 Subject: Merged feature branch mocca-1.2.13-id@r724 back to trunk. git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@725 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../bku/binding/EmptyMultipartSLRequestTest.java | 98 ---------------------- 1 file changed, 98 deletions(-) delete mode 100644 bkucommon/src/test/java/at/gv/egiz/bku/binding/EmptyMultipartSLRequestTest.java (limited to 'bkucommon/src/test/java/at/gv/egiz/bku/binding/EmptyMultipartSLRequestTest.java') diff --git a/bkucommon/src/test/java/at/gv/egiz/bku/binding/EmptyMultipartSLRequestTest.java b/bkucommon/src/test/java/at/gv/egiz/bku/binding/EmptyMultipartSLRequestTest.java deleted file mode 100644 index ee17f5e9..00000000 --- a/bkucommon/src/test/java/at/gv/egiz/bku/binding/EmptyMultipartSLRequestTest.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2008 Federal Chancellery Austria and - * Graz University of Technology - * - * 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 at.gv.egiz.bku.binding; - -import at.gv.egiz.bku.conf.Configuration; -import iaik.security.ecc.provider.ECCProvider; -import iaik.security.provider.IAIK; -import iaik.xml.crypto.XSecProvider; - -import java.io.InputStream; -import java.net.MalformedURLException; -import java.security.Provider; -import java.security.Security; -import java.security.Provider.Service; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.junit.Before; -import org.junit.Test; - -import at.gv.egiz.bku.conf.Configurator; -import at.gv.egiz.bku.conf.DummyConfiguration; -import at.gv.egiz.bku.slcommands.SLCommandFactory; -import at.gv.egiz.bku.slcommands.impl.xsect.STALProvider; - -public class EmptyMultipartSLRequestTest { - - private static Log log = LogFactory.getLog(EmptyMultipartSLRequestTest.class); - - protected String resourceName = "at/gv/egiz/bku/binding/MultipartEmpty.txt"; - - protected BindingProcessor bindingProcessor; - protected InputStream dataStream; - protected BindingProcessorManager manager; - - @Before - public void setUp() throws MalformedURLException, ClassNotFoundException { - manager = new BindingProcessorManagerImpl(new DummyStalFactory(), - new SLCommandInvokerImpl(), new DummyConfiguration()); - HTTPBindingProcessor http = (HTTPBindingProcessor) manager - .createBindingProcessor("http://www.at/", null); - Map headers = new HashMap(); - headers.put("Content-Type", InputDecoderFactory.MULTIPART_FORMDATA - + ";boundary=uW10q_I9UeqKyw-1o5EW4jtEAaGs7-mC6o"); - http.setHTTPHeaders(headers); - dataStream = getClass().getClassLoader().getResourceAsStream(resourceName); - bindingProcessor = http; - Map commandMap = new HashMap(); - commandMap - .put( - "http://www.buergerkarte.at/namespaces/securitylayer/1.2#:CreateXMLSignatureRequest", - "at.gv.egiz.bku.slcommands.impl.CreateXMLSignatureCommandImpl"); - commandMap - .put( - "http://www.buergerkarte.at/namespaces/securitylayer/1.2#:InfoboxReadRequest", - "at.gv.egiz.bku.slcommands.impl.InfoboxReadCommandImpl"); - SLCommandFactory.getInstance().setCommandImpl(commandMap); - Security.insertProviderAt(new IAIK(), 1); - Security.insertProviderAt(new ECCProvider(false), 2); - XSecProvider.addAsProvider(false); - // registering STALProvider as delegation provider for XSECT - STALProvider stalProvider = new STALProvider(); - Security.addProvider(stalProvider); - Set services = stalProvider.getServices(); - StringBuilder sb = new StringBuilder(); - for (Service service : services) { - String algorithm = service.getType() + "." + service.getAlgorithm(); - XSecProvider.setDelegationProvider(algorithm, stalProvider.getName()); - sb.append("\n" + algorithm); - } - log.debug(sb); - } - - @Test - public void testBasicNop() { - bindingProcessor.consumeRequestStream(dataStream); - // manager.process(bindingProcessor); - bindingProcessor.run(); - } - -} -- cgit v1.2.3