コード例 #1
0
ファイル: AdaptorTest.java プロジェクト: jordiblasco/Xenon
  @Test
  public void test2() throws XenonException {
    ImmutableArray<String> schemes = new ImmutableArray<>("SCHEME1", "SCHEME2");
    ImmutableArray<String> locations = new ImmutableArray<>("L1", "L2");

    ImmutableArray<XenonPropertyDescription> supportedProperties =
        new ImmutableArray<XenonPropertyDescription>(
            new XenonPropertyDescriptionImplementation(
                "xenon.adaptors.test.p1",
                Type.STRING,
                EnumSet.of(Component.XENON),
                "aap2",
                "test property p1"),
            new XenonPropertyDescriptionImplementation(
                "xenon.adaptors.test.p2",
                Type.STRING,
                EnumSet.of(Component.XENON),
                "noot2",
                "test property p2"));

    Map<String, String> m = new HashMap<>(3);
    m.put("xenon.adaptors.test.p1", "mies");
    m.put("xenon.adaptors.test.p2", "zus");

    XenonProperties prop = new XenonProperties(supportedProperties, m);
    TestAdaptor t =
        new TestAdaptor(null, "test", "DESCRIPTION", schemes, locations, supportedProperties, prop);

    XenonPropertyDescription[] p = t.getSupportedProperties();

    assertNotNull(p);
    assertEquals(2, p.length);
    assertEquals("xenon.adaptors.test.p1", p[0].getName());
    assertEquals("aap2", p[0].getDefaultValue());
    assertEquals("xenon.adaptors.test.p2", p[1].getName());
    assertEquals("noot2", p[1].getDefaultValue());

    XenonProperties props = t.getProperties();
    assertEquals("mies", props.getProperty(p[0].getName()));
    assertEquals("zus", props.getProperty(p[1].getName()));
  }
コード例 #2
0
ファイル: AdaptorTest.java プロジェクト: jordiblasco/Xenon
  @Test
  public void test0() throws XenonException {

    ImmutableArray<String> schemes = new ImmutableArray<>("SCHEME1", "SCHEME2");
    ImmutableArray<String> locations = new ImmutableArray<>("L1", "L2");

    TestAdaptor t =
        new TestAdaptor(
            null,
            "test",
            "DESCRIPTION",
            schemes,
            locations,
            new ImmutableArray<XenonPropertyDescription>(),
            new XenonProperties());

    String[] tmp = t.getSupportedSchemes();

    assert (tmp != null);
    assert (Arrays.equals(schemes.asArray(), tmp));
  }