Search in sources :

Example 1 with ServiceNameRef

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

the class ServiceNameRefArrayEditorTest method testSetAsText1.

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

Example 2 with ServiceNameRef

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

the class ServiceNameRefArrayEditorTest method testSetAsText2.

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

Example 3 with ServiceNameRef

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

the class ServiceNameRefArrayEditorTest method testSetAsText4.

public void testSetAsText4() throws Exception {
    ServiceNameRefArrayEditor editor = new ServiceNameRefArrayEditor();
    editor.setServiceManagerName("Manager1");
    editor.setAsText(" \t Service1=#Service1\n    Service2=Manager2#Service2  \n    Service3=Service3  ");
    Object val = editor.getValue();
    assertEquals(3, Array.getLength(val));
    assertEquals(new ServiceNameRef("Service1", new ServiceName("Manager1", "Service1")), Array.get(val, 0));
    assertEquals(new ServiceNameRef("Service2", new ServiceName("Manager2", "Service2")), Array.get(val, 1));
    assertEquals(new ServiceNameRef("Service3", new ServiceName("Service3")), Array.get(val, 2));
}
Also used : ServiceName(jp.ossc.nimbus.core.ServiceName) ServiceNameRef(jp.ossc.nimbus.core.ServiceNameRef)

Example 4 with ServiceNameRef

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

the class ServiceNameRefArrayEditorTest method testSetAsText6.

public void testSetAsText6() throws Exception {
    ServiceNameRefArrayEditor editor = new ServiceNameRefArrayEditor();
    editor.setServiceManagerName("Manager1");
    System.setProperty("test.ServiceNameRefArrayEditor.value", "Manager2#Service2");
    editor.setAsText("Service1=#Service1\nService2=${test.ServiceNameRefArrayEditor.value}");
    Object val = editor.getValue();
    assertEquals(2, Array.getLength(val));
    assertEquals(new ServiceNameRef("Service1", new ServiceName("Manager1", "Service1")), Array.get(val, 0));
    assertEquals(new ServiceNameRef("Service2", new ServiceName("Manager2", "Service2")), Array.get(val, 1));
}
Also used : ServiceName(jp.ossc.nimbus.core.ServiceName) ServiceNameRef(jp.ossc.nimbus.core.ServiceNameRef)

Example 5 with ServiceNameRef

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

the class ServiceNameRefEditorTest method testSetAsText3.

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

Aggregations

ServiceName (jp.ossc.nimbus.core.ServiceName)13 ServiceNameRef (jp.ossc.nimbus.core.ServiceNameRef)13