Search in sources :

Example 46 with ServiceName

use of jp.ossc.nimbus.core.ServiceName in project nimbus by nimbus-org.

the class StreamExchangeInterceptorServiceTest method testSetterGetter.

/**
 * StreamExchangeInterceptorServiceTestの各プロパティを設定、取得するテスト。
 * <p>
 * 条件:
 * <ul>
 * <li>StreamExchangeInterceptorServiceTestインスタンスを生成する</li>
 * <li>各setterメソッドを実行</li>
 * <li>各getterメソッドを実行</li>
 * </ul>
 * 確認:
 * <ul>
 * <li>正常終了。設定した値が正しく取得できることを確認</li>
 * </ul>
 */
public void testSetterGetter() {
    StreamExchangeInterceptorService ic = new StreamExchangeInterceptorService();
    DataSetXMLConverter xconv = new DataSetXMLConverter();
    ic.setRequestStreamConverter(xconv);
    assertEquals(xconv, ic.getRequestStreamConverter());
    ic.setResponseStreamConverter(xconv);
    assertEquals(xconv, ic.getResponseStreamConverter());
    Context context = new ThreadContextService();
    ic.setThreadContext(context);
    assertEquals(context, ic.getThreadContext());
    Journal journal = new ThreadManagedJournalService();
    ic.setJournal(journal);
    assertEquals(journal, ic.getJournal());
    EditorFinder finder = new ObjectMappedEditorFinderService();
    ic.setExchangeEditorFinder(finder);
    assertEquals(finder, ic.getExchangeEditorFinder());
    ic.setExchangeRequestEditorFinder(finder);
    assertEquals(finder, ic.getExchangeRequestEditorFinder());
    ic.setExchangeResponseEditorFinder(finder);
    assertEquals(finder, ic.getExchangeResponseEditorFinder());
    ic.setRequestBytesEditorFinder(finder);
    assertEquals(finder, ic.getRequestBytesEditorFinder());
    ic.setRequestObjectEditorFinder(finder);
    assertEquals(finder, ic.getRequestObjectEditorFinder());
    ic.setResponseBytesEditorFinder(finder);
    assertEquals(finder, ic.getResponseBytesEditorFinder());
    ic.setResponseObjectEditorFinder(finder);
    assertEquals(finder, ic.getResponseObjectEditorFinder());
    ic.setExceptionEditorFinder(finder);
    assertEquals(finder, ic.getExceptionEditorFinder());
    ServiceName sname = new ServiceName("Service");
    ic.setRequestStreamConverterServiceName(sname);
    assertEquals(sname, ic.getRequestStreamConverterServiceName());
    ic.setResponseStreamConverterServiceName(sname);
    assertEquals(sname, ic.getResponseStreamConverterServiceName());
    ic.setThreadContextServiceName(sname);
    assertEquals(sname, ic.getThreadContextServiceName());
    ic.setJournalServiceName(sname);
    assertEquals(sname, ic.getJournalServiceName());
    ic.setExchangeEditorFinderServiceName(sname);
    assertEquals(sname, ic.getExchangeEditorFinderServiceName());
    ic.setExchangeRequestEditorFinderServiceName(sname);
    assertEquals(sname, ic.getExchangeRequestEditorFinderServiceName());
    ic.setExchangeResponseEditorFinderServiceName(sname);
    assertEquals(sname, ic.getExchangeResponseEditorFinderServiceName());
    ic.setRequestBytesEditorFinderServiceName(sname);
    assertEquals(sname, ic.getRequestBytesEditorFinderServiceName());
    ic.setRequestObjectEditorFinderServiceName(sname);
    assertEquals(sname, ic.getRequestObjectEditorFinderServiceName());
    ic.setResponseBytesEditorFinderServiceName(sname);
    assertEquals(sname, ic.getResponseBytesEditorFinderServiceName());
    ic.setResponseObjectEditorFinderServiceName(sname);
    assertEquals(sname, ic.getResponseObjectEditorFinderServiceName());
    ic.setExceptionEditorFinderServiceName(sname);
    assertEquals(sname, ic.getExceptionEditorFinderServiceName());
    ic.setResponseContentType("application/x-www-form-urlencoded");
    assertEquals("application/x-www-form-urlencoded", ic.getResponseContentType());
    ic.setRequestObjectAttributeName("TEST");
    assertEquals("TEST", ic.getRequestObjectAttributeName());
    ic.setResponseObjectAttributeName("TEST");
    assertEquals("TEST", ic.getResponseObjectAttributeName());
    ic.setRequestObjectContextKey("TEST");
    assertEquals("TEST", ic.getRequestObjectContextKey());
    ic.setResponseObjectContextKey("TEST");
    assertEquals("TEST", ic.getResponseObjectContextKey());
    ic.setRequestStreamInflate(false);
    assertEquals(false, ic.isRequestStreamInflate());
    ic.setExchangeJournalKey("TEST");
    assertEquals("TEST", ic.getExchangeJournalKey());
    ic.setExchangeRequestJournalKey("TEST");
    assertEquals("TEST", ic.getExchangeRequestJournalKey());
    ic.setExchangeResponseJournalKey("TEST");
    assertEquals("TEST", ic.getExchangeResponseJournalKey());
    ic.setRequestBytesJournalKey("TEST");
    assertEquals("TEST", ic.getRequestBytesJournalKey());
    ic.setRequestObjectJournalKey("TEST");
    assertEquals("TEST", ic.getRequestObjectJournalKey());
    ic.setResponseBytesJournalKey("TEST");
    assertEquals("TEST", ic.getResponseBytesJournalKey());
    ic.setResponseObjectJournalKey("TEST");
    assertEquals("TEST", ic.getResponseObjectJournalKey());
    ic.setExceptionJournalKey("TEST");
    assertEquals("TEST", ic.getExceptionJournalKey());
}
Also used : ServletFilterInvocationContext(jp.ossc.nimbus.service.aop.ServletFilterInvocationContext) ServiceName(jp.ossc.nimbus.core.ServiceName) DataSetXMLConverter(jp.ossc.nimbus.util.converter.DataSetXMLConverter)

