Jump to content

Recommended Posts

Posted

Howdy all

 

I'm trying to set up unit testing for some of my classes (using JUnit) and it's doing my head in trying to set up the FMLLog so it doesn't crash when the class under test writes to it.

 

eg if my class under test has

      if (!backupListing.hasKey(BACKUP_LISTING_VERSION_TAG) || !backupListing.hasKey(BACKUP_LISTING_PATHS_TAG)) {
        FMLLog.warning("Invalid backuplisting file (missing tag): " + backupListingPath.toString());
        return retval;
      }

 

then when it is called by my test class, it gives me a NullPointerException

caused by this line in FMLRelaunchLog::configureLogging

            File logPath = new File(minecraftHome, logFileNamePattern);

because minecraftHome and logFileNamePattern are both not set properly.

 

I haven't been able to find a way to set them up.

 

Anyone else figured out a straightforward way to do this?  (Other than replacing all my calls to FMLLog with a wrapper, that is)

 

-TGG

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.