Search in sources :

Example 6 with ServiceNameRef

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

the class ServiceNameRefEditorTest method testSetAsText2.

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

Example 7 with ServiceNameRef

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

the class ServiceNameRefArrayEditorTest method testSetValue2.

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

Example 8 with ServiceNameRef

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

the class ServiceNameRefArrayEditorTest method testSetAsText3.

public void testSetAsText3() throws Exception {
    ServiceNameRefArrayEditor editor = new ServiceNameRefArrayEditor();
    editor.setServiceManagerName("Manager1");
    editor.setAsText("Service1=#Service1\nService2=Manager2#Service2");
    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 9 with ServiceNameRef

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

the class ServiceNameRefArrayEditorTest method testSetValue1.

public void testSetValue1() throws Exception {
    ServiceNameRefArrayEditor editor = new ServiceNameRefArrayEditor();
    editor.setValue(new ServiceNameRef[] { new ServiceNameRef("Service1", new ServiceName("Manager1", "Service1")) });
    assertEquals("Service1=Manager1#Service1", editor.getAsText());
}
Also used : ServiceName(jp.ossc.nimbus.core.ServiceName) ServiceNameRef(jp.ossc.nimbus.core.ServiceNameRef)

Example 10 with ServiceNameRef

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

the class ServiceNameRefArrayEditorTest method testSetAsText5.

public void testSetAsText5() throws Exception {
    ServiceNameRefArrayEditor editor = new ServiceNameRefArrayEditor();
    editor.setServiceManagerName("Manager1");
    editor.setAsText("Service1=#Service1\n<!-- Service2=Manager2#Service2 -->\nService3=Service3");
    Object val = editor.getValue();
    assertEquals(2, Array.getLength(val));
    assertEquals(new ServiceNameRef("Service1", new ServiceName("Manager1", "Service1")), Array.get(val, 0));
    assertEquals(new ServiceNameRef("Service3", new ServiceName("Service3")), Array.get(val, 1));
}
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