Example 47 with ServiceName

use of jp.ossc.nimbus.core.ServiceName in project nimbus by nimbus-org.

the class ServiceNameArrayEditorTest method testSetValue2.

public void testSetValue2() throws Exception {
    ServiceNameArrayEditor editor = new ServiceNameArrayEditor();
    editor.setValue(new ServiceName[] { new ServiceName("Manager1", "Service1"), new ServiceName("Manager2", "Service2") });
    assertEquals("Manager1#Service1" + System.getProperty("line.separator") + "Manager2#Service2", editor.getAsText());
}
Also used : ServiceName(jp.ossc.nimbus.core.ServiceName)

Example 48 with ServiceName

use of jp.ossc.nimbus.core.ServiceName in project nimbus by nimbus-org.

the class ServiceNameArrayEditorTest method testSetAsText1.

public void testSetAsText1() throws Exception {
    ServiceNameArrayEditor editor = new ServiceNameArrayEditor();
    editor.setServiceManagerName("Manager1");
    editor.setAsText("#Service1");
    Object val = editor.getValue();
    assertEquals(1, Array.getLength(val));
    assertEquals(new ServiceName("Manager1", "Service1"), Array.get(val, 0));
}
Also used : ServiceName(jp.ossc.nimbus.core.ServiceName)

Example 49 with ServiceName

use of jp.ossc.nimbus.core.ServiceName in project nimbus by nimbus-org.

the class ServiceNameEditorTest method testSetAsText1.

public void testSetAsText1() throws Exception {
    ServiceNameEditor editor = new ServiceNameEditor();
    editor.setServiceManagerName("Manager1");
    editor.setAsText("#Service1");
    assertEquals(new ServiceName("Manager1", "Service1"), editor.getValue());
}
Also used : ServiceName(jp.ossc.nimbus.core.ServiceName)

Example 50 with ServiceName

use of jp.ossc.nimbus.core.ServiceName in project nimbus by nimbus-org.

the class ServiceNameEditorTest method testSetAsText4.

public void testSetAsText4() throws Exception {
    ServiceNameEditor editor = new ServiceNameEditor();
    System.setProperty("test.ServiceNameEditor.value", "Manager1#Service1");
    editor.setAsText("${test.ServiceNameEditor.value}");
    assertEquals(new ServiceName("Manager1", "Service1"), editor.getValue());
}
Also used : ServiceName(jp.ossc.nimbus.core.ServiceName)

Aggregations

ServiceName (jp.ossc.nimbus.core.ServiceName)66 ServiceNameRef (jp.ossc.nimbus.core.ServiceNameRef)13 ServiceNameEditor (jp.ossc.nimbus.beans.ServiceNameEditor)12 DefaultInterceptorChainList (jp.ossc.nimbus.service.aop.DefaultInterceptorChainList)9 DefaultMethodInvocationContext (jp.ossc.nimbus.service.aop.DefaultMethodInvocationContext)8 Interceptor (jp.ossc.nimbus.service.aop.Interceptor)8 InvocationContext (jp.ossc.nimbus.service.aop.InvocationContext)8 FilterChain (javax.servlet.FilterChain)7 InterceptorChain (jp.ossc.nimbus.service.aop.InterceptorChain)7 Map (java.util.Map)6 Properties (java.util.Properties)6 DefaultInterceptorChain (jp.ossc.nimbus.service.aop.DefaultInterceptorChain)6 HashMap (java.util.HashMap)5 ServiceMetaData (jp.ossc.nimbus.core.ServiceMetaData)5 Invoker (jp.ossc.nimbus.service.aop.Invoker)5 Iterator (java.util.Iterator)4 Method (java.lang.reflect.Method)3 ServletConfig (javax.servlet.ServletConfig)3 DefaultThreadLocalInterceptorChain (jp.ossc.nimbus.service.aop.DefaultThreadLocalInterceptorChain)3 DefaultSemaphoreService (jp.ossc.nimbus.service.semaphore.DefaultSemaphoreService)3