Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8877311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:26:18+00:00 2026-06-14T19:26:18+00:00

In a xml config file I have a delimiter property configured as unicode escape

  • 0

In a xml config file I have a delimiter property configured as unicode escape seq like this:

<adapter name="Adapter2">
  <property name="adapter.delimiter" value="\u0009"/>
</adapter>

There is also method getting any property in Adapter class:

String getProperty(String propertyName)

For getProperty(“adapter.delimiter”) it returns already escaped string “\t”

What I need is to convert property \u0009 into char to be able to provide the \t char to any further methods.

  • How to verify that the method really returns tab char in unit test?

This does not work (I am not sure if the code or unit test is wrong):

public char getDelimiter() throws VTBaseException {
    String delimiterProperty = getProperty("adapter.delimiter");

    if (delimiterProperty == null || "".equals(delimiterProperty)) {
        //default
        return DEFAULT_DELIMITER;
    } else if (delimiterProperty.length() == 1) {
        return delimiterProperty.charAt(0);
    } else {
        throw new VTBaseException();
    }
}

Unit test:

@Test
public void testReturnDelimiterProperty()
    throws Exception
{
    VTAdapter adapter = manager.getAdapter("Adapter2");
    assertEquals(',', adapter.getDelimiter());//passes if property not set
    adapter = world.getAdapterList().getAdapter("Adapter1");
    assertEquals("\t", adapter.getDelimiter());//fails with exception bellow


}

junit.framework.AssertionFailedError: expected:<    > but was:< >
at junit.framework.Assert.fail(Assert.java:47)
at junit.framework.Assert.failNotEquals(Assert.java:283)
at junit.framework.Assert.assertEquals(Assert.java:64)
at junit.framework.Assert.assertEquals(Assert.java:71)
at 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T19:26:19+00:00Added an answer on June 14, 2026 at 7:26 pm

    Outputs a tab:

    String s = "\\u0009";
    s = s.substring(2);
    char i = (char)(int)Integer.valueOf(s, 16);
    System.out.println(i);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this section in my CruiseControl config.xml file: <publishers> <onsuccess> <artifactspublisher dest=artifacts/${project.name} file=projects/${project.name}/fred/>
I have the following text in xml file: <Config Builder=LP Wizard> <Libraries> <Library Name=XCAMSource/>
My db-data-config.xml like this: <dataSource name=192.168.5.206 driver=com.mysql.jdbc.Driver url=jdbc:mysql://192.168.5.206:3306/editor_app user=root password=tvmining /> <dataSource name=localhost driver=com.mysql.jdbc.Driver
I would like to have an xml config file as follows: <?xml version=1.0 encoding=utf-8
Im have a xml config file called solrconfig.xml, it has this section in the
I have defined in a xml config file: <bean id=bootstrap class=com.package.Bootstrap></bean> this works fine.
I'm using an XML config file to populate my navigation using Zend_Navigation. I have
I've defined 2 preferences in the extension's config.xml file: <preference name=interval value=1800 readonly=false />
This is my web.config file contents: <?xml version=1.0?> <configuration> <system.webServer> <httpErrors errorMode=Detailed /> <asp
Looking in the android sdk folders, I've found a file called values/config.xml . This

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.