Package org.netbeans.ns.project._1

Examples of org.netbeans.ns.project._1.Configuration


  }

  @Override
  public String getName() {
    String result = null;
    MetadataType md = gpx.getMetadata();
    if( null != md ) {
      result = md.getName();
    }
    return result;
  }
View Full Code Here


  }

  @Override
  public String getDescription() {
    String result = null;
    MetadataType md = gpx.getMetadata();
    if( null != md ) {
      result = md.getDesc();
    }
    return result;
  }
View Full Code Here

  /**
   * the servcie.
   */
  public void testEPCISService() throws Exception {
    EPCISServicePortTypeImpl service = new EPCISServicePortTypeImpl();
    ArrayOfString queryNames = service.getQueryNames(new EmptyParms());
    TreeSet<String> names = new TreeSet<String>();
    assertNotNull(queryNames.getString());
    names.addAll(queryNames.getString());
    assertTrue(names.remove("hello"));
    assertTrue(names.remove("how"));
View Full Code Here

  /**
   * the servcie.
   */
  public void testEPCISService() throws Exception {
    EPCISServicePortTypeImpl service = new EPCISServicePortTypeImpl();
    ArrayOfString queryNames = service.getQueryNames(new EmptyParms());
    TreeSet<String> names = new TreeSet<String>();
    assertNotNull(queryNames.getString());
    names.addAll(queryNames.getString());
    assertTrue(names.remove("hello"));
    assertTrue(names.remove("how"));
    assertTrue(names.remove("are"));
    assertTrue(names.remove("you?"));
    assertTrue(names.isEmpty());
View Full Code Here

  /**
   * the servcie.
   */
  public void testEPCISService() throws Exception {
    EPCISServicePortTypeImpl service = new EPCISServicePortTypeImpl();
    ArrayOfString queryNames = service.getQueryNames(new EmptyParms());
    TreeSet<String> names = new TreeSet<String>();
    assertNotNull(queryNames.getString());
    names.addAll(queryNames.getString());
    assertTrue(names.remove("hello"));
    assertTrue(names.remove("how"));
View Full Code Here

  /**
   * tests serializing query results as json
   */
  public void testQueryResultsAsJson() throws Exception {
    QueryResults results = new QueryResults();
    QueryResultsBody body = new QueryResultsBody();
    VocabularyListType vl = new VocabularyListType();
    VocabularyType vt = new VocabularyType();
    VocabularyElementListType elementListType = new VocabularyElementListType();

    VocabularyElementType elementType = new VocabularyElementType();
    AttributeType at = new AttributeType();
    at.setId("someid");
    DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
    Document document = builder.parse(new ByteArrayInputStream("<mynode>value</mynode>".getBytes("utf-8")));
    document.normalizeDocument();
    at.getAny().add(document.getDocumentElement());

    document = builder.newDocument();
    Element el = document.createElement("myelement");
    el.setTextContent("howdy");
    document.appendChild(el);
    elementType.getAttribute().add(at);
    elementListType.getVocabularyElement().add(document.getDocumentElement());
    vt.setVocabularyElementList(elementListType);
    vl.getVocabulary().add(vt);
    body.setVocabularyList(vl);
    results.setResultsBody(body);

    ObjectMapper resultsMapper = new DomElementJacksonObjectMapperResolver().getContext(null);

    StringWriter out = new StringWriter();
    resultsMapper.writeValue(out, results);
View Full Code Here

  /**
   * tests serializing query results as json
   */
  public void testQueryResultsAsJson() throws Exception {
    QueryResults results = new QueryResults();
    QueryResultsBody body = new QueryResultsBody();
    VocabularyListType vl = new VocabularyListType();
    VocabularyType vt = new VocabularyType();
    VocabularyElementListType elementListType = new VocabularyElementListType();

    VocabularyElementType elementType = new VocabularyElementType();
    AttributeType at = new AttributeType();
    at.setId("someid");
    DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
    Document document = builder.parse(new ByteArrayInputStream("<mynode>value</mynode>".getBytes("utf-8")));
    document.normalizeDocument();
    at.getAny().add(document.getDocumentElement());

    document = builder.newDocument();
    Element el = document.createElement("myelement");
    el.setTextContent("howdy");
    document.appendChild(el);
    elementType.getAttribute().add(at);
    elementListType.getVocabularyElement().add(document.getDocumentElement());
    vt.setVocabularyElementList(elementListType);
    vl.getVocabulary().add(vt);
    body.setVocabularyList(vl);
    results.setResultsBody(body);

    ObjectMapper resultsMapper = new DomElementJacksonObjectMapperResolver().getContext(null);

    StringWriter out = new StringWriter();
View Full Code Here

    }

    @Test
    public void testSubset()
    {
        Configuration subset = config.subset("dictionary");
        Iterator<String> keys = subset.getKeys();

        String key = keys.next();
        assertEquals("1st key", "key1", key);
        assertEquals("1st value", "value1", subset.getString(key));

        key = keys.next();
        assertEquals("2nd key", "key2", key);
        assertEquals("2nd value", "value2", subset.getString(key));

        key = keys.next();
        assertEquals("3rd key", "key3", key);
        assertEquals("3rd value", "value3", subset.getString(key));

        assertFalse("more than 3 properties founds", keys.hasNext());
    }
View Full Code Here

        assertFalse("empty array", list.isEmpty());
        assertEquals("size", 2, list.size());

        // 1st dictionary
        ObjectAssert.assertInstanceOf("the dict element is not parsed as a Configuration", Configuration.class, list.get(0));
        Configuration conf1 = (Configuration) list.get(0);
        assertFalse("configuration 1 is empty", conf1.isEmpty());
        assertEquals("configuration element", "bar", conf1.getProperty("foo"));

        // 2nd dictionary
        ObjectAssert.assertInstanceOf("the dict element is not parsed as a Configuration", Configuration.class, list.get(1));
        Configuration conf2 = (Configuration) list.get(1);
        assertFalse("configuration 2 is empty", conf2.isEmpty());
        assertEquals("configuration element", "value", conf2.getProperty("key"));
    }
View Full Code Here

        EasyMock.replay(detector);
        ReloadingController controller = new ReloadingController(detector);
        BasicConfigurationBuilder<Configuration> builder =
                new BasicConfigurationBuilder<Configuration>(
                        PropertiesConfiguration.class);
        Configuration configuration = builder.getConfiguration();

        builder.connectToReloadingController(controller);
        controller.checkForReloading(null);
        assertTrue("Not in reloading state", controller.isInReloadingState());
        assertNotSame("No new configuration created", configuration,
View Full Code Here

TOP

Related Classes of org.netbeans.ns.project._1.Configuration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.